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

Unified Diff: bench/DisplacementBench.cpp

Issue 1877783003: Update DisplacementMapEffect to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix bug 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 | bench/ImageFilterDAGBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | bench/ImageFilterDAGBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698