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

Unified Diff: gm/localmatriximagefilter.cpp

Issue 1810813003: update callsites for Make image factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: start to take advantage of sk_sp drawImage 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/imagetoyuvplanes.cpp ('k') | gm/mipmap.cpp » ('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 64ed6d7b8c9c3bdf43d210b7282ad7d6fe1a4c49..f99655863eea603ac3125da05a52b7b5f8abac8f 100644
--- a/gm/localmatriximagefilter.cpp
+++ b/gm/localmatriximagefilter.cpp
@@ -14,7 +14,7 @@
#include "SkOffsetImageFilter.h"
#include "SkSurface.h"
-static SkImage* make_image(SkCanvas* rootCanvas) {
+static sk_sp<SkImage> make_image(SkCanvas* rootCanvas) {
SkImageInfo info = SkImageInfo::MakeN32Premul(100, 100);
SkAutoTUnref<SkSurface> surface(rootCanvas->newSurface(info));
if (!surface) {
@@ -25,7 +25,7 @@ static SkImage* make_image(SkCanvas* rootCanvas) {
paint.setAntiAlias(true);
paint.setColor(SK_ColorRED);
surface->getCanvas()->drawCircle(50, 50, 50, paint);
- return surface->newImageSnapshot();
+ return surface->makeImageSnapshot();
}
typedef SkImageFilter* (*ImageFilterFactory)();
@@ -62,7 +62,7 @@ protected:
}
void onDraw(SkCanvas* canvas) override {
- SkAutoTUnref<SkImage> image0(make_image(canvas));
+ sk_sp<SkImage> image0(make_image(canvas));
const ImageFilterFactory factories[] = {
IFCCast([]{ return SkBlurImageFilter::Create(8, 8); }),
@@ -84,11 +84,11 @@ protected:
SkAutoTUnref<SkImageFilter> filter(factory());
canvas->save();
- show_image(canvas, image0, filter);
+ show_image(canvas, image0.get(), filter);
for (const auto& matrix : matrices) {
SkAutoTUnref<SkImageFilter> localFilter(filter->newWithLocalMatrix(matrix));
canvas->translate(spacer, 0);
- show_image(canvas, image0, localFilter);
+ show_image(canvas, image0.get(), localFilter);
}
canvas->restore();
canvas->translate(0, spacer);
« no previous file with comments | « gm/imagetoyuvplanes.cpp ('k') | gm/mipmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698