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

Unified Diff: bench/ImageFilterCollapse.cpp

Issue 1858813002: Update SkColorFilterImageFilter 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 | « bench/ColorFilterBench.cpp ('k') | gm/coloremoji.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/ImageFilterCollapse.cpp
diff --git a/bench/ImageFilterCollapse.cpp b/bench/ImageFilterCollapse.cpp
index cafcd38c6e94cbf0054ea26fa5d6cd16f077e913..d85d1de330b74a3a0c806a6a08eeec323a975068 100644
--- a/bench/ImageFilterCollapse.cpp
+++ b/bench/ImageFilterCollapse.cpp
@@ -22,20 +22,15 @@
class BaseImageFilterCollapseBench : public Benchmark {
public:
- BaseImageFilterCollapseBench(): fImageFilter(nullptr) {}
- ~BaseImageFilterCollapseBench() {
- SkSafeUnref(fImageFilter);
- }
+ BaseImageFilterCollapseBench() {}
protected:
void doPreDraw(sk_sp<SkColorFilter> colorFilters[], int nFilters) {
+ SkASSERT(!fImageFilter);
+
// Create a chain of ImageFilters from colorFilters
- fImageFilter = nullptr;
for(int i = nFilters; i --> 0;) {
- SkAutoTUnref<SkImageFilter> filter(
- SkColorFilterImageFilter::Create(colorFilters[i].get(), fImageFilter, nullptr)
- );
- SkRefCnt_SafeAssign(fImageFilter, filter.get());
+ fImageFilter = SkColorFilterImageFilter::Make(colorFilters[i], fImageFilter);
}
}
@@ -50,7 +45,7 @@ protected:
}
private:
- SkImageFilter* fImageFilter;
+ sk_sp<SkImageFilter> fImageFilter;
SkBitmap fBitmap;
void makeBitmap() {
@@ -95,7 +90,7 @@ protected:
SkTableColorFilter::Make(table3),
};
- doPreDraw(colorFilters, SK_ARRAY_COUNT(colorFilters));
+ this->doPreDraw(colorFilters, SK_ARRAY_COUNT(colorFilters));
}
private:
@@ -134,7 +129,7 @@ protected:
make_brightness(-0.1f),
};
- doPreDraw(colorFilters, SK_ARRAY_COUNT(colorFilters));
+ this->doPreDraw(colorFilters, SK_ARRAY_COUNT(colorFilters));
}
};
« no previous file with comments | « bench/ColorFilterBench.cpp ('k') | gm/coloremoji.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698