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

Unified Diff: samplecode/SampleQuadStroker.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 | « samplecode/SampleFilterQuality.cpp ('k') | samplecode/SampleTextureDomain.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleQuadStroker.cpp
diff --git a/samplecode/SampleQuadStroker.cpp b/samplecode/SampleQuadStroker.cpp
index 48f29f7f501b25fdc93dbf1f8a87526cf22283aa..40f01fd1053fe085a45ac39fe50425c6d7b1b9ef 100644
--- a/samplecode/SampleQuadStroker.cpp
+++ b/samplecode/SampleQuadStroker.cpp
@@ -76,7 +76,7 @@ static void getContourCounts(const SkPath& path, SkTArray<int>* contourCounts) {
}
}
-static void erase(SkSurface* surface) {
+static void erase(const sk_sp<SkSurface>& surface) {
SkCanvas* canvas = surface->getCanvas();
if (canvas) {
canvas->clear(SK_ColorTRANSPARENT);
@@ -110,8 +110,8 @@ class QuadStrokerView : public SampleView {
SkRect fBounds;
SkMatrix fMatrix, fInverse;
sk_sp<SkShader> fShader;
- SkAutoTUnref<SkSurface> fMinSurface;
- SkAutoTUnref<SkSurface> fMaxSurface;
+ sk_sp<SkSurface> fMinSurface;
+ sk_sp<SkSurface> fMaxSurface;
StrokeTypeButton fCubicButton;
StrokeTypeButton fConicButton;
StrokeTypeButton fQuadButton;
@@ -267,9 +267,9 @@ protected:
fShader = sk_tool_utils::create_checkerboard_shader(0xFFCCCCCC, 0xFFFFFFFF, zoom);
SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
- fMinSurface.reset(SkSurface::NewRaster(info));
+ fMinSurface = SkSurface::MakeRaster(info);
info = info.makeWH(width * zoom, height * zoom);
- fMaxSurface.reset(SkSurface::NewRaster(info));
+ fMaxSurface = SkSurface::MakeRaster(info);
}
void draw_points(SkCanvas* canvas, const SkPath& path, SkColor color,
« no previous file with comments | « samplecode/SampleFilterQuality.cpp ('k') | samplecode/SampleTextureDomain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698