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

Unified Diff: src/gpu/GrAtlas.h

Issue 269423007: Add CPU backing store for GrAtlas to reduce texture uploads (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add assert to GrPlot::uploadTexture() Created 6 years, 7 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/GrAtlas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAtlas.h
diff --git a/src/gpu/GrAtlas.h b/src/gpu/GrAtlas.h
index d7f533414143214dce46d41c3bbf7cca4c52bdfc..b3affe20a4ab0029c3bb747acf2ccfdd12de39c7 100644
--- a/src/gpu/GrAtlas.h
+++ b/src/gpu/GrAtlas.h
@@ -40,21 +40,28 @@ public:
GrDrawTarget::DrawToken drawToken() const { return fDrawToken; }
void setDrawToken(GrDrawTarget::DrawToken draw) { fDrawToken = draw; }
+ void uploadToTexture();
+
void resetRects();
private:
GrPlot();
~GrPlot(); // does not try to delete the fNext field
- void init(GrAtlasMgr* mgr, int offX, int offY, int width, int height, size_t bpp);
+ void init(GrAtlasMgr* mgr, int offX, int offY, int width, int height, size_t bpp,
+ bool batchUploads);
// for recycling
GrDrawTarget::DrawToken fDrawToken;
+ unsigned char* fPlotData;
GrTexture* fTexture;
GrRectanizer* fRects;
GrAtlasMgr* fAtlasMgr;
GrIPoint16 fOffset; // the offset of the plot in the backing texture
size_t fBytesPerPixel;
+ SkIRect fDirtyRect;
+ bool fDirty;
+ bool fBatchUploads;
friend class GrAtlasMgr;
};
@@ -64,7 +71,7 @@ typedef SkTInternalLList<GrPlot> GrPlotList;
class GrAtlasMgr {
public:
GrAtlasMgr(GrGpu*, GrPixelConfig, const SkISize& backingTextureSize,
- int numPlotsX, int numPlotsY);
+ int numPlotsX, int numPlotsY, bool batchUploads);
~GrAtlasMgr();
// add subimage of width, height dimensions to atlas
@@ -82,6 +89,8 @@ public:
return fTexture;
}
+ void uploadPlotsToTexture();
+
private:
void moveToHead(GrPlot* plot);
@@ -91,6 +100,7 @@ private:
SkISize fBackingTextureSize;
int fNumPlotsX;
int fNumPlotsY;
+ bool fBatchUploads;
// allocated array of GrPlots
GrPlot* fPlotArray;
« no previous file with comments | « no previous file | src/gpu/GrAtlas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698