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

Unified Diff: src/gpu/GrLayerCache.cpp

Issue 431603002: Fix ref counting of cached layer's texture (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove incorrect 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrLayerCache.cpp
diff --git a/src/gpu/GrLayerCache.cpp b/src/gpu/GrLayerCache.cpp
index 58994790b732e3b3e515652e85c3887449020904..2c97387c7f93fdcfa8851e3773f05c21c8d31118 100644
--- a/src/gpu/GrLayerCache.cpp
+++ b/src/gpu/GrLayerCache.cpp
@@ -198,8 +198,10 @@ bool GrLayerCache::lock(GrCachedLayer* layer, const GrTextureDesc& desc) {
// The texture wouldn't fit in the cache - give it it's own texture.
// This path always uses a new scratch texture and (thus) doesn't cache anything.
// This can yield a lot of re-rendering
- layer->setTexture(fContext->lockAndRefScratchTexture(desc, GrContext::kApprox_ScratchTexMatch),
- GrIRect16::MakeWH(SkToS16(desc.fWidth), SkToS16(desc.fHeight)));
+ SkAutoTUnref<GrTexture> tex(fContext->lockAndRefScratchTexture(desc,
+ GrContext::kApprox_ScratchTexMatch));
+
+ layer->setTexture(tex, GrIRect16::MakeWH(SkToS16(desc.fWidth), SkToS16(desc.fHeight)));
layer->setLocked(true);
return false;
}
« no previous file with comments | « src/gpu/GrLayerCache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698