| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 sk_tool_utils::add_to_text_blob(&builder, text, paint, 0, yOffset); | 67 sk_tool_utils::add_to_text_blob(&builder, text, paint, 0, yOffset); |
| 68 | 68 |
| 69 // micro (will fall out of distance field text even if distance field te
xt is enabled) | 69 // micro (will fall out of distance field text even if distance field te
xt is enabled) |
| 70 paint.measureText(text, strlen(text), &bounds); | 70 paint.measureText(text, strlen(text), &bounds); |
| 71 yOffset += bounds.height(); | 71 yOffset += bounds.height(); |
| 72 paint.setTextSize(14); | 72 paint.setTextSize(14); |
| 73 | 73 |
| 74 sk_tool_utils::add_to_text_blob(&builder, text, paint, 0, yOffset); | 74 sk_tool_utils::add_to_text_blob(&builder, text, paint, 0, yOffset); |
| 75 | 75 |
| 76 // Zero size. |
| 77 paint.measureText(text, strlen(text), &bounds); |
| 78 yOffset += bounds.height(); |
| 79 paint.setTextSize(0); |
| 80 |
| 81 sk_tool_utils::add_to_text_blob(&builder, text, paint, 0, yOffset); |
| 82 |
| 76 // build | 83 // build |
| 77 fBlob.reset(builder.build()); | 84 fBlob.reset(builder.build()); |
| 78 } | 85 } |
| 79 | 86 |
| 80 SkString onShortName() override { | 87 SkString onShortName() override { |
| 81 SkString name("textblobmixedsizes"); | 88 SkString name("textblobmixedsizes"); |
| 82 if (fUseDFT) { | 89 if (fUseDFT) { |
| 83 name.appendf("_df"); | 90 name.appendf("_df"); |
| 84 } | 91 } |
| 85 return name; | 92 return name; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 typedef GM INHERITED; | 189 typedef GM INHERITED; |
| 183 }; | 190 }; |
| 184 | 191 |
| 185 ////////////////////////////////////////////////////////////////////////////// | 192 ////////////////////////////////////////////////////////////////////////////// |
| 186 | 193 |
| 187 DEF_GM( return new TextBlobMixedSizes(false); ) | 194 DEF_GM( return new TextBlobMixedSizes(false); ) |
| 188 #if SK_SUPPORT_GPU | 195 #if SK_SUPPORT_GPU |
| 189 DEF_GM( return new TextBlobMixedSizes(true); ) | 196 DEF_GM( return new TextBlobMixedSizes(true); ) |
| 190 #endif | 197 #endif |
| 191 } | 198 } |
| OLD | NEW |