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

Unified Diff: src/gpu/GrBatchAtlas.cpp

Issue 1011403004: BitmapTextBatch and BitmapTextBlob (Closed) Base URL: https://skia.googlesource.com/skia.git@dfpr_take_2
Patch Set: tidying Created 5 years, 9 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
Index: src/gpu/GrBatchAtlas.cpp
diff --git a/src/gpu/GrBatchAtlas.cpp b/src/gpu/GrBatchAtlas.cpp
index 4b242820e33699c07a2d97e6e6a91193fbdc9163..4262256b47abb873619a37fbb8214e1c435b8fac 100644
--- a/src/gpu/GrBatchAtlas.cpp
+++ b/src/gpu/GrBatchAtlas.cpp
@@ -227,7 +227,8 @@ GrBatchAtlas::GrBatchAtlas(GrTexture* texture, int numPlotsX, int numPlotsY)
, fNumPlotsX(numPlotsX)
, fNumPlotsY(numPlotsY)
, fPlotWidth(texture->width() / numPlotsX)
- , fPlotHeight(texture->height() / numPlotsY) {
+ , fPlotHeight(texture->height() / numPlotsY)
+ , fAtlasGeneration(kInvalidAtlasGeneration + 1) {
SkASSERT(fPlotWidth * fNumPlotsX == texture->width());
SkASSERT(fPlotHeight * fNumPlotsY == texture->height());
@@ -243,7 +244,8 @@ GrBatchAtlas::GrBatchAtlas(GrTexture* texture, int numPlotsX, int numPlotsY)
for (int x = fNumPlotsX - 1, c = 0; x >= 0; --x, ++c) {
int id = r * fNumPlotsX + c;
currPlot->reset(SkNEW(BatchPlot));
- (*currPlot)->init(this, texture, id, 0, x, y, fPlotWidth, fPlotHeight, fBPP);
+ (*currPlot)->init(this, texture, id, fAtlasGeneration, x, y, fPlotWidth, fPlotHeight,
+ fBPP);
// build LRU list
fPlotList.addToHead(currPlot->get());
@@ -318,6 +320,7 @@ bool GrBatchAtlas::addToAtlas(AtlasID* id, GrBatchTarget* batchTarget,
SkDEBUGCODE(bool verify = )plot->addSubImage(width, height, image, loc, fBPP * width);
SkASSERT(verify);
this->updatePlot(batchTarget, id, plot);
+ fAtlasGeneration++;
return true;
}
@@ -352,6 +355,7 @@ bool GrBatchAtlas::addToAtlas(AtlasID* id, GrBatchTarget* batchTarget,
batchTarget->upload(uploader);
*id = newPlot->id();
plot->unref();
+ fAtlasGeneration++;
bsalomon 2015/03/26 17:06:55 Is it worth detecting when this wraps and bumping
joshualitt 2015/03/26 18:21:43 Maybe, your call. I could also make it a uint64_t
return true;
}

Powered by Google App Engine
This is Rietveld 408576698