Index: gm/drawlooper.cpp |
diff --git a/gm/drawlooper.cpp b/gm/drawlooper.cpp |
index 678d2ad35f2a8a226053af1d709b0a87829d893b..d3a44754426ebf1d097b372df317baf213e350d8 100644 |
--- a/gm/drawlooper.cpp |
+++ b/gm/drawlooper.cpp |
@@ -72,7 +72,7 @@ private: |
{ 0x88000000, SkPaint::kFill_Style, 0, SkIntToScalar(10), SkIntToScalar(3) } |
}; |
- fLooper = new SkLayerDrawLooper; |
+ SkLayerDrawLooper::Builder looperBuilder; |
SkLayerDrawLooper::LayerInfo info; |
info.fPaintBits = SkLayerDrawLooper::kStyle_Bit | SkLayerDrawLooper::kMaskFilter_Bit; |
@@ -80,7 +80,7 @@ private: |
for (size_t i = 0; i < SK_ARRAY_COUNT(gParams); i++) { |
info.fOffset.set(gParams[i].fOffset, gParams[i].fOffset); |
- SkPaint* paint = fLooper->addLayer(info); |
+ SkPaint* paint = looperBuilder.addLayer(info); |
paint->setColor(gParams[i].fColor); |
paint->setStyle(gParams[i].fStyle); |
paint->setStrokeWidth(gParams[i].fWidth); |
@@ -90,6 +90,7 @@ private: |
paint->setMaskFilter(mf)->unref(); |
} |
} |
+ fLooper = looperBuilder.detachLooper(); |
} |
typedef GM INHERITED; |