OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "sk_tool_utils.h" | 8 #include "sk_tool_utils.h" |
9 #include "sk_tool_utils_flags.h" | 9 #include "sk_tool_utils_flags.h" |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 } | 65 } |
66 | 66 |
67 const char* platform_os_emoji() { | 67 const char* platform_os_emoji() { |
68 const char* osName = platform_os_name(); | 68 const char* osName = platform_os_name(); |
69 if (!strcmp(osName, "Android") || !strcmp(osName, "Ubuntu")) { | 69 if (!strcmp(osName, "Android") || !strcmp(osName, "Ubuntu")) { |
70 return "CBDT"; | 70 return "CBDT"; |
71 } | 71 } |
72 if (!strncmp(osName, "Mac", 3)) { | 72 if (!strncmp(osName, "Mac", 3)) { |
73 return "SBIX"; | 73 return "SBIX"; |
74 } | 74 } |
75 if (!strncmp(osName, "Win", 3)) { | |
76 return "COLR"; | |
77 } | |
75 return ""; | 78 return ""; |
76 } | 79 } |
77 | 80 |
78 sk_sp<SkTypeface> emoji_typeface() { | 81 sk_sp<SkTypeface> emoji_typeface() { |
79 if (!strcmp(sk_tool_utils::platform_os_emoji(), "CBDT")) { | 82 if (!strcmp(sk_tool_utils::platform_os_emoji(), "CBDT")) { |
80 return MakeResourceAsTypeface("/fonts/Funkster.ttf"); | 83 return MakeResourceAsTypeface("/fonts/Funkster.ttf"); |
81 } | 84 } |
82 if (!strcmp(sk_tool_utils::platform_os_emoji(), "SBIX")) { | 85 if (!strcmp(sk_tool_utils::platform_os_emoji(), "SBIX")) { |
83 return SkTypeface::MakeFromName("Apple Color Emoji", SkTypeface::kNormal ); | 86 return SkTypeface::MakeFromName("Apple Color Emoji", SkTypeface::kNormal ); |
84 } | 87 } |
88 if (!strcmp(sk_tool_utils::platform_os_emoji(), "COLR")) { | |
89 return SkTypeface::MakeFromName("Segoe UI Emoji", SkTypeface::kNormal); | |
bungeman-skia
2016/05/26 19:49:35
After running the trybots on this and taking a loo
Ilya Kulshin
2016/05/27 04:59:17
Done, although since this was creating the font ma
| |
90 } | |
85 return nullptr; | 91 return nullptr; |
86 } | 92 } |
87 | 93 |
88 const char* emoji_sample_text() { | 94 const char* emoji_sample_text() { |
89 if (!strcmp(sk_tool_utils::platform_os_emoji(), "CBDT")) { | 95 if (!strcmp(sk_tool_utils::platform_os_emoji(), "CBDT")) { |
90 return "Hamburgefons"; | 96 return "Hamburgefons"; |
91 } | 97 } |
92 if (!strcmp(sk_tool_utils::platform_os_emoji(), "SBIX")) { | 98 if (!strcmp(sk_tool_utils::platform_os_emoji(), "SBIX") || |
99 !strcmp(sk_tool_utils::platform_os_emoji(), "COLR")) | |
100 { | |
93 return "\xF0\x9F\x92\xB0" "\xF0\x9F\x8F\xA1" "\xF0\x9F\x8E\x85" // π°π‘π | 101 return "\xF0\x9F\x92\xB0" "\xF0\x9F\x8F\xA1" "\xF0\x9F\x8E\x85" // π°π‘π |
94 "\xF0\x9F\x8D\xAA" "\xF0\x9F\x8D\x95" "\xF0\x9F\x9A\x80" // πͺππ | 102 "\xF0\x9F\x8D\xAA" "\xF0\x9F\x8D\x95" "\xF0\x9F\x9A\x80" // πͺππ |
95 "\xF0\x9F\x9A\xBB" "\xF0\x9F\x92\xA9" "\xF0\x9F\x93\xB7" // π»π©π· | 103 "\xF0\x9F\x9A\xBB" "\xF0\x9F\x92\xA9" "\xF0\x9F\x93\xB7" // π»π©π· |
96 "\xF0\x9F\x93\xA6" // π¦ | 104 "\xF0\x9F\x93\xA6" // π¦ |
97 "\xF0\x9F\x87\xBA" "\xF0\x9F\x87\xB8" "\xF0\x9F\x87\xA6"; // πΊπΈπ¦ | 105 "\xF0\x9F\x87\xBA" "\xF0\x9F\x87\xB8" "\xF0\x9F\x87\xA6"; // πΊπΈπ¦ |
98 } | 106 } |
99 return ""; | 107 return ""; |
100 } | 108 } |
101 | 109 |
102 const char* platform_os_name() { | 110 const char* platform_os_name() { |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
433 for (int y = 0; y < src.height(); ++y) { | 441 for (int y = 0; y < src.height(); ++y) { |
434 for (int x = 0; x < src.width(); ++x) { | 442 for (int x = 0; x < src.width(); ++x) { |
435 *dst.getAddr32(x, y) = blur_pixel(src, x, y, kernel.get(), wh); | 443 *dst.getAddr32(x, y) = blur_pixel(src, x, y, kernel.get(), wh); |
436 } | 444 } |
437 } | 445 } |
438 | 446 |
439 return dst; | 447 return dst; |
440 } | 448 } |
441 | 449 |
442 } // namespace sk_tool_utils | 450 } // namespace sk_tool_utils |
OLD | NEW |