aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2017-04-18 12:08:58 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-18 16:40:48 +0000
commit73e597d0eddeaaa466101d5bb7da537c0066166a (patch)
tree4d6196ac7f074c96ccaee75beaffa196d27fe1fe /tests
parent4304d11ada22ebfb6b64d87247ad24cde89c3a74 (diff)
keep integral rectangle intersections integral
A pair of coincident lines can generate multiple intersection points. Path ops is more stable when the intersection T value is used to recompute the intersection point, but this has the side-effect of making integral edges intersect at non-integral values. While it's worthwhile to fix this, for the moment it is less disruptive to only worry about keeping intersection values integral if the original intersection point is integral in both axes. Also, fix some debugging code that bit-rotted. R=msarett@google.com Change-Id: Iefd27b25d1d21c22b224c174bd59bc6c105033c4 Reviewed-on: https://skia-review.googlesource.com/13721 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/PathOpsOpTest.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/PathOpsOpTest.cpp b/tests/PathOpsOpTest.cpp
index 365409d5b6..6cc9dc7c9e 100644
--- a/tests/PathOpsOpTest.cpp
+++ b/tests/PathOpsOpTest.cpp
@@ -5409,6 +5409,24 @@ path.close();
testPathOp(reporter, path, path, kUnion_SkPathOp, filename);
}
+static void android1(skiatest::Reporter* reporter, const char* filename) {
+ SkPath path, pathB;
+path.moveTo(SkBits2Float(0xc0a00000), SkBits2Float(0x00000000)); // -5, 0
+path.lineTo(SkBits2Float(0x44866000), SkBits2Float(0x00000000)); // 1075, 0
+path.lineTo(SkBits2Float(0x44866000), SkBits2Float(0x43720000)); // 1075, 242
+path.lineTo(SkBits2Float(0xc0a00000), SkBits2Float(0x43720000)); // -5, 242
+path.lineTo(SkBits2Float(0xc0a00000), SkBits2Float(0x00000000)); // -5, 0
+path.close();
+pathB.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0
+pathB.lineTo(SkBits2Float(0x44870000), SkBits2Float(0x00000000)); // 1080, 0
+pathB.lineTo(SkBits2Float(0x44870000), SkBits2Float(0x43720000)); // 1080, 242
+pathB.lineTo(SkBits2Float(0x00000000), SkBits2Float(0x43720000)); // 0, 242
+pathB.lineTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0
+pathB.close();
+ testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
+}
+
+
static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0;
static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0;
static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0;
@@ -5416,6 +5434,7 @@ static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0;
#define TEST(name) { name, #name }
static struct TestDesc tests[] = {
+ TEST(android1),
TEST(bug5240),
TEST(circlesOp4),
TEST(loop17),