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

Unified Diff: bench/MorphologyBench.cpp

Issue 1860573002: Update SkMorphology ImageFilters to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT Created 4 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 | gm/imagefilters.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/MorphologyBench.cpp
diff --git a/bench/MorphologyBench.cpp b/bench/MorphologyBench.cpp
index fd60ebed466b5f7bdb805d7784f196024bf5305b..5edae6e299525e4078b3a41087b1bb2f55f8ba17 100644
--- a/bench/MorphologyBench.cpp
+++ b/bench/MorphologyBench.cpp
@@ -46,11 +46,11 @@ public:
}
protected:
- virtual const char* onGetName() {
+ const char* onGetName() override {
return fName.c_str();
}
- virtual void onDraw(int loops, SkCanvas* canvas) {
+ void onDraw(int loops, SkCanvas* canvas) override {
SkPaint paint;
this->setupPaint(&paint);
@@ -63,18 +63,20 @@ protected:
r.offset(fRadius, fRadius);
if (fRadius > 0) {
- SkImageFilter* mf = nullptr;
+ sk_sp<SkImageFilter> mf;
switch (fStyle) {
case kDilate_MT:
- mf = SkDilateImageFilter::Create(SkScalarFloorToInt(fRadius),
- SkScalarFloorToInt(fRadius));
+ mf = SkDilateImageFilter::Make(SkScalarFloorToInt(fRadius),
+ SkScalarFloorToInt(fRadius),
+ nullptr);
break;
case kErode_MT:
- mf = SkErodeImageFilter::Create(SkScalarFloorToInt(fRadius),
- SkScalarFloorToInt(fRadius));
+ mf = SkErodeImageFilter::Make(SkScalarFloorToInt(fRadius),
+ SkScalarFloorToInt(fRadius),
+ nullptr);
break;
}
- paint.setImageFilter(mf)->unref();
+ paint.setImageFilter(std::move(mf));
}
canvas->drawOval(r, paint);
}
« no previous file with comments | « no previous file | gm/imagefilters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698