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

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

Issue 553163002: [DirectWrite] Limit noSubpixelForSmallSizeFont to low-DPI (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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 | « Source/platform/fonts/FontCache.cpp ('k') | Source/web/win/WebFontRendering.cpp » ('j') | 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 398088717b3f0b834be87889025c04bfca422e70..621e25263c1704bd76dfaa602598f7212f50d097 100644
--- a/Source/platform/fonts/win/FontPlatformDataWin.cpp
+++ b/Source/platform/fonts/win/FontPlatformDataWin.cpp
@@ -64,13 +64,20 @@ void FontPlatformData::setupPaint(SkPaint* paint, GraphicsContext* context) cons
if (ts >= m_minSizeForAntiAlias) {
- // Subpixel text positioning looks pretty bad without font smoothing.
- // Disable it unless some type of font smoothing is used. As most tests
- // run without font smoothing we enable it for tests to ensure we get
- // good test coverage matching the more common smoothing enabled
- // behavior.
- if (m_useSubpixelPositioning && ts >= m_minSizeForSubpixel
- && ((textFlags & SkPaint::kAntiAlias_Flag) || LayoutTestSupport::isRunningLayoutTest()))
+ if (m_useSubpixelPositioning
+ // Disable subpixel text for certain older fonts at smaller sizes as
+ // they tend to get quite blurry at non-integer sizes and positions.
+ // For high-DPI this workaround isn't required.
+ && (ts >= m_minSizeForSubpixel
+ || FontCache::fontCache()->deviceScaleFactor() >= 1.5)
+
+ // Subpixel text positioning looks pretty bad without font
+ // smoothing. Disable it unless some type of font smoothing is used.
+ // As most tests run without font smoothing we enable it for tests
+ // to ensure we get good test coverage matching the more common
+ // smoothing enabled behavior.
+ && ((textFlags & SkPaint::kAntiAlias_Flag)
+ || LayoutTestSupport::isRunningLayoutTest()))
flags |= SkPaint::kSubpixelText_Flag;
// Only set painting flags when we're actually painting.
« no previous file with comments | « Source/platform/fonts/FontCache.cpp ('k') | Source/web/win/WebFontRendering.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698