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 "SkPath.h" | 8 #include "SkPath.h" |
9 #include "SkStream.h" | 9 #include "SkStream.h" |
10 #include "gm.h" | 10 #include "gm.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 bkgrnd.setColor(SK_ColorWHITE); | 84 bkgrnd.setColor(SK_ColorWHITE); |
85 canvas->drawRect(SkRect::MakeIWH(onISize().fWidth, onISize().fHeight), b
kgrnd); | 85 canvas->drawRect(SkRect::MakeIWH(onISize().fWidth, onISize().fHeight), b
kgrnd); |
86 | 86 |
87 auto drawPaths = [&](SkPaint& paint, int indexMask) { | 87 auto drawPaths = [&](SkPaint& paint, int indexMask) { |
88 canvas->translate(0, 30.0f); | 88 canvas->translate(0, 30.0f); |
89 int index = 0; | 89 int index = 0; |
90 for (const SkPath& path : fPaths) { | 90 for (const SkPath& path : fPaths) { |
91 if (indexMask & (1 << index)) { | 91 if (indexMask & (1 << index)) { |
92 canvas->drawPath(path, paint); | 92 canvas->drawPath(path, paint); |
93 } | 93 } |
94 if (paint.getStrokeWidth() < 2) { | 94 if (this->getMode() == skiagm::GM::kSample_Mode && paint.getStro
keWidth() < 2) { |
95 drawFat(canvas, path, paint, index); | 95 drawFat(canvas, path, paint, index); |
96 } | 96 } |
97 ++index; | 97 ++index; |
98 } | 98 } |
99 }; | 99 }; |
100 | 100 |
101 if (false) { // debugging variant that draws a single element | 101 if (false) { // debugging variant that draws a single element |
102 SkScalar width = 0; | 102 SkScalar width = 0; |
103 bool antialias = true; | 103 bool antialias = true; |
104 | 104 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 + (index >= 5 ? 5 : 0)) / scale, (bounds.fTop - 20 + 420) /
scale); | 186 + (index >= 5 ? 5 : 0)) / scale, (bounds.fTop - 20 + 420) /
scale); |
187 canvas->restore(); | 187 canvas->restore(); |
188 } | 188 } |
189 } | 189 } |
190 | 190 |
191 }; | 191 }; |
192 | 192 |
193 /////////////////////////////////////////////////////////////////////////////// | 193 /////////////////////////////////////////////////////////////////////////////// |
194 | 194 |
195 DEF_GM( return new StrokeZeroGM(); ) | 195 DEF_GM( return new StrokeZeroGM(); ) |
OLD | NEW |