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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkGradientShader.h" | 10 #include "SkGradientShader.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 for (size_t ty = 0; ty < SK_ARRAY_COUNT(tileModes); ++ty) { | 148 for (size_t ty = 0; ty < SK_ARRAY_COUNT(tileModes); ++ty) { |
149 shaders[shdIdx++] = MakeBitmapShader(tileModes[tx], | 149 shaders[shdIdx++] = MakeBitmapShader(tileModes[tx], |
150 tileModes[ty], | 150 tileModes[ty], |
151 w/8, h); | 151 w/8, h); |
152 } | 152 } |
153 } | 153 } |
154 | 154 |
155 SkPaint paint; | 155 SkPaint paint; |
156 paint.setDither(true); | 156 paint.setDither(true); |
157 paint.setAntiAlias(true); | 157 paint.setAntiAlias(true); |
| 158 sk_tool_utils::set_portable_typeface(&paint); |
158 paint.setTextSize(SkIntToScalar(pointSize)); | 159 paint.setTextSize(SkIntToScalar(pointSize)); |
159 | 160 |
160 canvas->save(); | 161 canvas->save(); |
161 canvas->translate(SkIntToScalar(20), SkIntToScalar(10)); | 162 canvas->translate(SkIntToScalar(20), SkIntToScalar(10)); |
162 | 163 |
163 SkPath path; | 164 SkPath path; |
164 path.arcTo(SkRect::MakeXYWH(SkIntToScalar(-40), SkIntToScalar(15), | 165 path.arcTo(SkRect::MakeXYWH(SkIntToScalar(-40), SkIntToScalar(15), |
165 SkIntToScalar(300), SkIntToScalar(90)), | 166 SkIntToScalar(300), SkIntToScalar(90)), |
166 SkIntToScalar(225), SkIntToScalar(90), | 167 SkIntToScalar(225), SkIntToScalar(90), |
167 false); | 168 false); |
(...skipping 24 matching lines...) Expand all Loading... |
192 | 193 |
193 private: | 194 private: |
194 typedef GM INHERITED; | 195 typedef GM INHERITED; |
195 }; | 196 }; |
196 | 197 |
197 /////////////////////////////////////////////////////////////////////////////// | 198 /////////////////////////////////////////////////////////////////////////////// |
198 | 199 |
199 static GM* MyFactory(void*) { return new ShaderTextGM; } | 200 static GM* MyFactory(void*) { return new ShaderTextGM; } |
200 static GMRegistry reg(MyFactory); | 201 static GMRegistry reg(MyFactory); |
201 } | 202 } |
OLD | NEW |