Index: samplecode/SampleTiling.cpp |
diff --git a/samplecode/SampleTiling.cpp b/samplecode/SampleTiling.cpp |
index 735b9907ef4e784776955cb59fef322189937192..7bacb8b81eb9b5c436b4cc090c6bf979fa293c01 100644 |
--- a/samplecode/SampleTiling.cpp |
+++ b/samplecode/SampleTiling.cpp |
@@ -62,23 +62,19 @@ static const int gWidth = 32; |
static const int gHeight = 32; |
class TilingView : public SampleView { |
- SkPicture* fTextPicture; |
- SkBlurDrawLooper fLooper; |
+ SkAutoTUnref<SkPicture> fTextPicture; |
+ SkAutoTUnref<SkBlurDrawLooper> fLooper; |
public: |
TilingView() |
- : fLooper(0x88000000, |
- SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(1)), |
- SkIntToScalar(2), SkIntToScalar(2)) { |
- fTextPicture = new SkPicture(); |
+ : fTextPicture(new SkPicture) |
+ , fLooper(SkBlurDrawLooper::Create(0x88000000, |
+ SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(1)), |
+ SkIntToScalar(2), SkIntToScalar(2))) { |
for (size_t i = 0; i < SK_ARRAY_COUNT(gColorTypes); i++) { |
makebm(&fTexture[i], gColorTypes[i], gWidth, gHeight); |
} |
} |
- ~TilingView() { |
- fTextPicture->unref(); |
- } |
- |
SkBitmap fTexture[SK_ARRAY_COUNT(gColorTypes)]; |
protected: |
@@ -117,7 +113,7 @@ protected: |
SkString str; |
p.setAntiAlias(true); |
p.setDither(true); |
- p.setLooper(&fLooper); |
+ p.setLooper(fLooper); |
str.printf("[%s,%s]", gModeNames[kx], gModeNames[ky]); |
p.setTextAlign(SkPaint::kCenter_Align); |
@@ -151,7 +147,7 @@ protected: |
SkPaint p; |
SkString str; |
p.setAntiAlias(true); |
- p.setLooper(&fLooper); |
+ p.setLooper(fLooper); |
str.printf("%s, %s", gConfigNames[i], gFilterNames[j]); |
textCanvas->drawText(str.c_str(), str.size(), x, y + r.height() * 2 / 3, p); |
} |