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

Unified Diff: src/gpu/GrLayerCache.h

Issue 476833004: Refactor GrLayerCache for new API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add DISABLE_CACHING guard Created 6 years, 4 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/GrLayerCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrLayerCache.h
diff --git a/src/gpu/GrLayerCache.h b/src/gpu/GrLayerCache.h
index f027a26cbcab40bf4acf747538790714faf75a3a..fcf62f9c3a8faa59503b2f9ad627657f785c05de 100644
--- a/src/gpu/GrLayerCache.h
+++ b/src/gpu/GrLayerCache.h
@@ -117,7 +117,7 @@ public:
const GrIRect16& rect() const { return fRect; }
void setPlot(GrPlot* plot) {
- SkASSERT(NULL == fPlot);
+ SkASSERT(NULL == plot || NULL == fPlot);
fPlot = plot;
}
GrPlot* plot() { return fPlot; }
@@ -171,16 +171,15 @@ public:
// elements by the GrContext
void freeAll();
- GrCachedLayer* findLayer(const SkPicture* picture, int start, int stop, const SkMatrix& ctm);
- GrCachedLayer* findLayerOrCreate(const SkPicture* picture,
+ GrCachedLayer* findLayer(uint32_t pictureID, int start, int stop, const SkMatrix& ctm);
+ GrCachedLayer* findLayerOrCreate(uint32_t pictureID,
int start, int stop,
const SkMatrix& ctm);
-
- // Inform the cache that layer's cached image is now required. Return true
- // if it was found in the ResourceCache and doesn't need to be regenerated.
- // If false is returned the caller should (re)render the layer into the
- // newly acquired texture.
- bool lock(GrCachedLayer* layer, const GrTextureDesc& desc);
+
+ // Inform the cache that layer's cached image is now required.
+ // Return true if the layer must be re-rendered. Return false if the
+ // layer was found in the cache and can be reused.
+ bool lock(GrCachedLayer* layer, const GrTextureDesc& desc, bool dontAtlas);
// Inform the cache that layer's cached image is not currently required
void unlock(GrCachedLayer* layer);
@@ -228,7 +227,10 @@ private:
int fPlotLocks[kNumPlotsX * kNumPlotsY];
void initAtlas();
- GrCachedLayer* createLayer(const SkPicture* picture, int start, int stop, const SkMatrix& ctm);
+ GrCachedLayer* createLayer(uint32_t pictureID, int start, int stop, const SkMatrix& ctm);
+
+public:
+ void purgeAll();
// Remove all the layers (and unlock any resources) associated with 'pictureID'
void purge(uint32_t pictureID);
@@ -237,6 +239,8 @@ private:
return width <= kPlotWidth && height <= kPlotHeight;
}
+ void purgePlot(GrPlot* plot);
+
// Try to find a purgeable plot and clear it out. Return true if a plot
// was purged; false otherwise.
bool purgePlot();
« no previous file with comments | « no previous file | src/gpu/GrLayerCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698