Index: gm/pictureimagegenerator.cpp |
diff --git a/gm/pictureimagegenerator.cpp b/gm/pictureimagegenerator.cpp |
index 2d50f3a6bedde651d0a90c2bcf9930314512cf19..829006d80876e86759b020b1f90af659a1522edc 100644 |
--- a/gm/pictureimagegenerator.cpp |
+++ b/gm/pictureimagegenerator.cpp |
@@ -68,8 +68,10 @@ |
const SkScalar pos1[] = { 0, 0.75f }; |
const SkColor colors1[] = { SK_ColorTRANSPARENT, SK_ColorBLACK }; |
SkASSERT(SK_ARRAY_COUNT(pos1) == SK_ARRAY_COUNT(colors1)); |
- paint.setShader(SkGradientShader::MakeLinear(pts1, colors1, pos1, SK_ARRAY_COUNT(pos1), |
- SkShader::kClamp_TileMode)); |
+ SkAutoTUnref<SkShader> gradient1(SkGradientShader::CreateLinear(pts1, colors1, pos1, |
+ SK_ARRAY_COUNT(pos1), |
+ SkShader::kClamp_TileMode)); |
+ paint.setShader(gradient1.get()); |
canvas->drawRect(underlineRect, paint); |
const SkPoint pts2[] = { SkPoint::Make(iBox.x() - iBox.width() * kGradientPad, 0), |
@@ -86,8 +88,10 @@ |
SK_ColorBLACK |
}; |
SkASSERT(SK_ARRAY_COUNT(pos2) == SK_ARRAY_COUNT(colors2)); |
- paint.setShader(SkGradientShader::MakeLinear(pts2, colors2, pos2, SK_ARRAY_COUNT(pos2), |
- SkShader::kClamp_TileMode)); |
+ SkAutoTUnref<SkShader> gradient2(SkGradientShader::CreateLinear(pts2, colors2, pos2, |
+ SK_ARRAY_COUNT(pos2), |
+ SkShader::kClamp_TileMode)); |
+ paint.setShader(gradient2.get()); |
canvas->drawText(kSkiaStr, textLen, 0, 0, paint); |
} |