Index: samplecode/SampleClamp.cpp |
diff --git a/samplecode/SampleClamp.cpp b/samplecode/SampleClamp.cpp |
index e319a56dc4f3d59f835a56536c0ce4b5cb945b17..97390535223324c83d8bf5246a954ff84897b8a7 100644 |
--- a/samplecode/SampleClamp.cpp |
+++ b/samplecode/SampleClamp.cpp |
@@ -13,25 +13,20 @@ |
#include "SkGradientShader.h" |
#include "SkPicture.h" |
-static SkShader* make_linear() { |
+static sk_sp<SkShader> make_linear() { |
SkPoint pts[] = { 0, 0, SK_Scalar1/500, SK_Scalar1/500 }; |
SkColor colors[] = { SK_ColorRED, SK_ColorBLUE }; |
- return SkGradientShader::CreateLinear(pts, colors, nullptr, 2, |
- SkShader::kClamp_TileMode); |
+ return SkGradientShader::MakeLinear(pts, colors, nullptr, 2, SkShader::kClamp_TileMode); |
} |
class ClampView : public SampleView { |
- SkShader* fGrad; |
+ sk_sp<SkShader> fGrad; |
public: |
ClampView() { |
fGrad = make_linear(); |
} |
- virtual ~ClampView() { |
- fGrad->unref(); |
- } |
- |
protected: |
// overrides from SkEventSink |
virtual bool onQuery(SkEvent* evt) { |