Index: bench/DisplacementBench.cpp |
diff --git a/bench/DisplacementBench.cpp b/bench/DisplacementBench.cpp |
index 82857e630f962e264d79f4b6bc8a1d794f9faaaa..9edf21476ccfe4bf905d3cae47d67afa1c0238f1 100644 |
--- a/bench/DisplacementBench.cpp |
+++ b/bench/DisplacementBench.cpp |
@@ -18,9 +18,7 @@ |
class DisplacementBaseBench : public Benchmark { |
public: |
- DisplacementBaseBench(bool small) : |
- fInitialized(false), fIsSmall(small) { |
- } |
+ DisplacementBaseBench(bool small) : fInitialized(false), fIsSmall(small) { } |
protected: |
void onDelayedSetup() override { |
@@ -92,8 +90,7 @@ private: |
class DisplacementZeroBench : public DisplacementBaseBench { |
public: |
- DisplacementZeroBench(bool small) : INHERITED(small) { |
- } |
+ DisplacementZeroBench(bool small) : INHERITED(small) { } |
protected: |
const char* onGetName() override { |
@@ -104,9 +101,10 @@ protected: |
SkPaint paint; |
sk_sp<SkImageFilter> displ(SkImageSource::Make(fCheckerboard)); |
// No displacement effect |
- paint.setImageFilter(SkDisplacementMapEffect::Create( |
- SkDisplacementMapEffect::kR_ChannelSelectorType, |
- SkDisplacementMapEffect::kG_ChannelSelectorType, 0.0f, displ.get()))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Make( |
+ SkDisplacementMapEffect::kR_ChannelSelectorType, |
+ SkDisplacementMapEffect::kG_ChannelSelectorType, |
+ 0.0f, std::move(displ), nullptr)); |
for (int i = 0; i < loops; i++) { |
this->drawClippedBitmap(canvas, 0, 0, paint); |
@@ -119,8 +117,7 @@ private: |
class DisplacementAlphaBench : public DisplacementBaseBench { |
public: |
- DisplacementAlphaBench(bool small) : INHERITED(small) { |
- } |
+ DisplacementAlphaBench(bool small) : INHERITED(small) { } |
protected: |
const char* onGetName() override { |
@@ -131,11 +128,12 @@ protected: |
SkPaint paint; |
sk_sp<SkImageFilter> displ(SkImageSource::Make(fCheckerboard)); |
// Displacement, with 1 alpha component (which isn't pre-multiplied) |
- paint.setImageFilter(SkDisplacementMapEffect::Create( |
- SkDisplacementMapEffect::kB_ChannelSelectorType, |
- SkDisplacementMapEffect::kA_ChannelSelectorType, 16.0f, displ.get()))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Make( |
+ SkDisplacementMapEffect::kB_ChannelSelectorType, |
+ SkDisplacementMapEffect::kA_ChannelSelectorType, |
+ 16.0f, std::move(displ), nullptr)); |
for (int i = 0; i < loops; i++) { |
- drawClippedBitmap(canvas, 100, 0, paint); |
+ this->drawClippedBitmap(canvas, 100, 0, paint); |
} |
} |
@@ -145,8 +143,7 @@ private: |
class DisplacementFullBench : public DisplacementBaseBench { |
public: |
- DisplacementFullBench(bool small) : INHERITED(small) { |
- } |
+ DisplacementFullBench(bool small) : INHERITED(small) { } |
protected: |
const char* onGetName() override { |
@@ -157,9 +154,10 @@ protected: |
SkPaint paint; |
sk_sp<SkImageFilter> displ(SkImageSource::Make(fCheckerboard)); |
// Displacement, with 2 non-alpha components |
- paint.setImageFilter(SkDisplacementMapEffect::Create( |
- SkDisplacementMapEffect::kR_ChannelSelectorType, |
- SkDisplacementMapEffect::kB_ChannelSelectorType, 32.0f, displ.get()))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Make( |
+ SkDisplacementMapEffect::kR_ChannelSelectorType, |
+ SkDisplacementMapEffect::kB_ChannelSelectorType, |
+ 32.0f, std::move(displ), nullptr)); |
for (int i = 0; i < loops; ++i) { |
this->drawClippedBitmap(canvas, 200, 0, paint); |
} |