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

Unified Diff: src/gpu/GrLayerHoister.cpp

Issue 1406013006: Update Layer Hoisting to store its atlas texture in the resource cache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix Android bug Created 5 years, 1 month 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/GrLayerHoister.h ('k') | src/gpu/GrRectanizer_skyline.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrLayerHoister.cpp
diff --git a/src/gpu/GrLayerHoister.cpp b/src/gpu/GrLayerHoister.cpp
index 2bf1abb5fdb3618debdac00385c1d72cd1d35783..004e4d0e6eb38ab190e6d16a402b0e5d1c78d48f 100644
--- a/src/gpu/GrLayerHoister.cpp
+++ b/src/gpu/GrLayerHoister.cpp
@@ -322,7 +322,7 @@ void GrLayerHoister::FilterLayer(GrContext* context,
}
SkIRect newRect = SkIRect::MakeWH(filteredBitmap.width(), filteredBitmap.height());
- layer->setTexture(filteredBitmap.getTexture(), newRect);
+ layer->setTexture(filteredBitmap.getTexture(), newRect, false);
layer->setOffset(offset);
}
@@ -380,13 +380,22 @@ void GrLayerHoister::UnlockLayers(GrContext* context,
SkDEBUGCODE(layerCache->validate();)
}
-void GrLayerHoister::PurgeCache(GrContext* context) {
-#if !GR_CACHE_HOISTED_LAYERS
+void GrLayerHoister::Begin(GrContext* context) {
+ GrLayerCache* layerCache = context->getLayerCache();
+
+ layerCache->begin();
+}
+
+void GrLayerHoister::End(GrContext* context) {
GrLayerCache* layerCache = context->getLayerCache();
+#if !GR_CACHE_HOISTED_LAYERS
+
// This code completely clears out the atlas. It is required when
// caching is disabled so the atlas doesn't fill up and force more
// free floating layers
layerCache->purgeAll();
#endif
+
+ layerCache->end();
}
« no previous file with comments | « src/gpu/GrLayerHoister.h ('k') | src/gpu/GrRectanizer_skyline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698