OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include "gm.h" | 7 #include "gm.h" |
8 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkPaint.h" | 9 #include "SkPaint.h" |
10 #include "SkRandom.h" | 10 #include "SkRandom.h" |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 titlePaint.setLCDRenderText(true); | 295 titlePaint.setLCDRenderText(true); |
296 titlePaint.setTextSize(15 * SK_Scalar1); | 296 titlePaint.setTextSize(15 * SK_Scalar1); |
297 const char title[] = "Random Paths Drawn Into Rectangle Clips With " | 297 const char title[] = "Random Paths Drawn Into Rectangle Clips With " |
298 "Indicated Style, Fill and Linecaps, " | 298 "Indicated Style, Fill and Linecaps, " |
299 "with Stroke width 6"; | 299 "with Stroke width 6"; |
300 canvas->drawText(title, strlen(title), | 300 canvas->drawText(title, strlen(title), |
301 20 * SK_Scalar1, | 301 20 * SK_Scalar1, |
302 20 * SK_Scalar1, | 302 20 * SK_Scalar1, |
303 titlePaint); | 303 titlePaint); |
304 | 304 |
305 SkLCGRandom rand; | 305 SkRandom rand; |
306 SkRect rect = SkRect::MakeWH(220*SK_Scalar1, 50*SK_Scalar1); | 306 SkRect rect = SkRect::MakeWH(220*SK_Scalar1, 50*SK_Scalar1); |
307 canvas->save(); | 307 canvas->save(); |
308 canvas->translate(2*SK_Scalar1, 30 * SK_Scalar1); // The title | 308 canvas->translate(2*SK_Scalar1, 30 * SK_Scalar1); // The title |
309 canvas->save(); | 309 canvas->save(); |
310 unsigned numSegments = SK_ARRAY_COUNT(gSegmentFunctions); | 310 unsigned numSegments = SK_ARRAY_COUNT(gSegmentFunctions); |
311 unsigned numCaps = SK_ARRAY_COUNT(gCaps); | 311 unsigned numCaps = SK_ARRAY_COUNT(gCaps); |
312 unsigned numStyles = SK_ARRAY_COUNT(gStyles); | 312 unsigned numStyles = SK_ARRAY_COUNT(gStyles); |
313 unsigned numFills = SK_ARRAY_COUNT(gFills); | 313 unsigned numFills = SK_ARRAY_COUNT(gFills); |
314 for (size_t row = 0; row < 6; ++row) { | 314 for (size_t row = 0; row < 6; ++row) { |
315 if (0 < row) { | 315 if (0 < row) { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 private: | 397 private: |
398 typedef GM INHERITED; | 398 typedef GM INHERITED; |
399 }; | 399 }; |
400 | 400 |
401 ////////////////////////////////////////////////////////////////////////////// | 401 ////////////////////////////////////////////////////////////////////////////// |
402 | 402 |
403 static GM* MyFactory(void*) { return new DegenerateSegmentsGM; } | 403 static GM* MyFactory(void*) { return new DegenerateSegmentsGM; } |
404 static GMRegistry reg(MyFactory); | 404 static GMRegistry reg(MyFactory); |
405 | 405 |
406 } | 406 } |
OLD | NEW |