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

Unified Diff: content/renderer/renderer_main_platform_delegate_win.cc

Issue 231763003: Support sideloaded fonts via command line option for blink layout_tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: guard for xp Created 6 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/renderer/renderer_main_platform_delegate_win.cc
diff --git a/content/renderer/renderer_main_platform_delegate_win.cc b/content/renderer/renderer_main_platform_delegate_win.cc
index 56d81ee47774c580d99c7937e9df6240040c3a35..3503fdd3ded81a4f4a5585ba6a64523147b7345f 100644
--- a/content/renderer/renderer_main_platform_delegate_win.cc
+++ b/content/renderer/renderer_main_platform_delegate_win.cc
@@ -14,6 +14,7 @@
#include "content/common/sandbox_win.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/injection_test_win.h"
+#include "content/public/renderer/render_font_warmup_win.h"
#include "content/public/renderer/render_thread.h"
#include "content/renderer/render_thread_impl.h"
#include "sandbox/win/src/sandbox.h"
@@ -52,32 +53,12 @@ void SkiaPreCacheFontCharacters(const LOGFONT& logfont,
}
}
-// Windows-only DirectWrite support. These warm up the DirectWrite paths
-// before sandbox lock down to allow Skia access to the Font Manager service.
-void CreateDirectWriteFactory(IDWriteFactory** factory) {
- typedef decltype(DWriteCreateFactory)* DWriteCreateFactoryProc;
- DWriteCreateFactoryProc dwrite_create_factory_proc =
- reinterpret_cast<DWriteCreateFactoryProc>(
- GetProcAddress(LoadLibraryW(L"dwrite.dll"), "DWriteCreateFactory"));
- CHECK(dwrite_create_factory_proc);
- CHECK(SUCCEEDED(
- dwrite_create_factory_proc(DWRITE_FACTORY_TYPE_ISOLATED,
- __uuidof(IDWriteFactory),
- reinterpret_cast<IUnknown**>(factory))));
-}
-
void WarmupDirectWrite() {
// The objects used here are intentionally not freed as we want the Skia
// code to use these objects after warmup.
- IDWriteFactory* factory;
- CreateDirectWriteFactory(&factory);
- blink::WebFontRendering::setDirectWriteFactory(factory);
- SkFontMgr* fontmgr = SkFontMgr_New_DirectWrite(factory);
- SkTypeface* typeface = fontmgr->legacyCreateTypeface("Times New Roman", 0);
- SkPaint paint_warmup;
- paint_warmup.setTypeface(typeface);
- wchar_t glyph = L'S';
- paint_warmup.measureText(&glyph, 2);
+ SkTypeface* typeface =
+ GetPreSandboxWarmupFontMgr()->legacyCreateTypeface("Times New Roman", 0);
+ DoPreSandboxWarmupForTypeface(typeface);
}
} // namespace
« no previous file with comments | « content/public/renderer/render_font_warmup_win.cc ('k') | content/shell/app/webkit_test_platform_support_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698