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

Unified Diff: gm/displacement.cpp

Issue 104853005: Accept displacement with no displacement input (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT Created 7 years 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 | « expectations/gm/ignored-tests.txt ('k') | src/effects/SkDisplacementMapEffect.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 5a20f8187be4a7a57beb761483e36599e0d4a776..cc664012da6e3612baec272d123d33259bb8bc39 100644
--- a/gm/displacement.cpp
+++ b/gm/displacement.cpp
@@ -183,6 +183,7 @@ protected:
40.0f, displ, NULL, &cropRect)))->unref();
drawClippedBitmap(canvas, 400, 300, paint);
+ // Tests for images of different sizes
displ.reset(SkNEW_ARGS(SkBitmapSource, (fSmall)));
paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect,
(SkDisplacementMapEffect::kR_ChannelSelectorType,
@@ -207,6 +208,15 @@ protected:
SkDisplacementMapEffect::kA_ChannelSelectorType,
40.0f, displ)))->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(SkNEW_ARGS(SkDisplacementMapEffect,
+ (SkDisplacementMapEffect::kG_ChannelSelectorType,
+ SkDisplacementMapEffect::kA_ChannelSelectorType,
+ 40.0f, NULL)))->unref();
+ drawClippedBitmap(canvas, 400, 400, paint);
}
private:
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698