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)); |
} |
}; |