Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Unified Diff: gm/drawlooper.cpp

Issue 232913003: Make sure SkDrawLooper objects can only be allocated on the heap. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/circles.cpp ('k') | gm/megalooper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « gm/circles.cpp ('k') | gm/megalooper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698