OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkJSONCanvas_DEFINED | 8 #ifndef SkJSONCanvas_DEFINED |
9 #define SkJSONCanvas_DEFINED | 9 #define SkJSONCanvas_DEFINED |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 #define SKJSONCANVAS_ATTRIBUTE_PATH "path" | 56 #define SKJSONCANVAS_ATTRIBUTE_PATH "path" |
57 #define SKJSONCANVAS_ATTRIBUTE_TEXT "text" | 57 #define SKJSONCANVAS_ATTRIBUTE_TEXT "text" |
58 #define SKJSONCANVAS_ATTRIBUTE_COLOR "color" | 58 #define SKJSONCANVAS_ATTRIBUTE_COLOR "color" |
59 #define SKJSONCANVAS_ATTRIBUTE_STYLE "style" | 59 #define SKJSONCANVAS_ATTRIBUTE_STYLE "style" |
60 #define SKJSONCANVAS_ATTRIBUTE_STROKEWIDTH "strokeWidth" | 60 #define SKJSONCANVAS_ATTRIBUTE_STROKEWIDTH "strokeWidth" |
61 #define SKJSONCANVAS_ATTRIBUTE_ANTIALIAS "antiAlias" | 61 #define SKJSONCANVAS_ATTRIBUTE_ANTIALIAS "antiAlias" |
62 #define SKJSONCANVAS_ATTRIBUTE_REGION "region" | 62 #define SKJSONCANVAS_ATTRIBUTE_REGION "region" |
63 #define SKJSONCANVAS_ATTRIBUTE_REGIONOP "op" | 63 #define SKJSONCANVAS_ATTRIBUTE_REGIONOP "op" |
64 #define SKJSONCANVAS_ATTRIBUTE_EDGESTYLE "edgeStyle" | 64 #define SKJSONCANVAS_ATTRIBUTE_EDGESTYLE "edgeStyle" |
65 #define SKJSONCANVAS_ATTRIBUTE_DEVICEREGION "deviceRegion" | 65 #define SKJSONCANVAS_ATTRIBUTE_DEVICEREGION "deviceRegion" |
| 66 #define SKJSONCANVAS_ATTRIBUTE_BLUR "blur" |
| 67 #define SKJSONCANVAS_ATTRIBUTE_SIGMA "sigma" |
| 68 #define SKJSONCANVAS_ATTRIBUTE_QUALITY "quality" |
| 69 #define SKJSONCANVAS_ATTRIBUTE_TEXTALIGN "textAlign" |
| 70 #define SKJSONCANVAS_ATTRIBUTE_TEXTSIZE "textSize" |
| 71 #define SKJSONCANVAS_ATTRIBUTE_TEXTSCALEX "textScaleX" |
| 72 #define SKJSONCANVAS_ATTRIBUTE_TEXTSKEWX "textSkewX" |
| 73 #define SKJSONCANVAS_ATTRIBUTE_DASHING "dashing" |
| 74 #define SKJSONCANVAS_ATTRIBUTE_INTERVALS "intervals" |
| 75 #define SKJSONCANVAS_ATTRIBUTE_PHASE "phase" |
| 76 #define SKJSONCANVAS_ATTRIBUTE_FILLTYPE "fillType" |
| 77 #define SKJSONCANVAS_ATTRIBUTE_VERBS "verbs" |
66 | 78 |
67 #define SKJSONCANVAS_VERB_MOVE "move" | 79 #define SKJSONCANVAS_VERB_MOVE "move" |
68 #define SKJSONCANVAS_VERB_LINE "line" | 80 #define SKJSONCANVAS_VERB_LINE "line" |
69 #define SKJSONCANVAS_VERB_QUAD "quad" | 81 #define SKJSONCANVAS_VERB_QUAD "quad" |
70 #define SKJSONCANVAS_VERB_CUBIC "cubic" | 82 #define SKJSONCANVAS_VERB_CUBIC "cubic" |
71 #define SKJSONCANVAS_VERB_CONIC "conic" | 83 #define SKJSONCANVAS_VERB_CONIC "conic" |
72 #define SKJSONCANVAS_VERB_CLOSE "close" | 84 #define SKJSONCANVAS_VERB_CLOSE "close" |
73 | 85 |
74 #define SKJSONCANVAS_STYLE_FILL "fill" | 86 #define SKJSONCANVAS_STYLE_FILL "fill" |
75 #define SKJSONCANVAS_STYLE_STROKE "stroke" | 87 #define SKJSONCANVAS_STYLE_STROKE "stroke" |
76 #define SKJSONCANVAS_STYLE_STROKEANDFILL "strokeAndFill" | 88 #define SKJSONCANVAS_STYLE_STROKEANDFILL "strokeAndFill" |
77 | 89 |
78 #define SKJSONCANVAS_EDGESTYLE_HARD "hard" | |
79 #define SKJSONCANVAS_EDGESTYLE_SOFT "soft" | |
80 | |
81 #define SKJSONCANVAS_POINTMODE_POINTS "points" | 90 #define SKJSONCANVAS_POINTMODE_POINTS "points" |
82 #define SKJSONCANVAS_POINTMODE_LINES "lines" | 91 #define SKJSONCANVAS_POINTMODE_LINES "lines" |
83 #define SKJSONCANVAS_POINTMODE_POLYGON "polygon" | 92 #define SKJSONCANVAS_POINTMODE_POLYGON "polygon" |
84 | 93 |
85 #define SKJSONCANVAS_REGIONOP_DIFFERENCE "difference" | 94 #define SKJSONCANVAS_REGIONOP_DIFFERENCE "difference" |
86 #define SKJSONCANVAS_REGIONOP_INTERSECT "intersect" | 95 #define SKJSONCANVAS_REGIONOP_INTERSECT "intersect" |
87 #define SKJSONCANVAS_REGIONOP_UNION "union" | 96 #define SKJSONCANVAS_REGIONOP_UNION "union" |
88 #define SKJSONCANVAS_REGIONOP_XOR "xor" | 97 #define SKJSONCANVAS_REGIONOP_XOR "xor" |
89 #define SKJSONCANVAS_REGIONOP_REVERSE_DIFFERENCE "reverseDifference" | 98 #define SKJSONCANVAS_REGIONOP_REVERSE_DIFFERENCE "reverseDifference" |
90 #define SKJSONCANVAS_REGIONOP_REPLACE "replace" | 99 #define SKJSONCANVAS_REGIONOP_REPLACE "replace" |
91 | 100 |
| 101 #define SKJSONCANVAS_BLURSTYLE_NORMAL "normal" |
| 102 #define SKJSONCANVAS_BLURSTYLE_SOLID "solid" |
| 103 #define SKJSONCANVAS_BLURSTYLE_OUTER "outer" |
| 104 #define SKJSONCANVAS_BLURSTYLE_INNER "inner" |
| 105 |
| 106 #define SKJSONCANVAS_BLURQUALITY_LOW "low" |
| 107 #define SKJSONCANVAS_BLURQUALITY_HIGH "high" |
| 108 |
| 109 #define SKJSONCANVAS_ALIGN_LEFT "left" |
| 110 #define SKJSONCANVAS_ALIGN_CENTER "center" |
| 111 #define SKJSONCANVAS_ALIGN_RIGHT "right" |
| 112 |
| 113 #define SKJSONCANVAS_FILLTYPE_WINDING "winding" |
| 114 #define SKJSONCANVAS_FILLTYPE_EVENODD "evenOdd" |
| 115 #define SKJSONCANVAS_FILLTYPE_INVERSEWINDING "inverseWinding" |
| 116 #define SKJSONCANVAS_FILLTYPE_INVERSEEVENODD "inverseEvenOdd" |
| 117 |
92 /* | 118 /* |
93 * Implementation of SkCanvas which writes JSON when drawn to. The JSON describe
s all of the draw | 119 * Implementation of SkCanvas which writes JSON when drawn to. The JSON describe
s all of the draw |
94 * commands issued to the canvas, and can later be turned back into draw command
s using | 120 * commands issued to the canvas, and can later be turned back into draw command
s using |
95 * SkJSONRenderer. Be sure to call finish() when you are done drawing. | 121 * SkJSONRenderer. Be sure to call finish() when you are done drawing. |
96 */ | 122 */ |
97 class SkJSONCanvas : public SkCanvas { | 123 class SkJSONCanvas : public SkCanvas { |
98 public: | 124 public: |
99 /* Create a canvas which writes to the specified output stream. */ | 125 /* Create a canvas which writes to the specified output stream. */ |
100 SkJSONCanvas(int width, int height, SkWStream& out); | 126 SkJSONCanvas(int width, int height, SkWStream& out); |
101 | 127 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 229 |
204 SkWStream& fOut; | 230 SkWStream& fOut; |
205 SkMatrix fLastMatrix; | 231 SkMatrix fLastMatrix; |
206 Json::Value fRoot; | 232 Json::Value fRoot; |
207 Json::Value fCommands; | 233 Json::Value fCommands; |
208 | 234 |
209 typedef SkCanvas INHERITED; | 235 typedef SkCanvas INHERITED; |
210 }; | 236 }; |
211 | 237 |
212 #endif | 238 #endif |
OLD | NEW |