Index: ui/gfx/render_text.h |
diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h |
index c4d48fd79058f9e81fb51816ea923052d7a02165..2a3d94e00aad7e28e35e118d3d0ff4032792e1ae 100644 |
--- a/ui/gfx/render_text.h |
+++ b/ui/gfx/render_text.h |
@@ -147,6 +147,10 @@ class UI_EXPORT RenderText { |
// Get the first font in |font_list_|. |
const Font& GetFont() const; |
+ // Returns the common height and baseline of the fonts in the font list. |
+ int GetFontListHeight() const { return font_list_height_; } |
+ int GetFontListBaseline() const { return font_list_baseline_; } |
+ |
bool cursor_enabled() const { return cursor_enabled_; } |
void SetCursorEnabled(bool cursor_enabled); |
@@ -494,6 +498,12 @@ class UI_EXPORT RenderText { |
// A list of fonts used to render |text_|. |
FontList font_list_; |
+ // The common height and baseline of the fonts in the font list. |
+ // We cache these values because they change iff |font_list_| changes, and |
+ // we need to scan font metrics for all the fonts in |font_list_| in order to |
+ // get these values. |
+ int font_list_height_; |
msw
2013/07/11 22:47:29
Can FontList cache these values itself?
Yuki
2013/07/12 08:25:53
Yes, I've moved these cache to FontList.
|
+ int font_list_baseline_; |
// Logical selection range and visual cursor position. |
SelectionModel selection_model_; |