☠☠ backed out by edd424223fb1 ☠ ☠ | |
author | Masatoshi Kimura <VYV03354@nifty.ne.jp> |
Fri, 10 Mar 2017 00:47:44 +0900 | |
changeset 346865 | cf2b0421dd5795d39c6924f5d761a6369a8a60ad |
parent 346864 | e586e5f9e9a4f0b1febd9433f20754b19a5fc85b |
child 346866 | 8e03e57d44aa428d78dcf886be0e42c998f3ad61 |
push id | 31480 |
push user | cbook@mozilla.com |
push date | Fri, 10 Mar 2017 10:37:06 +0000 |
treeherder | mozilla-central@e18d3dd20e8d [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | mchang |
bugs | 1345222 |
milestone | 55.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -1128,18 +1128,20 @@ gfxWindowsPlatform::FontsPrefsChanged(co if (clearTextFontCaches) { gfxFontCache *fc = gfxFontCache::GetCache(); if (fc) { fc->Flush(); } } } -#define ENHANCED_CONTRAST_REGISTRY_KEY \ - HKEY_CURRENT_USER, "Software\\Microsoft\\Avalon.Graphics\\DISPLAY1\\EnhancedContrastLevel" +#define DISPLAY1_REGISTRY_KEY \ + HKEY_CURRENT_USER, "Software\\Microsoft\\Avalon.Graphics\\DISPLAY1" + +#define ENHANCED_CONTRAST_VALUE_NAME "EnhancedContrastLevel" void gfxWindowsPlatform::SetupClearTypeParams() { if (GetDWriteFactory()) { // any missing prefs will default to invalid (-1) and be ignored; // out-of-range values will also be ignored FLOAT gamma = -1.0; @@ -1196,20 +1198,24 @@ gfxWindowsPlatform::SetupClearTypeParams RefPtr<IDWriteRenderingParams> defaultRenderingParams; GetDWriteFactory()->CreateRenderingParams(getter_AddRefs(defaultRenderingParams)); // For EnhancedContrast, we override the default if the user has not set it // in the registry (by using the ClearType Tuner). if (contrast >= 0.0 && contrast <= 10.0) { contrast = contrast; } else { HKEY hKey; - if (RegOpenKeyExA(ENHANCED_CONTRAST_REGISTRY_KEY, - 0, KEY_READ, &hKey) == ERROR_SUCCESS) - { - contrast = defaultRenderingParams->GetEnhancedContrast(); + LONG res = RegOpenKeyExA(DISPLAY1_REGISTRY_KEY, + 0, KEY_READ, &hKey); + if (res == ERROR_SUCCESS) { + res = RegQueryValueExA(hKey, ENHANCED_CONTRAST_VALUE_NAME, + nullptr, nullptr, nullptr, nullptr); + if (res == ERROR_SUCCESS) { + contrast = defaultRenderingParams->GetEnhancedContrast(); + } RegCloseKey(hKey); } else { contrast = 1.0; } } // For parameters that have not been explicitly set, // we copy values from default params (or our overridden value for contrast)