Commit 8fcbb059 authored by Xiaocheng Hu's avatar Xiaocheng Hu Committed by Commit Bot

Simplify a call site of Font::Update() in CanvasFontCache

The site creates a new ComputedStyle(), and then immediately uses its
FontSelector, which is always nullptr at the moment, to call
Font::Update(). Hence, this patch simpilies it with nullptr.

This is preparation for eliminating Font::Update().

Bug: 1049295
Change-Id: I7279993d62c0a6a25e34fbfce8b5cd3dc6e6a3f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2103647Reviewed-by: default avatarAnders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#750627}
parent 087f5c46
...@@ -37,8 +37,7 @@ CanvasFontCache::CanvasFontCache(Document& document) ...@@ -37,8 +37,7 @@ CanvasFontCache::CanvasFontCache(Document& document)
default_font_description.SetComputedSize(defaultFontSize); default_font_description.SetComputedSize(defaultFontSize);
default_font_style_ = ComputedStyle::Create(); default_font_style_ = ComputedStyle::Create();
default_font_style_->SetFontDescription(default_font_description); default_font_style_->SetFontDescription(default_font_description);
default_font_style_->GetFont().Update( default_font_style_->GetFont().Update(nullptr);
default_font_style_->GetFont().GetFontSelector());
} }
CanvasFontCache::~CanvasFontCache() { CanvasFontCache::~CanvasFontCache() {
......
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