Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(475)

Unified Diff: src/gpu/GrAtlas.cpp

Issue 347563005: Reduce texture uploads for font atlas. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/GrBitmapTextContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAtlas.cpp
diff --git a/src/gpu/GrAtlas.cpp b/src/gpu/GrAtlas.cpp
index 331f5d92aa25b8008efee5715112e61fb1e3ed83..ea5ad50a39e5d11e5c630ebb6d2f5c4914ab2fdc 100644
--- a/src/gpu/GrAtlas.cpp
+++ b/src/gpu/GrAtlas.cpp
@@ -10,6 +10,7 @@
#include "GrContext.h"
#include "GrGpu.h"
#include "GrRectanizer.h"
+#include "GrTracing.h"
///////////////////////////////////////////////////////////////////////////////
@@ -90,6 +91,7 @@ bool GrPlot::addSubImage(int width, int height, const void* image,
} else {
adjust_for_offset(loc, fOffset);
GrContext* context = fTexture->getContext();
+ TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia.gpu"), "GrPlot::uploadToTexture");
context->writeTexturePixels(fTexture,
loc->fX, loc->fY, width, height,
fTexture->config(), image, 0,
@@ -110,12 +112,13 @@ void GrPlot::uploadToTexture() {
SkASSERT(fBatchUploads);
if (fDirty) {
+ TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia.gpu"), "GrPlot::uploadToTexture");
SkASSERT(NULL != fTexture);
GrContext* context = fTexture->getContext();
// We pass the flag that does not force a flush. We assume our caller is
// smart and hasn't referenced the part of the texture we're about to update
// since the last flush.
- int rowBytes = fBytesPerPixel*fRects->width();
+ size_t rowBytes = fBytesPerPixel*fRects->width();
const unsigned char* dataPtr = fPlotData;
dataPtr += rowBytes*fDirtyRect.fTop;
dataPtr += fBytesPerPixel*fDirtyRect.fLeft;
« no previous file with comments | « no previous file | src/gpu/GrBitmapTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698