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

Unified Diff: content/common/sandbox_win.cc

Issue 342353003: Don't use DirectWrite if smoothing or ClearType is off (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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: content/common/sandbox_win.cc
diff --git a/content/common/sandbox_win.cc b/content/common/sandbox_win.cc
index 68a00dd55908e07826be58616e45858e8d996cdd..7047421936a877e0b0c9abbdadc2fa52db6f34fb 100644
--- a/content/common/sandbox_win.cc
+++ b/content/common/sandbox_win.cc
@@ -590,6 +590,16 @@ bool ShouldUseDirectWrite() {
return true;
#endif
+ // If anti-aliasing or ClearType are off, don't use DirectWrite.
+ BOOL smoothing = FALSE;
+ SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &smoothing, 0);
+ if (!smoothing)
+ return false;
+ UINT smooth_type = 0;
+ SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &smooth_type, 0);
+ if (smooth_type != FE_FONTSMOOTHINGCLEARTYPE)
+ return false;
+
// Otherwise, check the field trial.
const std::string group_name =
base::FieldTrialList::FindFullName("DirectWrite");
« 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