add gm for distance field bug
Added gm to illustrate this bug. If you trace through
the red path, it uses GrAADistanceFieldPathRenderer
when it draws without antialiasing.
R=jvanverth@google.com
BUG=skia:4864
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1755683002
Review URL: https://codereview.chromium.org/1755683002
diff --git a/gm/pathfill.cpp b/gm/pathfill.cpp
index a524588..b4010ce 100644
--- a/gm/pathfill.cpp
+++ b/gm/pathfill.cpp
@@ -213,6 +213,28 @@
typedef skiagm::GM INHERITED;
};
+DEF_SIMPLE_GM(rotatedcubicpath, canvas, 200, 200) {
+ SkPaint p;
+ p.setAntiAlias(true);
+ p.setStyle(SkPaint::kFill_Style);
+
+ canvas->translate(50, 50);
+ SkPath path;
+ path.moveTo(48,-23);
+ path.cubicTo(48,-29.5, 6,-30, 6,-30);
+ path.cubicTo(6,-30, 2,0, 2,0);
+ path.cubicTo(2,0, 44,-21.5, 48,-23);
+ path.close();
+
+ p.setColor(SK_ColorBLUE);
+ canvas->drawPath(path, p);
+
+ // Rotated path, which is not antialiased on GPU
+ p.setColor(SK_ColorRED);
+ canvas->rotate(90);
+ canvas->drawPath(path, p);
+}
+
///////////////////////////////////////////////////////////////////////////////
DEF_GM( return new PathFillGM; )