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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 int i = 2*s; | 166 int i = 2*s; |
167 canvas->translate(SkIntToScalar((i / testsPerCol) * colWidth), | 167 canvas->translate(SkIntToScalar((i / testsPerCol) * colWidth), |
168 SkIntToScalar((i % testsPerCol) * rowHeight)); | 168 SkIntToScalar((i % testsPerCol) * rowHeight)); |
169 paint.setShader(shaders[s])->unref(); | 169 paint.setShader(shaders[s])->unref(); |
170 canvas->drawText(text, textLen, 0, textBase, paint); | 170 canvas->drawText(text, textLen, 0, textBase, paint); |
171 canvas->restore(); | 171 canvas->restore(); |
172 canvas->save(); | 172 canvas->save(); |
173 ++i; | 173 ++i; |
174 canvas->translate(SkIntToScalar((i / testsPerCol) * colWidth), | 174 canvas->translate(SkIntToScalar((i / testsPerCol) * colWidth), |
175 SkIntToScalar((i % testsPerCol) * rowHeight)); | 175 SkIntToScalar((i % testsPerCol) * rowHeight)); |
176 canvas->drawTextOnPath(text, textLen, path, NULL, paint); | 176 canvas->drawTextOnPath(text, textLen, path, NULL, |
| 177 SkCanvas::kStretch_TextOnPathMethod, paint); |
177 canvas->restore(); | 178 canvas->restore(); |
178 } | 179 } |
179 canvas->restore(); | 180 canvas->restore(); |
180 | 181 |
181 } | 182 } |
182 | 183 |
183 private: | 184 private: |
184 typedef GM INHERITED; | 185 typedef GM INHERITED; |
185 }; | 186 }; |
186 | 187 |
187 /////////////////////////////////////////////////////////////////////////////// | 188 /////////////////////////////////////////////////////////////////////////////// |
188 | 189 |
189 static GM* MyFactory(void*) { return new ShaderTextGM; } | 190 static GM* MyFactory(void*) { return new ShaderTextGM; } |
190 static GMRegistry reg(MyFactory); | 191 static GMRegistry reg(MyFactory); |
191 } | 192 } |
OLD | NEW |