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

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

Issue 2737533002: Replace subpixel font size heuristics with using OpenType gasp table (Closed)
Patch Set: No subpixel without smoothing, not even for layout tests Created 3 years, 9 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 | « third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/fonts/win/FontPlatformDataWin.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/win/FontPlatformDataWin.cpp b/third_party/WebKit/Source/platform/fonts/win/FontPlatformDataWin.cpp
index 6031bf38b05555976f1377310ae0c2c59977bf90..e6bc30fe118526c6bd7c0c23756eadf3dee679ef 100644
--- a/third_party/WebKit/Source/platform/fonts/win/FontPlatformDataWin.cpp
+++ b/third_party/WebKit/Source/platform/fonts/win/FontPlatformDataWin.cpp
@@ -61,25 +61,16 @@ void FontPlatformData::setupPaint(SkPaint* paint, float, const Font*) const {
if (ts <= kMaxSizeForEmbeddedBitmap)
flags |= SkPaint::kEmbeddedBitmapText_Flag;
- if (ts >= m_minSizeForAntiAlias) {
- // 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.
- if ((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;
-
- SkASSERT(!(textFlags & ~textFlagsMask));
- flags |= textFlags;
- }
+ // Subpixel text positioning leads to uneven spacing without font
eae 2017/03/17 16:53:16 This explanation is a little confusing at first as
+ // smoothing. Subpixel test placement coordinates would be passed to Skia,
+ // which only has non-antialiased glyphs to draw, so they necessarily get
+ // clamped at pixel positions, which leads to uneven spacing, either too close
+ // or too far away from adjacent glyphs.
+ if (textFlags & SkPaint::kAntiAlias_Flag)
+ flags |= SkPaint::kSubpixelText_Flag;
+
+ SkASSERT(!(textFlags & ~textFlagsMask));
+ flags |= textFlags;
paint->setFlags(flags);
}
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698