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

Unified Diff: gm/xfermodes3.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/verylargebitmap.cpp ('k') | gyp/skia_for_android_framework_defines.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/xfermodes3.cpp
diff --git a/gm/xfermodes3.cpp b/gm/xfermodes3.cpp
index 4cd05df5c40c4f436209393f67b33d3bbe8750c1..84bc1e2218fbd80d7be5d673851e6e7816a8c54b 100644
--- a/gm/xfermodes3.cpp
+++ b/gm/xfermodes3.cpp
@@ -60,7 +60,7 @@ protected:
0x80,
};
- SkAutoTUnref<SkSurface> tempSurface(this->possiblyCreateTempSurface(canvas, kSize, kSize));
+ auto tempSurface(this->possiblyCreateTempSurface(canvas, kSize, kSize));
int test = 0;
int x = 0, y = 0;
@@ -83,7 +83,7 @@ protected:
modePaint.setStyle(kStrokes[s].fStyle);
modePaint.setStrokeWidth(kStrokes[s].fWidth);
- this->drawMode(canvas, x, y, kSize, kSize, modePaint, tempSurface);
+ this->drawMode(canvas, x, y, kSize, kSize, modePaint, tempSurface.get());
++test;
x += kSize + 10;
@@ -100,7 +100,7 @@ protected:
modePaint.setStyle(kStrokes[s].fStyle);
modePaint.setStrokeWidth(kStrokes[s].fWidth);
- this->drawMode(canvas, x, y, kSize, kSize, modePaint, tempSurface);
+ this->drawMode(canvas, x, y, kSize, kSize, modePaint, tempSurface.get());
++test;
x += kSize + 10;
@@ -122,13 +122,13 @@ private:
* So when running on a GPU canvas we explicitly create a temporary canvas using a texture with
* dimensions exactly matching the layer size.
*/
- SkSurface* possiblyCreateTempSurface(SkCanvas* baseCanvas, int w, int h) {
+ sk_sp<SkSurface> possiblyCreateTempSurface(SkCanvas* baseCanvas, int w, int h) {
#if SK_SUPPORT_GPU
GrContext* context = baseCanvas->getGrContext();
SkImageInfo baseInfo = baseCanvas->imageInfo();
SkImageInfo info = SkImageInfo::Make(w, h, baseInfo.colorType(), baseInfo.alphaType(),
baseInfo.profileType());
- return SkSurface::NewRenderTarget(context, SkBudgeted::kNo, info, 0, nullptr);
+ return SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info, 0, nullptr);
#else
return nullptr;
#endif
« no previous file with comments | « gm/verylargebitmap.cpp ('k') | gyp/skia_for_android_framework_defines.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698