Re-enable DirectWrite on Windows 8.1+
Interestingly, rendering issues reported in #348 were only fron Windows
Vista/7 users. Thus it's worth trying to re-enable DirectWrite-based
text rendering, which has been disabled by a previous CL [1], only on
newer platforms. This CL uses Windows 8.1 as the minimum OS version to
do that because it is the first Windows OS that supports color-Emoji
rendering.
[1]: f1deddfd14084384fe0e2aad02ce2d2ecc8da078
BUG=#348
TEST=
REF_BUG=23803925
REF_CL=114070280
REF_TIME=2016-02-07T16:28:27-08:00
REF_TIME_RAW=1454891307 -0800
Yohei Yukawa
8 years ago
0 | 0 |
MAJOR=2
|
1 | 1 |
MINOR=17
|
2 | |
BUILD=2454
|
|
2 |
BUILD=2455
|
3 | 3 |
REVISION=102
|
4 | 4 |
# NACL_DICTIONARY_VERSION is the target version of the system dictionary to be
|
5 | 5 |
# downloaded by NaCl Mozc.
|
572 | 572 |
TextRenderer *TextRenderer::Create() {
|
573 | 573 |
// In some environments, DirectWrite cannot render characters in the
|
574 | 574 |
// candidate window or even worse may cause crash. As a workaround,
|
575 | |
// this function always returns new GidTextRenderer().
|
576 | |
//
|
577 | |
// TODO: Reactivate the following code when b/23803925 is fixed.
|
578 | |
//
|
579 | |
// auto *dwrite_text_renderer = DirectWriteTextRenderer::Create();
|
580 | |
// if (dwrite_text_renderer != nullptr) {
|
581 | |
// return dwrite_text_renderer;
|
582 | |
// }
|
|
575 |
// we try to use DirectWrite only on Windows 8.1 and later.
|
|
576 |
// TODO(yukawa): Reactivate the following code for older OSes when
|
|
577 |
// the root cause of b/23803925 is identified.
|
|
578 |
if (SystemUtil::IsWindows8_1OrLater()) {
|
|
579 |
auto *dwrite_text_renderer = DirectWriteTextRenderer::Create();
|
|
580 |
if (dwrite_text_renderer != nullptr) {
|
|
581 |
return dwrite_text_renderer;
|
|
582 |
}
|
|
583 |
}
|
583 | 584 |
return new GdiTextRenderer();
|
584 | 585 |
}
|
585 | 586 |
|