Commit 592a59eb authored by jschuh@chromium.org's avatar jschuh@chromium.org

Default to nicer font settings on SystemParametersInfo failure

SystemParametersInfo will fail if we've disconnected win32k
via the sandbox on Win8+. So, just default to nicer font
settings for now, since we know the OS supports them.

BUG=365160

Review URL: https://codereview.chromium.org/331843004

git-svn-id: svn://svn.chromium.org/blink/trunk@176134 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 7e55fd99
...@@ -91,14 +91,22 @@ static uint32_t getSystemTextFlags() ...@@ -91,14 +91,22 @@ static uint32_t getSystemTextFlags()
if (!gInited) { if (!gInited) {
BOOL enabled; BOOL enabled;
gFlags = 0; gFlags = 0;
if (SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &enabled, 0) && enabled) { if (SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &enabled, 0)) {
gFlags |= SkPaint::kAntiAlias_Flag; if (enabled) {
gFlags |= SkPaint::kAntiAlias_Flag;
UINT smoothType;
if (SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &smoothType, 0)) { UINT smoothType;
if (FE_FONTSMOOTHINGCLEARTYPE == smoothType) if (SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &smoothType, 0)) {
gFlags |= SkPaint::kLCDRenderText_Flag; if (FE_FONTSMOOTHINGCLEARTYPE == smoothType)
gFlags |= SkPaint::kLCDRenderText_Flag;
}
} }
} else {
// SystemParametersInfo will fail only under full sandbox lockdown on Win8+.
// So, we default to settings we know are supported and look good.
// FIXME(eae): We should be querying the DirectWrite settings directly
// so we can respect the settings for users who turn off smoothing.
gFlags = SkPaint::kAntiAlias_Flag | SkPaint::kLCDRenderText_Flag;
} }
gInited = true; gInited = true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment