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

Unified Diff: ui/gfx/platform_font_pango.cc

Issue 509093004: linux: Make RenderTextPango avoid clipping underlines. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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: ui/gfx/platform_font_pango.cc
diff --git a/ui/gfx/platform_font_pango.cc b/ui/gfx/platform_font_pango.cc
index 403b8364bce918dfbf130e97de1b9ebd43b57039..c40874040965bf5dafa98dd21ec3f782bde5cc4c 100644
--- a/ui/gfx/platform_font_pango.cc
+++ b/ui/gfx/platform_font_pango.cc
@@ -130,16 +130,6 @@ PlatformFontPango::PlatformFontPango(const std::string& font_name,
query.style, gfx::GetFontRenderParams(query, NULL));
}
-double PlatformFontPango::underline_position() const {
- const_cast<PlatformFontPango*>(this)->InitPangoMetrics();
- return underline_position_pixels_;
-}
-
-double PlatformFontPango::underline_thickness() const {
- const_cast<PlatformFontPango*>(this)->InitPangoMetrics();
- return underline_thickness_pixels_;
-}
-
////////////////////////////////////////////////////////////////////////////////
// PlatformFontPango, PlatformFont implementation:
@@ -283,8 +273,6 @@ void PlatformFontPango::InitFromDetails(
pango_metrics_inited_ = false;
average_width_pixels_ = 0.0f;
- underline_position_pixels_ = 0.0f;
- underline_thickness_pixels_ = 0.0f;
}
void PlatformFontPango::InitFromPlatformFont(const PlatformFontPango* other) {
@@ -298,8 +286,6 @@ void PlatformFontPango::InitFromPlatformFont(const PlatformFontPango* other) {
cap_height_pixels_ = other->cap_height_pixels_;
pango_metrics_inited_ = other->pango_metrics_inited_;
average_width_pixels_ = other->average_width_pixels_;
- underline_position_pixels_ = other->underline_position_pixels_;
- underline_thickness_pixels_ = other->underline_thickness_pixels_;
}
void PlatformFontPango::PaintSetup(SkPaint* paint) const {
@@ -318,19 +304,6 @@ void PlatformFontPango::InitPangoMetrics() {
ScopedPangoFontDescription pango_desc(GetNativeFont());
PangoFontMetrics* pango_metrics = GetPangoFontMetrics(pango_desc.get());
- underline_position_pixels_ =
- pango_font_metrics_get_underline_position(pango_metrics) /
- PANGO_SCALE;
-
- // TODO(davemoore): Come up with a better solution.
- // This is a hack, but without doing this the underlines
- // we get end up fuzzy. So we align to the midpoint of a pixel.
- underline_position_pixels_ /= 2;
-
- underline_thickness_pixels_ =
- pango_font_metrics_get_underline_thickness(pango_metrics) /
- PANGO_SCALE;
-
// First get the Pango-based width (converting from Pango units to pixels).
const double pango_width_pixels =
pango_font_metrics_get_approximate_char_width(pango_metrics) /

Powered by Google App Engine
This is Rietveld 408576698