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

Unified Diff: ui/gfx/render_text.cc

Issue 19666006: Supports FontList in Textfield. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removes ResourceBundle::Delegate::GetFontList. 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.cc
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc
index 91f9f42bd89ad69dad47646e52c08516e9cad394..14bdcfa93cbe5194debc6e005416df6a77de0bf2 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -360,15 +360,15 @@ void RenderText::SetFontSize(int size) {
SetFontList(font_list_.DeriveFontListWithSize(size));
}
+const Font& RenderText::GetPrimaryFont() const {
+ return font_list_.GetPrimaryFont();
+}
+
void RenderText::SetCursorEnabled(bool cursor_enabled) {
cursor_enabled_ = cursor_enabled;
cached_bounds_and_offset_valid_ = false;
}
-const Font& RenderText::GetFont() const {
- return font_list_.GetFonts()[0];
-}
-
void RenderText::ToggleInsertMode() {
insert_mode_ = !insert_mode_;
cached_bounds_and_offset_valid_ = false;
@@ -873,7 +873,8 @@ void RenderText::ApplyFadeEffects(internal::SkiaTextRenderer* renderer) {
if (text_width <= display_width)
return;
- int gradient_width = CalculateFadeGradientWidth(GetFont(), display_width);
+ int gradient_width = CalculateFadeGradientWidth(GetPrimaryFont(),
+ display_width);
if (gradient_width == 0)
return;

Powered by Google App Engine
This is Rietveld 408576698