aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar senorblanco <senorblanco@chromium.org>2016-01-21 09:55:47 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-21 09:55:47 -0800
commit00502373c8d38b091fe1b9ba15b8510bcc0375bc (patch)
tree6ea7daea6d98946db72c36ee8e946573b7729600 /gm
parentba6ada74e8658571c451f375b3e7736da83ea578 (diff)
Fix bounds computations for SkDisplacementMapEffect with negative scale.
Diffstat (limited to 'gm')
-rw-r--r--gm/displacement.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/gm/displacement.cpp b/gm/displacement.cpp
index bebc276161..c5f1837c91 100644
--- a/gm/displacement.cpp
+++ b/gm/displacement.cpp
@@ -43,7 +43,7 @@ protected:
}
SkISize onISize() override {
- return SkISize::Make(500, 500);
+ return SkISize::Make(600, 500);
}
void drawClippedBitmap(SkCanvas* canvas, int x, int y, const SkPaint& paint) const {
@@ -153,6 +153,13 @@ protected:
40.0f, displ, nullptr, &cropRect))->unref();
drawClippedBitmap(canvas, 400, 300, paint);
+ // Test for negative scale.
+ paint.setImageFilter(SkDisplacementMapEffect::Create(
+ SkDisplacementMapEffect::kG_ChannelSelectorType,
+ SkDisplacementMapEffect::kA_ChannelSelectorType,
+ -40.0f, displ))->unref();
+ this->drawClippedBitmap(canvas, 500, 0, paint);
+
// Tests for images of different sizes
displ.reset(SkImageSource::Create(fSmall));
paint.setImageFilter(SkDisplacementMapEffect::Create(