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

Unified Diff: bench/BlurRoundRectBench.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 | « no previous file | bench/RectoriBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/BlurRoundRectBench.cpp
diff --git a/bench/BlurRoundRectBench.cpp b/bench/BlurRoundRectBench.cpp
index 29c00805940262af617a4ce8d1e7fc2248cdb960..a3d0ba9fd9291d26d6a271ffdc397c1a417c2b55 100644
--- a/bench/BlurRoundRectBench.cpp
+++ b/bench/BlurRoundRectBench.cpp
@@ -40,7 +40,7 @@ public:
}
virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE {
- SkLayerDrawLooper* looper = new SkLayerDrawLooper;
+ SkLayerDrawLooper::Builder looperBuilder;
{
SkLayerDrawLooper::LayerInfo info;
info.fPaintBits = SkLayerDrawLooper::kMaskFilter_Bit
@@ -48,7 +48,7 @@ public:
info.fColorMode = SkXfermode::kSrc_Mode;
info.fOffset = SkPoint::Make(SkIntToScalar(-1), SkIntToScalar(0));
info.fPostTranslate = false;
- SkPaint* paint = looper->addLayerOnTop(info);
+ SkPaint* paint = looperBuilder.addLayerOnTop(info);
SkMaskFilter* maskFilter = SkBlurMaskFilter::Create(
SkBlurMaskFilter::kNormal_BlurStyle,
SkBlurMask::ConvertRadiusToSigma(SK_ScalarHalf),
@@ -61,13 +61,13 @@ public:
}
{
SkLayerDrawLooper::LayerInfo info;
- looper->addLayerOnTop(info);
+ looperBuilder.addLayerOnTop(info);
}
SkPaint dullPaint;
dullPaint.setAntiAlias(true);
SkPaint loopedPaint;
- loopedPaint.setLooper(looper)->unref();
+ loopedPaint.setLooper(looperBuilder.detachLooper())->unref();
loopedPaint.setAntiAlias(true);
loopedPaint.setColor(SK_ColorCYAN);
« no previous file with comments | « no previous file | bench/RectoriBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698