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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 titlePaint.setLCDRenderText(true); | 290 titlePaint.setLCDRenderText(true); |
291 titlePaint.setTextSize(15 * SK_Scalar1); | 291 titlePaint.setTextSize(15 * SK_Scalar1); |
292 const char title[] = "Random Paths Drawn Into Rectangle Clips With " | 292 const char title[] = "Random Paths Drawn Into Rectangle Clips With " |
293 "Indicated Style, Fill and Linecaps, " | 293 "Indicated Style, Fill and Linecaps, " |
294 "with Stroke width 6"; | 294 "with Stroke width 6"; |
295 canvas->drawText(title, strlen(title), | 295 canvas->drawText(title, strlen(title), |
296 20 * SK_Scalar1, | 296 20 * SK_Scalar1, |
297 20 * SK_Scalar1, | 297 20 * SK_Scalar1, |
298 titlePaint); | 298 titlePaint); |
299 | 299 |
300 SkRandom rand; | 300 SkLCGRandom rand; |
301 SkRect rect = SkRect::MakeWH(220*SK_Scalar1, 50*SK_Scalar1); | 301 SkRect rect = SkRect::MakeWH(220*SK_Scalar1, 50*SK_Scalar1); |
302 canvas->save(); | 302 canvas->save(); |
303 canvas->translate(2*SK_Scalar1, 30 * SK_Scalar1); // The title | 303 canvas->translate(2*SK_Scalar1, 30 * SK_Scalar1); // The title |
304 canvas->save(); | 304 canvas->save(); |
305 unsigned numSegments = SK_ARRAY_COUNT(gSegmentFunctions); | 305 unsigned numSegments = SK_ARRAY_COUNT(gSegmentFunctions); |
306 unsigned numCaps = SK_ARRAY_COUNT(gCaps); | 306 unsigned numCaps = SK_ARRAY_COUNT(gCaps); |
307 unsigned numStyles = SK_ARRAY_COUNT(gStyles); | 307 unsigned numStyles = SK_ARRAY_COUNT(gStyles); |
308 unsigned numFills = SK_ARRAY_COUNT(gFills); | 308 unsigned numFills = SK_ARRAY_COUNT(gFills); |
309 for (size_t row = 0; row < 6; ++row) { | 309 for (size_t row = 0; row < 6; ++row) { |
310 if (0 < row) { | 310 if (0 < row) { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 private: | 391 private: |
392 typedef GM INHERITED; | 392 typedef GM INHERITED; |
393 }; | 393 }; |
394 | 394 |
395 ////////////////////////////////////////////////////////////////////////////// | 395 ////////////////////////////////////////////////////////////////////////////// |
396 | 396 |
397 static GM* MyFactory(void*) { return new DegenerateSegmentsGM; } | 397 static GM* MyFactory(void*) { return new DegenerateSegmentsGM; } |
398 static GMRegistry reg(MyFactory); | 398 static GMRegistry reg(MyFactory); |
399 | 399 |
400 } | 400 } |
OLD | NEW |