Commit 46300153 authored by Travis Skare's avatar Travis Skare Committed by Commit Bot

Use shared bold fontlist delta to avoid re-deriving it.

Bug: 843368
Change-Id: I300f2793ee70f93275be20aa77d24296d7da05d1
Reviewed-on: https://chromium-review.googlesource.com/1087317Reviewed-by: default avatarDave Schuyler <dschuyler@chromium.org>
Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
Commit-Queue: Travis Skare <skare@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565133}
parent 77f04217
......@@ -352,10 +352,14 @@ int OmniboxTextView::GetLineHeight() const {
}
void OmniboxTextView::UpdateLineHeight() {
font_height_ = std::max(render_text_->font_list().GetHeight(),
render_text_->font_list()
.DeriveWithWeight(gfx::Font::Weight::BOLD)
.GetHeight());
const int height_normal = render_text_->font_list().GetHeight();
const int height_bold =
ui::ResourceBundle::GetSharedInstance()
.GetFontListWithDelta(render_text_->font_list().GetFontSize() -
gfx::FontList().GetFontSize(),
gfx::Font::NORMAL, gfx::Font::Weight::BOLD)
.GetHeight();
font_height_ = std::max(height_normal, height_bold);
font_height_ += ui::MaterialDesignController::IsRefreshUi()
? kRefreshVerticalPadding
: kVerticalPadding;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment