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

Unified Diff: content/ppapi_plugin/ppapi_plugin_main.cc

Issue 1325843002: Added directwrite warmup for PPAPI processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add_win32k_enable_policy
Patch Set: Removed init check. Created 5 years, 3 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/common/sandbox_win.cc ('k') | content/renderer/renderer_main_platform_delegate_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/ppapi_plugin/ppapi_plugin_main.cc
diff --git a/content/ppapi_plugin/ppapi_plugin_main.cc b/content/ppapi_plugin/ppapi_plugin_main.cc
index b20bdd934ec7c8c252494e409ae833b47dc72f46..feaaf4b1fe762031ad1fe21f05cfa0a6fe9470a0 100644
--- a/content/ppapi_plugin/ppapi_plugin_main.cc
+++ b/content/ppapi_plugin/ppapi_plugin_main.cc
@@ -25,8 +25,14 @@
#include "ui/base/ui_base_switches.h"
#if defined(OS_WIN)
+#include "base/win/win_util.h"
+#include "base/win/windows_version.h"
+#include "content/common/font_warmup_win.h"
#include "sandbox/win/src/sandbox.h"
+#include "third_party/WebKit/public/web/win/WebFontRendering.h"
#include "third_party/skia/include/ports/SkTypeface_win.h"
+#include "ui/gfx/win/direct_write.h"
+#include "ui/gfx/win/dpi.h"
#endif
#if defined(OS_CHROMEOS)
@@ -135,7 +141,17 @@ int PpapiPluginMain(const MainFunctionParams& parameters) {
new PpapiThread(parameters.command_line, false)); // Not a broker.
#if defined(OS_WIN)
- SkTypeface_SetEnsureLOGFONTAccessibleProc(SkiaPreCacheFont);
+ if (!base::win::IsUser32AndGdi32Available())
+ gfx::win::MaybeInitializeDirectWrite();
+ bool use_direct_write = gfx::win::IsDirectWriteEnabled();
+ if (use_direct_write) {
+ WarmupDirectWrite();
+ } else {
+ SkTypeface_SetEnsureLOGFONTAccessibleProc(SkiaPreCacheFont);
+ }
+
+ blink::WebFontRendering::setUseDirectWrite(use_direct_write);
+ blink::WebFontRendering::setDeviceScaleFactor(gfx::GetDPIScale());
#endif
main_message_loop.Run();
« no previous file with comments | « content/common/sandbox_win.cc ('k') | content/renderer/renderer_main_platform_delegate_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698