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

Unified Diff: samplecode/SampleApp.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 | « public.bzl ('k') | samplecode/SampleAtlas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleApp.cpp
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index afd942bf1f5fc2dc7885d4599242a2eea0e768de..3149711d86b30e88784715a4862c7c526b714896 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -291,7 +291,7 @@ public:
#if SK_SUPPORT_GPU
if (IsGpuDeviceType(dType) && fCurContext) {
SkSurfaceProps props(win->getSurfaceProps());
- return SkSurface::NewRenderTargetDirect(fCurRenderTarget, &props);
+ return SkSurface::MakeRenderTargetDirect(fCurRenderTarget, &props).release();
}
#endif
return nullptr;
@@ -1066,7 +1066,7 @@ void SampleWindow::draw(SkCanvas* canvas) {
const SkScalar w = SkScalarCeilToScalar(tile.width());
const SkScalar h = SkScalarCeilToScalar(tile.height());
SkImageInfo info = SkImageInfo::MakeN32Premul(SkScalarTruncToInt(w), SkScalarTruncToInt(h));
- SkAutoTUnref<SkSurface> surface(canvas->newSurface(info));
+ auto surface(canvas->makeSurface(info));
SkCanvas* tileCanvas = surface->getCanvas();
for (SkScalar y = 0; y < height(); y += h) {
« no previous file with comments | « public.bzl ('k') | samplecode/SampleAtlas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698