summaryrefslogtreecommitdiffstats
path: root/ui/gfx/render_text.h
diff options
context:
space:
mode:
authorasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-12 22:59:41 +0000
committerasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-12 22:59:41 +0000
commite232601e029e6222029c8161b2b26687b192839f (patch)
tree5ae7682c07ac1e70432917f708eda1287912a3fb /ui/gfx/render_text.h
parent2ccd201c85f964bbb504f732cf99ff6820e08a60 (diff)
downloadchromium_src-e232601e029e6222029c8161b2b26687b192839f.zip
chromium_src-e232601e029e6222029c8161b2b26687b192839f.tar.gz
chromium_src-e232601e029e6222029c8161b2b26687b192839f.tar.bz2
Use pango underline metrics in RenderTextLinux.
Also, changes type of SkiaTextRenderer::SetTextSize() to SkScalar to match the underlying Skia type, which is needed for future RenderTextMac implementation. BUG=126506, 125664, 105550 TEST=Eyeball underlined text in views_examples' text style example. Review URL: https://chromiumcodereview.appspot.com/10520017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141772 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/render_text.h')
-rw-r--r--ui/gfx/render_text.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h
index 0646e7d..fa2e7d0 100644
--- a/ui/gfx/render_text.h
+++ b/ui/gfx/render_text.h
@@ -48,10 +48,14 @@ class SkiaTextRenderer {
void SetDrawLooper(SkDrawLooper* draw_looper);
void SetFontSmoothingSettings(bool enable_smoothing, bool enable_lcd_text);
void SetTypeface(SkTypeface* typeface);
- void SetTextSize(int size);
+ void SetTextSize(SkScalar size);
void SetFontFamilyWithStyle(const std::string& family, int font_style);
void SetForegroundColor(SkColor foreground);
void SetShader(SkShader* shader, const Rect& bounds);
+ // Sets underline metrics to use if the text will be drawn with an underline.
+ // If not set, default values based on the size of the text will be used. The
+ // two metrics must be set together.
+ void SetUnderlineMetrics(SkScalar thickness, SkScalar position);
void DrawSelection(const std::vector<Rect>& selection, SkColor color);
void DrawPosText(const SkPoint* pos,
const uint16* glyphs,
@@ -64,6 +68,8 @@ class SkiaTextRenderer {
SkPaint paint_;
SkRect bounds_;
SkRefPtr<SkShader> deferred_fade_shader_;
+ SkScalar underline_thickness_;
+ SkScalar underline_position_;
DISALLOW_COPY_AND_ASSIGN(SkiaTextRenderer);
};