diff options
author | rmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-23 18:14:13 +0000 |
---|---|---|
committer | rmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-23 18:14:13 +0000 |
commit | d6176b0dcacb124539e0cfd051e6d93a9782f020 (patch) | |
tree | 9e6f4b465e54c9b26e1ba70cd8890b55abb08464 /gm/pathfill.cpp | |
parent | fbfcd5602128ec010c82cb733c9cdc0a3254f9f3 (diff) |
Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/)
This CL is part II of IV (I broke down the 1280 files into 4 CLs).
Review URL: https://codereview.appspot.com/6474054
git-svn-id: http://skia.googlecode.com/svn/trunk@5263 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/pathfill.cpp')
-rw-r--r-- | gm/pathfill.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/gm/pathfill.cpp b/gm/pathfill.cpp index fc864198b4..bfaabc924a 100644 --- a/gm/pathfill.cpp +++ b/gm/pathfill.cpp @@ -13,7 +13,7 @@ static SkScalar make_frame(SkPath* path) { SkRect r = { SkIntToScalar(10), SkIntToScalar(10), SkIntToScalar(630), SkIntToScalar(470) }; path->addRoundRect(r, SkIntToScalar(15), SkIntToScalar(15)); - + SkPaint paint; paint.setStyle(SkPaint::kStroke_Style); paint.setStrokeWidth(SkIntToScalar(5)); @@ -55,7 +55,7 @@ static SkScalar make_sawtooth(SkPath* path) { const SkScalar x0 = x; const SkScalar dx = SK_Scalar1 * 5; const SkScalar dy = SK_Scalar1 * 10; - + path->moveTo(x, y); for (int i = 0; i < 32; i++) { x += dx; @@ -72,10 +72,10 @@ static SkScalar make_sawtooth(SkPath* path) { static SkScalar make_star(SkPath* path, int n) { const SkScalar c = SkIntToScalar(45); const SkScalar r = SkIntToScalar(20); - + SkScalar rad = -SK_ScalarPI / 2; const SkScalar drad = (n >> 1) * SK_ScalarPI * 2 / n; - + path->moveTo(c, c - r); for (int i = 1; i < n; i++) { rad += drad; @@ -123,26 +123,26 @@ public: fDY[i] = gProcs[i](&fPath[i]); } } - + protected: virtual SkString onShortName() { return SkString("pathfill"); } - + virtual SkISize onISize() { return SkISize::Make(640, 480); } - + virtual void onDraw(SkCanvas* canvas) { SkPaint paint; paint.setAntiAlias(true); - + for (size_t i = 0; i < N; i++) { canvas->drawPath(fPath[i], paint); canvas->translate(SkIntToScalar(0), fDY[i]); } } - + private: typedef skiagm::GM INHERITED; }; @@ -157,16 +157,16 @@ public: fDY[i] = gProcs[i](&fPath[i]); } } - + protected: virtual SkString onShortName() { return SkString("pathinvfill"); } - + virtual SkISize onISize() { return SkISize::Make(450, 220); } - + static void show(SkCanvas* canvas, const SkPath& path, const SkPaint& paint, const SkRect* clip, SkScalar top, const SkScalar bottom) { canvas->save(); @@ -182,7 +182,7 @@ protected: virtual void onDraw(SkCanvas* canvas) { SkPath path; - + path.addCircle(SkIntToScalar(50), SkIntToScalar(50), SkIntToScalar(40)); path.toggleInverseFillType(); @@ -197,18 +197,18 @@ protected: canvas->save(); canvas->clipRect(clipR); - + const SkRect* clipPtr = doclip ? &clipR : NULL; show(canvas, path, paint, clipPtr, clipR.fTop, clipR.centerY()); show(canvas, path, paint, clipPtr, clipR.centerY(), clipR.fBottom); - + canvas->restore(); canvas->translate(SkIntToScalar(110), 0); } } } - + private: typedef skiagm::GM INHERITED; }; |