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

Unified Diff: gm/displacement.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 | « fuzz/FilterFuzz.cpp ('k') | gm/imagefiltersclipped.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/displacement.cpp
diff --git a/gm/displacement.cpp b/gm/displacement.cpp
index 9fea0188df3da7ecc770396391ecad177311429c..9b62a60ab3ee86f957b6da8ae68d7b1ef2672048 100644
--- a/gm/displacement.cpp
+++ b/gm/displacement.cpp
@@ -58,142 +58,142 @@
canvas->clear(SK_ColorBLACK);
SkPaint paint;
sk_sp<SkImageFilter> displ(SkImageSource::Make(fCheckerboard));
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kG_ChannelSelectorType, 0.0f, displ, nullptr));
- this->drawClippedBitmap(canvas, 0, 0, paint);
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kB_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType, 16.0f, displ, nullptr));
- this->drawClippedBitmap(canvas, 100, 0, paint);
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kB_ChannelSelectorType, 32.0f, displ, nullptr));
- this->drawClippedBitmap(canvas, 200, 0, paint);
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kG_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType, 48.0f, displ, nullptr));
- this->drawClippedBitmap(canvas, 300, 0, paint);
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType, 64.0f, displ, nullptr));
- this->drawClippedBitmap(canvas, 400, 0, paint);
-
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kG_ChannelSelectorType, 40.0f, displ, nullptr));
- this->drawClippedBitmap(canvas, 0, 100, paint);
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kB_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType, 40.0f, displ, nullptr));
- this->drawClippedBitmap(canvas, 100, 100, paint);
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kB_ChannelSelectorType, 40.0f, displ, nullptr));
- this->drawClippedBitmap(canvas, 200, 100, paint);
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kG_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType, 40.0f, displ, nullptr));
- this->drawClippedBitmap(canvas, 300, 100, paint);
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType, 40.0f, displ, nullptr));
- this->drawClippedBitmap(canvas, 400, 100, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kR_ChannelSelectorType,
+ SkDisplacementMapEffect::kG_ChannelSelectorType, 0.0f, displ.get()))->unref();
+ drawClippedBitmap(canvas, 0, 0, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kB_ChannelSelectorType,
+ SkDisplacementMapEffect::kA_ChannelSelectorType, 16.0f, displ.get()))->unref();
+ drawClippedBitmap(canvas, 100, 0, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kR_ChannelSelectorType,
+ SkDisplacementMapEffect::kB_ChannelSelectorType, 32.0f, displ.get()))->unref();
+ drawClippedBitmap(canvas, 200, 0, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kG_ChannelSelectorType,
+ SkDisplacementMapEffect::kA_ChannelSelectorType, 48.0f, displ.get()))->unref();
+ drawClippedBitmap(canvas, 300, 0, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kR_ChannelSelectorType,
+ SkDisplacementMapEffect::kA_ChannelSelectorType, 64.0f, displ.get()))->unref();
+ drawClippedBitmap(canvas, 400, 0, paint);
+
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kR_ChannelSelectorType,
+ SkDisplacementMapEffect::kG_ChannelSelectorType, 40.0f, displ.get()))->unref();
+ drawClippedBitmap(canvas, 0, 100, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kB_ChannelSelectorType,
+ SkDisplacementMapEffect::kA_ChannelSelectorType, 40.0f, displ.get()))->unref();
+ drawClippedBitmap(canvas, 100, 100, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kR_ChannelSelectorType,
+ SkDisplacementMapEffect::kB_ChannelSelectorType, 40.0f, displ.get()))->unref();
+ drawClippedBitmap(canvas, 200, 100, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kG_ChannelSelectorType,
+ SkDisplacementMapEffect::kA_ChannelSelectorType, 40.0f, displ.get()))->unref();
+ drawClippedBitmap(canvas, 300, 100, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kR_ChannelSelectorType,
+ SkDisplacementMapEffect::kA_ChannelSelectorType, 40.0f, displ.get()))->unref();
+ drawClippedBitmap(canvas, 400, 100, paint);
SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(30, 30, 40, 40));
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kG_ChannelSelectorType,
- 0.0f, displ, nullptr, &cropRect));
- this->drawClippedBitmap(canvas, 0, 200, paint);
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kB_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType,
- 16.0f, displ, nullptr, &cropRect));
- this->drawClippedBitmap(canvas, 100, 200, paint);
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kB_ChannelSelectorType,
- 32.0f, displ, nullptr, &cropRect));
- this->drawClippedBitmap(canvas, 200, 200, paint);
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kG_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType,
- 48.0f, displ, nullptr, &cropRect));
- this->drawClippedBitmap(canvas, 300, 200, paint);
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType,
- 64.0f, displ, nullptr, &cropRect));
- this->drawClippedBitmap(canvas, 400, 200, paint);
-
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kG_ChannelSelectorType,
- 40.0f, displ, nullptr, &cropRect));
- this->drawClippedBitmap(canvas, 0, 300, paint);
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kB_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType,
- 40.0f, displ, nullptr, &cropRect));
- this->drawClippedBitmap(canvas, 100, 300, paint);
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kB_ChannelSelectorType,
- 40.0f, displ, nullptr, &cropRect));
- this->drawClippedBitmap(canvas, 200, 300, paint);
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kG_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType,
- 40.0f, displ, nullptr, &cropRect));
- this->drawClippedBitmap(canvas, 300, 300, paint);
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType,
- 40.0f, displ, nullptr, &cropRect));
- this->drawClippedBitmap(canvas, 400, 300, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kR_ChannelSelectorType,
+ SkDisplacementMapEffect::kG_ChannelSelectorType,
+ 0.0f, displ.get(), nullptr, &cropRect))->unref();
+ drawClippedBitmap(canvas, 0, 200, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kB_ChannelSelectorType,
+ SkDisplacementMapEffect::kA_ChannelSelectorType,
+ 16.0f, displ.get(), nullptr, &cropRect))->unref();
+ drawClippedBitmap(canvas, 100, 200, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kR_ChannelSelectorType,
+ SkDisplacementMapEffect::kB_ChannelSelectorType,
+ 32.0f, displ.get(), nullptr, &cropRect))->unref();
+ drawClippedBitmap(canvas, 200, 200, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kG_ChannelSelectorType,
+ SkDisplacementMapEffect::kA_ChannelSelectorType,
+ 48.0f, displ.get(), nullptr, &cropRect))->unref();
+ drawClippedBitmap(canvas, 300, 200, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kR_ChannelSelectorType,
+ SkDisplacementMapEffect::kA_ChannelSelectorType,
+ 64.0f, displ.get(), nullptr, &cropRect))->unref();
+ drawClippedBitmap(canvas, 400, 200, paint);
+
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kR_ChannelSelectorType,
+ SkDisplacementMapEffect::kG_ChannelSelectorType,
+ 40.0f, displ.get(), nullptr, &cropRect))->unref();
+ drawClippedBitmap(canvas, 0, 300, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kB_ChannelSelectorType,
+ SkDisplacementMapEffect::kA_ChannelSelectorType,
+ 40.0f, displ.get(), nullptr, &cropRect))->unref();
+ drawClippedBitmap(canvas, 100, 300, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kR_ChannelSelectorType,
+ SkDisplacementMapEffect::kB_ChannelSelectorType,
+ 40.0f, displ.get(), nullptr, &cropRect))->unref();
+ drawClippedBitmap(canvas, 200, 300, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kG_ChannelSelectorType,
+ SkDisplacementMapEffect::kA_ChannelSelectorType,
+ 40.0f, displ.get(), nullptr, &cropRect))->unref();
+ drawClippedBitmap(canvas, 300, 300, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kR_ChannelSelectorType,
+ SkDisplacementMapEffect::kA_ChannelSelectorType,
+ 40.0f, displ.get(), nullptr, &cropRect))->unref();
+ drawClippedBitmap(canvas, 400, 300, paint);
// Test for negative scale.
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kG_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType,
- -40.0f, displ, nullptr));
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kG_ChannelSelectorType,
+ SkDisplacementMapEffect::kA_ChannelSelectorType,
+ -40.0f, displ.get()))->unref();
this->drawClippedBitmap(canvas, 500, 0, paint);
// Tests for images of different sizes
displ = SkImageSource::Make(fSmall);
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kG_ChannelSelectorType,
- 40.0f, std::move(displ), nullptr));
- this->drawClippedBitmap(canvas, 0, 400, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kR_ChannelSelectorType,
+ SkDisplacementMapEffect::kG_ChannelSelectorType,
+ 40.0f, displ.get()))->unref();
+ drawClippedBitmap(canvas, 0, 400, paint);
displ = SkImageSource::Make(fLarge);
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kB_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType,
- 40.0f, std::move(displ), nullptr));
- this->drawClippedBitmap(canvas, 100, 400, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kB_ChannelSelectorType,
+ SkDisplacementMapEffect::kA_ChannelSelectorType,
+ 40.0f, displ.get()))->unref();
+ drawClippedBitmap(canvas, 100, 400, paint);
displ = SkImageSource::Make(fLargeW);
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kR_ChannelSelectorType,
- SkDisplacementMapEffect::kB_ChannelSelectorType,
- 40.0f, std::move(displ), nullptr));
- this->drawClippedBitmap(canvas, 200, 400, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kR_ChannelSelectorType,
+ SkDisplacementMapEffect::kB_ChannelSelectorType,
+ 40.0f, displ.get()))->unref();
+ drawClippedBitmap(canvas, 200, 400, paint);
displ = SkImageSource::Make(fLargeH);
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kG_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType,
- 40.0f, std::move(displ), nullptr));
- this->drawClippedBitmap(canvas, 300, 400, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kG_ChannelSelectorType,
+ SkDisplacementMapEffect::kA_ChannelSelectorType,
+ 40.0f, displ.get()))->unref();
+ drawClippedBitmap(canvas, 300, 400, paint);
// Test for no given displacement input. In this case, both displacement
// and color should use the same bitmap, given to SkCanvas::drawBitmap()
// as an input argument.
- paint.setImageFilter(SkDisplacementMapEffect::Make(
- SkDisplacementMapEffect::kG_ChannelSelectorType,
- SkDisplacementMapEffect::kA_ChannelSelectorType,
- 40.0f, nullptr, nullptr));
- this->drawClippedBitmap(canvas, 400, 400, paint);
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kG_ChannelSelectorType,
+ SkDisplacementMapEffect::kA_ChannelSelectorType,
+ 40.0f, nullptr))->unref();
+ drawClippedBitmap(canvas, 400, 400, paint);
}
private:
« no previous file with comments | « fuzz/FilterFuzz.cpp ('k') | gm/imagefiltersclipped.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698