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

Unified Diff: content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc

Issue 1846433005: Implement direct write fallback proxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a missing SUCCEEDED call Created 4 years, 8 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: content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
diff --git a/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc b/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
index e81203ceccba6637fab99ea906bc9aa3e9ea876a..b2acd7003c5c6f62aa429cca5177a4c0c785f066 100644
--- a/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
+++ b/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
@@ -245,6 +245,22 @@ bool DWriteFontCollectionProxy::LoadFamily(
return SUCCEEDED(hr);
}
+bool DWriteFontCollectionProxy::GetFontFamily(UINT32 family_index,
+ const base::string16& family_name,
+ IDWriteFontFamily** font_family) {
+ DCHECK(font_family);
+ DCHECK(!family_name.empty());
+ if (!CreateFamily(family_index))
+ return false;
+
+ mswr::ComPtr<DWriteFontFamilyProxy>& family = families_[family_index];
+ if (!family->IsLoaded() || family->GetName().empty())
+ family->SetName(family_name);
+
+ family.CopyTo(font_family);
+ return true;
+}
+
bool DWriteFontCollectionProxy::LoadFamilyNames(
UINT32 family_index,
IDWriteLocalizedStrings** localized_strings) {
@@ -404,6 +420,10 @@ void DWriteFontFamilyProxy::SetName(const base::string16& family_name) {
family_name_.assign(family_name);
}
+const base::string16& DWriteFontFamilyProxy::GetName() {
+ return family_name_;
+}
+
bool DWriteFontFamilyProxy::IsLoaded() {
return family_ != nullptr;
}
« no previous file with comments | « content/child/dwrite_font_proxy/dwrite_font_proxy_win.h ('k') | content/child/dwrite_font_proxy/font_fallback_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698