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

Unified Diff: Source/platform/fonts/win/FontPlatformDataWin.cpp

Issue 331843004: Default to nicer font settings on SystemParametersInfo failure (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: nit Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/win/FontPlatformDataWin.cpp
diff --git a/Source/platform/fonts/win/FontPlatformDataWin.cpp b/Source/platform/fonts/win/FontPlatformDataWin.cpp
index 2d436cdbaebb2f6f45274e33d6dd820e6c0beb45..ead1f1b179320a2ffa69ab0735fc18fd52edc8fe 100644
--- a/Source/platform/fonts/win/FontPlatformDataWin.cpp
+++ b/Source/platform/fonts/win/FontPlatformDataWin.cpp
@@ -91,14 +91,22 @@ static uint32_t getSystemTextFlags()
if (!gInited) {
BOOL enabled;
gFlags = 0;
- if (SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &enabled, 0) && enabled) {
- gFlags |= SkPaint::kAntiAlias_Flag;
-
- UINT smoothType;
- if (SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &smoothType, 0)) {
- if (FE_FONTSMOOTHINGCLEARTYPE == smoothType)
- gFlags |= SkPaint::kLCDRenderText_Flag;
+ if (SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &enabled, 0)) {
+ if (enabled) {
+ gFlags |= SkPaint::kAntiAlias_Flag;
+
+ UINT smoothType;
+ if (SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &smoothType, 0)) {
+ 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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698