Index: content/child/font_warmup_win.cc |
diff --git a/content/child/font_warmup_win.cc b/content/child/font_warmup_win.cc |
index be532df2196d72111b7d2628ddbd310d81cc8fd6..076915588496c48182995c40bd8217f386cfe973 100644 |
--- a/content/child/font_warmup_win.cc |
+++ b/content/child/font_warmup_win.cc |
@@ -130,25 +130,6 @@ void CreateDirectWriteFactory(IDWriteFactory** factory) { |
reinterpret_cast<IUnknown**>(factory)))); |
} |
-HRESULT STDMETHODCALLTYPE StubFontCollection(IDWriteFactory* factory, |
- IDWriteFontCollection** col, |
- BOOL checkUpdates) { |
- // We always return pre-created font collection from here. |
- IDWriteFontCollection* custom_collection = GetCustomFontCollection(factory); |
- DCHECK(custom_collection != nullptr); |
- *col = custom_collection; |
- return S_OK; |
-} |
- |
-void PatchDWriteFactory(IDWriteFactory* factory) { |
- const unsigned int kGetSystemFontCollectionVTableIndex = 3; |
- |
- PROC* vtable = *reinterpret_cast<PROC**>(factory); |
- PROC* function_ptr = &vtable[kGetSystemFontCollectionVTableIndex]; |
- void* stub_function = &StubFontCollection; |
- base::win::ModifyCode(function_ptr, &stub_function, sizeof(PROC)); |
-} |
- |
// Class to fake out a DC or a Font object. Maintains a reference to a |
// SkTypeFace to emulate the simple operation of a DC and Font. |
class FakeGdiObject : public base::RefCountedThreadSafe<FakeGdiObject> { |
@@ -478,12 +459,9 @@ SkFontMgr* GetPreSandboxWarmupFontMgr() { |
IDWriteFactory* factory; |
CreateDirectWriteFactory(&factory); |
- GetCustomFontCollection(factory); |
- |
- PatchDWriteFactory(factory); |
- |
- blink::WebFontRendering::setDirectWriteFactory(factory); |
- g_warmup_fontmgr = SkFontMgr_New_DirectWrite(factory); |
+ g_warmup_fontmgr = |
+ SkFontMgr_New_DirectWrite(factory, GetCustomFontCollection(factory)); |
+ blink::WebFontRendering::setSkiaFontManager(g_warmup_fontmgr); |
} |
return g_warmup_fontmgr; |
} |