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

Unified Diff: third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp

Issue 2797293003: Always use subpixel ascent and descent
Patch Set: Created 3 years, 8 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: third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp b/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp
index 136998d0b3f5484dc9d93b37b9bdff9796e13c56..990e04c8561fb2f8d43c8b79c9ecd53432067241 100644
--- a/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp
+++ b/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp
@@ -134,29 +134,8 @@ void SimpleFontData::platformInit(bool subpixelAscentDescent) {
ascent = vdmxAscent;
descent = -vdmxDescent;
} else {
- // For tiny fonts, the rounding of fAscent and fDescent results in equal
- // baseline for different types of text baselines (crbug.com/338908).
- // Please see CanvasRenderingContext2D::getFontBaseline for the heuristic.
- if (subpixelAscentDescent &&
- (-metrics.fAscent < 3 || -metrics.fAscent + metrics.fDescent < 2)) {
- ascent = -metrics.fAscent;
- descent = metrics.fDescent;
- } else {
- ascent = SkScalarRoundToScalar(-metrics.fAscent);
- descent = SkScalarRoundToScalar(metrics.fDescent);
- }
-#if OS(LINUX) || OS(ANDROID)
- // When subpixel positioning is enabled, if the descent is rounded down, the
- // descent part of the glyph may be truncated when displayed in a 'overflow:
- // hidden' container. To avoid that, borrow 1 unit from the ascent when
- // possible.
- // FIXME: This can be removed if sub-pixel ascent/descent is supported.
- if (platformData().getFontRenderStyle().useSubpixelPositioning &&
- descent < SkScalarToFloat(metrics.fDescent) && ascent >= 1) {
- ++descent;
- --ascent;
- }
-#endif
+ ascent = -metrics.fAscent;
+ descent = metrics.fDescent;
}
#if OS(MACOSX)
« 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