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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/base_paths.h" 5 #include "base/base_paths.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/debug/debugger.h" 7 #include "base/debug/debugger.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 #include "base/threading/platform_thread.h" 12 #include "base/threading/platform_thread.h"
13 #include "build/build_config.h" 13 #include "build/build_config.h"
14 #include "content/child/child_process.h" 14 #include "content/child/child_process.h"
15 #include "content/common/content_constants_internal.h" 15 #include "content/common/content_constants_internal.h"
16 #include "content/common/sandbox_linux/sandbox_linux.h" 16 #include "content/common/sandbox_linux/sandbox_linux.h"
17 #include "content/ppapi_plugin/ppapi_thread.h" 17 #include "content/ppapi_plugin/ppapi_thread.h"
18 #include "content/public/common/content_client.h" 18 #include "content/public/common/content_client.h"
19 #include "content/public/common/content_switches.h" 19 #include "content/public/common/content_switches.h"
20 #include "content/public/common/main_function_params.h" 20 #include "content/public/common/main_function_params.h"
21 #include "content/public/plugin/content_plugin_client.h" 21 #include "content/public/plugin/content_plugin_client.h"
22 #include "crypto/nss_util.h" 22 #include "crypto/nss_util.h"
23 #include "ppapi/proxy/plugin_globals.h" 23 #include "ppapi/proxy/plugin_globals.h"
24 #include "ppapi/proxy/proxy_module.h" 24 #include "ppapi/proxy/proxy_module.h"
25 #include "ui/base/ui_base_switches.h" 25 #include "ui/base/ui_base_switches.h"
26 26
27 #if defined(OS_WIN) 27 #if defined(OS_WIN)
28 #include "base/win/win_util.h"
29 #include "base/win/windows_version.h"
30 #include "content/common/font_warmup_win.h"
28 #include "sandbox/win/src/sandbox.h" 31 #include "sandbox/win/src/sandbox.h"
32 #include "third_party/WebKit/public/web/win/WebFontRendering.h"
29 #include "third_party/skia/include/ports/SkTypeface_win.h" 33 #include "third_party/skia/include/ports/SkTypeface_win.h"
34 #include "ui/gfx/win/direct_write.h"
35 #include "ui/gfx/win/dpi.h"
30 #endif 36 #endif
31 37
32 #if defined(OS_CHROMEOS) 38 #if defined(OS_CHROMEOS)
33 #include "base/files/file_util.h" 39 #include "base/files/file_util.h"
34 #endif 40 #endif
35 41
36 #if defined(OS_LINUX) 42 #if defined(OS_LINUX)
37 #include "content/public/common/sandbox_init.h" 43 #include "content/public/common/sandbox_init.h"
38 #endif 44 #endif
39 45
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 134
129 #if defined(OS_LINUX) 135 #if defined(OS_LINUX)
130 LinuxSandbox::InitializeSandbox(); 136 LinuxSandbox::InitializeSandbox();
131 #endif 137 #endif
132 138
133 ChildProcess ppapi_process; 139 ChildProcess ppapi_process;
134 ppapi_process.set_main_thread( 140 ppapi_process.set_main_thread(
135 new PpapiThread(parameters.command_line, false)); // Not a broker. 141 new PpapiThread(parameters.command_line, false)); // Not a broker.
136 142
137 #if defined(OS_WIN) 143 #if defined(OS_WIN)
138 SkTypeface_SetEnsureLOGFONTAccessibleProc(SkiaPreCacheFont); 144 if (!base::win::IsUser32AndGdi32Available())
145 gfx::win::MaybeInitializeDirectWrite();
146 bool use_direct_write = gfx::win::IsDirectWriteEnabled();
147 if (use_direct_write) {
148 WarmupDirectWrite();
149 } else {
150 SkTypeface_SetEnsureLOGFONTAccessibleProc(SkiaPreCacheFont);
151 }
152
153 blink::WebFontRendering::setUseDirectWrite(use_direct_write);
154 blink::WebFontRendering::setDeviceScaleFactor(gfx::GetDPIScale());
139 #endif 155 #endif
140 156
141 main_message_loop.Run(); 157 main_message_loop.Run();
142 return 0; 158 return 0;
143 } 159 }
144 160
145 } // namespace content 161 } // namespace content
OLDNEW
« 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