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(); |