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

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

Issue 2816243004: 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 2af2e28a1324de3cd956bce90081f772333738d6..6d81bfc6f2d3d1f1f12a5e2b7010728d59d8e216 100644
--- a/third_party/WebKit/Source/platform/fonts/SimpleFontData.h
+++ b/third_party/WebKit/Source/platform/fonts/SimpleFontData.h
@@ -164,6 +164,13 @@ class PLATFORM_EXPORT SimpleFontData : public FontData {
CustomFontData* GetCustomFontData() const { return custom_font_data_.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> custom_data,
@@ -187,9 +194,7 @@ class PLATFORM_EXPORT SimpleFontData : public FontData {
FontPlatformData platform_data_;
SkPaint paint_;
- bool is_text_orientation_fallback_;
RefPtr<OpenTypeVerticalData> vertical_data_;
- bool has_vertical_glyphs_;
Glyph space_glyph_;
float space_width_;
@@ -217,6 +222,15 @@ class PLATFORM_EXPORT SimpleFontData : public FontData {
RefPtr<CustomFontData> custom_font_data_;
+ unsigned is_text_orientation_fallback_ : 1;
+ unsigned has_vertical_glyphs_ : 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