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

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: Ooops 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/imagefiltersscaled.cpp ('k') | include/core/SkImageFilter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/localmatriximagefilter.cpp
diff --git a/gm/localmatriximagefilter.cpp b/gm/localmatriximagefilter.cpp
index d53380b85856957c2ac90232c6a6e19b186f76bf..5414fe341cc0a3a89f08d53a8a74e3370630ed62 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,14 +81,14 @@ 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);
+ show_image(canvas, image0.get(), std::move(localFilter));
}
canvas->restore();
canvas->translate(0, spacer);
« no previous file with comments | « gm/imagefiltersscaled.cpp ('k') | include/core/SkImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698