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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 408923002: Add auto purging for SkPicture-related Ganesh resources (esp. layers) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix comment 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/GrLayerCache.cpp ('k') | tests/GpuLayerCacheTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index b06046a557f9a18c1d9b407b8d154b06503d57cb..c35ff41219be49f68297780abb2303c1378be17e 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1842,6 +1842,8 @@ SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info) {
}
void SkGpuDevice::EXPERIMENTAL_optimize(const SkPicture* picture) {
+ fContext->getLayerCache()->processDeletedPictures();
+
SkPicture::AccelData::Key key = GPUAccelData::ComputeAccelDataKey();
const SkPicture::AccelData* existing = picture->EXPERIMENTAL_getAccelData(key);
@@ -1854,6 +1856,8 @@ void SkGpuDevice::EXPERIMENTAL_optimize(const SkPicture* picture) {
picture->EXPERIMENTAL_addAccelData(data);
GatherGPUInfo(picture, data);
+
+ fContext->getLayerCache()->trackPicture(picture);
}
static void wrap_texture(GrTexture* texture, int width, int height, SkBitmap* result) {
@@ -1862,11 +1866,8 @@ static void wrap_texture(GrTexture* texture, int width, int height, SkBitmap* re
result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, texture)))->unref();
}
-void SkGpuDevice::EXPERIMENTAL_purge(const SkPicture* picture) {
- fContext->getLayerCache()->purge(picture);
-}
-
bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* canvas, const SkPicture* picture) {
+ fContext->getLayerCache()->processDeletedPictures();
SkPicture::AccelData::Key key = GPUAccelData::ComputeAccelDataKey();
« no previous file with comments | « src/gpu/GrLayerCache.cpp ('k') | tests/GpuLayerCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698