aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/verylargebitmap.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-03-17 10:51:11 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-17 10:51:11 -0700
commit9ce9d6772df650ceb0511f275e1a83dffa78ff72 (patch)
tree1c0d54a75945863947490ec45cccf7c30eaa2ca4 /gm/verylargebitmap.cpp
parent42d95a0afb26560586232961445ba36de387ca37 (diff)
update callsites for Make image factories
not forced yet, as we still have the build-guard. waiting on chrome CL BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1810813003 TBR= Review URL: https://codereview.chromium.org/1810813003
Diffstat (limited to 'gm/verylargebitmap.cpp')
-rw-r--r--gm/verylargebitmap.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/gm/verylargebitmap.cpp b/gm/verylargebitmap.cpp
index ab6821dc1a..4ce5b7b379 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;