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

Unified Diff: gm/imagefilters.cpp

Issue 1518643002: SkBlurImageFilter returns input when sigma = 0 (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: clean up Created 5 years 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 | « gm/imageblurtiled.cpp ('k') | include/effects/SkBlurImageFilter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagefilters.cpp
diff --git a/gm/imagefilters.cpp b/gm/imagefilters.cpp
index af2c776ce186e77d8e72b6bb4a0d9d81d984da5e..5f1ae849490dd8971a99ab656d7f4b8bca48c255 100644
--- a/gm/imagefilters.cpp
+++ b/gm/imagefilters.cpp
@@ -22,7 +22,7 @@
static void do_draw(SkCanvas* canvas, SkXfermode::Mode mode, SkImageFilter* imf) {
SkAutoCanvasRestore acr(canvas, true);
canvas->clipRect(SkRect::MakeWH(220, 220));
-
+
// want to force a layer, so modes like DstIn can combine meaningfully, but the final
// image can still be shown against our default (opaque) background. non-opaque GMs
// are a lot more trouble to compare/triage.
@@ -31,10 +31,10 @@ static void do_draw(SkCanvas* canvas, SkXfermode::Mode mode, SkImageFilter* imf)
SkPaint paint;
paint.setAntiAlias(true);
-
+
SkRect r0 = SkRect::MakeXYWH(10, 60, 200, 100);
SkRect r1 = SkRect::MakeXYWH(60, 10, 100, 200);
-
+
paint.setColor(SK_ColorRED);
canvas->drawOval(r0, paint);
@@ -54,14 +54,14 @@ DEF_SIMPLE_GM(imagefilters_xfermodes, canvas, 480, 480) {
const SkXfermode::Mode modes[] = {
SkXfermode::kSrcATop_Mode, SkXfermode::kDstIn_Mode
};
-
+
for (size_t i = 0; i < SK_ARRAY_COUNT(modes); ++i) {
canvas->save();
do_draw(canvas, modes[i], nullptr);
canvas->translate(240, 0);
do_draw(canvas, modes[i], imf);
canvas->restore();
-
+
canvas->translate(0, 240);
}
}
@@ -87,7 +87,8 @@ DEF_SIMPLE_GM(fast_slow_blurimagefilter, canvas, 620, 260) {
canvas->translate(10, 10);
for (SkScalar sigma = 8; sigma <= 128; sigma *= 2) {
SkPaint paint;
- paint.setImageFilter(SkBlurImageFilter::Create(sigma, sigma))->unref();
+ SkAutoTUnref<SkImageFilter> blur(SkBlurImageFilter::Create(sigma, sigma));
+ paint.setImageFilter(blur);
canvas->save();
// we outset the clip by 1, to fall out of the fast-case in drawImage
« no previous file with comments | « gm/imageblurtiled.cpp ('k') | include/effects/SkBlurImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698