Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: gm/inversestrokefill.cpp

Issue 19519017: Inverse fill support in PDF (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: More style fixes Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | gyp/gmslides.gypi » ('j') | src/pdf/SkPDFDevice.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2013 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "gm.h"
9 #include "SkCanvas.h"
10 #include "SkPath.h"
11
12 namespace skiagm {
13
14 class InverseStrokeFillGM : public GM {
15 public:
16 InverseStrokeFillGM() {
17
18 }
19
20 protected:
21 virtual SkString onShortName() {
22 return SkString("inverse_stroke_fill");
23 }
24
25 virtual SkISize onISize() {
26 return make_isize(100, 100);
27 }
28
29 virtual void onDraw(SkCanvas* canvas) {
30 SkScalar x = SkIntToScalar(50);
31 SkScalar y = SkIntToScalar(50);
32 SkScalar r = SkIntToScalar(40);
33
34 SkPaint paint;
35 paint.setStrokeWidth(SkIntToScalar(5));
edisonn 2013/07/26 20:23:52 add option for stoke width 0
ducky 2013/07/29 19:07:51 Done. The original intent of this GM was to test o
36 paint.setStyle(SkPaint::kStrokeAndFill_Style);
edisonn 2013/07/26 20:23:52 what about the rest of styles?
ducky 2013/07/29 19:07:51 Done.
37
38 SkPath path;
39 path.setFillType(SkPath::kInverseWinding_FillType);
40 path.addCircle(x, y, r, SkPath::kCW_Direction);
41 canvas->drawPath(path, paint);
edisonn 2013/07/26 20:23:52 please add tests for other addFoo operations. some
ducky 2013/07/29 19:07:51 Done.
42
43 // Draw positive centerline for reference.
44 paint.setStrokeWidth(SkIntToScalar(0));
45 paint.setStyle(SkPaint::kStroke_Style);
46 path.setFillType(SkPath::kWinding_FillType);
47 canvas->drawPath(path, paint);
48 }
49
50 private:
51 typedef GM INHERITED;
52 };
53
54 DEF_GM( return new InverseStrokeFillGM; )
55 }
OLDNEW
« no previous file with comments | « no previous file | gyp/gmslides.gypi » ('j') | src/pdf/SkPDFDevice.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698