Index: bench/ColorCubeBench.cpp |
diff --git a/bench/ColorCubeBench.cpp b/bench/ColorCubeBench.cpp |
index 6c5a16d6a212bf03d362408ef71742dcb0fb7dc7..9f6bd001ff00b5b972dad83acce4d87f65ea7386 100644 |
--- a/bench/ColorCubeBench.cpp |
+++ b/bench/ColorCubeBench.cpp |
@@ -48,13 +48,13 @@ protected: |
} |
private: |
- static SkShader* MakeLinear(const SkISize& size) { |
+ static sk_sp<SkShader> MakeLinear(const SkISize& size) { |
const SkPoint pts[2] = { |
{ 0, 0 }, |
{ SkIntToScalar(size.width()), SkIntToScalar(size.height()) } |
}; |
static const SkColor colors[] = { SK_ColorYELLOW, SK_ColorBLUE }; |
- return SkGradientShader::CreateLinear( |
+ return SkGradientShader::MakeLinear( |
pts, colors, nullptr, 2, SkShader::kRepeat_TileMode, 0, &SkMatrix::I()); |
} |
@@ -64,11 +64,9 @@ private: |
canvas.clear(0x00000000); |
SkPaint paint; |
paint.setAntiAlias(true); |
- SkShader* shader = MakeLinear(fSize); |
- paint.setShader(shader); |
+ paint.setShader(MakeLinear(fSize)); |
SkRect r = { 0, 0, SkIntToScalar(fSize.width()), SkIntToScalar(fSize.height()) }; |
canvas.drawRect(r, paint); |
- shader->unref(); |
} |
void makeCubeData() { |