Index: gm/vertices.cpp |
diff --git a/gm/vertices.cpp b/gm/vertices.cpp |
index 177dc43c2b7bc83b4d7838defc0cea3bc405cb52..31fb3527248b5f38ee4e057a4ab073deffb3a58c 100644 |
--- a/gm/vertices.cpp |
+++ b/gm/vertices.cpp |
@@ -11,19 +11,20 @@ |
#include "SkGradientShader.h" |
#include "SkRandom.h" |
-static sk_sp<SkShader> make_shader1(SkScalar w, SkScalar h) { |
+static SkShader* make_shader1(SkScalar w, SkScalar h) { |
const SkColor colors[] = { |
SK_ColorRED, SK_ColorCYAN, SK_ColorGREEN, SK_ColorWHITE, |
SK_ColorMAGENTA, SK_ColorBLUE, SK_ColorYELLOW, |
}; |
const SkPoint pts[] = { { w/4, 0 }, { 3*w/4, h } }; |
- return SkGradientShader::MakeLinear(pts, colors, nullptr, SK_ARRAY_COUNT(colors), |
- SkShader::kMirror_TileMode); |
+ return SkGradientShader::CreateLinear(pts, colors, nullptr, |
+ SK_ARRAY_COUNT(colors), |
+ SkShader::kMirror_TileMode); |
} |
-static sk_sp<SkShader> make_shader2() { |
- return SkShader::MakeColorShader(SK_ColorBLUE); |
+static SkShader* make_shader2() { |
+ return SkShader::CreateColorShader(SK_ColorBLUE); |
} |
static SkColorFilter* make_color_filter() { |
@@ -34,8 +35,8 @@ |
SkPoint fPts[9]; |
SkPoint fTexs[9]; |
SkColor fColors[9]; |
- sk_sp<SkShader> fShader1; |
- sk_sp<SkShader> fShader2; |
+ SkAutoTUnref<SkShader> fShader1; |
+ SkAutoTUnref<SkShader> fShader2; |
SkAutoTUnref<SkColorFilter> fColorFilter; |
public: |
@@ -58,8 +59,8 @@ |
fTexs[3].set(0, h/2); fTexs[4].set(w/2, h/2); fTexs[5].set(w, h/2); |
fTexs[6].set(0, h); fTexs[7].set(w/2, h); fTexs[8].set(w, h); |
- fShader1 = make_shader1(w, h); |
- fShader2 = make_shader2(); |
+ fShader1.reset(make_shader1(w, h)); |
+ fShader2.reset(make_shader2()); |
fColorFilter.reset(make_color_filter()); |
SkRandom rand; |
@@ -85,11 +86,11 @@ |
}; |
const struct { |
- const SkColor* fColors; |
- const SkPoint* fTexs; |
- const sk_sp<SkShader>& fShader; |
- SkColorFilter* fColorFilter; |
- uint8_t fAlpha; |
+ const SkColor* fColors; |
+ const SkPoint* fTexs; |
+ SkShader* fShader; |
+ SkColorFilter* fColorFilter; |
+ uint8_t fAlpha; |
} rec[] = { |
{ fColors, nullptr, fShader1, nullptr , 0xFF }, |
{ nullptr, fTexs , fShader1, nullptr , 0xFF }, |