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

Unified Diff: ui/gfx/render_text.h

Issue 18848002: Shows Japanese and English mixed queries correctly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adds a unit test. Created 7 years, 5 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/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_;

Powered by Google App Engine
This is Rietveld 408576698