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

Unified Diff: bench/RectoriBench.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 | « bench/BlurRoundRectBench.cpp ('k') | gm/blurroundrect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/RectoriBench.cpp
diff --git a/bench/RectoriBench.cpp b/bench/RectoriBench.cpp
index ee79ca9964500135b187d8a11e9bbc3d0809ce8c..87f5feef8924dea08bb685cc1d353563ecf7878f 100644
--- a/bench/RectoriBench.cpp
+++ b/bench/RectoriBench.cpp
@@ -71,7 +71,7 @@ private:
};
SkLayerDrawLooper* createLooper(SkScalar xOff, SkScalar sigma) {
- SkLayerDrawLooper* looper = new SkLayerDrawLooper;
+ SkLayerDrawLooper::Builder looperBuilder;
//-----------------------------------------------
SkLayerDrawLooper::LayerInfo info;
@@ -83,7 +83,7 @@ private:
info.fOffset.set(xOff, 0);
info.fPostTranslate = false;
- SkPaint* paint = looper->addLayer(info);
+ SkPaint* paint = looperBuilder.addLayer(info);
SkMaskFilter* mf = SkBlurMaskFilter::Create(SkBlurMaskFilter::kNormal_BlurStyle,
sigma,
@@ -94,8 +94,8 @@ private:
info.fPaintBits = 0;
info.fOffset.set(0, 0);
- paint = looper->addLayer(info);
- return looper;
+ paint = looperBuilder.addLayer(info);
+ return looperBuilder.detachLooper();
}
typedef SkBenchmark INHERITED;
« no previous file with comments | « bench/BlurRoundRectBench.cpp ('k') | gm/blurroundrect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698