OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkTArray.h" | 10 #include "SkTArray.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 } | 161 } |
162 } | 162 } |
163 | 163 |
164 void onDraw(SkCanvas* canvas) override { | 164 void onDraw(SkCanvas* canvas) override { |
165 static const SkAlpha kAlphaValue[] = { 0xFF, 0x40 }; | 165 static const SkAlpha kAlphaValue[] = { 0xFF, 0x40 }; |
166 static const SkScalar kWidths[] = { 0, 0.5f, 1.5f }; | 166 static const SkScalar kWidths[] = { 0, 0.5f, 1.5f }; |
167 | 167 |
168 enum { | 168 enum { |
169 kMargin = 5, | 169 kMargin = 5, |
170 }; | 170 }; |
171 int wrapX = canvas->getDeviceSize().fWidth - kMargin; | 171 int wrapX = 1250 - kMargin; |
172 | 172 |
173 SkScalar maxH = 0; | 173 SkScalar maxH = 0; |
174 canvas->translate(SkIntToScalar(kMargin), SkIntToScalar(kMargin)); | 174 canvas->translate(SkIntToScalar(kMargin), SkIntToScalar(kMargin)); |
175 canvas->save(); | 175 canvas->save(); |
176 | 176 |
177 SkScalar x = SkIntToScalar(kMargin); | 177 SkScalar x = SkIntToScalar(kMargin); |
178 for (int p = 0; p < fPaths.count(); ++p) { | 178 for (int p = 0; p < fPaths.count(); ++p) { |
179 for (size_t a = 0; a < SK_ARRAY_COUNT(kAlphaValue); ++a) { | 179 for (size_t a = 0; a < SK_ARRAY_COUNT(kAlphaValue); ++a) { |
180 for (int aa = 0; aa < 2; ++aa) { | 180 for (int aa = 0; aa < 2; ++aa) { |
181 for (size_t w = 0; w < SK_ARRAY_COUNT(kWidths); w++) { | 181 for (size_t w = 0; w < SK_ARRAY_COUNT(kWidths); w++) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 SkTArray<SkPath> fPaths; | 216 SkTArray<SkPath> fPaths; |
217 typedef GM INHERITED; | 217 typedef GM INHERITED; |
218 }; | 218 }; |
219 | 219 |
220 ////////////////////////////////////////////////////////////////////////////// | 220 ////////////////////////////////////////////////////////////////////////////// |
221 | 221 |
222 static GM* MyFactory(void*) { return new HairlinesGM; } | 222 static GM* MyFactory(void*) { return new HairlinesGM; } |
223 static GMRegistry reg(MyFactory); | 223 static GMRegistry reg(MyFactory); |
224 | 224 |
225 } | 225 } |
OLD | NEW |