From 72b55be3f3448287e8ff6fe83633edadfb60f59a Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Thu, 26 Jan 2012 20:33:19 +0000 Subject: Change background color and add paths to convexpaths gm git-svn-id: http://skia.googlecode.com/svn/trunk@3090 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gm/convexpaths.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/gm/convexpaths.cpp b/gm/convexpaths.cpp index 5d8f049bab..b3800cd2d4 100644 --- a/gm/convexpaths.cpp +++ b/gm/convexpaths.cpp @@ -14,7 +14,7 @@ namespace skiagm { class ConvexPathsGM : public GM { public: ConvexPathsGM() { - this->setBGColor(0xFFDDDDDD); + this->setBGColor(0xFF000000); this->makePaths(); } @@ -63,10 +63,6 @@ protected: 100 * SK_Scalar1), SkPath::kCCW_Direction); - fPaths.push_back().addRect(0, 0, - 100 * SK_Scalar1, 100 * SK_Scalar1, - SkPath::kCCW_Direction); - fPaths.push_back().addRoundRect(SkRect::MakeXYWH(0, 0, SK_Scalar1 * 100, SK_Scalar1 * 100), @@ -78,6 +74,12 @@ protected: SK_Scalar1 * 100), 20 * SK_Scalar1, 40 * SK_Scalar1, SkPath::kCCW_Direction); + + // shallow diagonals + fPaths.push_back().lineTo(100 * SK_Scalar1, SK_Scalar1); + fPaths.back().lineTo(98 * SK_Scalar1, 100 * SK_Scalar1); + fPaths.back().lineTo(3 * SK_Scalar1, 96 * SK_Scalar1); + /* It turns out arcTos are not automatically marked as convex and they may in fact be ever so slightly concave. @@ -87,6 +89,14 @@ protected: 25 * SK_Scalar1, 130 * SK_Scalar1, false); */ + // cubics + fPaths.push_back().cubicTo( 1 * SK_Scalar1, 1 * SK_Scalar1, + 10 * SK_Scalar1, 90 * SK_Scalar1, + 0 * SK_Scalar1, 100 * SK_Scalar1); + fPaths.push_back().cubicTo(100 * SK_Scalar1, 50 * SK_Scalar1, + 20 * SK_Scalar1, 100 * SK_Scalar1, + 0 * SK_Scalar1, 0 * SK_Scalar1); + // point degenerate fPaths.push_back().moveTo(50 * SK_Scalar1, 50 * SK_Scalar1); fPaths.back().lineTo(50 * SK_Scalar1, 50 * SK_Scalar1); @@ -117,7 +127,7 @@ protected: paint.setAntiAlias(true); SkRandom rand; canvas->translate(20 * SK_Scalar1, 20 * SK_Scalar1); - for (int i = 0 ; i < fPaths.count(); ++i) { + for (int i = 0; i < fPaths.count(); ++i) { canvas->save(); // position the path, and make it at off-integer coords. canvas->translate(SK_Scalar1 * 200 * (i % 5) + SK_Scalar1 / 4, -- cgit v1.2.3