| 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 | 9 |
| 10 #include "Resources.h" | 10 #include "Resources.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 fEmojiText = sk_tool_utils::emoji_sample_text(); | 43 fEmojiText = sk_tool_utils::emoji_sample_text(); |
| 44 fReallyBigATypeface.reset(GetResourceAsTypeface("/fonts/ReallyBigA.ttf")
); | 44 fReallyBigATypeface.reset(GetResourceAsTypeface("/fonts/ReallyBigA.ttf")
); |
| 45 | 45 |
| 46 SkTextBlobBuilder builder; | 46 SkTextBlobBuilder builder; |
| 47 | 47 |
| 48 // make textblob | 48 // make textblob |
| 49 // Text so large we draw as paths | 49 // Text so large we draw as paths |
| 50 SkPaint paint; | 50 SkPaint paint; |
| 51 paint.setTextSize(385); | 51 paint.setTextSize(385); |
| 52 const char* text = "O"; | 52 const char* text = "O"; |
| 53 sk_tool_utils::set_portable_typeface(&paint); | 53 sk_tool_utils::set_portable_typeface_always(&paint); |
| 54 | 54 |
| 55 SkRect bounds; | 55 SkRect bounds; |
| 56 paint.measureText(text, strlen(text), &bounds); | 56 paint.measureText(text, strlen(text), &bounds); |
| 57 | 57 |
| 58 SkScalar yOffset = bounds.height(); | 58 SkScalar yOffset = bounds.height(); |
| 59 sk_tool_utils::add_to_text_blob(&builder, text, paint, 10, yOffset); | 59 sk_tool_utils::add_to_text_blob(&builder, text, paint, 10, yOffset); |
| 60 SkScalar corruptedAx = bounds.width(); | 60 SkScalar corruptedAx = bounds.width(); |
| 61 SkScalar corruptedAy = yOffset; | 61 SkScalar corruptedAy = yOffset; |
| 62 | 62 |
| 63 const SkScalar boundsHalfWidth = bounds.width() * SK_ScalarHalf; | 63 const SkScalar boundsHalfWidth = bounds.width() * SK_ScalarHalf; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 static const int kWidth = 1250; | 156 static const int kWidth = 1250; |
| 157 static const int kHeight = 700; | 157 static const int kHeight = 700; |
| 158 | 158 |
| 159 typedef GM INHERITED; | 159 typedef GM INHERITED; |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 ////////////////////////////////////////////////////////////////////////////// | 162 ////////////////////////////////////////////////////////////////////////////// |
| 163 | 163 |
| 164 DEF_GM( return SkNEW(MixedTextBlobsGM); ) | 164 DEF_GM( return SkNEW(MixedTextBlobsGM); ) |
| 165 } | 165 } |
| OLD | NEW |