aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathOpsOpTest.cpp
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-06-18 08:53:00 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-18 13:30:38 +0000
commit1bb47df4fc8edf62b0463d088214ed1ffb909ca9 (patch)
treeb0feb88d7609d30eef13946af3b2499567b80120 /tests/PathOpsOpTest.cpp
parent63132864e96657ea1a74b93acf5a00d40ebe49b3 (diff)
fast path for pathops
Add faster path for simple but common path ops: - intersect two rects - all ops where one operand is empty R=halcanary@google.com Bug: skia:8049 Change-Id: I2a516d095feae8478ee9433262c9c77e5e18ce81 Reviewed-on: https://skia-review.googlesource.com/132929 Auto-Submit: Cary Clark <caryclark@skia.org> Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'tests/PathOpsOpTest.cpp')
-rw-r--r--tests/PathOpsOpTest.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/PathOpsOpTest.cpp b/tests/PathOpsOpTest.cpp
index cfa9a450a0..52cd8b2a04 100644
--- a/tests/PathOpsOpTest.cpp
+++ b/tests/PathOpsOpTest.cpp
@@ -5729,6 +5729,28 @@ static void halbug(skiatest::Reporter* reporter, const char* filename) {
testPathOp(reporter, path, path2, kIntersect_SkPathOp, filename);
}
+static void testRect1_u(skiatest::Reporter* reporter, const char* filename) {
+ SkPath path, pathB;
+ path.setFillType(SkPath::kWinding_FillType);
+ path.moveTo(0, 0);
+ path.lineTo(0, 60);
+ path.lineTo(60, 60);
+ path.lineTo(60, 0);
+ path.close();
+ path.moveTo(30, 20);
+ path.lineTo(30, 50);
+ path.lineTo(50, 50);
+ path.lineTo(50, 20);
+ path.close();
+ path.moveTo(24, 20);
+ path.lineTo(24, 30);
+ path.lineTo(36, 30);
+ path.lineTo(36, 20);
+ path.close();
+ pathB.setFillType(SkPath::kWinding_FillType);
+ testPathOp(reporter, path, pathB, kUnion_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;
@@ -5736,6 +5758,7 @@ static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0;
#define TEST(name) { name, #name }
static struct TestDesc tests[] = {
+ TEST(testRect1_u),
TEST(halbug),
TEST(seanbug),
TEST(android1),