| 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 #include "gm.h" | 7 #include "gm.h" |
| 8 #include "Resources.h" | 8 #include "Resources.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkStream.h" | 10 #include "SkStream.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 #else | 65 #else |
| 66 SkCanvas* canvas = inputCanvas; | 66 SkCanvas* canvas = inputCanvas; |
| 67 #endif | 67 #endif |
| 68 // apply global scale to test glyph positioning | 68 // apply global scale to test glyph positioning |
| 69 canvas->scale(1.05f, 1.05f); | 69 canvas->scale(1.05f, 1.05f); |
| 70 canvas->clear(0xffffffff); | 70 canvas->clear(0xffffffff); |
| 71 | 71 |
| 72 SkPaint paint; | 72 SkPaint paint; |
| 73 paint.setAntiAlias(true); | 73 paint.setAntiAlias(true); |
| 74 paint.setSubpixelText(true); | 74 paint.setSubpixelText(true); |
| 75 #if !SK_SUPPORT_GPU | 75 |
| 76 paint.setDistanceFieldTextTEMP(true); | |
| 77 #endif | |
| 78 sk_tool_utils::set_portable_typeface(&paint, "Times New Roman", SkTypefa
ce::kNormal); | 76 sk_tool_utils::set_portable_typeface(&paint, "Times New Roman", SkTypefa
ce::kNormal); |
| 79 | 77 |
| 80 const char* text = "Hamburgefons"; | 78 const char* text = "Hamburgefons"; |
| 81 const size_t textLen = strlen(text); | 79 const size_t textLen = strlen(text); |
| 82 | 80 |
| 83 // check scaling up | 81 // check scaling up |
| 84 SkScalar x = SkIntToScalar(0); | 82 SkScalar x = SkIntToScalar(0); |
| 85 SkScalar y = SkIntToScalar(78); | 83 SkScalar y = SkIntToScalar(78); |
| 86 for (size_t i = 0; i < SK_ARRAY_COUNT(textSizes); ++i) { | 84 for (size_t i = 0; i < SK_ARRAY_COUNT(textSizes); ++i) { |
| 87 SkAutoCanvasRestore acr(canvas, true); | 85 SkAutoCanvasRestore acr(canvas, true); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 #endif | 225 #endif |
| 228 } | 226 } |
| 229 | 227 |
| 230 private: | 228 private: |
| 231 SkTypeface* fTypeface; | 229 SkTypeface* fTypeface; |
| 232 | 230 |
| 233 typedef skiagm::GM INHERITED; | 231 typedef skiagm::GM INHERITED; |
| 234 }; | 232 }; |
| 235 | 233 |
| 236 DEF_GM( return SkNEW(DFTextGM); ) | 234 DEF_GM( return SkNEW(DFTextGM); ) |
| OLD | NEW |