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

Unified Diff: gm/pixelxorxfermode.cpp

Issue 1633773002: Fix memory leak in pixelxorxfermode GM (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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: gm/pixelxorxfermode.cpp
diff --git a/gm/pixelxorxfermode.cpp b/gm/pixelxorxfermode.cpp
index 8066959cea073f677fb933b380f642907c874b38..76685706a777e4a6891658a0846dbeacb370d65a 100644
--- a/gm/pixelxorxfermode.cpp
+++ b/gm/pixelxorxfermode.cpp
@@ -49,7 +49,7 @@ protected:
// the green & blue channels alone
SkPaint p1;
p1.setColor(SK_ColorBLACK); // noop
- p1.setXfermode(SkPixelXorXfermode::Create(SK_ColorRED));
+ p1.setXfermode(SkPixelXorXfermode::Create(SK_ColorRED))->unref();
canvas->drawRect(r, p1);
@@ -58,7 +58,7 @@ protected:
// Negate the dst color via the src color
SkPaint p2;
p2.setColor(SK_ColorWHITE);
- p2.setXfermode(SkPixelXorXfermode::Create(SK_ColorBLACK)); // noop
+ p2.setXfermode(SkPixelXorXfermode::Create(SK_ColorBLACK))->unref(); // noop
canvas->drawRect(r, p2);
@@ -67,7 +67,7 @@ protected:
// Just return the original color
SkPaint p3;
p3.setColor(SK_ColorBLACK); // noop
- p3.setXfermode(SkPixelXorXfermode::Create(SK_ColorBLACK)); // noop
+ p3.setXfermode(SkPixelXorXfermode::Create(SK_ColorBLACK))->unref(); // noop
canvas->drawRect(r, p3);
@@ -77,7 +77,7 @@ protected:
// the blue channel alone
SkPaint p4;
p4.setColor(SK_ColorBLACK); // noop
- p4.setXfermode(SkPixelXorXfermode::Create(SK_ColorYELLOW));
+ p4.setXfermode(SkPixelXorXfermode::Create(SK_ColorYELLOW))->unref();
canvas->drawRect(r, p4);
}
« 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