| OLD | NEW |
| 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/crash_logging.h" | 7 #include "base/debug/crash_logging.h" |
| 8 #include "base/debug/debugger.h" | 8 #include "base/debug/debugger.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "content/public/plugin/content_plugin_client.h" | 22 #include "content/public/plugin/content_plugin_client.h" |
| 23 #include "ipc/ipc_sender.h" | 23 #include "ipc/ipc_sender.h" |
| 24 #include "ppapi/proxy/plugin_globals.h" | 24 #include "ppapi/proxy/plugin_globals.h" |
| 25 #include "ppapi/proxy/proxy_module.h" | 25 #include "ppapi/proxy/proxy_module.h" |
| 26 #include "ui/base/ui_base_switches.h" | 26 #include "ui/base/ui_base_switches.h" |
| 27 | 27 |
| 28 #if defined(OS_WIN) | 28 #if defined(OS_WIN) |
| 29 #include "base/win/win_util.h" | 29 #include "base/win/win_util.h" |
| 30 #include "base/win/windows_version.h" | 30 #include "base/win/windows_version.h" |
| 31 #include "content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.h" | 31 #include "content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.h" |
| 32 #include "content/child/font_warmup_win.h" |
| 33 #include "content/public/common/dwrite_font_platform_win.h" |
| 32 #include "sandbox/win/src/sandbox.h" | 34 #include "sandbox/win/src/sandbox.h" |
| 33 #include "third_party/WebKit/public/web/win/WebFontRendering.h" | 35 #include "third_party/WebKit/public/web/win/WebFontRendering.h" |
| 34 #include "third_party/skia/include/ports/SkTypeface_win.h" | 36 #include "third_party/skia/include/ports/SkTypeface_win.h" |
| 35 #include "ui/gfx/win/direct_write.h" | 37 #include "ui/gfx/win/direct_write.h" |
| 36 #include "ui/gfx/win/dpi.h" | 38 #include "ui/gfx/win/dpi.h" |
| 37 #endif | 39 #endif |
| 38 | 40 |
| 39 #if defined(OS_CHROMEOS) | 41 #if defined(OS_CHROMEOS) |
| 40 #include "base/files/file_util.h" | 42 #include "base/files/file_util.h" |
| 41 #endif | 43 #endif |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 135 |
| 134 ChildProcess ppapi_process; | 136 ChildProcess ppapi_process; |
| 135 ppapi_process.set_main_thread( | 137 ppapi_process.set_main_thread( |
| 136 new PpapiThread(parameters.command_line, false)); // Not a broker. | 138 new PpapiThread(parameters.command_line, false)); // Not a broker. |
| 137 | 139 |
| 138 #if defined(OS_WIN) | 140 #if defined(OS_WIN) |
| 139 if (!base::win::IsUser32AndGdi32Available()) | 141 if (!base::win::IsUser32AndGdi32Available()) |
| 140 gfx::win::MaybeInitializeDirectWrite(); | 142 gfx::win::MaybeInitializeDirectWrite(); |
| 141 bool use_direct_write = gfx::win::IsDirectWriteEnabled(); | 143 bool use_direct_write = gfx::win::IsDirectWriteEnabled(); |
| 142 if (use_direct_write) { | 144 if (use_direct_write) { |
| 143 InitializeDWriteFontProxy( | 145 if (ShouldUseDirectWriteFontProxyFieldTrial()) { |
| 144 base::Bind(&ppapi::proxy::PluginGlobals::GetBrowserSender, | 146 InitializeDWriteFontProxy( |
| 145 base::Unretained(ppapi::proxy::PluginGlobals::Get()))); | 147 base::Bind(&ppapi::proxy::PluginGlobals::GetBrowserSender, |
| 148 base::Unretained(ppapi::proxy::PluginGlobals::Get()))); |
| 149 } else { |
| 150 WarmupDirectWrite(); |
| 151 } |
| 146 } else { | 152 } else { |
| 147 SkTypeface_SetEnsureLOGFONTAccessibleProc(SkiaPreCacheFont); | 153 SkTypeface_SetEnsureLOGFONTAccessibleProc(SkiaPreCacheFont); |
| 148 } | 154 } |
| 149 | 155 |
| 150 blink::WebFontRendering::setUseDirectWrite(use_direct_write); | 156 blink::WebFontRendering::setUseDirectWrite(use_direct_write); |
| 151 blink::WebFontRendering::setDeviceScaleFactor(gfx::GetDPIScale()); | 157 blink::WebFontRendering::setDeviceScaleFactor(gfx::GetDPIScale()); |
| 152 #endif | 158 #endif |
| 153 | 159 |
| 154 main_message_loop.Run(); | 160 main_message_loop.Run(); |
| 155 | 161 |
| 156 #if defined(OS_WIN) | 162 #if defined(OS_WIN) |
| 157 UninitializeDWriteFontProxy(); | 163 if (ShouldUseDirectWriteFontProxyFieldTrial()) |
| 164 UninitializeDWriteFontProxy(); |
| 158 #endif | 165 #endif |
| 159 return 0; | 166 return 0; |
| 160 } | 167 } |
| 161 | 168 |
| 162 } // namespace content | 169 } // namespace content |
| OLD | NEW |