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

Unified Diff: gm/verylargebitmap.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/tileimagefilter.cpp ('k') | gm/xfermodeimagefilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/verylargebitmap.cpp
diff --git a/gm/verylargebitmap.cpp b/gm/verylargebitmap.cpp
index ab6821dc1abc651b01b40e57a9075a3afcb11145..4ce5b7b379cf3973877a852a17b755483c316999 100644
--- a/gm/verylargebitmap.cpp
+++ b/gm/verylargebitmap.cpp
@@ -22,25 +22,25 @@ static void draw(SkCanvas* canvas, int width, int height, SkColor colors[2]) {
canvas->drawPaint(paint);
}
-static SkImage* make_raster_image(int width, int height, SkColor colors[2]) {
+static sk_sp<SkImage> make_raster_image(int width, int height, SkColor colors[2]) {
SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(width, height));
draw(surface->getCanvas(), width, height, colors);
- return surface->newImageSnapshot();
+ return surface->makeImageSnapshot();
}
-static SkImage* make_picture_image(int width, int height, SkColor colors[2]) {
+static sk_sp<SkImage> make_picture_image(int width, int height, SkColor colors[2]) {
SkPictureRecorder recorder;
draw(recorder.beginRecording(SkRect::MakeIWH(width, height)), width, height, colors);
SkAutoTUnref<SkPicture> picture(recorder.endRecording());
- return SkImage::NewFromPicture(picture, SkISize::Make(width, height),
- nullptr, nullptr);
+ return SkImage::MakeFromPicture(sk_ref_sp(picture.get()), SkISize::Make(width, height),
+ nullptr, nullptr);
}
-typedef SkImage* (*ImageMakerProc)(int width, int height, SkColor colors[2]);
+typedef sk_sp<SkImage> (*ImageMakerProc)(int width, int height, SkColor colors[2]);
static void show_image(SkCanvas* canvas, int width, int height, SkColor colors[2],
ImageMakerProc proc) {
- SkAutoTUnref<SkImage> image(proc(width, height, colors));
+ sk_sp<SkImage> image(proc(width, height, colors));
SkPaint paint;
SkRect r;
« no previous file with comments | « gm/tileimagefilter.cpp ('k') | gm/xfermodeimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698