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

Side by Side Diff: gm/imageblur2.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 unified diff | Download patch
« no previous file with comments | « gm/imageblur.cpp ('k') | gm/imageblurtiled.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 SkScalar dx = WIDTH / sigmaCount; 51 SkScalar dx = WIDTH / sigmaCount;
52 SkScalar dy = HEIGHT / sigmaCount; 52 SkScalar dy = HEIGHT / sigmaCount;
53 const SkScalar textSize = 12; 53 const SkScalar textSize = 12;
54 54
55 for (int x = 0; x < sigmaCount; x++) { 55 for (int x = 0; x < sigmaCount; x++) {
56 SkScalar sigmaX = kBlurSigmas[x]; 56 SkScalar sigmaX = kBlurSigmas[x];
57 for (int y = 0; y < sigmaCount; y++) { 57 for (int y = 0; y < sigmaCount; y++) {
58 SkScalar sigmaY = kBlurSigmas[y]; 58 SkScalar sigmaY = kBlurSigmas[y];
59 59
60 SkPaint paint; 60 SkPaint paint;
61 paint.setImageFilter(SkBlurImageFilter::Create(sigmaX, sigmaY))- >unref(); 61 SkAutoTUnref<SkImageFilter> blur(SkBlurImageFilter::Create(sigma X, sigmaY));
62 paint.setImageFilter(blur);
62 canvas->saveLayer(nullptr, &paint); 63 canvas->saveLayer(nullptr, &paint);
63 64
64 SkRandom rand; 65 SkRandom rand;
65 SkPaint textPaint; 66 SkPaint textPaint;
66 textPaint.setAntiAlias(false); 67 textPaint.setAntiAlias(false);
67 textPaint.setColor(sk_tool_utils::color_to_565(rand.nextBits(24) | 0xFF000000)); 68 textPaint.setColor(sk_tool_utils::color_to_565(rand.nextBits(24) | 0xFF000000));
68 sk_tool_utils::set_portable_typeface(&textPaint); 69 sk_tool_utils::set_portable_typeface(&textPaint);
69 textPaint.setTextSize(textSize); 70 textPaint.setTextSize(textSize);
70 71
71 for (int i = 0; i < testStringCount; i++) { 72 for (int i = 0; i < testStringCount; i++) {
(...skipping 13 matching lines...) Expand all
85 86
86 typedef GM INHERITED; 87 typedef GM INHERITED;
87 }; 88 };
88 89
89 ////////////////////////////////////////////////////////////////////////////// 90 //////////////////////////////////////////////////////////////////////////////
90 91
91 static GM* MyFactory(void*) { return new BlurImageFilter; } 92 static GM* MyFactory(void*) { return new BlurImageFilter; }
92 static GMRegistry reg(MyFactory); 93 static GMRegistry reg(MyFactory);
93 94
94 } 95 }
OLDNEW
« no previous file with comments | « gm/imageblur.cpp ('k') | gm/imageblurtiled.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698