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

Unified Diff: samplecode/SampleQuadStroker.cpp

Issue 1772463002: use Make instead of Create to return a shared shader (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/SamplePatch.cpp ('k') | samplecode/SampleRegion.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 eae683f82ed29519cf119fb92d8eff0ae8f2d2aa..48f29f7f501b25fdc93dbf1f8a87526cf22283aa 100644
--- a/samplecode/SampleQuadStroker.cpp
+++ b/samplecode/SampleQuadStroker.cpp
@@ -109,7 +109,7 @@ class QuadStrokerView : public SampleView {
SkRect fWidthControl;
SkRect fBounds;
SkMatrix fMatrix, fInverse;
- SkAutoTUnref<SkShader> fShader;
+ sk_sp<SkShader> fShader;
SkAutoTUnref<SkSurface> fMinSurface;
SkAutoTUnref<SkSurface> fMaxSurface;
StrokeTypeButton fCubicButton;
@@ -264,8 +264,7 @@ protected:
fBounds.set(0, 0, SkIntToScalar(width * zoom), SkIntToScalar(height * zoom));
fMatrix.setScale(SkIntToScalar(zoom), SkIntToScalar(zoom));
fInverse.setScale(SK_Scalar1 / zoom, SK_Scalar1 / zoom);
- fShader.reset(sk_tool_utils::create_checkerboard_shader(
- 0xFFCCCCCC, 0xFFFFFFFF, zoom));
+ fShader = sk_tool_utils::create_checkerboard_shader(0xFFCCCCCC, 0xFFFFFFFF, zoom);
SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
fMinSurface.reset(SkSurface::NewRaster(info));
« no previous file with comments | « samplecode/SamplePatch.cpp ('k') | samplecode/SampleRegion.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698