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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 26968006: detach blur result texture when it is the same texture used to render path mask (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix comment Created 7 years, 2 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 | « gyp/gmslides.gypi ('k') | no next file » | 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 3fa13a7df9abd6b7b5b5ee220d3f4210ef362b39..7bba41f60aa42f7dc21e2e5ff71500a09076d2ef 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -951,8 +951,17 @@ void SkGpuDevice::drawPath(const SkDraw& draw, const SkPath& origSrcPath,
GrTexture* filtered;
if (paint.getMaskFilter()->filterMaskGPU(mask.texture(), maskRect, &filtered, true)) {
+ // filterMaskGPU gives us ownership of a ref to the result
SkAutoTUnref<GrTexture> atu(filtered);
+ // If the scratch texture that we used as the filter src also holds the filter
+ // result then we must detach so that this texture isn't recycled for a later
+ // draw.
+ if (filtered == mask.texture()) {
+ mask.detach();
+ filtered->unref(); // detach transfers GrAutoScratchTexture's ref to us.
+ }
+
if (draw_mask(fContext, maskRect, &grPaint, filtered)) {
// This path is completely drawn
return;
« no previous file with comments | « gyp/gmslides.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698