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

Unified Diff: src/gpu/GrAtlas.cpp

Issue 391153002: Add unique ID to GrPlot (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix initialization list order Created 6 years, 5 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 | « src/gpu/GrAtlas.h ('k') | no next file » | 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 a9b8ae95e6f0f67ffd6ed1230e7514d42e9364d0..353bf55f55aa80624ab245ca0739e2cf6dadb0e4 100644
--- a/src/gpu/GrAtlas.cpp
+++ b/src/gpu/GrAtlas.cpp
@@ -20,13 +20,15 @@
static int g_UploadCount = 0;
#endif
-GrPlot::GrPlot() : fDrawToken(NULL, 0)
- , fTexture(NULL)
- , fRects(NULL)
- , fAtlas(NULL)
- , fBytesPerPixel(1)
- , fDirty(false)
- , fBatchUploads(false)
+GrPlot::GrPlot()
+ : fDrawToken(NULL, 0)
+ , fID(-1)
+ , fTexture(NULL)
+ , fRects(NULL)
+ , fAtlas(NULL)
+ , fBytesPerPixel(1)
+ , fDirty(false)
+ , fBatchUploads(false)
{
fOffset.set(0, 0);
}
@@ -37,8 +39,9 @@ GrPlot::~GrPlot() {
delete fRects;
}
-void GrPlot::init(GrAtlas* atlas, int offX, int offY, int width, int height, size_t bpp,
+void GrPlot::init(GrAtlas* atlas, int id, int offX, int offY, int width, int height, size_t bpp,
bool batchUploads) {
+ fID = id;
fRects = GrRectanizer::Factory(width, height);
fAtlas = atlas;
fOffset.set(offX * width, offY * height);
@@ -178,7 +181,7 @@ GrAtlas::GrAtlas(GrGpu* gpu, GrPixelConfig config, GrTextureFlags flags,
GrPlot* currPlot = fPlotArray;
for (int y = numPlotsY-1; y >= 0; --y) {
for (int x = numPlotsX-1; x >= 0; --x) {
- currPlot->init(this, x, y, plotWidth, plotHeight, bpp, batchUploads);
+ currPlot->init(this, y*numPlotsX+x, x, y, plotWidth, plotHeight, bpp, batchUploads);
// build LRU list
fPlotList.addToHead(currPlot);
« no previous file with comments | « src/gpu/GrAtlas.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698