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

Unified Diff: src/gpu/GrClipMaskManager.cpp

Issue 1385823002: Fix memory leak in ClipMaskManager (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrClipMaskManager.cpp
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index 1ddcef1b36c3cc4c48c4f00d8a6f401172736995..0f85517a1d4a74614606fcf12a499323d50e9ac5 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -308,7 +308,7 @@ bool GrClipMaskManager::setupClipping(const GrPipelineBuilder& pipelineBuilder,
// If MSAA is enabled we can do everything in the stencil buffer.
if (0 == rt->numStencilSamples() && requiresAA) {
- GrTexture* result = nullptr;
+ SkAutoTUnref<GrTexture> result;
// The top-left of the mask corresponds to the top-left corner of the bounds.
SkVector clipToMaskOffset = {
@@ -319,17 +319,17 @@ bool GrClipMaskManager::setupClipping(const GrPipelineBuilder& pipelineBuilder,
if (this->useSWOnlyPath(pipelineBuilder, clipToMaskOffset, elements)) {
// The clip geometry is complex enough that it will be more efficient to create it
// entirely in software
- result = this->createSoftwareClipMask(genID,
- initialState,
- elements,
- clipToMaskOffset,
- clipSpaceIBounds);
+ result.reset(this->createSoftwareClipMask(genID,
+ initialState,
+ elements,
+ clipToMaskOffset,
+ clipSpaceIBounds));
} else {
- result = this->createAlphaClipMask(genID,
- initialState,
- elements,
- clipToMaskOffset,
- clipSpaceIBounds);
+ result.reset(this->createAlphaClipMask(genID,
+ initialState,
+ elements,
+ clipToMaskOffset,
+ clipSpaceIBounds));
}
if (result) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698