summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/platform/fonts/font_global_context.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/platform/fonts/font_global_context.cc')
-rw-r--r--chromium/third_party/blink/renderer/platform/fonts/font_global_context.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/chromium/third_party/blink/renderer/platform/fonts/font_global_context.cc b/chromium/third_party/blink/renderer/platform/fonts/font_global_context.cc
index ff2fd249e6c..ee1cb3b220c 100644
--- a/chromium/third_party/blink/renderer/platform/fonts/font_global_context.cc
+++ b/chromium/third_party/blink/renderer/platform/fonts/font_global_context.cc
@@ -20,7 +20,9 @@ FontGlobalContext* FontGlobalContext::Get(CreateIfNeeded create_if_needed) {
return *font_persistent;
}
-FontGlobalContext::FontGlobalContext() : harfbuzz_font_funcs_(nullptr) {}
+FontGlobalContext::FontGlobalContext()
+ : harfbuzz_font_funcs_skia_advances_(nullptr),
+ harfbuzz_font_funcs_harfbuzz_advances_(nullptr) {}
FontGlobalContext::~FontGlobalContext() = default;
@@ -32,6 +34,15 @@ FontUniqueNameLookup* FontGlobalContext::GetFontUniqueNameLookup() {
return Get()->font_unique_name_lookup_.get();
}
+HarfBuzzFontCache* FontGlobalContext::GetHarfBuzzFontCache() {
+ std::unique_ptr<HarfBuzzFontCache>& global_context_harfbuzz_font_cache =
+ Get()->harfbuzz_font_cache_;
+ if (!global_context_harfbuzz_font_cache) {
+ global_context_harfbuzz_font_cache = std::make_unique<HarfBuzzFontCache>();
+ }
+ return global_context_harfbuzz_font_cache.get();
+}
+
void FontGlobalContext::ClearMemory() {
if (!Get(kDoNotCreate))
return;