| 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 "SkFontMgr.h" | 10 #include "SkFontMgr.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 void onDraw(SkCanvas* canvas) override { | 255 void onDraw(SkCanvas* canvas) override { |
| 256 SkPaint paint; | 256 SkPaint paint; |
| 257 paint.setAntiAlias(true); | 257 paint.setAntiAlias(true); |
| 258 paint.setSubpixelText(true); | 258 paint.setSubpixelText(true); |
| 259 paint.setTextSize(100); | 259 paint.setTextSize(100); |
| 260 paint.setStyle(SkPaint::kStroke_Style); | 260 paint.setStyle(SkPaint::kStroke_Style); |
| 261 paint.setTextScaleX(fScaleX); | 261 paint.setTextScaleX(fScaleX); |
| 262 paint.setTextSkewX(fSkewX); | 262 paint.setTextSkewX(fSkewX); |
| 263 | 263 |
| 264 const SkColor boundsColors[2] = { SK_ColorRED, SK_ColorBLUE }; | 264 const SkColor boundsColors[2] = { SK_ColorRED, SK_ColorBLUE }; |
| 265 | 265 |
| 266 SkFontMgr* fm = fFM; | 266 SkFontMgr* fm = fFM; |
| 267 int count = SkMin32(fm->countFamilies(), 32); | 267 int count = SkMin32(fm->countFamilies(), 32); |
| 268 | 268 |
| 269 int index = 0; | 269 int index = 0; |
| 270 SkScalar x = 0, y = 0; | 270 SkScalar x = 0, y = 0; |
| 271 | 271 |
| 272 canvas->translate(80, 120); | 272 canvas->translate(80, 120); |
| 273 | 273 |
| 274 for (int i = 0; i < count; ++i) { | 274 for (int i = 0; i < count; ++i) { |
| 275 SkAutoTUnref<SkFontStyleSet> set(fm->createStyleSet(i)); | 275 SkAutoTUnref<SkFontStyleSet> set(fm->createStyleSet(i)); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 302 | 302 |
| 303 DEF_GM(return new FontMgrGM;) | 303 DEF_GM(return new FontMgrGM;) |
| 304 DEF_GM(return new FontMgrMatchGM;) | 304 DEF_GM(return new FontMgrMatchGM;) |
| 305 DEF_GM(return new FontMgrBoundsGM(1.0, 0);) | 305 DEF_GM(return new FontMgrBoundsGM(1.0, 0);) |
| 306 DEF_GM(return new FontMgrBoundsGM(0.75, 0);) | 306 DEF_GM(return new FontMgrBoundsGM(0.75, 0);) |
| 307 DEF_GM(return new FontMgrBoundsGM(1.0, -0.25);) | 307 DEF_GM(return new FontMgrBoundsGM(1.0, -0.25);) |
| 308 | 308 |
| 309 #ifdef SK_BUILD_FOR_WIN | 309 #ifdef SK_BUILD_FOR_WIN |
| 310 DEF_GM(return new FontMgrGM(SkFontMgr_New_DirectWrite());) | 310 DEF_GM(return new FontMgrGM(SkFontMgr_New_DirectWrite());) |
| 311 #endif | 311 #endif |
| OLD | NEW |