add conic support to hairlines
git-svn-id: http://skia.googlecode.com/svn/trunk@9493 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/aaclip.cpp b/gm/aaclip.cpp
index f59f6aa..6ebb88c 100644
--- a/gm/aaclip.cpp
+++ b/gm/aaclip.cpp
@@ -9,6 +9,34 @@
#include "SkCanvas.h"
#include "SkPath.h"
+static void draw_conic(SkCanvas* canvas, SkScalar weight, const SkPaint& paint) {
+ SkPath path;
+ path.moveTo(100, 100);
+ path.conicTo(300, 100, 300, 300, weight);
+ canvas->drawPath(path, paint);
+}
+
+static void test_conic(SkCanvas* canvas) {
+ SkPaint paint;
+ paint.setAntiAlias(true);
+ paint.setStyle(SkPaint::kStroke_Style);
+
+ static const struct {
+ SkScalar fWeight;
+ SkColor fColor;
+ } gRec[] = {
+ { 2 , SK_ColorRED },
+ { 1 , SK_ColorGREEN },
+ { 0.5f, SK_ColorBLUE },
+ };
+
+ for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); ++i) {
+ paint.setColor(gRec[i].fColor);
+ draw_conic(canvas, gRec[i].fWeight, paint);
+ canvas->translate(-30, 30);
+ }
+}
+
#include "SkGradientShader.h"
static void test_shallow_gradient(SkCanvas* canvas, SkScalar width, SkScalar height) {
SkColor colors[] = { 0xFF7F7F7F, 0xFF7F7F7F, 0xFF000000 };
@@ -219,6 +247,7 @@
}
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
+ if (false) { test_conic(canvas); return; }
if (false) {
SkRect bounds;
canvas->getClipBounds(&bounds);