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

Unified Diff: gm/displacement.cpp

Issue 1616663003: Fix bounds computations for SkDisplacementMapEffect with negative scale. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix onComputeFastBounds() as well Created 4 years, 11 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 | 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 bebc2761617b071efa7ebbedb7e00fa981c16bcb..c5f1837c91133bede3fcf4f01ba98cca24253173 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(
« no previous file with comments | « no previous file | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698