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

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

Issue 2819953002: Adjust visual overflow rect for rounded/shifted ascent/descent (Closed)
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
Index: third_party/WebKit/Source/platform/fonts/SimpleFontData.h
diff --git a/third_party/WebKit/Source/platform/fonts/SimpleFontData.h b/third_party/WebKit/Source/platform/fonts/SimpleFontData.h
index 73f6a3ead9032c4ed5398e1026ba5048d64b3656..ce0cd74251cfabf0c8bf8042cb144671c268772a 100644
--- a/third_party/WebKit/Source/platform/fonts/SimpleFontData.h
+++ b/third_party/WebKit/Source/platform/fonts/SimpleFontData.h
@@ -157,6 +157,13 @@ class PLATFORM_EXPORT SimpleFontData : public FontData {
CustomFontData* customFontData() const { return m_customFontData.get(); }
+ unsigned VisualOverflowInflationForAscent() const {
+ return visual_overflow_inflation_for_ascent_;
+ }
+ unsigned VisualOverflowInflationForDescent() const {
+ return visual_overflow_inflation_for_descent_;
+ }
+
protected:
SimpleFontData(const FontPlatformData&,
PassRefPtr<CustomFontData> customData,
@@ -182,9 +189,7 @@ class PLATFORM_EXPORT SimpleFontData : public FontData {
FontPlatformData m_platformData;
SkPaint m_paint;
- bool m_isTextOrientationFallback;
RefPtr<OpenTypeVerticalData> m_verticalData;
- bool m_hasVerticalGlyphs;
Glyph m_spaceGlyph;
float m_spaceWidth;
@@ -212,6 +217,15 @@ class PLATFORM_EXPORT SimpleFontData : public FontData {
RefPtr<CustomFontData> m_customFontData;
+ unsigned m_isTextOrientationFallback : 1;
+ unsigned m_hasVerticalGlyphs : 1;
+
+ // These are set to non-zero when ascent or descent is rounded or shifted
+ // to be smaller than the actual ascent or descent. When calculating visual
+ // overflows, we should add the inflations.
+ unsigned visual_overflow_inflation_for_ascent_ : 2;
+ unsigned visual_overflow_inflation_for_descent_ : 2;
+
// See discussion on crbug.com/631032 and Skiaissue
// https://bugs.chromium.org/p/skia/issues/detail?id=5328 :
// On Mac we're still using path based glyph metrics, and they seem to be
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutText.cpp ('k') | third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698