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

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

Issue 2117683002: Revert of Link to DirectWrite directly, instead of calling LoadLibrary (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « content/child/dwrite_font_proxy/dwrite_font_proxy_win_unittest.cc ('k') | content/content_child.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/dwrite_font_proxy/font_fallback_win_unittest.cc
diff --git a/content/child/dwrite_font_proxy/font_fallback_win_unittest.cc b/content/child/dwrite_font_proxy/font_fallback_win_unittest.cc
index 4f8358f24731705554f241db52640188c7fb6b42..b5faca2bcc0128949cf4cf549b6f1e95ba20ef01 100644
--- a/content/child/dwrite_font_proxy/font_fallback_win_unittest.cc
+++ b/content/child/dwrite_font_proxy/font_fallback_win_unittest.cc
@@ -25,8 +25,7 @@
class FontFallbackUnitTest : public testing::Test {
public:
FontFallbackUnitTest() {
- DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED,
- __uuidof(IDWriteFactory), &factory_);
+ CreateDWriteFactory(&factory_);
factory_->CreateNumberSubstitution(DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE,
L"en-us", true /* ignoreUserOverride */,
@@ -48,6 +47,22 @@
&collection_, factory_.Get(), fake_collection_->GetSender());
}
+ void CreateDWriteFactory(IUnknown** factory) {
+ using DWriteCreateFactoryProc = decltype(DWriteCreateFactory)*;
+ HMODULE dwrite_dll = LoadLibraryW(L"dwrite.dll");
+ if (!dwrite_dll)
+ return;
+
+ DWriteCreateFactoryProc dwrite_create_factory_proc =
+ reinterpret_cast<DWriteCreateFactoryProc>(
+ GetProcAddress(dwrite_dll, "DWriteCreateFactory"));
+ if (!dwrite_create_factory_proc)
+ return;
+
+ dwrite_create_factory_proc(DWRITE_FACTORY_TYPE_SHARED,
+ __uuidof(IDWriteFactory), factory);
+ }
+
scoped_refptr<FakeFontCollection> fake_collection_;
mswr::ComPtr<IDWriteFactory> factory_;
mswr::ComPtr<DWriteFontCollectionProxy> collection_;
« no previous file with comments | « content/child/dwrite_font_proxy/dwrite_font_proxy_win_unittest.cc ('k') | content/content_child.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698