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

Unified Diff: gm/imagefilters.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/imagealphathreshold.cpp ('k') | gm/imagefiltersclipped.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagefilters.cpp
diff --git a/gm/imagefilters.cpp b/gm/imagefilters.cpp
index 951a934d8210614daf9ad41262ca8e7cf0dda8bb..24a08ff865f8a44e7c638270b5fb8c6c33cd15d5 100644
--- a/gm/imagefilters.cpp
+++ b/gm/imagefilters.cpp
@@ -66,14 +66,14 @@ DEF_SIMPLE_GM(imagefilters_xfermodes, canvas, 480, 480) {
}
}
-static SkImage* make_image(SkCanvas* canvas) {
+static sk_sp<SkImage> make_image(SkCanvas* canvas) {
const SkImageInfo info = SkImageInfo::MakeN32Premul(100, 100);
SkAutoTUnref<SkSurface> surface(canvas->newSurface(info));
if (!surface) {
surface.reset(SkSurface::NewRaster(info));
}
surface->getCanvas()->drawRect(SkRect::MakeXYWH(25, 25, 50, 50), SkPaint());
- return surface->newImageSnapshot();
+ return surface->makeImageSnapshot();
}
// Compare blurs when we're tightly clipped (fast) and not as tightly (slower)
@@ -81,7 +81,7 @@ static SkImage* make_image(SkCanvas* canvas) {
// Expect the two to draw the same (modulo the extra border of pixels when the clip is larger)
//
DEF_SIMPLE_GM(fast_slow_blurimagefilter, canvas, 620, 260) {
- SkAutoTUnref<SkImage> image(make_image(canvas));
+ sk_sp<SkImage> image(make_image(canvas));
const SkRect r = SkRect::MakeIWH(image->width(), image->height());
canvas->translate(10, 10);
@@ -162,7 +162,7 @@ DEF_SIMPLE_GM(savelayer_with_backdrop, canvas, 830, 550) {
SkPaint paint;
paint.setFilterQuality(kMedium_SkFilterQuality);
- SkAutoTUnref<SkImage> image(GetResourceAsImage("mandrill_512.png"));
+ sk_sp<SkImage> image(GetResourceAsImage("mandrill_512.png"));
canvas->translate(20, 20);
for (const auto& xform : xforms) {
« no previous file with comments | « gm/imagealphathreshold.cpp ('k') | gm/imagefiltersclipped.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698