Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: tools/sk_tool_utils.cpp

Issue 1984943002: Implement support for rendering color emoji on Windows (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Add skia tests and other review feedback Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ports/SkScalerContext_win_dw.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/ports/SkScalerContext_win_dw.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698