More Unref GrXPFactory.
authorbungeman <bungeman@google.com>
Sat, 4 Jun 2016 00:43:24 +0000 (17:43 -0700)
committerCommit bot <commit-bot@chromium.org>
Sat, 4 Jun 2016 00:43:24 +0000 (17:43 -0700)
Not releasing the reference was caught by the Skia asan bot.
All remaining occurences of this pattern have been updated.

This fixes "Make GrClipMaskManager stateless and push GrPipelineBuilder construction downstack".

TBR=herb

Review-Url: https://codereview.chromium.org/2037243002

src/gpu/GrClipMaskManager.cpp
src/gpu/batches/GrDefaultPathRenderer.cpp
src/gpu/batches/GrMSAAPathRenderer.cpp
src/gpu/batches/GrStencilAndCoverPathRenderer.cpp

index ff95eeaac33439b7eef438e6caef5e6a7167e544..fd741b9a2bef61ce6f11804e57eedd30fcb106ae 100644 (file)
@@ -683,7 +683,7 @@ bool GrClipMaskManager::CreateStencilClipMask(GrContext* context,
                     if (!clipPath.isEmpty()) {
                         if (canRenderDirectToStencil) {
                             GrPaint paint;
-                            paint.setXPFactory(GrDisableColorXPFactory::Create());
+                            SkSafeUnref(paint.setXPFactory(GrDisableColorXPFactory::Create()));
                             paint.setAntiAlias(element->isAA());
 
                             GrPathRenderer::DrawPathArgs args;
@@ -724,7 +724,7 @@ bool GrClipMaskManager::CreateStencilClipMask(GrContext* context,
                                       viewMatrix, element->getRect(), element->isAA(), *pass);
                     } else {
                         GrPaint paint;
-                        paint.setXPFactory(GrDisableColorXPFactory::Create());
+                        SkSafeUnref(paint.setXPFactory(GrDisableColorXPFactory::Create()));
                         paint.setAntiAlias(element->isAA());
 
                         GrPathRenderer::DrawPathArgs args;
index 9077d92f4e05f524bfaa395790f02fa9504501ac..1bcfc2d8b6d900056cac1fe030344cae81da3efc 100644 (file)
@@ -629,7 +629,7 @@ void GrDefaultPathRenderer::onStencilPath(const StencilPathArgs& args) {
     SkASSERT(SkPath::kInverseWinding_FillType != args.fPath->getFillType());
 
     GrPaint paint;
-    paint.setXPFactory(GrDisableColorXPFactory::Create());
+    SkSafeUnref(paint.setXPFactory(GrDisableColorXPFactory::Create()));
     paint.setAntiAlias(args.fIsAA);
 
     this->internalDrawPath(args.fDrawContext,
index 887c5273647822e5e6282018d2aa1fad9db80d40..2983f58055d20724c753e1de025d49bdbedc9de9 100644 (file)
@@ -751,7 +751,7 @@ void GrMSAAPathRenderer::onStencilPath(const StencilPathArgs& args) {
     SkASSERT(SkPath::kInverseWinding_FillType != args.fPath->getFillType());
 
     GrPaint paint;
-    paint.setXPFactory(GrDisableColorXPFactory::Create());
+    SkSafeUnref(paint.setXPFactory(GrDisableColorXPFactory::Create()));
     paint.setAntiAlias(args.fIsAA);
 
     this->internalDrawPath(args.fDrawContext,
index e43d05c09815ca2c995b1a96f0509bc35c6c06d3..314e6c26497f11e0bd50aff9a9427f041ccbbb40 100644 (file)
@@ -71,7 +71,7 @@ void GrStencilAndCoverPathRenderer::onStencilPath(const StencilPathArgs& args) {
                               "GrStencilAndCoverPathRenderer::onStencilPath");
 
     GrPaint paint;
-    paint.setXPFactory(GrDisableColorXPFactory::Create());
+    SkSafeUnref(paint.setXPFactory(GrDisableColorXPFactory::Create()));
     paint.setAntiAlias(args.fIsAA);
 
     GrPipelineBuilder pipelineBuilder(paint, args.fDrawContext->isUnifiedMultisampled());