Index: gm/shadertext3.cpp |
diff --git a/gm/shadertext3.cpp b/gm/shadertext3.cpp |
index 0d1c03e345a20846d3f77cf1d6b9e382bcf02547..07ecd7184b7305b117ed7667a799cf60370fd79a 100644 |
--- a/gm/shadertext3.cpp |
+++ b/gm/shadertext3.cpp |
@@ -26,11 +26,11 @@ |
SkPaint paint; |
- paint.setShader(SkGradientShader::MakeLinear(kPts0, kColors0, kPos, |
- SK_ARRAY_COUNT(kColors0), SkShader::kClamp_TileMode)); |
+ paint.setShader(SkGradientShader::CreateLinear(kPts0, kColors0, kPos, |
+ SK_ARRAY_COUNT(kColors0), SkShader::kClamp_TileMode))->unref(); |
canvas.drawPaint(paint); |
- paint.setShader(SkGradientShader::MakeLinear(kPts1, kColors1, kPos, |
- SK_ARRAY_COUNT(kColors1), SkShader::kClamp_TileMode)); |
+ paint.setShader(SkGradientShader::CreateLinear(kPts1, kColors1, kPos, |
+ SK_ARRAY_COUNT(kColors1), SkShader::kClamp_TileMode))->unref(); |
canvas.drawPaint(paint); |
} |
@@ -100,13 +100,17 @@ |
localM.postRotate(20); |
localM.postScale(1.15f, .85f); |
+ SkAutoTUnref<SkShader> shader(SkShader::CreateBitmapShader(fBmp, |
+ kTileModes[tm0], |
+ kTileModes[tm1], |
+ &localM)); |
+ |
SkPaint fillPaint; |
fillPaint.setAntiAlias(true); |
sk_tool_utils::set_portable_typeface(&fillPaint); |
fillPaint.setTextSize(SkIntToScalar(kPointSize)); |
fillPaint.setFilterQuality(kLow_SkFilterQuality); |
- fillPaint.setShader(SkShader::MakeBitmapShader(fBmp, kTileModes[tm0], |
- kTileModes[tm1], &localM)); |
+ fillPaint.setShader(shader); |
canvas->drawText(kText, kTextLen, 0, 0, fillPaint); |
canvas->drawText(kText, kTextLen, 0, 0, outlinePaint); |