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

Unified Diff: gm/localmatriximagefilter.cpp

Issue 1842793002: Switch SkLocalMatrixImageFilter and SkPaintImageFilter over to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up 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
Index: gm/localmatriximagefilter.cpp
diff --git a/gm/localmatriximagefilter.cpp b/gm/localmatriximagefilter.cpp
index dd86c967f96eebc2e77d85be4a6e64b192b026be..2bb7c540447d3ed384368cf391d886a81cf86ba2 100644
--- a/gm/localmatriximagefilter.cpp
+++ b/gm/localmatriximagefilter.cpp
@@ -49,7 +49,7 @@ protected:
return SkISize::Make(640, 640);
}
- static void show_image(SkCanvas* canvas, SkImage* image, SkImageFilter* filter) {
+ static void show_image(SkCanvas* canvas, SkImage* image, sk_sp<SkImageFilter> filter) {
SkPaint paint;
paint.setStyle(SkPaint::kStroke_Style);
SkRect r = SkRect::MakeIWH(image->width(), image->height()).makeOutset(SK_ScalarHalf,
@@ -81,12 +81,12 @@ protected:
canvas->translate(40, 40);
for (auto&& factory : factories) {
- SkAutoTUnref<SkImageFilter> filter(factory());
+ sk_sp<SkImageFilter> filter(factory());
canvas->save();
show_image(canvas, image0.get(), filter);
for (const auto& matrix : matrices) {
- SkAutoTUnref<SkImageFilter> localFilter(filter->newWithLocalMatrix(matrix));
+ sk_sp<SkImageFilter> localFilter(filter->makeWithLocalMatrix(matrix));
canvas->translate(spacer, 0);
show_image(canvas, image0.get(), localFilter);
f(malita) 2016/03/29 18:10:06 nit: std::move(localFilter)
robertphillips 2016/03/29 19:31:39 Done.
}

Powered by Google App Engine
This is Rietveld 408576698