| 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 | 7 |
| 8 #include "gm.h" | 8 #include "gm.h" |
| 9 #include "SkPath.h" | 9 #include "SkPath.h" |
| 10 #include "SkRandom.h" | 10 #include "SkRandom.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 strokePaint.setAlpha(255); | 121 strokePaint.setAlpha(255); |
| 122 strokePaint.setStrokeWidth(i ? 8.f : 10.f); | 122 strokePaint.setStrokeWidth(i ? 8.f : 10.f); |
| 123 strokePaint.setStrokeCap(i ? SkPaint::kSquare_Cap : SkPaint::kRound_
Cap); | 123 strokePaint.setStrokeCap(i ? SkPaint::kSquare_Cap : SkPaint::kRound_
Cap); |
| 124 canvas->save(); | 124 canvas->save(); |
| 125 canvas->translate(10 + i * 100.f, 10); | 125 canvas->translate(10 + i * 100.f, 10); |
| 126 canvas->drawPath(fMoveHfPath, strokePaint); | 126 canvas->drawPath(fMoveHfPath, strokePaint); |
| 127 canvas->translate(0, 20); | 127 canvas->translate(0, 20); |
| 128 canvas->drawPath(fMoveZfPath, strokePaint); | 128 canvas->drawPath(fMoveZfPath, strokePaint); |
| 129 dashPaint = strokePaint; | 129 dashPaint = strokePaint; |
| 130 const SkScalar intervals[] = { 0, 10 }; | 130 const SkScalar intervals[] = { 0, 10 }; |
| 131 dashPaint.setPathEffect(SkDashPathEffect::Make(intervals, 2, 0)); | 131 dashPaint.setPathEffect(SkDashPathEffect::Create(intervals, 2, 0))->
unref(); |
| 132 SkPath fillPath; | 132 SkPath fillPath; |
| 133 dashPaint.getFillPath(fDashedfPath, &fillPath); | 133 dashPaint.getFillPath(fDashedfPath, &fillPath); |
| 134 canvas->translate(0, 20); | 134 canvas->translate(0, 20); |
| 135 canvas->drawPath(fDashedfPath, dashPaint); | 135 canvas->drawPath(fDashedfPath, dashPaint); |
| 136 canvas->translate(0, 20); | 136 canvas->translate(0, 20); |
| 137 canvas->drawPath(fRefPath[i * 2], fillPaint); | 137 canvas->drawPath(fRefPath[i * 2], fillPaint); |
| 138 strokePaint.setStrokeWidth(20); | 138 strokePaint.setStrokeWidth(20); |
| 139 strokePaint.setAlpha(127); | 139 strokePaint.setAlpha(127); |
| 140 canvas->translate(0, 50); | 140 canvas->translate(0, 50); |
| 141 canvas->drawPath(fMoveHfPath, strokePaint); | 141 canvas->drawPath(fMoveHfPath, strokePaint); |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 ////////////////////////////////////////////////////////////////////////////// | 516 ////////////////////////////////////////////////////////////////////////////// |
| 517 | 517 |
| 518 DEF_GM( return new StrokesGM; ) | 518 DEF_GM( return new StrokesGM; ) |
| 519 DEF_GM( return new Strokes2GM; ) | 519 DEF_GM( return new Strokes2GM; ) |
| 520 DEF_GM( return new Strokes3GM; ) | 520 DEF_GM( return new Strokes3GM; ) |
| 521 DEF_GM( return new Strokes4GM; ) | 521 DEF_GM( return new Strokes4GM; ) |
| 522 DEF_GM( return new Strokes5GM; ) | 522 DEF_GM( return new Strokes5GM; ) |
| 523 | 523 |
| 524 DEF_GM( return new ZeroLenStrokesGM; ) | 524 DEF_GM( return new ZeroLenStrokesGM; ) |
| 525 DEF_GM( return new TeenyStrokesGM; ) | 525 DEF_GM( return new TeenyStrokesGM; ) |
| OLD | NEW |