bsalomon@google.com | 69cc6ad | 2012-01-17 14:25:10 +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 | */ |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 7 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 8 | #include "gm/gm.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 9 | #include "include/core/SkCanvas.h" |
| 10 | #include "include/core/SkColor.h" |
| 11 | #include "include/core/SkMatrix.h" |
| 12 | #include "include/core/SkPaint.h" |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 13 | #include "include/core/SkPathBuilder.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 14 | #include "include/core/SkRect.h" |
| 15 | #include "include/core/SkScalar.h" |
| 16 | #include "include/core/SkSize.h" |
| 17 | #include "include/core/SkString.h" |
| 18 | #include "include/core/SkTypes.h" |
| 19 | #include "include/private/SkNoncopyable.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 20 | #include "include/private/SkTArray.h" |
| 21 | #include "include/utils/SkRandom.h" |
bsalomon@google.com | 69cc6ad | 2012-01-17 14:25:10 +0000 | [diff] [blame] | 22 | |
Hal Canary | bd865e2 | 2019-07-18 11:51:19 -0400 | [diff] [blame] | 23 | namespace { |
| 24 | |
commit-bot@chromium.org | 2ab1ba0 | 2014-01-17 17:55:02 +0000 | [diff] [blame] | 25 | class SkDoOnce : SkNoncopyable { |
reed@google.com | d42e3f6 | 2012-03-30 20:04:21 +0000 | [diff] [blame] | 26 | public: |
commit-bot@chromium.org | 2ab1ba0 | 2014-01-17 17:55:02 +0000 | [diff] [blame] | 27 | SkDoOnce() { fDidOnce = false; } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 28 | |
reed@google.com | d42e3f6 | 2012-03-30 20:04:21 +0000 | [diff] [blame] | 29 | bool needToDo() const { return !fDidOnce; } |
| 30 | bool alreadyDone() const { return fDidOnce; } |
| 31 | void accomplished() { |
| 32 | SkASSERT(!fDidOnce); |
| 33 | fDidOnce = true; |
| 34 | } |
| 35 | |
| 36 | private: |
| 37 | bool fDidOnce; |
| 38 | }; |
| 39 | |
Hal Canary | bd865e2 | 2019-07-18 11:51:19 -0400 | [diff] [blame] | 40 | class ConvexPathsGM : public skiagm::GM { |
commit-bot@chromium.org | 2ab1ba0 | 2014-01-17 17:55:02 +0000 | [diff] [blame] | 41 | SkDoOnce fOnce; |
bsalomon@google.com | 69cc6ad | 2012-01-17 14:25:10 +0000 | [diff] [blame] | 42 | |
Hal Canary | bd865e2 | 2019-07-18 11:51:19 -0400 | [diff] [blame] | 43 | void onOnceBeforeDraw() override { this->setBGColor(0xFF000000); } |
commit-bot@chromium.org | a90c680 | 2014-04-30 13:20:45 +0000 | [diff] [blame] | 44 | |
Hal Canary | bd865e2 | 2019-07-18 11:51:19 -0400 | [diff] [blame] | 45 | SkString onShortName() override { return SkString("convexpaths"); } |
bsalomon@google.com | 69cc6ad | 2012-01-17 14:25:10 +0000 | [diff] [blame] | 46 | |
| 47 | |
Hal Canary | bd865e2 | 2019-07-18 11:51:19 -0400 | [diff] [blame] | 48 | SkISize onISize() override { return {1200, 1100}; } |
bsalomon@google.com | 69cc6ad | 2012-01-17 14:25:10 +0000 | [diff] [blame] | 49 | |
| 50 | void makePaths() { |
reed@google.com | d42e3f6 | 2012-03-30 20:04:21 +0000 | [diff] [blame] | 51 | if (fOnce.alreadyDone()) { |
| 52 | return; |
| 53 | } |
| 54 | fOnce.accomplished(); |
commit-bot@chromium.org | fdfbb9d | 2013-08-15 18:16:27 +0000 | [diff] [blame] | 55 | |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 56 | SkPathBuilder b; |
| 57 | fPaths.push_back(b.moveTo(0, 0) |
| 58 | .quadTo(50, 100, 0, 100) |
| 59 | .lineTo(0, 0) |
| 60 | .detach()); |
bsalomon@google.com | 278dc69 | 2012-02-15 16:52:51 +0000 | [diff] [blame] | 61 | |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 62 | fPaths.push_back(b.moveTo(0, 50) |
| 63 | .quadTo(50, 0, 100, 50) |
| 64 | .quadTo(50, 100, 0, 50) |
| 65 | .detach()); |
bsalomon@google.com | 278dc69 | 2012-02-15 16:52:51 +0000 | [diff] [blame] | 66 | |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 67 | fPaths.push_back(SkPath::Rect({0, 0, 100, 100}, SkPathDirection::kCW)); |
| 68 | fPaths.push_back(SkPath::Rect({0, 0, 100, 100}, SkPathDirection::kCCW)); |
| 69 | fPaths.push_back(SkPath::Circle(50, 50, 50, SkPathDirection::kCW)); |
| 70 | fPaths.push_back(SkPath::Oval(SkRect::MakeXYWH(0, 0, 50, 100), SkPathDirection::kCW)); |
| 71 | fPaths.push_back(SkPath::Oval(SkRect::MakeXYWH(0, 0, 100, 5), SkPathDirection::kCCW)); |
| 72 | fPaths.push_back(SkPath::Oval(SkRect::MakeXYWH(0, 0, 1, 100), SkPathDirection::kCCW)); |
| 73 | fPaths.push_back(SkPath::RRect(SkRRect::MakeRectXY({0, 0, 100, 100}, 40, 20), |
| 74 | SkPathDirection::kCW)); |
bsalomon@google.com | 69cc6ad | 2012-01-17 14:25:10 +0000 | [diff] [blame] | 75 | |
bsalomon@google.com | 7d9ffc8 | 2013-05-14 14:20:28 +0000 | [diff] [blame] | 76 | // large number of points |
| 77 | enum { |
| 78 | kLength = 100, |
| 79 | kPtsPerSide = (1 << 12), |
| 80 | }; |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 81 | b.moveTo(0, 0); |
bsalomon@google.com | 7d9ffc8 | 2013-05-14 14:20:28 +0000 | [diff] [blame] | 82 | for (int i = 1; i < kPtsPerSide; ++i) { // skip the first point due to moveTo. |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 83 | b.lineTo(kLength * SkIntToScalar(i) / kPtsPerSide, 0); |
bsalomon@google.com | 7d9ffc8 | 2013-05-14 14:20:28 +0000 | [diff] [blame] | 84 | } |
| 85 | for (int i = 0; i < kPtsPerSide; ++i) { |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 86 | b.lineTo(kLength, kLength * SkIntToScalar(i) / kPtsPerSide); |
bsalomon@google.com | 7d9ffc8 | 2013-05-14 14:20:28 +0000 | [diff] [blame] | 87 | } |
| 88 | for (int i = kPtsPerSide; i > 0; --i) { |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 89 | b.lineTo(kLength * SkIntToScalar(i) / kPtsPerSide, kLength); |
bsalomon@google.com | 7d9ffc8 | 2013-05-14 14:20:28 +0000 | [diff] [blame] | 90 | } |
| 91 | for (int i = kPtsPerSide; i > 0; --i) { |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 92 | b.lineTo(0, kLength * SkIntToScalar(i) / kPtsPerSide); |
bsalomon@google.com | 7d9ffc8 | 2013-05-14 14:20:28 +0000 | [diff] [blame] | 93 | } |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 94 | fPaths.push_back(b.detach()); |
bsalomon@google.com | 7d9ffc8 | 2013-05-14 14:20:28 +0000 | [diff] [blame] | 95 | |
bsalomon@google.com | 72b55be | 2012-01-26 20:33:19 +0000 | [diff] [blame] | 96 | // shallow diagonals |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 97 | fPaths.push_back(SkPath::Polygon({{0,0}, {100,1}, {98,100}, {3,96}}, false)); |
bsalomon@google.com | 9732f62 | 2012-01-31 15:19:21 +0000 | [diff] [blame] | 98 | |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 99 | fPaths.push_back(b.arcTo(SkRect::MakeXYWH(0, 0, 50, 100), 25, 130, false) |
| 100 | .detach()); |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 101 | |
bsalomon@google.com | 72b55be | 2012-01-26 20:33:19 +0000 | [diff] [blame] | 102 | // cubics |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 103 | fPaths.push_back(b.cubicTo( 1, 1, 10, 90, 0, 100).detach()); |
| 104 | fPaths.push_back(b.cubicTo(100, 50, 20, 100, 0, 0).detach()); |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 105 | |
bsalomon@google.com | a51ab84 | 2012-07-10 19:53:34 +0000 | [diff] [blame] | 106 | // path that has a cubic with a repeated first control point and |
| 107 | // a repeated last control point. |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 108 | fPaths.push_back(b.moveTo(10, 10) |
| 109 | .cubicTo(10, 10, 10, 0, 20, 0) |
| 110 | .lineTo(40, 0) |
| 111 | .cubicTo(40, 0, 50, 0, 50, 10) |
| 112 | .detach()); |
bsalomon@google.com | a51ab84 | 2012-07-10 19:53:34 +0000 | [diff] [blame] | 113 | |
| 114 | // path that has two cubics with repeated middle control points. |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 115 | fPaths.push_back(b.moveTo(10, 10) |
| 116 | .cubicTo(10, 0, 10, 0, 20, 0) |
| 117 | .lineTo(40, 0) |
| 118 | .cubicTo(50, 0, 50, 0, 50, 10) |
| 119 | .detach()); |
bsalomon@google.com | a51ab84 | 2012-07-10 19:53:34 +0000 | [diff] [blame] | 120 | |
bsalomon@google.com | 54ad851 | 2012-08-02 14:55:45 +0000 | [diff] [blame] | 121 | // cubic where last three points are almost a line |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 122 | fPaths.push_back(b.moveTo(0, 228.0f/8) |
| 123 | .cubicTo( 628.0f/ 8, 82.0f/8, |
| 124 | 1255.0f/ 8, 141.0f/8, |
| 125 | 1883.0f/ 8, 202.0f/8) |
| 126 | .detach()); |
bsalomon@google.com | 54ad851 | 2012-08-02 14:55:45 +0000 | [diff] [blame] | 127 | |
| 128 | // flat cubic where the at end point tangents both point outward. |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 129 | fPaths.push_back(b.moveTo(10, 0) |
| 130 | .cubicTo(0, 1, 30, 1, 20, 0) |
| 131 | .detach()); |
bsalomon@google.com | 54ad851 | 2012-08-02 14:55:45 +0000 | [diff] [blame] | 132 | |
| 133 | // flat cubic where initial tangent is in, end tangent out |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 134 | fPaths.push_back(b.moveTo(0, 0) |
| 135 | .cubicTo(10, 1, 30, 1, 20, 0) |
| 136 | .detach()); |
bsalomon@google.com | 54ad851 | 2012-08-02 14:55:45 +0000 | [diff] [blame] | 137 | |
| 138 | // flat cubic where initial tangent is out, end tangent in |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 139 | fPaths.push_back(b.moveTo(10, 0) |
| 140 | .cubicTo(0, 1, 20, 1, 30, 0) |
| 141 | .detach()); |
bsalomon@google.com | 54ad851 | 2012-08-02 14:55:45 +0000 | [diff] [blame] | 142 | |
bsalomon@google.com | dc3c780 | 2012-01-31 20:46:32 +0000 | [diff] [blame] | 143 | // triangle where one edge is a degenerate quad |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 144 | fPaths.push_back(b.moveTo(8.59375f, 45) |
| 145 | .quadTo(16.9921875f, 45, |
| 146 | 31.25f, 45) |
| 147 | .lineTo(100, 100) |
| 148 | .lineTo(8.59375f, 45) |
| 149 | .detach()); |
bsalomon@google.com | dc3c780 | 2012-01-31 20:46:32 +0000 | [diff] [blame] | 150 | |
commit-bot@chromium.org | fdfbb9d | 2013-08-15 18:16:27 +0000 | [diff] [blame] | 151 | // triangle where one edge is a quad with a repeated point |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 152 | fPaths.push_back(b.moveTo(0, 25) |
| 153 | .lineTo(50, 0) |
| 154 | .quadTo(50, 50, 50, 50) |
| 155 | .detach()); |
commit-bot@chromium.org | fdfbb9d | 2013-08-15 18:16:27 +0000 | [diff] [blame] | 156 | |
| 157 | // triangle where one edge is a cubic with a 2x repeated point |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 158 | fPaths.push_back(b.moveTo(0, 25) |
| 159 | .lineTo(50, 0) |
| 160 | .cubicTo(50, 0, 50, 50, 50, 50) |
| 161 | .detach()); |
commit-bot@chromium.org | fdfbb9d | 2013-08-15 18:16:27 +0000 | [diff] [blame] | 162 | |
| 163 | // triangle where one edge is a quad with a nearly repeated point |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 164 | fPaths.push_back(b.moveTo(0, 25) |
| 165 | .lineTo(50, 0) |
| 166 | .quadTo(50, 49.95f, 50, 50) |
| 167 | .detach()); |
commit-bot@chromium.org | fdfbb9d | 2013-08-15 18:16:27 +0000 | [diff] [blame] | 168 | |
| 169 | // triangle where one edge is a cubic with a 3x nearly repeated point |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 170 | fPaths.push_back(b.moveTo(0, 25) |
| 171 | .lineTo(50, 0) |
| 172 | .cubicTo(50, 49.95f, 50, 49.97f, 50, 50) |
| 173 | .detach()); |
commit-bot@chromium.org | fdfbb9d | 2013-08-15 18:16:27 +0000 | [diff] [blame] | 174 | |
| 175 | // triangle where there is a point degenerate cubic at one corner |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 176 | fPaths.push_back(b.moveTo(0, 25) |
| 177 | .lineTo(50, 0) |
| 178 | .lineTo(50, 50) |
| 179 | .cubicTo(50, 50, 50, 50, 50, 50) |
| 180 | .detach()); |
commit-bot@chromium.org | fdfbb9d | 2013-08-15 18:16:27 +0000 | [diff] [blame] | 181 | |
| 182 | // point line |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 183 | fPaths.push_back(SkPath::Line({50, 50}, {50, 50})); |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 184 | |
commit-bot@chromium.org | fdfbb9d | 2013-08-15 18:16:27 +0000 | [diff] [blame] | 185 | // point quad |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 186 | fPaths.push_back(b.moveTo(50, 50) |
| 187 | .quadTo(50, 50, 50, 50) |
| 188 | .detach()); |
commit-bot@chromium.org | fdfbb9d | 2013-08-15 18:16:27 +0000 | [diff] [blame] | 189 | |
| 190 | // point cubic |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 191 | fPaths.push_back(b.moveTo(50, 50) |
| 192 | .cubicTo(50, 50, 50, 50, 50, 50) |
| 193 | .detach()); |
bsalomon@google.com | dc3c780 | 2012-01-31 20:46:32 +0000 | [diff] [blame] | 194 | |
bsalomon@google.com | 9732f62 | 2012-01-31 15:19:21 +0000 | [diff] [blame] | 195 | // moveTo only paths |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 196 | fPaths.push_back(b.moveTo(0, 0) |
| 197 | .moveTo(0, 0) |
| 198 | .moveTo(1, 1) |
| 199 | .moveTo(1, 1) |
| 200 | .moveTo(10, 10) |
| 201 | .detach()); |
bsalomon@google.com | 9732f62 | 2012-01-31 15:19:21 +0000 | [diff] [blame] | 202 | |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 203 | fPaths.push_back(b.moveTo(0, 0) |
| 204 | .moveTo(0, 0) |
| 205 | .detach()); |
bsalomon@google.com | 69cc6ad | 2012-01-17 14:25:10 +0000 | [diff] [blame] | 206 | |
| 207 | // line degenerate |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 208 | fPaths.push_back(b.lineTo(100, 100).detach()); |
| 209 | fPaths.push_back(b.quadTo(100, 100, 0, 0).detach()); |
| 210 | fPaths.push_back(b.quadTo(100, 100, 50, 50).detach()); |
| 211 | fPaths.push_back(b.quadTo(50, 50, 100, 100).detach()); |
| 212 | fPaths.push_back(b.cubicTo(0, 0, 0, 0, 100, 100).detach()); |
bsalomon@google.com | 5b56d9e | 2012-02-23 19:18:37 +0000 | [diff] [blame] | 213 | |
Brian Salomon | 73c6c9d | 2019-03-29 15:41:27 -0400 | [diff] [blame] | 214 | // skbug.com/8928 |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 215 | fPaths.push_back(b.moveTo(16.875f, 192.594f) |
| 216 | .cubicTo(45.625f, 192.594f, 74.375f, 192.594f, 103.125f, 192.594f) |
| 217 | .cubicTo(88.75f, 167.708f, 74.375f, 142.823f, 60, 117.938f) |
| 218 | .cubicTo(45.625f, 142.823f, 31.25f, 167.708f, 16.875f, 192.594f) |
| 219 | .close() |
| 220 | .detach()); |
Brian Salomon | 73c6c9d | 2019-03-29 15:41:27 -0400 | [diff] [blame] | 221 | SkMatrix m; |
| 222 | m.setAll(0.1f, 0, -1, 0, 0.115207f, -2.64977f, 0, 0, 1); |
| 223 | fPaths.back().transform(m); |
| 224 | |
bsalomon@google.com | 5b56d9e | 2012-02-23 19:18:37 +0000 | [diff] [blame] | 225 | // small circle. This is listed last so that it has device coords far |
| 226 | // from the origin (small area relative to x,y values). |
Mike Reed | 92f6eb1 | 2020-08-25 11:48:41 -0400 | [diff] [blame] | 227 | fPaths.push_back(SkPath::Circle(0, 0, 1.2f)); |
bsalomon@google.com | 69cc6ad | 2012-01-17 14:25:10 +0000 | [diff] [blame] | 228 | } |
| 229 | |
Hal Canary | bd865e2 | 2019-07-18 11:51:19 -0400 | [diff] [blame] | 230 | void onDraw(SkCanvas* canvas) override { |
reed@google.com | d42e3f6 | 2012-03-30 20:04:21 +0000 | [diff] [blame] | 231 | this->makePaths(); |
bsalomon@google.com | 69cc6ad | 2012-01-17 14:25:10 +0000 | [diff] [blame] | 232 | |
Jim Van Verth | f9e678d | 2017-02-15 15:46:52 -0500 | [diff] [blame] | 233 | SkPaint paint; |
| 234 | paint.setAntiAlias(true); |
| 235 | SkRandom rand; |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 236 | canvas->translate(20, 20); |
commit-bot@chromium.org | fdfbb9d | 2013-08-15 18:16:27 +0000 | [diff] [blame] | 237 | |
Jim Van Verth | f9e678d | 2017-02-15 15:46:52 -0500 | [diff] [blame] | 238 | // As we've added more paths this has gotten pretty big. Scale the whole thing down. |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 239 | canvas->scale(2.0f/3, 2.0f/3); |
commit-bot@chromium.org | fdfbb9d | 2013-08-15 18:16:27 +0000 | [diff] [blame] | 240 | |
Jim Van Verth | f9e678d | 2017-02-15 15:46:52 -0500 | [diff] [blame] | 241 | for (int i = 0; i < fPaths.count(); ++i) { |
| 242 | canvas->save(); |
| 243 | // position the path, and make it at off-integer coords. |
Mike Reed | 15a5403 | 2020-08-16 11:15:41 -0400 | [diff] [blame] | 244 | canvas->translate(200.0f * (i % 5) + 1.0f/10, |
| 245 | 200.0f * (i / 5) + 9.0f/10); |
Jim Van Verth | f9e678d | 2017-02-15 15:46:52 -0500 | [diff] [blame] | 246 | SkColor color = rand.nextU(); |
| 247 | color |= 0xff000000; |
| 248 | paint.setColor(color); |
| 249 | #if 0 // This hitting on 32bit Linux builds for some paths. Temporarily disabling while it is |
| 250 | // debugged. |
| 251 | SkASSERT(fPaths[i].isConvex()); |
bsalomon@google.com | 44d662b | 2013-08-15 20:34:45 +0000 | [diff] [blame] | 252 | #endif |
Jim Van Verth | f9e678d | 2017-02-15 15:46:52 -0500 | [diff] [blame] | 253 | canvas->drawPath(fPaths[i], paint); |
| 254 | canvas->restore(); |
| 255 | } |
bsalomon@google.com | 69cc6ad | 2012-01-17 14:25:10 +0000 | [diff] [blame] | 256 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 257 | |
bsalomon@google.com | 69cc6ad | 2012-01-17 14:25:10 +0000 | [diff] [blame] | 258 | SkTArray<SkPath> fPaths; |
| 259 | }; |
Hal Canary | bd865e2 | 2019-07-18 11:51:19 -0400 | [diff] [blame] | 260 | } // namespace |
bsalomon@google.com | 69cc6ad | 2012-01-17 14:25:10 +0000 | [diff] [blame] | 261 | |
Hal Canary | e964c18 | 2019-01-23 10:22:01 -0500 | [diff] [blame] | 262 | DEF_GM( return new ConvexPathsGM; ) |