mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 1 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 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. |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 8 | #include "gm.h" |
Mike Klein | 33d2055 | 2017-03-22 13:47:51 -0400 | [diff] [blame] | 9 | #include "sk_tool_utils.h" |
bungeman | d3ebb48 | 2015-08-05 13:57:49 -0700 | [diff] [blame] | 10 | #include "SkPath.h" |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 11 | #include "SkRandom.h" |
caryclark | 5cb00a9 | 2015-08-26 09:04:55 -0700 | [diff] [blame] | 12 | #include "SkDashPathEffect.h" |
| 13 | #include "SkParsePath.h" |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 14 | |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 15 | #define W 400 |
| 16 | #define H 400 |
| 17 | #define N 50 |
| 18 | |
mtklein | dbfd7ab | 2016-09-01 11:24:54 -0700 | [diff] [blame] | 19 | constexpr SkScalar SW = SkIntToScalar(W); |
| 20 | constexpr SkScalar SH = SkIntToScalar(H); |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 21 | |
scroggo | f9d6101 | 2014-12-15 12:54:51 -0800 | [diff] [blame] | 22 | static void rnd_rect(SkRect* r, SkPaint* paint, SkRandom& rand) { |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 23 | SkScalar x = rand.nextUScalar1() * W; |
| 24 | SkScalar y = rand.nextUScalar1() * H; |
| 25 | SkScalar w = rand.nextUScalar1() * (W >> 2); |
| 26 | SkScalar h = rand.nextUScalar1() * (H >> 2); |
epoger@google.com | 17b7894 | 2011-08-26 14:40:38 +0000 | [diff] [blame] | 27 | SkScalar hoffset = rand.nextSScalar1(); |
| 28 | SkScalar woffset = rand.nextSScalar1(); |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 29 | |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 30 | r->set(x, y, x + w, y + h); |
epoger@google.com | 17b7894 | 2011-08-26 14:40:38 +0000 | [diff] [blame] | 31 | r->offset(-w/2 + woffset, -h/2 + hoffset); |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 32 | |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 33 | paint->setColor(rand.nextU()); |
| 34 | paint->setAlpha(0xFF); |
| 35 | } |
| 36 | |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 37 | |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 38 | class StrokesGM : public skiagm::GM { |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 39 | public: |
| 40 | StrokesGM() {} |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 41 | |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 42 | protected: |
commit-bot@chromium.org | a90c680 | 2014-04-30 13:20:45 +0000 | [diff] [blame] | 43 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 44 | SkString onShortName() override { |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 45 | return SkString("strokes_round"); |
| 46 | } |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 47 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 48 | SkISize onISize() override { |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 49 | return SkISize::Make(W, H*2); |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 50 | } |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 51 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 52 | void onDraw(SkCanvas* canvas) override { |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 53 | SkPaint paint; |
| 54 | paint.setStyle(SkPaint::kStroke_Style); |
| 55 | paint.setStrokeWidth(SkIntToScalar(9)/2); |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 56 | |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 57 | for (int y = 0; y < 2; y++) { |
| 58 | paint.setAntiAlias(!!y); |
| 59 | SkAutoCanvasRestore acr(canvas, true); |
| 60 | canvas->translate(0, SH * y); |
| 61 | canvas->clipRect(SkRect::MakeLTRB( |
| 62 | SkIntToScalar(2), SkIntToScalar(2) |
| 63 | , SW - SkIntToScalar(2), SH - SkIntToScalar(2) |
| 64 | )); |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 65 | |
scroggo | f9d6101 | 2014-12-15 12:54:51 -0800 | [diff] [blame] | 66 | SkRandom rand; |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 67 | for (int i = 0; i < N; i++) { |
| 68 | SkRect r; |
| 69 | rnd_rect(&r, &paint, rand); |
| 70 | canvas->drawOval(r, paint); |
| 71 | rnd_rect(&r, &paint, rand); |
| 72 | canvas->drawRoundRect(r, r.width()/4, r.height()/4, paint); |
| 73 | rnd_rect(&r, &paint, rand); |
| 74 | } |
| 75 | } |
| 76 | } |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 77 | |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 78 | private: |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 79 | typedef skiagm::GM INHERITED; |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 80 | }; |
| 81 | |
caryclark | 5cb00a9 | 2015-08-26 09:04:55 -0700 | [diff] [blame] | 82 | /* See |
| 83 | https://code.google.com/p/chromium/issues/detail?id=422974 and |
| 84 | http://jsfiddle.net/1xnku3sg/2/ |
| 85 | */ |
| 86 | class ZeroLenStrokesGM : public skiagm::GM { |
| 87 | SkPath fMoveHfPath, fMoveZfPath, fDashedfPath, fRefPath[4]; |
caryclark | 6651a32 | 2015-09-09 13:20:49 -0700 | [diff] [blame] | 88 | SkPath fCubicPath, fQuadPath, fLinePath; |
caryclark | 5cb00a9 | 2015-08-26 09:04:55 -0700 | [diff] [blame] | 89 | protected: |
| 90 | void onOnceBeforeDraw() override { |
| 91 | |
| 92 | SkAssertResult(SkParsePath::FromSVGString("M0,0h0M10,0h0M20,0h0", &fMoveHfPath)); |
| 93 | SkAssertResult(SkParsePath::FromSVGString("M0,0zM10,0zM20,0z", &fMoveZfPath)); |
| 94 | SkAssertResult(SkParsePath::FromSVGString("M0,0h25", &fDashedfPath)); |
caryclark | 6651a32 | 2015-09-09 13:20:49 -0700 | [diff] [blame] | 95 | SkAssertResult(SkParsePath::FromSVGString("M 0 0 C 0 0 0 0 0 0", &fCubicPath)); |
| 96 | SkAssertResult(SkParsePath::FromSVGString("M 0 0 Q 0 0 0 0", &fQuadPath)); |
| 97 | SkAssertResult(SkParsePath::FromSVGString("M 0 0 L 0 0", &fLinePath)); |
caryclark | 5cb00a9 | 2015-08-26 09:04:55 -0700 | [diff] [blame] | 98 | |
| 99 | for (int i = 0; i < 3; ++i) { |
| 100 | fRefPath[0].addCircle(i * 10.f, 0, 5); |
| 101 | fRefPath[1].addCircle(i * 10.f, 0, 10); |
| 102 | fRefPath[2].addRect(i * 10.f - 4, -2, i * 10.f + 4, 6); |
| 103 | fRefPath[3].addRect(i * 10.f - 10, -10, i * 10.f + 10, 10); |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | SkString onShortName() override { |
| 108 | return SkString("zeroPath"); |
| 109 | } |
| 110 | |
| 111 | SkISize onISize() override { |
| 112 | return SkISize::Make(W, H*2); |
| 113 | } |
| 114 | |
| 115 | void onDraw(SkCanvas* canvas) override { |
| 116 | SkPaint fillPaint, strokePaint, dashPaint; |
| 117 | fillPaint.setAntiAlias(true); |
| 118 | strokePaint = fillPaint; |
| 119 | strokePaint.setStyle(SkPaint::kStroke_Style); |
| 120 | for (int i = 0; i < 2; ++i) { |
| 121 | fillPaint.setAlpha(255); |
| 122 | strokePaint.setAlpha(255); |
| 123 | strokePaint.setStrokeWidth(i ? 8.f : 10.f); |
| 124 | strokePaint.setStrokeCap(i ? SkPaint::kSquare_Cap : SkPaint::kRound_Cap); |
| 125 | canvas->save(); |
| 126 | canvas->translate(10 + i * 100.f, 10); |
| 127 | canvas->drawPath(fMoveHfPath, strokePaint); |
| 128 | canvas->translate(0, 20); |
| 129 | canvas->drawPath(fMoveZfPath, strokePaint); |
| 130 | dashPaint = strokePaint; |
| 131 | const SkScalar intervals[] = { 0, 10 }; |
reed | a439334 | 2016-03-18 11:22:57 -0700 | [diff] [blame] | 132 | dashPaint.setPathEffect(SkDashPathEffect::Make(intervals, 2, 0)); |
caryclark | 5cb00a9 | 2015-08-26 09:04:55 -0700 | [diff] [blame] | 133 | SkPath fillPath; |
| 134 | dashPaint.getFillPath(fDashedfPath, &fillPath); |
| 135 | canvas->translate(0, 20); |
| 136 | canvas->drawPath(fDashedfPath, dashPaint); |
| 137 | canvas->translate(0, 20); |
| 138 | canvas->drawPath(fRefPath[i * 2], fillPaint); |
| 139 | strokePaint.setStrokeWidth(20); |
| 140 | strokePaint.setAlpha(127); |
| 141 | canvas->translate(0, 50); |
| 142 | canvas->drawPath(fMoveHfPath, strokePaint); |
| 143 | canvas->translate(0, 30); |
| 144 | canvas->drawPath(fMoveZfPath, strokePaint); |
| 145 | canvas->translate(0, 30); |
| 146 | fillPaint.setAlpha(127); |
| 147 | canvas->drawPath(fRefPath[1 + i * 2], fillPaint); |
caryclark | 6651a32 | 2015-09-09 13:20:49 -0700 | [diff] [blame] | 148 | canvas->translate(0, 30); |
| 149 | canvas->drawPath(fCubicPath, strokePaint); |
| 150 | canvas->translate(0, 30); |
| 151 | canvas->drawPath(fQuadPath, strokePaint); |
| 152 | canvas->translate(0, 30); |
| 153 | canvas->drawPath(fLinePath, strokePaint); |
caryclark | 5cb00a9 | 2015-08-26 09:04:55 -0700 | [diff] [blame] | 154 | canvas->restore(); |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | private: |
| 159 | typedef skiagm::GM INHERITED; |
| 160 | }; |
| 161 | |
caryclark | 950305e | 2015-10-26 08:17:04 -0700 | [diff] [blame] | 162 | class TeenyStrokesGM : public skiagm::GM { |
| 163 | |
| 164 | SkString onShortName() override { |
| 165 | return SkString("teenyStrokes"); |
| 166 | } |
| 167 | |
| 168 | SkISize onISize() override { |
| 169 | return SkISize::Make(W, H*2); |
| 170 | } |
| 171 | |
| 172 | static void line(SkScalar scale, SkCanvas* canvas, SkColor color) { |
| 173 | SkPaint p; |
| 174 | p.setAntiAlias(true); |
| 175 | p.setStyle(SkPaint::kStroke_Style); |
| 176 | p.setColor(color); |
| 177 | canvas->translate(50, 0); |
| 178 | canvas->save(); |
| 179 | p.setStrokeWidth(scale * 5); |
| 180 | canvas->scale(1 / scale, 1 / scale); |
| 181 | canvas->drawLine(20 * scale, 20 * scale, 20 * scale, 100 * scale, p); |
| 182 | canvas->drawLine(20 * scale, 20 * scale, 100 * scale, 100 * scale, p); |
| 183 | canvas->restore(); |
| 184 | } |
| 185 | |
| 186 | void onDraw(SkCanvas* canvas) override { |
| 187 | line(0.00005f, canvas, SK_ColorBLACK); |
| 188 | line(0.000045f, canvas, SK_ColorRED); |
| 189 | line(0.0000035f, canvas, SK_ColorGREEN); |
| 190 | line(0.000003f, canvas, SK_ColorBLUE); |
| 191 | line(0.000002f, canvas, SK_ColorBLACK); |
| 192 | } |
| 193 | private: |
| 194 | typedef skiagm::GM INHERITED; |
| 195 | }; |
| 196 | |
caryclark | b775e91 | 2015-11-30 13:47:11 -0800 | [diff] [blame] | 197 | DEF_SIMPLE_GM(CubicStroke, canvas, 384, 384) { |
| 198 | SkPaint p; |
| 199 | p.setAntiAlias(true); |
| 200 | p.setStyle(SkPaint::kStroke_Style); |
| 201 | p.setStrokeWidth(1.0720f); |
| 202 | SkPath path; |
| 203 | path.moveTo(-6000,-6000); |
| 204 | path.cubicTo(-3500,5500,-500,5500,2500,-6500); |
| 205 | canvas->drawPath(path, p); |
| 206 | p.setStrokeWidth(1.0721f); |
| 207 | canvas->translate(10, 10); |
| 208 | canvas->drawPath(path, p); |
| 209 | p.setStrokeWidth(1.0722f); |
| 210 | canvas->translate(10, 10); |
| 211 | canvas->drawPath(path, p); |
| 212 | } |
caryclark | 950305e | 2015-10-26 08:17:04 -0700 | [diff] [blame] | 213 | |
caryclark | 57eecc1 | 2015-12-08 04:29:45 -0800 | [diff] [blame] | 214 | DEF_SIMPLE_GM(zerolinestroke, canvas, 90, 120) { |
| 215 | SkPaint paint; |
| 216 | paint.setStyle(SkPaint::kStroke_Style); |
| 217 | paint.setStrokeWidth(20); |
| 218 | paint.setAntiAlias(true); |
| 219 | paint.setStrokeCap(SkPaint::kRound_Cap); |
| 220 | |
| 221 | SkPath path; |
| 222 | path.moveTo(30, 90); |
| 223 | path.lineTo(30, 90); |
| 224 | path.lineTo(60, 90); |
| 225 | path.lineTo(60, 90); |
| 226 | canvas->drawPath(path, paint); |
| 227 | |
| 228 | path.reset(); |
| 229 | path.moveTo(30, 30); |
| 230 | path.lineTo(60, 30); |
| 231 | canvas->drawPath(path, paint); |
| 232 | |
| 233 | path.reset(); |
| 234 | path.moveTo(30, 60); |
| 235 | path.lineTo(30, 60); |
| 236 | path.lineTo(60, 60); |
| 237 | canvas->drawPath(path, paint); |
| 238 | } |
| 239 | |
caryclark | 40b7d3b | 2015-12-22 06:13:33 -0800 | [diff] [blame] | 240 | DEF_SIMPLE_GM(quadcap, canvas, 200, 200) { |
| 241 | SkPaint p; |
| 242 | p.setAntiAlias(true); |
| 243 | p.setStyle(SkPaint::kStroke_Style); |
| 244 | p.setStrokeWidth(0); |
| 245 | SkPath path; |
| 246 | SkPoint pts[] = {{105.738571f,13.126318f}, |
halcanary | 9d524f2 | 2016-03-29 09:03:52 -0700 | [diff] [blame] | 247 | {105.738571f,13.126318f}, |
caryclark | 40b7d3b | 2015-12-22 06:13:33 -0800 | [diff] [blame] | 248 | {123.753784f,1.f}}; |
| 249 | SkVector tangent = pts[1] - pts[2]; |
| 250 | tangent.normalize(); |
| 251 | SkPoint pts2[3]; |
| 252 | memcpy(pts2, pts, sizeof(pts)); |
| 253 | const SkScalar capOutset = SK_ScalarPI / 8; |
| 254 | pts2[0].fX += tangent.fX * capOutset; |
| 255 | pts2[0].fY += tangent.fY * capOutset; |
| 256 | pts2[1].fX += tangent.fX * capOutset; |
| 257 | pts2[1].fY += tangent.fY * capOutset; |
| 258 | pts2[2].fX += -tangent.fX * capOutset; |
| 259 | pts2[2].fY += -tangent.fY * capOutset; |
| 260 | path.moveTo(pts2[0]); |
| 261 | path.quadTo(pts2[1], pts2[2]); |
| 262 | canvas->drawPath(path, p); |
| 263 | |
| 264 | path.reset(); |
| 265 | path.moveTo(pts[0]); |
| 266 | path.quadTo(pts[1], pts[2]); |
| 267 | p.setStrokeCap(SkPaint::kRound_Cap); |
| 268 | canvas->translate(30, 0); |
| 269 | canvas->drawPath(path, p); |
| 270 | } |
| 271 | |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 272 | class Strokes2GM : public skiagm::GM { |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 273 | SkPath fPath; |
caryclark | 63c684a | 2015-02-25 09:04:04 -0800 | [diff] [blame] | 274 | protected: |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 275 | void onOnceBeforeDraw() override { |
scroggo | f9d6101 | 2014-12-15 12:54:51 -0800 | [diff] [blame] | 276 | SkRandom rand; |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 277 | fPath.moveTo(0, 0); |
| 278 | for (int i = 0; i < 13; i++) { |
| 279 | SkScalar x = rand.nextUScalar1() * (W >> 1); |
| 280 | SkScalar y = rand.nextUScalar1() * (H >> 1); |
| 281 | fPath.lineTo(x, y); |
| 282 | } |
| 283 | } |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 284 | |
commit-bot@chromium.org | a90c680 | 2014-04-30 13:20:45 +0000 | [diff] [blame] | 285 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 286 | SkString onShortName() override { |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 287 | return SkString("strokes_poly"); |
| 288 | } |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 289 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 290 | SkISize onISize() override { |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 291 | return SkISize::Make(W, H*2); |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 292 | } |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 293 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 294 | void onDraw(SkCanvas* canvas) override { |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 295 | canvas->drawColor(SK_ColorWHITE); |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 296 | |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 297 | SkPaint paint; |
| 298 | paint.setStyle(SkPaint::kStroke_Style); |
| 299 | paint.setStrokeWidth(SkIntToScalar(9)/2); |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 300 | |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 301 | for (int y = 0; y < 2; y++) { |
| 302 | paint.setAntiAlias(!!y); |
| 303 | SkAutoCanvasRestore acr(canvas, true); |
| 304 | canvas->translate(0, SH * y); |
| 305 | canvas->clipRect(SkRect::MakeLTRB(SkIntToScalar(2), |
| 306 | SkIntToScalar(2), |
| 307 | SW - SkIntToScalar(2), |
| 308 | SH - SkIntToScalar(2))); |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 309 | |
scroggo | f9d6101 | 2014-12-15 12:54:51 -0800 | [diff] [blame] | 310 | SkRandom rand; |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 311 | for (int i = 0; i < N/2; i++) { |
| 312 | SkRect r; |
| 313 | rnd_rect(&r, &paint, rand); |
bungeman | 7438bfc | 2016-07-12 15:01:19 -0700 | [diff] [blame] | 314 | canvas->rotate(SkIntToScalar(15), SW/2, SH/2); |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 315 | canvas->drawPath(fPath, paint); |
| 316 | } |
| 317 | } |
| 318 | } |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 319 | |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 320 | private: |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 321 | typedef skiagm::GM INHERITED; |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 322 | }; |
| 323 | |
| 324 | ////////////////////////////////////////////////////////////////////////////// |
| 325 | |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 326 | static SkRect inset(const SkRect& r) { |
| 327 | SkRect rr(r); |
| 328 | rr.inset(r.width()/10, r.height()/10); |
| 329 | return rr; |
mike@reedtribe.org | f2c21cd | 2011-06-18 00:15:04 +0000 | [diff] [blame] | 330 | } |
| 331 | |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 332 | class Strokes3GM : public skiagm::GM { |
| 333 | static void make0(SkPath* path, const SkRect& bounds, SkString* title) { |
| 334 | path->addRect(bounds, SkPath::kCW_Direction); |
| 335 | path->addRect(inset(bounds), SkPath::kCW_Direction); |
| 336 | title->set("CW CW"); |
| 337 | } |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 338 | |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 339 | static void make1(SkPath* path, const SkRect& bounds, SkString* title) { |
| 340 | path->addRect(bounds, SkPath::kCW_Direction); |
| 341 | path->addRect(inset(bounds), SkPath::kCCW_Direction); |
| 342 | title->set("CW CCW"); |
| 343 | } |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 344 | |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 345 | static void make2(SkPath* path, const SkRect& bounds, SkString* title) { |
| 346 | path->addOval(bounds, SkPath::kCW_Direction); |
| 347 | path->addOval(inset(bounds), SkPath::kCW_Direction); |
| 348 | title->set("CW CW"); |
| 349 | } |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 350 | |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 351 | static void make3(SkPath* path, const SkRect& bounds, SkString* title) { |
| 352 | path->addOval(bounds, SkPath::kCW_Direction); |
| 353 | path->addOval(inset(bounds), SkPath::kCCW_Direction); |
| 354 | title->set("CW CCW"); |
| 355 | } |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 356 | |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 357 | static void make4(SkPath* path, const SkRect& bounds, SkString* title) { |
| 358 | path->addRect(bounds, SkPath::kCW_Direction); |
| 359 | SkRect r = bounds; |
| 360 | r.inset(bounds.width() / 10, -bounds.height() / 10); |
| 361 | path->addOval(r, SkPath::kCW_Direction); |
| 362 | title->set("CW CW"); |
| 363 | } |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 364 | |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 365 | static void make5(SkPath* path, const SkRect& bounds, SkString* title) { |
| 366 | path->addRect(bounds, SkPath::kCW_Direction); |
| 367 | SkRect r = bounds; |
| 368 | r.inset(bounds.width() / 10, -bounds.height() / 10); |
| 369 | path->addOval(r, SkPath::kCCW_Direction); |
| 370 | title->set("CW CCW"); |
| 371 | } |
| 372 | |
| 373 | public: |
| 374 | Strokes3GM() {} |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 375 | |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 376 | protected: |
commit-bot@chromium.org | a90c680 | 2014-04-30 13:20:45 +0000 | [diff] [blame] | 377 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 378 | SkString onShortName() override { |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 379 | return SkString("strokes3"); |
| 380 | } |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 381 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 382 | SkISize onISize() override { |
caryclark | 3760457 | 2015-02-23 06:51:04 -0800 | [diff] [blame] | 383 | return SkISize::Make(1500, 1500); |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 384 | } |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 385 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 386 | void onDraw(SkCanvas* canvas) override { |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 387 | SkPaint origPaint; |
| 388 | origPaint.setAntiAlias(true); |
| 389 | origPaint.setStyle(SkPaint::kStroke_Style); |
| 390 | SkPaint fillPaint(origPaint); |
| 391 | fillPaint.setColor(SK_ColorRED); |
| 392 | SkPaint strokePaint(origPaint); |
caryclark | 1259601 | 2015-07-29 05:27:47 -0700 | [diff] [blame] | 393 | strokePaint.setColor(sk_tool_utils::color_to_565(0xFF4444FF)); |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 394 | |
| 395 | void (*procs[])(SkPath*, const SkRect&, SkString*) = { |
| 396 | make0, make1, make2, make3, make4, make5 |
| 397 | }; |
| 398 | |
caryclark | 3760457 | 2015-02-23 06:51:04 -0800 | [diff] [blame] | 399 | canvas->translate(SkIntToScalar(20), SkIntToScalar(80)); |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 400 | |
| 401 | SkRect bounds = SkRect::MakeWH(SkIntToScalar(50), SkIntToScalar(50)); |
| 402 | SkScalar dx = bounds.width() * 4/3; |
| 403 | SkScalar dy = bounds.height() * 5; |
| 404 | |
| 405 | for (size_t i = 0; i < SK_ARRAY_COUNT(procs); ++i) { |
| 406 | SkPath orig; |
| 407 | SkString str; |
| 408 | procs[i](&orig, bounds, &str); |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 409 | |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 410 | canvas->save(); |
| 411 | for (int j = 0; j < 13; ++j) { |
| 412 | strokePaint.setStrokeWidth(SK_Scalar1 * j * j); |
| 413 | canvas->drawPath(orig, strokePaint); |
| 414 | canvas->drawPath(orig, origPaint); |
| 415 | SkPath fill; |
| 416 | strokePaint.getFillPath(orig, &fill); |
| 417 | canvas->drawPath(fill, fillPaint); |
| 418 | canvas->translate(dx + strokePaint.getStrokeWidth(), 0); |
| 419 | } |
| 420 | canvas->restore(); |
| 421 | canvas->translate(0, dy); |
| 422 | } |
| 423 | } |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 424 | |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 425 | private: |
| 426 | typedef skiagm::GM INHERITED; |
| 427 | }; |
| 428 | |
caryclark | 612f70d | 2015-05-19 11:05:37 -0700 | [diff] [blame] | 429 | class Strokes4GM : public skiagm::GM { |
| 430 | public: |
| 431 | Strokes4GM() {} |
| 432 | |
| 433 | protected: |
| 434 | |
| 435 | SkString onShortName() override { |
| 436 | return SkString("strokes_zoomed"); |
| 437 | } |
| 438 | |
| 439 | SkISize onISize() override { |
| 440 | return SkISize::Make(W, H*2); |
| 441 | } |
| 442 | |
| 443 | void onDraw(SkCanvas* canvas) override { |
| 444 | SkPaint paint; |
| 445 | paint.setStyle(SkPaint::kStroke_Style); |
| 446 | paint.setStrokeWidth(0.055f); |
halcanary | 9d524f2 | 2016-03-29 09:03:52 -0700 | [diff] [blame] | 447 | |
caryclark | 612f70d | 2015-05-19 11:05:37 -0700 | [diff] [blame] | 448 | canvas->scale(1000, 1000); |
| 449 | canvas->drawCircle(0, 2, 1.97f, paint); |
| 450 | } |
| 451 | |
| 452 | private: |
| 453 | typedef skiagm::GM INHERITED; |
| 454 | }; |
| 455 | |
caryclark | 45398df | 2015-08-25 13:19:06 -0700 | [diff] [blame] | 456 | // Test stroking for curves that produce degenerate tangents when t is 0 or 1 (see bug 4191) |
| 457 | class Strokes5GM : public skiagm::GM { |
| 458 | public: |
| 459 | Strokes5GM() {} |
| 460 | |
| 461 | protected: |
| 462 | |
| 463 | SkString onShortName() override { |
| 464 | return SkString("zero_control_stroke"); |
| 465 | } |
| 466 | |
| 467 | SkISize onISize() override { |
| 468 | return SkISize::Make(W, H*2); |
| 469 | } |
| 470 | |
| 471 | void onDraw(SkCanvas* canvas) override { |
| 472 | SkPaint p; |
| 473 | p.setColor(SK_ColorRED); |
| 474 | p.setAntiAlias(true); |
| 475 | p.setStyle(SkPaint::kStroke_Style); |
| 476 | p.setStrokeWidth(40); |
| 477 | p.setStrokeCap(SkPaint::kButt_Cap); |
| 478 | |
| 479 | SkPath path; |
| 480 | path.moveTo(157.474f,111.753f); |
| 481 | path.cubicTo(128.5f,111.5f,35.5f,29.5f,35.5f,29.5f); |
| 482 | canvas->drawPath(path, p); |
| 483 | path.reset(); |
| 484 | path.moveTo(250, 50); |
| 485 | path.quadTo(280, 80, 280, 80); |
| 486 | canvas->drawPath(path, p); |
| 487 | path.reset(); |
| 488 | path.moveTo(150, 50); |
| 489 | path.conicTo(180, 80, 180, 80, 0.707f); |
| 490 | canvas->drawPath(path, p); |
| 491 | |
| 492 | path.reset(); |
| 493 | path.moveTo(157.474f,311.753f); |
| 494 | path.cubicTo(157.474f,311.753f,85.5f,229.5f,35.5f,229.5f); |
| 495 | canvas->drawPath(path, p); |
| 496 | path.reset(); |
| 497 | path.moveTo(280, 250); |
| 498 | path.quadTo(280, 250, 310, 280); |
| 499 | canvas->drawPath(path, p); |
| 500 | path.reset(); |
| 501 | path.moveTo(180, 250); |
| 502 | path.conicTo(180, 250, 210, 280, 0.707f); |
| 503 | canvas->drawPath(path, p); |
| 504 | } |
| 505 | |
| 506 | private: |
| 507 | typedef skiagm::GM INHERITED; |
| 508 | }; |
| 509 | |
caryclark | 612f70d | 2015-05-19 11:05:37 -0700 | [diff] [blame] | 510 | |
reed@google.com | 4384fab | 2012-06-05 16:14:23 +0000 | [diff] [blame] | 511 | ////////////////////////////////////////////////////////////////////////////// |
| 512 | |
scroggo | 96f16e8 | 2015-12-10 13:31:59 -0800 | [diff] [blame] | 513 | DEF_GM( return new StrokesGM; ) |
| 514 | DEF_GM( return new Strokes2GM; ) |
| 515 | DEF_GM( return new Strokes3GM; ) |
| 516 | DEF_GM( return new Strokes4GM; ) |
| 517 | DEF_GM( return new Strokes5GM; ) |
caryclark | 5cb00a9 | 2015-08-26 09:04:55 -0700 | [diff] [blame] | 518 | |
halcanary | 385fe4d | 2015-08-26 13:07:48 -0700 | [diff] [blame] | 519 | DEF_GM( return new ZeroLenStrokesGM; ) |
caryclark | 950305e | 2015-10-26 08:17:04 -0700 | [diff] [blame] | 520 | DEF_GM( return new TeenyStrokesGM; ) |
Cary Clark | 0b1df4b | 2017-12-13 12:47:15 -0500 | [diff] [blame] | 521 | |
| 522 | DEF_SIMPLE_GM(zerolinedash, canvas, 256, 256) { |
| 523 | canvas->clear(SK_ColorWHITE); |
| 524 | |
| 525 | SkPaint paint; |
| 526 | paint.setColor(SkColorSetARGB(255, 0, 0, 0)); |
| 527 | paint.setStrokeWidth(11); |
| 528 | paint.setStrokeCap(SkPaint::kRound_Cap); |
| 529 | paint.setStrokeJoin(SkPaint::kBevel_Join); |
| 530 | |
| 531 | SkScalar dash_pattern[] = {1, 5}; |
| 532 | paint.setPathEffect(SkDashPathEffect::Make(dash_pattern, 2, 0)); |
| 533 | |
| 534 | canvas->drawLine(100, 100, 100, 100, paint); |
| 535 | } |
Greg Daniel | 9838b49 | 2017-12-21 14:55:00 +0000 | [diff] [blame] | 536 | |
| 537 | #ifdef PDF_IS_FIXED_SO_THIS_DOESNT_BREAK_IT |
| 538 | DEF_SIMPLE_GM(longrect_dash, canvas, 250, 250) { |
| 539 | canvas->clear(SK_ColorWHITE); |
| 540 | |
| 541 | SkPaint paint; |
| 542 | paint.setColor(SkColorSetARGB(255, 0, 0, 0)); |
| 543 | paint.setStrokeWidth(5); |
| 544 | paint.setStrokeCap(SkPaint::kRound_Cap); |
| 545 | paint.setStrokeJoin(SkPaint::kBevel_Join); |
| 546 | paint.setStyle(SkPaint::kStroke_Style); |
| 547 | SkScalar dash_pattern[] = {1, 5}; |
| 548 | paint.setPathEffect(SkDashPathEffect::Make(dash_pattern, 2, 0)); |
| 549 | // try all combinations of stretching bounds |
| 550 | for (auto left : { 20.f, -100001.f } ) { |
| 551 | for (auto top : { 20.f, -100001.f } ) { |
| 552 | for (auto right : { 40.f, 100001.f } ) { |
| 553 | for (auto bottom : { 40.f, 100001.f } ) { |
| 554 | canvas->save(); |
| 555 | canvas->clipRect({10, 10, 50, 50}); |
| 556 | canvas->drawRect({left, top, right, bottom}, paint); |
| 557 | canvas->restore(); |
| 558 | canvas->translate(60, 0); |
| 559 | } |
| 560 | } |
| 561 | canvas->translate(-60 * 4, 60); |
| 562 | } |
| 563 | } |
| 564 | } |
| 565 | #endif |
Cary Clark | a0e30b1 | 2018-02-02 11:02:46 -0500 | [diff] [blame] | 566 | |
| 567 | DEF_SIMPLE_GM(bigconic, canvas, 250, 250) { |
| 568 | SkPaint paint; |
| 569 | SkPath path; |
| 570 | path.setFillType(SkPath::kWinding_FillType); |
| 571 | path.moveTo(SkBits2Float(0x7f07a5af), SkBits2Float(0xff07ff1d)); // 1.80306e+38f, -1.8077e+38f |
| 572 | path.lineTo(SkBits2Float(0x7edf4b2d), SkBits2Float(0xfedffe0a)); // 1.48404e+38f, -1.48868e+38f |
| 573 | path.lineTo(SkBits2Float(0x7edf4585), SkBits2Float(0xfee003b2)); // 1.48389e+38f, -1.48883e+38f |
| 574 | path.lineTo(SkBits2Float(0x7ef348e9), SkBits2Float(0xfef403c6)); // 1.6169e+38f, -1.62176e+38f |
| 575 | path.lineTo(SkBits2Float(0x7ef74c4e), SkBits2Float(0xfef803cb)); // 1.64358e+38f, -1.64834e+38f |
| 576 | path.conicTo(SkBits2Float(0x7ef74f23), SkBits2Float(0xfef8069e), SkBits2Float(0x7ef751f6), SkBits2Float(0xfef803c9), SkBits2Float(0x3f3504f3)); // 1.64365e+38f, -1.64841e+38f, 1.64372e+38f, -1.64834e+38f, 0.707107f |
| 577 | path.conicTo(SkBits2Float(0x7ef754c8), SkBits2Float(0xfef800f5), SkBits2Float(0x7ef751f5), SkBits2Float(0xfef7fe22), SkBits2Float(0x3f353472)); // 1.6438e+38f, -1.64827e+38f, 1.64372e+38f, -1.64819e+38f, 0.707832f |
| 578 | path.lineTo(SkBits2Float(0x7edb57a9), SkBits2Float(0xfedbfe06)); // 1.45778e+38f, -1.4621e+38f |
| 579 | path.lineTo(SkBits2Float(0x7e875976), SkBits2Float(0xfe87fdb3)); // 8.99551e+37f, -9.03815e+37f |
| 580 | path.lineTo(SkBits2Float(0x7ded5c2b), SkBits2Float(0xfdeff59e)); // 3.94382e+37f, -3.98701e+37f |
| 581 | path.lineTo(SkBits2Float(0x7d7a78a7), SkBits2Float(0xfd7fda0f)); // 2.08083e+37f, -2.12553e+37f |
| 582 | path.lineTo(SkBits2Float(0x7d7a6403), SkBits2Float(0xfd7fe461)); // 2.08016e+37f, -2.12587e+37f |
| 583 | path.conicTo(SkBits2Float(0x7d7a4764), SkBits2Float(0xfd7ff2b0), SkBits2Float(0x7d7a55b4), SkBits2Float(0xfd8007a8), SkBits2Float(0x3f3504f3)); // 2.07924e+37f, -2.12633e+37f, 2.0797e+37f, -2.12726e+37f, 0.707107f |
| 584 | path.conicTo(SkBits2Float(0x7d7a5803), SkBits2Float(0xfd8009f7), SkBits2Float(0x7d7a5ba9), SkBits2Float(0xfd800bcc), SkBits2Float(0x3f7cba66)); // 2.07977e+37f, -2.12741e+37f, 2.07989e+37f, -2.12753e+37f, 0.987219f |
| 585 | path.lineTo(SkBits2Float(0x7d8d2067), SkBits2Float(0xfd900bdb)); // 2.34487e+37f, -2.39338e+37f |
| 586 | path.lineTo(SkBits2Float(0x7ddd137a), SkBits2Float(0xfde00c2d)); // 3.67326e+37f, -3.72263e+37f |
| 587 | path.lineTo(SkBits2Float(0x7ddd2a1b), SkBits2Float(0xfddff58e)); // 3.67473e+37f, -3.72116e+37f |
| 588 | path.lineTo(SkBits2Float(0x7c694ae5), SkBits2Float(0xfc7fa67c)); // 4.8453e+36f, -5.30965e+36f |
| 589 | path.lineTo(SkBits2Float(0xfc164a8b), SkBits2Float(0x7c005af5)); // -3.12143e+36f, 2.66584e+36f |
| 590 | path.lineTo(SkBits2Float(0xfc8ae983), SkBits2Float(0x7c802da7)); // -5.77019e+36f, 5.32432e+36f |
| 591 | path.lineTo(SkBits2Float(0xfc8b16d9), SkBits2Float(0x7c80007b)); // -5.77754e+36f, 5.31699e+36f |
| 592 | path.lineTo(SkBits2Float(0xfc8b029c), SkBits2Float(0x7c7f8788)); // -5.77426e+36f, 5.30714e+36f |
| 593 | path.lineTo(SkBits2Float(0xfc8b0290), SkBits2Float(0x7c7f8790)); // -5.77425e+36f, 5.30714e+36f |
| 594 | path.lineTo(SkBits2Float(0xfc8b16cd), SkBits2Float(0x7c80007f)); // -5.77753e+36f, 5.31699e+36f |
| 595 | path.lineTo(SkBits2Float(0xfc8b4409), SkBits2Float(0x7c7fa672)); // -5.78487e+36f, 5.30965e+36f |
| 596 | path.lineTo(SkBits2Float(0x7d7aa2ba), SkBits2Float(0xfd800bd1)); // 2.0822e+37f, -2.12753e+37f |
| 597 | path.lineTo(SkBits2Float(0x7e8757ee), SkBits2Float(0xfe88035b)); // 8.99512e+37f, -9.03962e+37f |
| 598 | path.lineTo(SkBits2Float(0x7ef7552d), SkBits2Float(0xfef803ca)); // 1.64381e+38f, -1.64834e+38f |
| 599 | path.lineTo(SkBits2Float(0x7f0fa653), SkBits2Float(0xff1001f9)); // 1.90943e+38f, -1.91419e+38f |
| 600 | path.lineTo(SkBits2Float(0x7f0fa926), SkBits2Float(0xff0fff24)); // 1.90958e+38f, -1.91404e+38f |
| 601 | path.lineTo(SkBits2Float(0x7f0da75c), SkBits2Float(0xff0dff22)); // 1.8829e+38f, -1.88746e+38f |
| 602 | path.lineTo(SkBits2Float(0x7f07a5af), SkBits2Float(0xff07ff1d)); // 1.80306e+38f, -1.8077e+38f |
| 603 | path.close(); |
| 604 | path.moveTo(SkBits2Float(0x7f07a2db), SkBits2Float(0xff0801f1)); // 1.80291e+38f, -1.80785e+38f |
| 605 | path.lineTo(SkBits2Float(0x7f0da48a), SkBits2Float(0xff0e01f8)); // 1.88275e+38f, -1.88761e+38f |
| 606 | path.lineTo(SkBits2Float(0x7f0fa654), SkBits2Float(0xff1001fa)); // 1.90943e+38f, -1.91419e+38f |
| 607 | path.lineTo(SkBits2Float(0x7f0fa7bd), SkBits2Float(0xff10008f)); // 1.90951e+38f, -1.91412e+38f |
| 608 | path.lineTo(SkBits2Float(0x7f0fa927), SkBits2Float(0xff0fff25)); // 1.90958e+38f, -1.91404e+38f |
| 609 | path.lineTo(SkBits2Float(0x7ef75ad5), SkBits2Float(0xfef7fe22)); // 1.64395e+38f, -1.64819e+38f |
| 610 | path.lineTo(SkBits2Float(0x7e875d96), SkBits2Float(0xfe87fdb3)); // 8.99659e+37f, -9.03815e+37f |
| 611 | path.lineTo(SkBits2Float(0x7d7acff6), SkBits2Float(0xfd7fea5b)); // 2.08367e+37f, -2.12606e+37f |
| 612 | path.lineTo(SkBits2Float(0xfc8b0588), SkBits2Float(0x7c8049b7)); // -5.77473e+36f, 5.32887e+36f |
| 613 | path.lineTo(SkBits2Float(0xfc8b2b16), SkBits2Float(0x7c803d32)); // -5.78083e+36f, 5.32684e+36f |
| 614 | path.conicTo(SkBits2Float(0xfc8b395c), SkBits2Float(0x7c803870), SkBits2Float(0xfc8b4405), SkBits2Float(0x7c802dd1), SkBits2Float(0x3f79349d)); // -5.78314e+36f, 5.32607e+36f, -5.78487e+36f, 5.32435e+36f, 0.973459f |
| 615 | path.conicTo(SkBits2Float(0xfc8b715b), SkBits2Float(0x7c8000a5), SkBits2Float(0xfc8b442f), SkBits2Float(0x7c7fa69e), SkBits2Float(0x3f3504f3)); // -5.79223e+36f, 5.31702e+36f, -5.7849e+36f, 5.30966e+36f, 0.707107f |
| 616 | path.lineTo(SkBits2Float(0xfc16ffaa), SkBits2Float(0x7bff4c12)); // -3.13612e+36f, 2.65116e+36f |
| 617 | path.lineTo(SkBits2Float(0x7c6895e0), SkBits2Float(0xfc802dc0)); // 4.83061e+36f, -5.32434e+36f |
| 618 | path.lineTo(SkBits2Float(0x7ddd137b), SkBits2Float(0xfde00c2e)); // 3.67326e+37f, -3.72263e+37f |
| 619 | path.lineTo(SkBits2Float(0x7ddd1ecb), SkBits2Float(0xfde000de)); // 3.67399e+37f, -3.72189e+37f |
| 620 | path.lineTo(SkBits2Float(0x7ddd2a1c), SkBits2Float(0xfddff58f)); // 3.67473e+37f, -3.72116e+37f |
| 621 | path.lineTo(SkBits2Float(0x7d8d3711), SkBits2Float(0xfd8ff543)); // 2.34634e+37f, -2.39191e+37f |
| 622 | path.lineTo(SkBits2Float(0x7d7a88fe), SkBits2Float(0xfd7fea69)); // 2.08136e+37f, -2.12606e+37f |
| 623 | path.lineTo(SkBits2Float(0x7d7a7254), SkBits2Float(0xfd800080)); // 2.08063e+37f, -2.1268e+37f |
| 624 | path.lineTo(SkBits2Float(0x7d7a80a4), SkBits2Float(0xfd800ed0)); // 2.08109e+37f, -2.12773e+37f |
| 625 | path.lineTo(SkBits2Float(0x7d7a80a8), SkBits2Float(0xfd800ecf)); // 2.08109e+37f, -2.12773e+37f |
| 626 | path.lineTo(SkBits2Float(0x7d7a7258), SkBits2Float(0xfd80007f)); // 2.08063e+37f, -2.1268e+37f |
| 627 | path.lineTo(SkBits2Float(0x7d7a5bb9), SkBits2Float(0xfd800bd0)); // 2.0799e+37f, -2.12753e+37f |
| 628 | path.lineTo(SkBits2Float(0x7ded458b), SkBits2Float(0xfdf00c3e)); // 3.94235e+37f, -3.98848e+37f |
| 629 | path.lineTo(SkBits2Float(0x7e8753ce), SkBits2Float(0xfe88035b)); // 8.99405e+37f, -9.03962e+37f |
| 630 | path.lineTo(SkBits2Float(0x7edb5201), SkBits2Float(0xfedc03ae)); // 1.45763e+38f, -1.46225e+38f |
| 631 | path.lineTo(SkBits2Float(0x7ef74c4d), SkBits2Float(0xfef803ca)); // 1.64358e+38f, -1.64834e+38f |
| 632 | path.lineTo(SkBits2Float(0x7ef74f21), SkBits2Float(0xfef800f6)); // 1.64365e+38f, -1.64827e+38f |
| 633 | path.lineTo(SkBits2Float(0x7ef751f4), SkBits2Float(0xfef7fe21)); // 1.64372e+38f, -1.64819e+38f |
| 634 | path.lineTo(SkBits2Float(0x7ef34e91), SkBits2Float(0xfef3fe1e)); // 1.61705e+38f, -1.62161e+38f |
| 635 | path.lineTo(SkBits2Float(0x7edf4b2d), SkBits2Float(0xfedffe0a)); // 1.48404e+38f, -1.48868e+38f |
| 636 | path.lineTo(SkBits2Float(0x7edf4859), SkBits2Float(0xfee000de)); // 1.48397e+38f, -1.48876e+38f |
| 637 | path.lineTo(SkBits2Float(0x7edf4585), SkBits2Float(0xfee003b2)); // 1.48389e+38f, -1.48883e+38f |
| 638 | path.lineTo(SkBits2Float(0x7f07a2db), SkBits2Float(0xff0801f1)); // 1.80291e+38f, -1.80785e+38f |
| 639 | path.close(); |
| 640 | path.moveTo(SkBits2Float(0xfab120db), SkBits2Float(0x77b50b4f)); // -4.59851e+35f, 7.34402e+33f |
| 641 | path.lineTo(SkBits2Float(0xfd6597e5), SkBits2Float(0x7d60177f)); // -1.90739e+37f, 1.86168e+37f |
| 642 | path.lineTo(SkBits2Float(0xfde2cea1), SkBits2Float(0x7de00c2e)); // -3.76848e+37f, 3.72263e+37f |
| 643 | path.lineTo(SkBits2Float(0xfe316511), SkBits2Float(0x7e300657)); // -5.89495e+37f, 5.84943e+37f |
| 644 | path.lineTo(SkBits2Float(0xfe415da1), SkBits2Float(0x7e400666)); // -6.42568e+37f, 6.38112e+37f |
| 645 | path.lineTo(SkBits2Float(0xfe41634a), SkBits2Float(0x7e4000be)); // -6.42641e+37f, 6.38039e+37f |
| 646 | path.lineTo(SkBits2Float(0xfe41634a), SkBits2Float(0x7e3ff8be)); // -6.42641e+37f, 6.37935e+37f |
| 647 | path.lineTo(SkBits2Float(0xfe416349), SkBits2Float(0x7e3ff8be)); // -6.42641e+37f, 6.37935e+37f |
| 648 | path.lineTo(SkBits2Float(0xfe415f69), SkBits2Float(0x7e3ff8be)); // -6.42591e+37f, 6.37935e+37f |
| 649 | path.lineTo(SkBits2Float(0xfe415bc9), SkBits2Float(0x7e3ff8be)); // -6.42544e+37f, 6.37935e+37f |
| 650 | path.lineTo(SkBits2Float(0xfe415bc9), SkBits2Float(0x7e4000be)); // -6.42544e+37f, 6.38039e+37f |
| 651 | path.lineTo(SkBits2Float(0xfe416171), SkBits2Float(0x7e3ffb16)); // -6.42617e+37f, 6.37966e+37f |
| 652 | path.lineTo(SkBits2Float(0xfe016131), SkBits2Float(0x7dfff5ae)); // -4.29938e+37f, 4.25286e+37f |
| 653 | path.lineTo(SkBits2Float(0xfe0155e2), SkBits2Float(0x7e000628)); // -4.29791e+37f, 4.25433e+37f |
| 654 | path.lineTo(SkBits2Float(0xfe0958ea), SkBits2Float(0x7e080630)); // -4.56415e+37f, 4.52018e+37f |
| 655 | path.lineTo(SkBits2Float(0xfe115c92), SkBits2Float(0x7e100638)); // -4.83047e+37f, 4.78603e+37f |
| 656 | path.conicTo(SkBits2Float(0xfe11623c), SkBits2Float(0x7e100bdf), SkBits2Float(0xfe1167e2), SkBits2Float(0x7e100636), SkBits2Float(0x3f3504f3)); // -4.8312e+37f, 4.78676e+37f, -4.83194e+37f, 4.78603e+37f, 0.707107f |
| 657 | path.conicTo(SkBits2Float(0xfe116d87), SkBits2Float(0x7e10008e), SkBits2Float(0xfe1167e2), SkBits2Float(0x7e0ffae8), SkBits2Float(0x3f35240a)); // -4.83267e+37f, 4.78529e+37f, -4.83194e+37f, 4.78456e+37f, 0.707581f |
| 658 | path.lineTo(SkBits2Float(0xfe016b92), SkBits2Float(0x7dfff5af)); // -4.30072e+37f, 4.25286e+37f |
| 659 | path.lineTo(SkBits2Float(0xfdc2d963), SkBits2Float(0x7dbff56e)); // -3.23749e+37f, 3.18946e+37f |
| 660 | path.lineTo(SkBits2Float(0xfd65ae25), SkBits2Float(0x7d5fea3d)); // -1.90811e+37f, 1.86021e+37f |
| 661 | path.lineTo(SkBits2Float(0xfab448de), SkBits2Float(0xf7b50a19)); // -4.68046e+35f, -7.34383e+33f |
| 662 | path.lineTo(SkBits2Float(0xfab174d9), SkBits2Float(0x43480000)); // -4.60703e+35f, 200 |
| 663 | path.lineTo(SkBits2Float(0xfab174d9), SkBits2Float(0x7800007f)); // -4.60703e+35f, 1.03848e+34f |
| 664 | path.lineTo(SkBits2Float(0xfab3f4db), SkBits2Float(0x7800007f)); // -4.67194e+35f, 1.03848e+34f |
| 665 | path.lineTo(SkBits2Float(0xfab3f4db), SkBits2Float(0x43480000)); // -4.67194e+35f, 200 |
| 666 | path.lineTo(SkBits2Float(0xfab120db), SkBits2Float(0x77b50b4f)); // -4.59851e+35f, 7.34402e+33f |
| 667 | path.close(); |
| 668 | path.moveTo(SkBits2Float(0xfab59cf2), SkBits2Float(0xf800007e)); // -4.71494e+35f, -1.03847e+34f |
| 669 | path.lineTo(SkBits2Float(0xfaa7cc52), SkBits2Float(0xf800007f)); // -4.35629e+35f, -1.03848e+34f |
| 670 | path.lineTo(SkBits2Float(0xfd6580e5), SkBits2Float(0x7d60177f)); // -1.90664e+37f, 1.86168e+37f |
| 671 | path.lineTo(SkBits2Float(0xfdc2c2c1), SkBits2Float(0x7dc00c0f)); // -3.23602e+37f, 3.19093e+37f |
| 672 | path.lineTo(SkBits2Float(0xfe016040), SkBits2Float(0x7e000626)); // -4.29925e+37f, 4.25433e+37f |
| 673 | path.lineTo(SkBits2Float(0xfe115c90), SkBits2Float(0x7e100636)); // -4.83047e+37f, 4.78603e+37f |
| 674 | path.lineTo(SkBits2Float(0xfe116239), SkBits2Float(0x7e10008f)); // -4.8312e+37f, 4.78529e+37f |
| 675 | path.lineTo(SkBits2Float(0xfe1167e0), SkBits2Float(0x7e0ffae6)); // -4.83194e+37f, 4.78456e+37f |
| 676 | path.lineTo(SkBits2Float(0xfe096438), SkBits2Float(0x7e07fade)); // -4.56562e+37f, 4.51871e+37f |
| 677 | path.lineTo(SkBits2Float(0xfe016130), SkBits2Float(0x7dfff5ac)); // -4.29938e+37f, 4.25286e+37f |
| 678 | path.lineTo(SkBits2Float(0xfe015b89), SkBits2Float(0x7e00007f)); // -4.29864e+37f, 4.25359e+37f |
| 679 | path.lineTo(SkBits2Float(0xfe0155e1), SkBits2Float(0x7e000627)); // -4.29791e+37f, 4.25433e+37f |
| 680 | path.lineTo(SkBits2Float(0xfe415879), SkBits2Float(0x7e4008bf)); // -6.42501e+37f, 6.38143e+37f |
| 681 | path.lineTo(SkBits2Float(0xfe415f69), SkBits2Float(0x7e4008bf)); // -6.42591e+37f, 6.38143e+37f |
| 682 | path.lineTo(SkBits2Float(0xfe416349), SkBits2Float(0x7e4008bf)); // -6.42641e+37f, 6.38143e+37f |
| 683 | path.lineTo(SkBits2Float(0xfe41634a), SkBits2Float(0x7e4008bf)); // -6.42641e+37f, 6.38143e+37f |
| 684 | path.conicTo(SkBits2Float(0xfe416699), SkBits2Float(0x7e4008bf), SkBits2Float(0xfe4168f1), SkBits2Float(0x7e400668), SkBits2Float(0x3f6c8ed9)); // -6.42684e+37f, 6.38143e+37f, -6.42715e+37f, 6.38113e+37f, 0.924055f |
| 685 | path.conicTo(SkBits2Float(0xfe416e9a), SkBits2Float(0x7e4000c2), SkBits2Float(0xfe4168f3), SkBits2Float(0x7e3ffb17), SkBits2Float(0x3f3504f3)); // -6.42788e+37f, 6.38039e+37f, -6.42715e+37f, 6.37966e+37f, 0.707107f |
| 686 | path.lineTo(SkBits2Float(0xfe317061), SkBits2Float(0x7e2ffb07)); // -5.89642e+37f, 5.84796e+37f |
| 687 | path.lineTo(SkBits2Float(0xfde2e542), SkBits2Float(0x7ddff58e)); // -3.76995e+37f, 3.72116e+37f |
| 688 | path.lineTo(SkBits2Float(0xfd65c525), SkBits2Float(0x7d5fea3d)); // -1.90886e+37f, 1.86021e+37f |
| 689 | path.lineTo(SkBits2Float(0xfab6c8db), SkBits2Float(0xf7b50b4f)); // -4.74536e+35f, -7.34402e+33f |
| 690 | path.lineTo(SkBits2Float(0xfab59cf2), SkBits2Float(0xf800007e)); // -4.71494e+35f, -1.03847e+34f |
| 691 | path.close(); |
| 692 | path.moveTo(SkBits2Float(0xfab3f4db), SkBits2Float(0x43480000)); // -4.67194e+35f, 200 |
| 693 | path.lineTo(SkBits2Float(0xfab174d9), SkBits2Float(0x43480000)); // -4.60703e+35f, 200 |
| 694 | path.quadTo(SkBits2Float(0xfd0593a5), SkBits2Float(0x7d00007f), SkBits2Float(0xfd659785), SkBits2Float(0x7d6000de)); // -1.10971e+37f, 1.0634e+37f, -1.90737e+37f, 1.86095e+37f |
| 695 | path.quadTo(SkBits2Float(0xfda2cdf2), SkBits2Float(0x7da0009f), SkBits2Float(0xfdc2ce12), SkBits2Float(0x7dc000be)); // -2.70505e+37f, 2.6585e+37f, -3.23675e+37f, 3.1902e+37f |
| 696 | path.quadTo(SkBits2Float(0xfde2ce31), SkBits2Float(0x7de000de), SkBits2Float(0xfe0165e9), SkBits2Float(0x7e00007f)); // -3.76845e+37f, 3.72189e+37f, -4.29999e+37f, 4.25359e+37f |
| 697 | path.quadTo(SkBits2Float(0xfe1164b9), SkBits2Float(0x7e10008f), SkBits2Float(0xfe116239), SkBits2Float(0x7e10008f)); // -4.83153e+37f, 4.78529e+37f, -4.8312e+37f, 4.78529e+37f |
| 698 | path.quadTo(SkBits2Float(0xfe116039), SkBits2Float(0x7e10008f), SkBits2Float(0xfe095e91), SkBits2Float(0x7e080087)); // -4.83094e+37f, 4.78529e+37f, -4.56488e+37f, 4.51944e+37f |
| 699 | path.quadTo(SkBits2Float(0xfe015d09), SkBits2Float(0x7e00007f), SkBits2Float(0xfe015b89), SkBits2Float(0x7e00007f)); // -4.29884e+37f, 4.25359e+37f, -4.29864e+37f, 4.25359e+37f |
| 700 | path.lineTo(SkBits2Float(0xfe415bc9), SkBits2Float(0x7e4000be)); // -6.42544e+37f, 6.38039e+37f |
| 701 | path.quadTo(SkBits2Float(0xfe415da9), SkBits2Float(0x7e4000be), SkBits2Float(0xfe415f69), SkBits2Float(0x7e4000be)); // -6.42568e+37f, 6.38039e+37f, -6.42591e+37f, 6.38039e+37f |
| 702 | path.quadTo(SkBits2Float(0xfe416149), SkBits2Float(0x7e4000be), SkBits2Float(0xfe416349), SkBits2Float(0x7e4000be)); // -6.42615e+37f, 6.38039e+37f, -6.42641e+37f, 6.38039e+37f |
| 703 | path.quadTo(SkBits2Float(0xfe416849), SkBits2Float(0x7e4000be), SkBits2Float(0xfe316ab9), SkBits2Float(0x7e3000af)); // -6.42706e+37f, 6.38039e+37f, -5.89569e+37f, 5.84869e+37f |
| 704 | path.quadTo(SkBits2Float(0xfe216d29), SkBits2Float(0x7e20009f), SkBits2Float(0xfde2d9f2), SkBits2Float(0x7de000de)); // -5.36431e+37f, 5.31699e+37f, -3.76921e+37f, 3.72189e+37f |
| 705 | path.quadTo(SkBits2Float(0xfda2d9b2), SkBits2Float(0x7da0009f), SkBits2Float(0xfd65ae85), SkBits2Float(0x7d6000de)); // -2.70582e+37f, 2.6585e+37f, -1.90812e+37f, 1.86095e+37f |
| 706 | path.quadTo(SkBits2Float(0xfd05a9a6), SkBits2Float(0x7d00007f), SkBits2Float(0xfab3f4db), SkBits2Float(0x43480000)); // -1.11043e+37f, 1.0634e+37f, -4.67194e+35f, 200 |
| 707 | path.close(); |
| 708 | path.moveTo(SkBits2Float(0x7f07a445), SkBits2Float(0xff080087)); // 1.80299e+38f, -1.80778e+38f |
| 709 | path.quadTo(SkBits2Float(0x7f0ba519), SkBits2Float(0xff0c008b), SkBits2Float(0x7f0da5f3), SkBits2Float(0xff0e008d)); // 1.8562e+38f, -1.86095e+38f, 1.88283e+38f, -1.88753e+38f |
| 710 | path.quadTo(SkBits2Float(0x7f0fa6d5), SkBits2Float(0xff10008f), SkBits2Float(0x7f0fa7bd), SkBits2Float(0xff10008f)); // 1.90946e+38f, -1.91412e+38f, 1.90951e+38f, -1.91412e+38f |
| 711 | path.quadTo(SkBits2Float(0x7f0faa7d), SkBits2Float(0xff10008f), SkBits2Float(0x7ef75801), SkBits2Float(0xfef800f6)); // 1.90965e+38f, -1.91412e+38f, 1.64388e+38f, -1.64827e+38f |
| 712 | path.quadTo(SkBits2Float(0x7ecf5b09), SkBits2Float(0xfed000ce), SkBits2Float(0x7e875ac2), SkBits2Float(0xfe880087)); // 1.37811e+38f, -1.38242e+38f, 8.99585e+37f, -9.03889e+37f |
| 713 | path.quadTo(SkBits2Float(0x7e0eb505), SkBits2Float(0xfe10008f), SkBits2Float(0x7d7ab958), SkBits2Float(0xfd80007f)); // 4.74226e+37f, -4.78529e+37f, 2.08293e+37f, -2.1268e+37f |
| 714 | path.quadTo(SkBits2Float(0xfc8ac1cd), SkBits2Float(0x7c80007f), SkBits2Float(0xfc8b16cd), SkBits2Float(0x7c80007f)); // -5.76374e+36f, 5.31699e+36f, -5.77753e+36f, 5.31699e+36f |
| 715 | path.quadTo(SkBits2Float(0xfc8b36cd), SkBits2Float(0x7c80007f), SkBits2Float(0xfc16a51a), SkBits2Float(0x7c00007f)); // -5.78273e+36f, 5.31699e+36f, -3.12877e+36f, 2.6585e+36f |
| 716 | path.quadTo(SkBits2Float(0xfab6e4de), SkBits2Float(0x43480000), SkBits2Float(0x7c68f062), SkBits2Float(0xfc80007f)); // -4.7482e+35f, 200, 4.83795e+36f, -5.31699e+36f |
| 717 | path.lineTo(SkBits2Float(0x7ddd1ecb), SkBits2Float(0xfde000de)); // 3.67399e+37f, -3.72189e+37f |
| 718 | path.quadTo(SkBits2Float(0x7d9d254b), SkBits2Float(0xfda0009f), SkBits2Float(0x7d8d2bbc), SkBits2Float(0xfd90008f)); // 2.61103e+37f, -2.6585e+37f, 2.3456e+37f, -2.39265e+37f |
| 719 | path.quadTo(SkBits2Float(0x7d7a64d8), SkBits2Float(0xfd80007f), SkBits2Float(0x7d7a7258), SkBits2Float(0xfd80007f)); // 2.08019e+37f, -2.1268e+37f, 2.08063e+37f, -2.1268e+37f |
| 720 | path.quadTo(SkBits2Float(0x7d7a9058), SkBits2Float(0xfd80007f), SkBits2Float(0x7ded50db), SkBits2Float(0xfdf000ee)); // 2.0816e+37f, -2.1268e+37f, 3.94309e+37f, -3.98774e+37f |
| 721 | path.quadTo(SkBits2Float(0x7e2eace5), SkBits2Float(0xfe3000af), SkBits2Float(0x7e8756a2), SkBits2Float(0xfe880087)); // 5.80458e+37f, -5.84869e+37f, 8.99478e+37f, -9.03889e+37f |
| 722 | path.quadTo(SkBits2Float(0x7ebf56d9), SkBits2Float(0xfec000be), SkBits2Float(0x7edb54d5), SkBits2Float(0xfedc00da)); // 1.27167e+38f, -1.27608e+38f, 1.45771e+38f, -1.46217e+38f |
| 723 | path.quadTo(SkBits2Float(0x7ef752e1), SkBits2Float(0xfef800f6), SkBits2Float(0x7ef74f21), SkBits2Float(0xfef800f6)); // 1.64375e+38f, -1.64827e+38f, 1.64365e+38f, -1.64827e+38f |
| 724 | path.quadTo(SkBits2Float(0x7ef74d71), SkBits2Float(0xfef800f6), SkBits2Float(0x7ef34bbd), SkBits2Float(0xfef400f2)); // 1.64361e+38f, -1.64827e+38f, 1.61698e+38f, -1.62168e+38f |
| 725 | path.quadTo(SkBits2Float(0x7eef4a19), SkBits2Float(0xfef000ee), SkBits2Float(0x7edf4859), SkBits2Float(0xfee000de)); // 1.59035e+38f, -1.5951e+38f, 1.48397e+38f, -1.48876e+38f |
| 726 | path.lineTo(SkBits2Float(0x7f07a445), SkBits2Float(0xff080087)); // 1.80299e+38f, -1.80778e+38f |
| 727 | path.close(); |
| 728 | canvas->drawPath(path, paint); |
| 729 | } |