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

Unified Diff: gm/ninepatchstretch.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/multipicturedraw.cpp ('k') | gm/perspshaders.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/ninepatchstretch.cpp
diff --git a/gm/ninepatchstretch.cpp b/gm/ninepatchstretch.cpp
index f269376bb0afe4aebbc2f23b18b58a1ef5cb6801..9b0b94ec276030b5ad05229d41ef626eb774d7a1 100644
--- a/gm/ninepatchstretch.cpp
+++ b/gm/ninepatchstretch.cpp
@@ -8,11 +8,11 @@
#include "gm.h"
#include "SkSurface.h"
-static SkSurface* make_surface(SkCanvas* root, int N) {
+static sk_sp<SkSurface> make_surface(SkCanvas* root, int N) {
SkImageInfo info = SkImageInfo::MakeN32Premul(N, N);
- SkSurface* surface = root->newSurface(info);
+ auto surface = root->makeSurface(info);
if (!surface) {
- surface = SkSurface::NewRaster(info);
+ surface = SkSurface::MakeRaster(info);
}
return surface;
}
@@ -22,7 +22,7 @@ static sk_sp<SkImage> make_image(SkCanvas* root, SkIRect* center) {
const int kStretchy = 8;
const int kSize = 2*kFixed + kStretchy;
- SkAutoTUnref<SkSurface> surface(make_surface(root, kSize));
+ auto surface(make_surface(root, kSize));
SkCanvas* canvas = surface->getCanvas();
SkRect r = SkRect::MakeWH(SkIntToScalar(kSize), SkIntToScalar(kSize));
« no previous file with comments | « gm/multipicturedraw.cpp ('k') | gm/perspshaders.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698