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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gyp/gmslides.gypi » ('j') | src/pdf/SkPDFDevice.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/inversestrokefill.cpp
diff --git a/gm/inversestrokefill.cpp b/gm/inversestrokefill.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..842cbd6fa81e58ee68a1c7dbf44128e6ab9c1d09
--- /dev/null
+++ b/gm/inversestrokefill.cpp
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2013 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "gm.h"
+#include "SkCanvas.h"
+#include "SkPath.h"
+
+namespace skiagm {
+
+class InverseStrokeFillGM : public GM {
+public:
+ InverseStrokeFillGM() {
+
+ }
+
+protected:
+ virtual SkString onShortName() {
+ return SkString("inverse_stroke_fill");
+ }
+
+ virtual SkISize onISize() {
+ return make_isize(100, 100);
+ }
+
+ virtual void onDraw(SkCanvas* canvas) {
+ SkScalar x = SkIntToScalar(50);
+ SkScalar y = SkIntToScalar(50);
+ SkScalar r = SkIntToScalar(40);
+
+ SkPaint paint;
+ 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
+ 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.
+
+ SkPath path;
+ path.setFillType(SkPath::kInverseWinding_FillType);
+ path.addCircle(x, y, r, SkPath::kCW_Direction);
+ 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.
+
+ // Draw positive centerline for reference.
+ paint.setStrokeWidth(SkIntToScalar(0));
+ paint.setStyle(SkPaint::kStroke_Style);
+ path.setFillType(SkPath::kWinding_FillType);
+ canvas->drawPath(path, paint);
+ }
+
+private:
+ typedef GM INHERITED;
+};
+
+DEF_GM( return new InverseStrokeFillGM; )
+}
« 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