aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/core/SkScan_DAAPath.cpp5
-rw-r--r--tests/PathTest.cpp11
2 files changed, 14 insertions, 2 deletions
diff --git a/src/core/SkScan_DAAPath.cpp b/src/core/SkScan_DAAPath.cpp
index a12b6da9b0..9250d02f07 100644
--- a/src/core/SkScan_DAAPath.cpp
+++ b/src/core/SkScan_DAAPath.cpp
@@ -173,8 +173,9 @@ void gen_alpha_deltas(const SkPath& path, const SkRegion& clipRgn, Deltas& resul
SkBezier* lb = list[i];
SkBezier* rb = list[i + 1];
- bool lDX0 = lb->fP0.fX == lb->fP1.fX;
- bool rDX0 = rb->fP0.fX == rb->fP1.fX;
+ // fCount == 2 ensures that lb and rb are lines instead of quads or cubics.
+ bool lDX0 = lb->fP0.fX == lb->fP1.fX && lb->fCount == 2;
+ bool rDX0 = rb->fP0.fX == rb->fP1.fX && rb->fCount == 2;
if (!lDX0 || !rDX0) { // make sure that the edges are vertical
continue;
}
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index 8c629d9485..4fb559b323 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -4482,6 +4482,16 @@ static void test_skbug_7015() {
test_draw_AA_path(500, 500, path);
}
+static void test_skbug_7051() {
+ SkPath path;
+ path.moveTo(10, 10);
+ path.cubicTo(10, 20, 10, 30, 30, 30);
+ path.lineTo(50, 20);
+ path.lineTo(50, 10);
+ path.close();
+ test_draw_AA_path(100, 100, path);
+}
+
#endif
static void test_interp(skiatest::Reporter* reporter) {
@@ -4559,6 +4569,7 @@ DEF_TEST(Paths, reporter) {
#if !defined(SK_SUPPORT_LEGACY_DELTA_AA)
test_skbug_6947();
test_skbug_7015();
+ test_skbug_7051();
#endif
SkSize::Make(3, 4);