Chromium Code Reviews| Index: content/test/layouttest_support.cc |
| diff --git a/content/test/layouttest_support.cc b/content/test/layouttest_support.cc |
| index 0f4fe3b6ca6be0256a4e7d37cbe7ac83af1fb728..f1f904acff3e026a455ee0261b080d1989ba56a6 100644 |
| --- a/content/test/layouttest_support.cc |
| +++ b/content/test/layouttest_support.cc |
| @@ -42,8 +42,10 @@ |
| #include "content/browser/frame_host/popup_menu_helper_mac.h" |
| #elif defined(OS_WIN) |
| #include "content/common/font_warmup_win.h" |
| +#include "content/public/common/dwrite_font_platform_win.h" |
| #include "third_party/WebKit/public/web/win/WebFontRendering.h" |
| #include "third_party/skia/include/ports/SkFontMgr.h" |
| +#include "third_party/skia/include/ports/SkTypeface_win.h" |
| #include "ui/gfx/win/direct_write.h" |
| #endif |
| @@ -104,7 +106,8 @@ void RegisterSideloadedTypefaces(SkFontMgr* fontmgr) { |
| i != files.end(); |
| ++i) { |
| SkTypeface* typeface = fontmgr->createFromFile(i->c_str()); |
| - DoPreSandboxWarmupForTypeface(typeface); |
| + if (!content::ShouldUseDirectWriteFontProxyFieldTrial()) |
|
jam
2016/01/11 05:05:45
also this file
Ilya Kulshin
2016/01/11 20:56:52
Done.
|
| + DoPreSandboxWarmupForTypeface(typeface); |
| blink::WebFontRendering::addSideloadedFontForTesting(typeface); |
| } |
| } |
| @@ -174,8 +177,12 @@ void EnableRendererLayoutTestMode() { |
| RenderThreadImpl::current()->set_layout_test_mode(true); |
| #if defined(OS_WIN) |
| - if (gfx::win::ShouldUseDirectWrite()) |
| - RegisterSideloadedTypefaces(GetPreSandboxWarmupFontMgr()); |
| + if (gfx::win::ShouldUseDirectWrite()) { |
| + if (content::ShouldUseDirectWriteFontProxyFieldTrial()) |
| + RegisterSideloadedTypefaces(SkFontMgr_New_DirectWrite()); |
| + else |
| + RegisterSideloadedTypefaces(GetPreSandboxWarmupFontMgr()); |
| + } |
| #endif |
| } |