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

Unified Diff: gm/spritebitmap.cpp

Issue 1852743002: Update SkBlurImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT & address code review comments Created 4 years, 9 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 | « gm/localmatriximagefilter.cpp ('k') | gm/testimagefilters.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/spritebitmap.cpp
diff --git a/gm/spritebitmap.cpp b/gm/spritebitmap.cpp
index 6c438fad11da5b90957678ac9fae2e6af4f2876d..38fe9f43021113d8176443b4f9c4cff74e2b0a7c 100644
--- a/gm/spritebitmap.cpp
+++ b/gm/spritebitmap.cpp
@@ -23,7 +23,7 @@ static void make_bm(SkBitmap* bm) {
}
static void draw_1_bitmap(SkCanvas* canvas, const SkBitmap& bm, bool doClip,
- int dx, int dy, SkImageFilter* filter = nullptr) {
+ int dx, int dy, sk_sp<SkImageFilter> filter) {
SkAutoCanvasRestore acr(canvas, true);
SkPaint paint;
@@ -32,7 +32,7 @@ static void draw_1_bitmap(SkCanvas* canvas, const SkBitmap& bm, bool doClip,
SkIntToScalar(bm.width()),
SkIntToScalar(bm.height()));
- paint.setImageFilter(filter);
+ paint.setImageFilter(std::move(filter));
clipR.inset(5, 5);
canvas->translate(SkIntToScalar(bm.width() + 20), 0);
@@ -72,13 +72,13 @@ protected:
int dy = 10;
SkScalar sigma = 8;
- SkAutoTUnref<SkImageFilter> filter(SkBlurImageFilter::Create(sigma, sigma));
+ sk_sp<SkImageFilter> filter(SkBlurImageFilter::Make(sigma, sigma, nullptr));
- draw_1_bitmap(canvas, bm, false, dx, dy);
+ draw_1_bitmap(canvas, bm, false, dx, dy, nullptr);
dy += bm.height() + 20;
draw_1_bitmap(canvas, bm, false, dx, dy, filter);
dy += bm.height() + 20;
- draw_1_bitmap(canvas, bm, true, dx, dy);
+ draw_1_bitmap(canvas, bm, true, dx, dy, nullptr);
dy += bm.height() + 20;
draw_1_bitmap(canvas, bm, true, dx, dy, filter);
}
« no previous file with comments | « gm/localmatriximagefilter.cpp ('k') | gm/testimagefilters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698