diff options
author | senorblanco <senorblanco@chromium.org> | 2016-01-21 09:55:47 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-21 09:55:47 -0800 |
commit | 00502373c8d38b091fe1b9ba15b8510bcc0375bc (patch) | |
tree | 6ea7daea6d98946db72c36ee8e946573b7729600 /gm | |
parent | ba6ada74e8658571c451f375b3e7736da83ea578 (diff) |
Fix bounds computations for SkDisplacementMapEffect with negative scale.
BUG=skia:4835
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1616663003
Review URL: https://codereview.chromium.org/1616663003
Diffstat (limited to 'gm')
-rw-r--r-- | gm/displacement.cpp | 9 |
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( |