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

Unified Diff: bench/DisplacementBench.cpp

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