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

Unified Diff: gm/image_shader.cpp

Issue 1817383002: switch surface to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/image_pict.cpp ('k') | gm/imagealphathreshold.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/image_shader.cpp
diff --git a/gm/image_shader.cpp b/gm/image_shader.cpp
index 061539013eb525f35dbc456ff8ec51736c6e477e..5fed7d1344bec0c39bb7c9c7a8d8db9ba2bc5e85 100644
--- a/gm/image_shader.cpp
+++ b/gm/image_shader.cpp
@@ -27,7 +27,7 @@ static void draw_something(SkCanvas* canvas, const SkRect& bounds) {
typedef sk_sp<SkImage> (*ImageMakerProc)(GrContext*, SkPicture*, const SkImageInfo&);
static sk_sp<SkImage> make_raster(GrContext*, SkPicture* pic, const SkImageInfo& info) {
- SkAutoTUnref<SkSurface> surface(SkSurface::NewRaster(info));
+ auto surface(SkSurface::MakeRaster(info));
surface->getCanvas()->clear(0);
surface->getCanvas()->drawPicture(pic);
return surface->makeImageSnapshot();
@@ -37,8 +37,7 @@ static sk_sp<SkImage> make_texture(GrContext* ctx, SkPicture* pic, const SkImage
if (!ctx) {
return nullptr;
}
- SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTarget(ctx, SkBudgeted::kNo,
- info, 0));
+ auto surface(SkSurface::MakeRenderTarget(ctx, SkBudgeted::kNo, info));
surface->getCanvas()->clear(0);
surface->getCanvas()->drawPicture(pic);
return surface->makeImageSnapshot();
« no previous file with comments | « gm/image_pict.cpp ('k') | gm/imagealphathreshold.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698