OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #include "gm.h" | 8 #include "gm.h" |
9 #include "SkPathPriv.h" | 9 #include "SkPathPriv.h" |
10 | 10 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 numPts = 20; | 204 numPts = 20; |
205 break; | 205 break; |
206 case 8: | 206 case 8: |
207 numPts = 100; | 207 numPts = 100; |
208 break; | 208 break; |
209 default: | 209 default: |
210 numPts = 3; | 210 numPts = 3; |
211 break; | 211 break; |
212 } | 212 } |
213 | 213 |
214 data.reset(SkNEW_ARRAY(SkPoint, numPts)); | 214 data.reset(new SkPoint[numPts]); |
215 | 215 |
216 create_ngon(numPts, data.get(), width, height); | 216 create_ngon(numPts, data.get(), width, height); |
217 points = data.get(); | 217 points = data.get(); |
218 } | 218 } |
219 | 219 |
220 SkPath path; | 220 SkPath path; |
221 | 221 |
222 if (SkPath::kCW_Direction == dir) { | 222 if (SkPath::kCW_Direction == dir) { |
223 path.moveTo(points[0]); | 223 path.moveTo(points[0]); |
224 for (int i = 1; i < numPts; ++i) { | 224 for (int i = 1; i < numPts; ++i) { |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 static const int kNumPaths = 20; | 310 static const int kNumPaths = 20; |
311 static const int kMaxPathHeight = 100; | 311 static const int kMaxPathHeight = 100; |
312 static const int kGMWidth = 512; | 312 static const int kGMWidth = 512; |
313 static const int kGMHeight = 512; | 313 static const int kGMHeight = 512; |
314 | 314 |
315 typedef GM INHERITED; | 315 typedef GM INHERITED; |
316 }; | 316 }; |
317 | 317 |
318 ////////////////////////////////////////////////////////////////////////////// | 318 ////////////////////////////////////////////////////////////////////////////// |
319 | 319 |
320 DEF_GM( return SkNEW(ConvexLineOnlyPathsGM); ) | 320 DEF_GM(return new ConvexLineOnlyPathsGM;) |
321 | |
322 } | 321 } |
OLD | NEW |