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

Side by Side Diff: content/ppapi_plugin/ppapi_plugin_main.cc

Issue 2182213004: Use ChildThreadImpl::thread_safe_sender in font proxy if available (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unittests Created 4 years, 4 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
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/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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 LinuxSandbox::InitializeSandbox(); 124 LinuxSandbox::InitializeSandbox();
125 #endif 125 #endif
126 126
127 ChildProcess ppapi_process; 127 ChildProcess ppapi_process;
128 ppapi_process.set_main_thread( 128 ppapi_process.set_main_thread(
129 new PpapiThread(parameters.command_line, false)); // Not a broker. 129 new PpapiThread(parameters.command_line, false)); // Not a broker.
130 130
131 #if defined(OS_WIN) 131 #if defined(OS_WIN)
132 if (!base::win::IsUser32AndGdi32Available()) 132 if (!base::win::IsUser32AndGdi32Available())
133 gfx::win::MaybeInitializeDirectWrite(); 133 gfx::win::MaybeInitializeDirectWrite();
134 InitializeDWriteFontProxy();
135
136 blink::WebFontRendering::setDeviceScaleFactor(display::win::GetDPIScale()); 134 blink::WebFontRendering::setDeviceScaleFactor(display::win::GetDPIScale());
135 InitializeDWriteFontProxy(
136 base::Bind(&ppapi::proxy::PluginGlobals::GetBrowserSender,
137 base::Unretained(ppapi::proxy::PluginGlobals::Get())));
137 138
138 const gfx::FontRenderParams font_params = 139 const gfx::FontRenderParams font_params =
139 gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr); 140 gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr);
140 blink::WebFontRendering::setAntialiasedTextEnabled(font_params.antialiasing); 141 blink::WebFontRendering::setAntialiasedTextEnabled(font_params.antialiasing);
141 blink::WebFontRendering::setLCDTextEnabled( 142 blink::WebFontRendering::setLCDTextEnabled(
142 font_params.subpixel_rendering != 143 font_params.subpixel_rendering !=
143 gfx::FontRenderParams::SUBPIXEL_RENDERING_NONE); 144 gfx::FontRenderParams::SUBPIXEL_RENDERING_NONE);
144 #endif 145 #endif
145 146
146 base::RunLoop().Run(); 147 base::RunLoop().Run();
147 148
148 #if defined(OS_WIN) 149 #if defined(OS_WIN)
149 UninitializeDWriteFontProxy(); 150 UninitializeDWriteFontProxy();
150 #endif 151 #endif
151 return 0; 152 return 0;
152 } 153 }
153 154
154 } // namespace content 155 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698