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

Unified Diff: bench/ImageFilterDAGBench.cpp

Issue 1852743002: Update SkBlurImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT & address code review comments Created 4 years, 9 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/BlurImageFilterBench.cpp ('k') | gm/coloremoji.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/ImageFilterDAGBench.cpp
diff --git a/bench/ImageFilterDAGBench.cpp b/bench/ImageFilterDAGBench.cpp
index 5fdf95b06d37ee1e387a4b084f7c65b86743cac7..308b3b003785b79b6ccaa0a0d2057c8f8a92ae43 100644
--- a/bench/ImageFilterDAGBench.cpp
+++ b/bench/ImageFilterDAGBench.cpp
@@ -28,7 +28,7 @@ protected:
const SkRect rect = SkRect::Make(SkIRect::MakeWH(400, 400));
for (int j = 0; j < loops; j++) {
- sk_sp<SkImageFilter> blur(SkBlurImageFilter::Create(20.0f, 20.0f));
+ sk_sp<SkImageFilter> blur(SkBlurImageFilter::Make(20.0f, 20.0f, nullptr));
sk_sp<SkImageFilter> inputs[kNumInputs];
for (int i = 0; i < kNumInputs; ++i) {
inputs[i] = blur;
@@ -58,14 +58,14 @@ protected:
void onDraw(int loops, SkCanvas* canvas) override {
for (int j = 0; j < loops; j++) {
- SkAutoTUnref<SkImageFilter> blur(SkBlurImageFilter::Create(4.0f, 4.0f));
- SkDisplacementMapEffect::ChannelSelectorType xSelector = SkDisplacementMapEffect::kR_ChannelSelectorType;
- SkDisplacementMapEffect::ChannelSelectorType ySelector = SkDisplacementMapEffect::kB_ChannelSelectorType;
+ sk_sp<SkImageFilter> blur(SkBlurImageFilter::Make(4.0f, 4.0f, nullptr));
+ auto xSelector = SkDisplacementMapEffect::kR_ChannelSelectorType;
+ auto ySelector = SkDisplacementMapEffect::kB_ChannelSelectorType;
SkScalar scale = 2;
- SkAutoTUnref<SkImageFilter> displ(SkDisplacementMapEffect::Create(xSelector, ySelector, scale,
- blur.get(), blur.get()));
+ sk_sp<SkImageFilter> displ(SkDisplacementMapEffect::Create(xSelector, ySelector, scale,
+ blur.get(), blur.get()));
SkPaint paint;
- paint.setImageFilter(displ);
+ paint.setImageFilter(std::move(displ));
SkRect rect = SkRect::Make(SkIRect::MakeWH(400, 400));
canvas->drawRect(rect, paint);
}
« no previous file with comments | « bench/BlurImageFilterBench.cpp ('k') | gm/coloremoji.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698