aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Fredrik Söderquist <fs@opera.com>2017-01-04 13:31:47 +0100
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-04 13:47:24 +0000
commitb60e8645ecddb1846cdba52073db394a633841ff (patch)
treeab6e70cd42f454ce81deff6de3be60b1596fe734 /tests
parent67116384368195913ec014972b4fc38de2087fb8 (diff)
Scale the result of TightBounds when path was inverse-scaled
When the path was "large" (as defined by ScaleFactor(...)), the computed bounds would not be adjusted to the correct space. Make sure to scale the result in those cases. BUG=chromium:678162 Change-Id: Ia2eb94050c4620286e9abb69976dbc0202ecc307 Reviewed-on: https://skia-review.googlesource.com/6501 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/PathOpsTightBoundsTest.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/PathOpsTightBoundsTest.cpp b/tests/PathOpsTightBoundsTest.cpp
index 8fd0fdb453..a2e7bcae9b 100644
--- a/tests/PathOpsTightBoundsTest.cpp
+++ b/tests/PathOpsTightBoundsTest.cpp
@@ -188,3 +188,14 @@ DEF_TEST(PathOpsTightBoundsIllBehaved, reporter) {
REPORTER_ASSERT(reporter, bounds != tight);
}
+DEF_TEST(PathOpsTightBoundsIllBehavedScaled, reporter) {
+ SkPath path;
+ path.moveTo(0, 0);
+ path.quadTo(1048578, 1048577, 1048576, 1048576);
+ const SkRect& bounds = path.getBounds();
+ SkRect tight;
+ REPORTER_ASSERT(reporter, TightBounds(path, &tight));
+ REPORTER_ASSERT(reporter, bounds != tight);
+ REPORTER_ASSERT(reporter, tight.right() == 1048576);
+ REPORTER_ASSERT(reporter, tight.bottom() == 1048576);
+}