schenney@chromium.org | 4da06ab | 2011-12-20 15:14:18 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2011 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 | #include "gm.h" |
| 8 | #include "SkCanvas.h" |
| 9 | #include "SkPaint.h" |
| 10 | #include "SkRandom.h" |
| 11 | |
reed@google.com | 22999c6 | 2013-05-23 19:30:48 +0000 | [diff] [blame] | 12 | // skbug.com/1316 shows that this cubic, when slightly clipped, creates big |
| 13 | // (incorrect) changes to its control points. |
| 14 | class ClippedCubicGM : public skiagm::GM { |
| 15 | public: |
| 16 | ClippedCubicGM() {} |
skia.committer@gmail.com | 3e2345a | 2013-05-24 07:01:26 +0000 | [diff] [blame] | 17 | |
reed@google.com | 22999c6 | 2013-05-23 19:30:48 +0000 | [diff] [blame] | 18 | protected: |
mtklein | 72c9faa | 2015-01-09 10:06:39 -0800 | [diff] [blame^] | 19 | uint32_t onGetFlags() const SK_OVERRIDE { |
commit-bot@chromium.org | a90c680 | 2014-04-30 13:20:45 +0000 | [diff] [blame] | 20 | return kSkipTiled_Flag; |
| 21 | } |
| 22 | |
reed@google.com | 22999c6 | 2013-05-23 19:30:48 +0000 | [diff] [blame] | 23 | SkString onShortName() { |
reed@google.com | 03ca64b | 2013-05-23 19:39:15 +0000 | [diff] [blame] | 24 | return SkString("clippedcubic"); |
reed@google.com | 22999c6 | 2013-05-23 19:30:48 +0000 | [diff] [blame] | 25 | } |
skia.committer@gmail.com | 3e2345a | 2013-05-24 07:01:26 +0000 | [diff] [blame] | 26 | |
reed@google.com | 22999c6 | 2013-05-23 19:30:48 +0000 | [diff] [blame] | 27 | SkISize onISize() { return SkISize::Make(1240, 390); } |
skia.committer@gmail.com | 3e2345a | 2013-05-24 07:01:26 +0000 | [diff] [blame] | 28 | |
reed@google.com | 22999c6 | 2013-05-23 19:30:48 +0000 | [diff] [blame] | 29 | virtual void onDraw(SkCanvas* canvas) { |
| 30 | SkPath path; |
| 31 | path.moveTo(0, 0); |
| 32 | path.cubicTo(140, 150, 40, 10, 170, 150); |
skia.committer@gmail.com | 3e2345a | 2013-05-24 07:01:26 +0000 | [diff] [blame] | 33 | |
reed@google.com | 22999c6 | 2013-05-23 19:30:48 +0000 | [diff] [blame] | 34 | SkPaint paint; |
| 35 | SkRect bounds = path.getBounds(); |
skia.committer@gmail.com | 3e2345a | 2013-05-24 07:01:26 +0000 | [diff] [blame] | 36 | |
reed@google.com | 0f8990c | 2013-05-23 19:47:05 +0000 | [diff] [blame] | 37 | for (SkScalar dy = -1; dy <= 1; dy += 1) { |
reed@google.com | 22999c6 | 2013-05-23 19:30:48 +0000 | [diff] [blame] | 38 | canvas->save(); |
reed@google.com | 0f8990c | 2013-05-23 19:47:05 +0000 | [diff] [blame] | 39 | for (SkScalar dx = -1; dx <= 1; dx += 1) { |
reed@google.com | 22999c6 | 2013-05-23 19:30:48 +0000 | [diff] [blame] | 40 | canvas->save(); |
| 41 | canvas->clipRect(bounds); |
| 42 | canvas->translate(dx, dy); |
| 43 | canvas->drawPath(path, paint); |
| 44 | canvas->restore(); |
skia.committer@gmail.com | 3e2345a | 2013-05-24 07:01:26 +0000 | [diff] [blame] | 45 | |
reed@google.com | 22999c6 | 2013-05-23 19:30:48 +0000 | [diff] [blame] | 46 | canvas->translate(bounds.width(), 0); |
| 47 | } |
| 48 | canvas->restore(); |
| 49 | canvas->translate(0, bounds.height()); |
| 50 | } |
| 51 | } |
skia.committer@gmail.com | 3e2345a | 2013-05-24 07:01:26 +0000 | [diff] [blame] | 52 | |
reed@google.com | 22999c6 | 2013-05-23 19:30:48 +0000 | [diff] [blame] | 53 | private: |
| 54 | typedef skiagm::GM INHERITED; |
| 55 | }; |
| 56 | |
reed@google.com | 27b90fa | 2013-03-08 18:44:01 +0000 | [diff] [blame] | 57 | class CubicPathGM : public skiagm::GM { |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 58 | public: |
| 59 | CubicPathGM() {} |
| 60 | |
| 61 | protected: |
mtklein | 72c9faa | 2015-01-09 10:06:39 -0800 | [diff] [blame^] | 62 | uint32_t onGetFlags() const SK_OVERRIDE { |
commit-bot@chromium.org | a90c680 | 2014-04-30 13:20:45 +0000 | [diff] [blame] | 63 | return kSkipTiled_Flag; |
| 64 | } |
| 65 | |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 66 | SkString onShortName() { |
| 67 | return SkString("cubicpath"); |
| 68 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 69 | |
reed@google.com | 27b90fa | 2013-03-08 18:44:01 +0000 | [diff] [blame] | 70 | SkISize onISize() { return SkISize::Make(1240, 390); } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 71 | |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 72 | void drawPath(SkPath& path,SkCanvas* canvas,SkColor color, |
| 73 | const SkRect& clip,SkPaint::Cap cap, SkPaint::Join join, |
| 74 | SkPaint::Style style, SkPath::FillType fill, |
| 75 | SkScalar strokeWidth) { |
| 76 | path.setFillType(fill); |
| 77 | SkPaint paint; |
| 78 | paint.setStrokeCap(cap); |
| 79 | paint.setStrokeWidth(strokeWidth); |
| 80 | paint.setStrokeJoin(join); |
| 81 | paint.setColor(color); |
| 82 | paint.setStyle(style); |
| 83 | canvas->save(); |
| 84 | canvas->clipRect(clip); |
| 85 | canvas->drawPath(path, paint); |
| 86 | canvas->restore(); |
| 87 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 88 | |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 89 | virtual void onDraw(SkCanvas* canvas) { |
| 90 | struct FillAndName { |
| 91 | SkPath::FillType fFill; |
| 92 | const char* fName; |
| 93 | }; |
| 94 | static const FillAndName gFills[] = { |
| 95 | {SkPath::kWinding_FillType, "Winding"}, |
| 96 | {SkPath::kEvenOdd_FillType, "Even / Odd"}, |
| 97 | {SkPath::kInverseWinding_FillType, "Inverse Winding"}, |
| 98 | {SkPath::kInverseEvenOdd_FillType, "Inverse Even / Odd"}, |
| 99 | }; |
| 100 | struct StyleAndName { |
| 101 | SkPaint::Style fStyle; |
| 102 | const char* fName; |
| 103 | }; |
| 104 | static const StyleAndName gStyles[] = { |
| 105 | {SkPaint::kFill_Style, "Fill"}, |
| 106 | {SkPaint::kStroke_Style, "Stroke"}, |
| 107 | {SkPaint::kStrokeAndFill_Style, "Stroke And Fill"}, |
| 108 | }; |
| 109 | struct CapAndName { |
| 110 | SkPaint::Cap fCap; |
| 111 | SkPaint::Join fJoin; |
| 112 | const char* fName; |
| 113 | }; |
| 114 | static const CapAndName gCaps[] = { |
| 115 | {SkPaint::kButt_Cap, SkPaint::kBevel_Join, "Butt"}, |
| 116 | {SkPaint::kRound_Cap, SkPaint::kRound_Join, "Round"}, |
| 117 | {SkPaint::kSquare_Cap, SkPaint::kBevel_Join, "Square"} |
| 118 | }; |
| 119 | struct PathAndName { |
| 120 | SkPath fPath; |
| 121 | const char* fName; |
| 122 | }; |
| 123 | PathAndName path; |
| 124 | path.fPath.moveTo(25*SK_Scalar1, 10*SK_Scalar1); |
| 125 | path.fPath.cubicTo(40*SK_Scalar1, 20*SK_Scalar1, |
| 126 | 60*SK_Scalar1, 20*SK_Scalar1, |
| 127 | 75*SK_Scalar1, 10*SK_Scalar1); |
| 128 | path.fName = "moveTo-cubic"; |
| 129 | |
| 130 | SkPaint titlePaint; |
| 131 | titlePaint.setColor(SK_ColorBLACK); |
| 132 | titlePaint.setAntiAlias(true); |
caryclark | 5fb6bd4 | 2014-06-23 11:25:00 -0700 | [diff] [blame] | 133 | sk_tool_utils::set_portable_typeface(&titlePaint); |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 134 | titlePaint.setLCDRenderText(true); |
| 135 | titlePaint.setTextSize(15 * SK_Scalar1); |
| 136 | const char title[] = "Cubic Drawn Into Rectangle Clips With " |
| 137 | "Indicated Style, Fill and Linecaps, with stroke width 10"; |
| 138 | canvas->drawText(title, strlen(title), |
| 139 | 20 * SK_Scalar1, |
| 140 | 20 * SK_Scalar1, |
| 141 | titlePaint); |
| 142 | |
scroggo | f9d6101 | 2014-12-15 12:54:51 -0800 | [diff] [blame] | 143 | SkRandom rand; |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 144 | SkRect rect = SkRect::MakeWH(100*SK_Scalar1, 30*SK_Scalar1); |
| 145 | canvas->save(); |
| 146 | canvas->translate(10 * SK_Scalar1, 30 * SK_Scalar1); |
| 147 | canvas->save(); |
| 148 | for (size_t cap = 0; cap < SK_ARRAY_COUNT(gCaps); ++cap) { |
| 149 | if (0 < cap) { |
| 150 | canvas->translate((rect.width() + 40 * SK_Scalar1) * SK_ARRAY_COUNT(gStyles), 0); |
| 151 | } |
| 152 | canvas->save(); |
| 153 | for (size_t fill = 0; fill < SK_ARRAY_COUNT(gFills); ++fill) { |
| 154 | if (0 < fill) { |
| 155 | canvas->translate(0, rect.height() + 40 * SK_Scalar1); |
| 156 | } |
| 157 | canvas->save(); |
| 158 | for (size_t style = 0; style < SK_ARRAY_COUNT(gStyles); ++style) { |
| 159 | if (0 < style) { |
| 160 | canvas->translate(rect.width() + 40 * SK_Scalar1, 0); |
| 161 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 162 | |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 163 | SkColor color = 0xff007000; |
| 164 | this->drawPath(path.fPath, canvas, color, rect, |
| 165 | gCaps[cap].fCap, gCaps[cap].fJoin, gStyles[style].fStyle, |
| 166 | gFills[fill].fFill, SK_Scalar1*10); |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 167 | |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 168 | SkPaint rectPaint; |
| 169 | rectPaint.setColor(SK_ColorBLACK); |
| 170 | rectPaint.setStyle(SkPaint::kStroke_Style); |
| 171 | rectPaint.setStrokeWidth(-1); |
| 172 | rectPaint.setAntiAlias(true); |
| 173 | canvas->drawRect(rect, rectPaint); |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 174 | |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 175 | SkPaint labelPaint; |
| 176 | labelPaint.setColor(color); |
| 177 | labelPaint.setAntiAlias(true); |
caryclark | 5fb6bd4 | 2014-06-23 11:25:00 -0700 | [diff] [blame] | 178 | sk_tool_utils::set_portable_typeface(&labelPaint); |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 179 | labelPaint.setLCDRenderText(true); |
| 180 | labelPaint.setTextSize(10 * SK_Scalar1); |
| 181 | canvas->drawText(gStyles[style].fName, |
| 182 | strlen(gStyles[style].fName), |
| 183 | 0, rect.height() + 12 * SK_Scalar1, |
| 184 | labelPaint); |
| 185 | canvas->drawText(gFills[fill].fName, |
| 186 | strlen(gFills[fill].fName), |
| 187 | 0, rect.height() + 24 * SK_Scalar1, |
| 188 | labelPaint); |
| 189 | canvas->drawText(gCaps[cap].fName, |
| 190 | strlen(gCaps[cap].fName), |
| 191 | 0, rect.height() + 36 * SK_Scalar1, |
| 192 | labelPaint); |
| 193 | } |
| 194 | canvas->restore(); |
| 195 | } |
| 196 | canvas->restore(); |
| 197 | } |
| 198 | canvas->restore(); |
| 199 | canvas->restore(); |
| 200 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 201 | |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 202 | private: |
reed@google.com | 27b90fa | 2013-03-08 18:44:01 +0000 | [diff] [blame] | 203 | typedef skiagm::GM INHERITED; |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 204 | }; |
| 205 | |
reed@google.com | 27b90fa | 2013-03-08 18:44:01 +0000 | [diff] [blame] | 206 | class CubicClosePathGM : public skiagm::GM { |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 207 | public: |
| 208 | CubicClosePathGM() {} |
| 209 | |
| 210 | protected: |
mtklein | 72c9faa | 2015-01-09 10:06:39 -0800 | [diff] [blame^] | 211 | uint32_t onGetFlags() const SK_OVERRIDE { |
commit-bot@chromium.org | a90c680 | 2014-04-30 13:20:45 +0000 | [diff] [blame] | 212 | return kSkipTiled_Flag; |
| 213 | } |
| 214 | |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 215 | SkString onShortName() { |
| 216 | return SkString("cubicclosepath"); |
| 217 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 218 | |
reed@google.com | 27b90fa | 2013-03-08 18:44:01 +0000 | [diff] [blame] | 219 | SkISize onISize() { return SkISize::Make(1240, 390); } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 220 | |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 221 | void drawPath(SkPath& path,SkCanvas* canvas,SkColor color, |
| 222 | const SkRect& clip,SkPaint::Cap cap, SkPaint::Join join, |
| 223 | SkPaint::Style style, SkPath::FillType fill, |
| 224 | SkScalar strokeWidth) { |
| 225 | path.setFillType(fill); |
| 226 | SkPaint paint; |
| 227 | paint.setStrokeCap(cap); |
| 228 | paint.setStrokeWidth(strokeWidth); |
| 229 | paint.setStrokeJoin(join); |
| 230 | paint.setColor(color); |
| 231 | paint.setStyle(style); |
| 232 | canvas->save(); |
| 233 | canvas->clipRect(clip); |
| 234 | canvas->drawPath(path, paint); |
| 235 | canvas->restore(); |
| 236 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 237 | |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 238 | virtual void onDraw(SkCanvas* canvas) { |
| 239 | struct FillAndName { |
| 240 | SkPath::FillType fFill; |
| 241 | const char* fName; |
| 242 | }; |
| 243 | static const FillAndName gFills[] = { |
| 244 | {SkPath::kWinding_FillType, "Winding"}, |
| 245 | {SkPath::kEvenOdd_FillType, "Even / Odd"}, |
| 246 | {SkPath::kInverseWinding_FillType, "Inverse Winding"}, |
| 247 | {SkPath::kInverseEvenOdd_FillType, "Inverse Even / Odd"}, |
| 248 | }; |
| 249 | struct StyleAndName { |
| 250 | SkPaint::Style fStyle; |
| 251 | const char* fName; |
| 252 | }; |
| 253 | static const StyleAndName gStyles[] = { |
| 254 | {SkPaint::kFill_Style, "Fill"}, |
| 255 | {SkPaint::kStroke_Style, "Stroke"}, |
| 256 | {SkPaint::kStrokeAndFill_Style, "Stroke And Fill"}, |
| 257 | }; |
| 258 | struct CapAndName { |
| 259 | SkPaint::Cap fCap; |
| 260 | SkPaint::Join fJoin; |
| 261 | const char* fName; |
| 262 | }; |
| 263 | static const CapAndName gCaps[] = { |
| 264 | {SkPaint::kButt_Cap, SkPaint::kBevel_Join, "Butt"}, |
| 265 | {SkPaint::kRound_Cap, SkPaint::kRound_Join, "Round"}, |
| 266 | {SkPaint::kSquare_Cap, SkPaint::kBevel_Join, "Square"} |
| 267 | }; |
| 268 | struct PathAndName { |
| 269 | SkPath fPath; |
| 270 | const char* fName; |
| 271 | }; |
| 272 | PathAndName path; |
| 273 | path.fPath.moveTo(25*SK_Scalar1, 10*SK_Scalar1); |
| 274 | path.fPath.cubicTo(40*SK_Scalar1, 20*SK_Scalar1, |
| 275 | 60*SK_Scalar1, 20*SK_Scalar1, |
| 276 | 75*SK_Scalar1, 10*SK_Scalar1); |
| 277 | path.fPath.close(); |
| 278 | path.fName = "moveTo-cubic-close"; |
| 279 | |
| 280 | SkPaint titlePaint; |
| 281 | titlePaint.setColor(SK_ColorBLACK); |
| 282 | titlePaint.setAntiAlias(true); |
Cary Clark | 992c7b0 | 2014-07-31 08:58:44 -0400 | [diff] [blame] | 283 | sk_tool_utils::set_portable_typeface(&titlePaint); |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 284 | titlePaint.setLCDRenderText(true); |
| 285 | titlePaint.setTextSize(15 * SK_Scalar1); |
| 286 | const char title[] = "Cubic Closed Drawn Into Rectangle Clips With " |
| 287 | "Indicated Style, Fill and Linecaps, with stroke width 10"; |
| 288 | canvas->drawText(title, strlen(title), |
| 289 | 20 * SK_Scalar1, |
| 290 | 20 * SK_Scalar1, |
| 291 | titlePaint); |
| 292 | |
scroggo | f9d6101 | 2014-12-15 12:54:51 -0800 | [diff] [blame] | 293 | SkRandom rand; |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 294 | SkRect rect = SkRect::MakeWH(100*SK_Scalar1, 30*SK_Scalar1); |
| 295 | canvas->save(); |
| 296 | canvas->translate(10 * SK_Scalar1, 30 * SK_Scalar1); |
| 297 | canvas->save(); |
| 298 | for (size_t cap = 0; cap < SK_ARRAY_COUNT(gCaps); ++cap) { |
| 299 | if (0 < cap) { |
| 300 | canvas->translate((rect.width() + 40 * SK_Scalar1) * SK_ARRAY_COUNT(gStyles), 0); |
| 301 | } |
| 302 | canvas->save(); |
| 303 | for (size_t fill = 0; fill < SK_ARRAY_COUNT(gFills); ++fill) { |
| 304 | if (0 < fill) { |
| 305 | canvas->translate(0, rect.height() + 40 * SK_Scalar1); |
| 306 | } |
| 307 | canvas->save(); |
| 308 | for (size_t style = 0; style < SK_ARRAY_COUNT(gStyles); ++style) { |
| 309 | if (0 < style) { |
| 310 | canvas->translate(rect.width() + 40 * SK_Scalar1, 0); |
| 311 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 312 | |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 313 | SkColor color = 0xff007000; |
| 314 | this->drawPath(path.fPath, canvas, color, rect, |
| 315 | gCaps[cap].fCap, gCaps[cap].fJoin, gStyles[style].fStyle, |
| 316 | gFills[fill].fFill, SK_Scalar1*10); |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 317 | |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 318 | SkPaint rectPaint; |
| 319 | rectPaint.setColor(SK_ColorBLACK); |
| 320 | rectPaint.setStyle(SkPaint::kStroke_Style); |
| 321 | rectPaint.setStrokeWidth(-1); |
| 322 | rectPaint.setAntiAlias(true); |
| 323 | canvas->drawRect(rect, rectPaint); |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 324 | |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 325 | SkPaint labelPaint; |
| 326 | labelPaint.setColor(color); |
| 327 | labelPaint.setAntiAlias(true); |
Cary Clark | 992c7b0 | 2014-07-31 08:58:44 -0400 | [diff] [blame] | 328 | sk_tool_utils::set_portable_typeface(&labelPaint); |
schenney@chromium.org | 45cbfdd | 2011-12-20 21:48:14 +0000 | [diff] [blame] | 329 | labelPaint.setLCDRenderText(true); |
| 330 | labelPaint.setTextSize(10 * SK_Scalar1); |
| 331 | canvas->drawText(gStyles[style].fName, |
| 332 | strlen(gStyles[style].fName), |
| 333 | 0, rect.height() + 12 * SK_Scalar1, |
| 334 | labelPaint); |
| 335 | canvas->drawText(gFills[fill].fName, |
| 336 | strlen(gFills[fill].fName), |
| 337 | 0, rect.height() + 24 * SK_Scalar1, |
| 338 | labelPaint); |
| 339 | canvas->drawText(gCaps[cap].fName, |
| 340 | strlen(gCaps[cap].fName), |
| 341 | 0, rect.height() + 36 * SK_Scalar1, |
| 342 | labelPaint); |
schenney@chromium.org | 4da06ab | 2011-12-20 15:14:18 +0000 | [diff] [blame] | 343 | } |
| 344 | canvas->restore(); |
| 345 | } |
| 346 | canvas->restore(); |
| 347 | } |
| 348 | canvas->restore(); |
| 349 | canvas->restore(); |
| 350 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 351 | |
schenney@chromium.org | 4da06ab | 2011-12-20 15:14:18 +0000 | [diff] [blame] | 352 | private: |
reed@google.com | 27b90fa | 2013-03-08 18:44:01 +0000 | [diff] [blame] | 353 | typedef skiagm::GM INHERITED; |
schenney@chromium.org | 4da06ab | 2011-12-20 15:14:18 +0000 | [diff] [blame] | 354 | }; |
| 355 | |
| 356 | ////////////////////////////////////////////////////////////////////////////// |
| 357 | |
reed@google.com | 27b90fa | 2013-03-08 18:44:01 +0000 | [diff] [blame] | 358 | DEF_GM( return new CubicPathGM; ) |
| 359 | DEF_GM( return new CubicClosePathGM; ) |
reed@google.com | 22999c6 | 2013-05-23 19:30:48 +0000 | [diff] [blame] | 360 | DEF_GM( return new ClippedCubicGM; ) |