Index: gm/mixedtextblobs.cpp |
diff --git a/gm/mixedtextblobs.cpp b/gm/mixedtextblobs.cpp |
index ab7beb909b5d3a32afd682ccd21177660bb0bf8f..643ac0511b9185788a81f0192562a9a25369e47b 100644 |
--- a/gm/mixedtextblobs.cpp |
+++ b/gm/mixedtextblobs.cpp |
@@ -39,14 +39,18 @@ public: |
protected: |
void onOnceBeforeDraw() override { |
-#ifndef SK_BUILD_FOR_MAC |
- fEmojiTypeface.reset(GetResourceAsTypeface("/fonts/Funkster.ttf")); |
- fEmojiText = "Emoji!!!"; |
-#else |
- fEmojiTypeface.reset(SkTypeface::CreateFromName("Apple Color Emoji", SkTypeface::kNormal)); |
- fEmojiText = "\xF0\x9F\x92\xB0" "\xF0\x9F\x8F\xA1" "\xF0\x9F\x8E\x85" // 💰🏡🎅 |
- "\xF0\x9F\x8D\xAA" "\xF0\x9F\x8D\x95" "\xF0\x9F\x9A\x80"; // 🍪🍕🚀 |
-#endif |
+ if (!strcmp(sk_tool_utils::platform_os_emoji(), "CBDT")) { |
+ fEmojiTypeface.reset(GetResourceAsTypeface("/fonts/Funkster.ttf")); |
+ fEmojiText = "Emoji!!!"; |
+ } else if (!strcmp(sk_tool_utils::platform_os_emoji(), "SBIX")) { |
+ fEmojiTypeface.reset(SkTypeface::CreateFromName("Apple Color Emoji", |
+ SkTypeface::kNormal)); |
+ fEmojiText = "\xF0\x9F\x92\xB0" "\xF0\x9F\x8F\xA1" "\xF0\x9F\x8E\x85" // 💰🏡🎅 |
+ "\xF0\x9F\x8D\xAA" "\xF0\x9F\x8D\x95" "\xF0\x9F\x9A\x80"; // 🍪🍕🚀 |
+ } else { |
+ fEmojiTypeface.reset(NULL); |
+ fEmojiText = ""; |
+ } |
fReallyBigATypeface.reset(GetResourceAsTypeface("/fonts/ReallyBigA.ttf")); |
SkTextBlobBuilder builder; |
@@ -83,13 +87,15 @@ protected: |
yOffset += bounds.height(); |
// color emoji |
- paint.setSubpixelText(false); |
- paint.setLCDRenderText(false); |
- paint.setTypeface(fEmojiTypeface); |
- text = fEmojiText; |
- paint.measureText(text, strlen(text), &bounds); |
- sk_tool_utils::add_to_text_blob(&builder, text, paint, xOffset - bounds.width() * 0.3f, |
- yOffset); |
+ if (fEmojiTypeface) { |
+ paint.setSubpixelText(false); |
+ paint.setLCDRenderText(false); |
+ paint.setTypeface(fEmojiTypeface); |
+ text = fEmojiText; |
+ paint.measureText(text, strlen(text), &bounds); |
+ sk_tool_utils::add_to_text_blob(&builder, text, paint, xOffset - bounds.width() * 0.3f, |
+ yOffset); |
+ } |
// Corrupted font |
paint.setTextSize(12); |
@@ -100,7 +106,9 @@ protected: |
} |
SkString onShortName() override { |
- return SkString("mixedtextblobs"); |
+ SkString name("mixedtextblobs"); |
+ name.append(sk_tool_utils::platform_os_emoji()); |
+ return name; |
} |
SkISize onISize() override { |