aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar liyuqian <liyuqian@google.com>2016-11-11 09:59:51 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-11-11 09:59:51 -0800
commit041da389dd923689041ba5e45cda34901ba4fe8a (patch)
treee469cd7a141bdd8817ea23e3710b7bab3ae9badd /tests
parent38af9438d7b7fa838aff2931d9afb4dd4a82549d (diff)
Tighten SkAAClip Bounds by Path Bounds
This bug chromium:662780 exists after our original fix (https://codereview.chromium.org/2477393002/) because this path (added in unit test) is calling blitAntiRect rather than blitAntiH when the path is drifted across the boundary. (The quadratic edge drifts across the boundary after an update and sets a dX=0 line segment which triggers blitAntiRect.) Note that I didn't assert for the dLeft = dRite = 0 case because the left/right there won't drift after the SkTMin/SkTMax in line 964/966. Theoretically we can revert the relaxation in https://codereview.chromium.org/2477393002/ (that's only a relaxation for analytic AA, not supersampled AA). However, consider that the initial landing of analytic AA is so painful, I decide to revert that relaxation only after our successful landing... BUG=chromium:662780, chromium:662862 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2482193004 Review-Url: https://codereview.chromium.org/2482193004
Diffstat (limited to 'tests')
-rw-r--r--tests/PathTest.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index b8247edbc3..85bd804874 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -170,6 +170,34 @@ static void test_fuzz_crbug_647922() {
canvas->drawPath(path, paint);
}
+static void test_fuzz_crbug_662780() {
+ auto surface(SkSurface::MakeRasterN32Premul(250, 250));
+ SkCanvas* canvas = surface->getCanvas();
+ SkPaint paint;
+ paint.setAntiAlias(true);
+ SkPath path;
+ path.moveTo(SkBits2Float(0x41000000), SkBits2Float(0x431e0000)); // 8, 158
+ path.lineTo(SkBits2Float(0x41000000), SkBits2Float(0x42f00000)); // 8, 120
+ // 8, 8, 8.00002f, 8, 0.707107f
+ path.conicTo(SkBits2Float(0x41000000), SkBits2Float(0x41000000),
+ SkBits2Float(0x41000010), SkBits2Float(0x41000000), SkBits2Float(0x3f3504f3));
+ path.lineTo(SkBits2Float(0x439a0000), SkBits2Float(0x41000000)); // 308, 8
+ // 308, 8, 308, 8, 0.707107f
+ path.conicTo(SkBits2Float(0x439a0000), SkBits2Float(0x41000000),
+ SkBits2Float(0x439a0000), SkBits2Float(0x41000000), SkBits2Float(0x3f3504f3));
+ path.lineTo(SkBits2Float(0x439a0000), SkBits2Float(0x431e0000)); // 308, 158
+ // 308, 158, 308, 158, 0.707107f
+ path.conicTo(SkBits2Float(0x439a0000), SkBits2Float(0x431e0000),
+ SkBits2Float(0x439a0000), SkBits2Float(0x431e0000), SkBits2Float(0x3f3504f3));
+ path.lineTo(SkBits2Float(0x41000000), SkBits2Float(0x431e0000)); // 8, 158
+ // 8, 158, 8, 158, 0.707107f
+ path.conicTo(SkBits2Float(0x41000000), SkBits2Float(0x431e0000),
+ SkBits2Float(0x41000000), SkBits2Float(0x431e0000), SkBits2Float(0x3f3504f3));
+ path.close();
+ canvas->clipPath(path, true);
+ canvas->drawRectCoords(0, 0, 250, 250, paint);
+}
+
/**
* In debug mode, this path was causing an assertion to fail in
* SkPathStroker::preJoinTo() and, in Release, the use of an unitialized value.
@@ -4330,6 +4358,7 @@ DEF_TEST(Paths, reporter) {
test_path_crbug364224();
test_fuzz_crbug_662952(reporter);
test_fuzz_crbug_662730(reporter);
+ test_fuzz_crbug_662780();
SkTSize<SkScalar>::Make(3,4);