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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 const SkScalar boundsHalfWidth = bounds.width() * SK_ScalarHalf; | 63 const SkScalar boundsHalfWidth = bounds.width() * SK_ScalarHalf; |
64 const SkScalar boundsHalfHeight = bounds.height() * SK_ScalarHalf; | 64 const SkScalar boundsHalfHeight = bounds.height() * SK_ScalarHalf; |
65 | 65 |
66 SkScalar xOffset = boundsHalfWidth; | 66 SkScalar xOffset = boundsHalfWidth; |
67 yOffset = boundsHalfHeight; | 67 yOffset = boundsHalfHeight; |
68 | 68 |
69 // LCD | 69 // LCD |
70 paint.setTextSize(32); | 70 paint.setTextSize(32); |
71 text = "LCD!!!!!"; | 71 text = "LCD!!!!!"; |
| 72 paint.setAntiAlias(true); |
72 paint.setSubpixelText(true); | 73 paint.setSubpixelText(true); |
73 paint.setLCDRenderText(true); | 74 paint.setLCDRenderText(true); |
74 paint.measureText(text, strlen(text), &bounds); | 75 paint.measureText(text, strlen(text), &bounds); |
75 sk_tool_utils::add_to_text_blob(&builder, text, paint, xOffset - bounds.
width() * 0.25f, | 76 sk_tool_utils::add_to_text_blob(&builder, text, paint, xOffset - bounds.
width() * 0.25f, |
76 yOffset - bounds.height() * 0.5f); | 77 yOffset - bounds.height() * 0.5f); |
77 yOffset += bounds.height(); | 78 yOffset += bounds.height(); |
78 | 79 |
79 // color emoji | 80 // color emoji |
80 if (fEmojiTypeface) { | 81 if (fEmojiTypeface) { |
| 82 paint.setAntiAlias(false); |
81 paint.setSubpixelText(false); | 83 paint.setSubpixelText(false); |
82 paint.setLCDRenderText(false); | 84 paint.setLCDRenderText(false); |
83 paint.setTypeface(fEmojiTypeface); | 85 paint.setTypeface(fEmojiTypeface); |
84 text = fEmojiText; | 86 text = fEmojiText; |
85 paint.measureText(text, strlen(text), &bounds); | 87 paint.measureText(text, strlen(text), &bounds); |
86 sk_tool_utils::add_to_text_blob(&builder, text, paint, xOffset - bou
nds.width() * 0.3f, | 88 sk_tool_utils::add_to_text_blob(&builder, text, paint, xOffset - bou
nds.width() * 0.3f, |
87 yOffset); | 89 yOffset); |
88 } | 90 } |
89 | 91 |
90 // Corrupted font | 92 // Corrupted font |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 static const int kWidth = 1250; | 158 static const int kWidth = 1250; |
157 static const int kHeight = 700; | 159 static const int kHeight = 700; |
158 | 160 |
159 typedef GM INHERITED; | 161 typedef GM INHERITED; |
160 }; | 162 }; |
161 | 163 |
162 ////////////////////////////////////////////////////////////////////////////// | 164 ////////////////////////////////////////////////////////////////////////////// |
163 | 165 |
164 DEF_GM( return SkNEW(MixedTextBlobsGM); ) | 166 DEF_GM( return SkNEW(MixedTextBlobsGM); ) |
165 } | 167 } |
OLD | NEW |