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

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

Issue 2306193002: Fix antialiasing ppapi settings, browser_tests in win32k lockdown (Closed)
Patch Set: no fatal Created 4 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/browser/ppapi_plugin_process_host.cc ('k') | content/public/common/content_switches.h » ('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/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"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/run_loop.h" 13 #include "base/run_loop.h"
14 #include "base/strings/string_number_conversions.h"
14 #include "base/threading/platform_thread.h" 15 #include "base/threading/platform_thread.h"
15 #include "build/build_config.h" 16 #include "build/build_config.h"
16 #include "content/child/child_process.h" 17 #include "content/child/child_process.h"
17 #include "content/common/content_constants_internal.h" 18 #include "content/common/content_constants_internal.h"
18 #include "content/common/sandbox_linux/sandbox_linux.h" 19 #include "content/common/sandbox_linux/sandbox_linux.h"
19 #include "content/ppapi_plugin/ppapi_thread.h" 20 #include "content/ppapi_plugin/ppapi_thread.h"
20 #include "content/public/common/content_client.h" 21 #include "content/public/common/content_client.h"
21 #include "content/public/common/content_switches.h" 22 #include "content/public/common/content_switches.h"
22 #include "content/public/common/main_function_params.h" 23 #include "content/public/common/main_function_params.h"
23 #include "ipc/ipc_sender.h" 24 #include "ipc/ipc_sender.h"
24 #include "ppapi/proxy/plugin_globals.h" 25 #include "ppapi/proxy/plugin_globals.h"
25 #include "ppapi/proxy/proxy_module.h" 26 #include "ppapi/proxy/proxy_module.h"
26 #include "ui/base/ui_base_switches.h" 27 #include "ui/base/ui_base_switches.h"
27 28
28 #if defined(OS_WIN) 29 #if defined(OS_WIN)
29 #include "base/win/win_util.h" 30 #include "base/win/win_util.h"
30 #include "base/win/windows_version.h" 31 #include "base/win/windows_version.h"
31 #include "content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.h" 32 #include "content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.h"
32 #include "sandbox/win/src/sandbox.h" 33 #include "sandbox/win/src/sandbox.h"
33 #include "third_party/WebKit/public/web/win/WebFontRendering.h" 34 #include "third_party/WebKit/public/web/win/WebFontRendering.h"
34 #include "third_party/skia/include/ports/SkTypeface_win.h" 35 #include "third_party/skia/include/ports/SkTypeface_win.h"
35 #include "ui/display/win/dpi.h"
36 #include "ui/gfx/font_render_params.h" 36 #include "ui/gfx/font_render_params.h"
37 #include "ui/gfx/win/direct_write.h" 37 #include "ui/gfx/win/direct_write.h"
38 #endif 38 #endif
39 39
40 #if defined(OS_CHROMEOS) 40 #if defined(OS_CHROMEOS)
41 #include "base/files/file_util.h" 41 #include "base/files/file_util.h"
42 #endif 42 #endif
43 43
44 #if defined(OS_LINUX) 44 #if defined(OS_LINUX)
45 #include "content/public/common/sandbox_init.h" 45 #include "content/public/common/sandbox_init.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(); 134 InitializeDWriteFontProxy();
135 135
136 blink::WebFontRendering::setDeviceScaleFactor(display::win::GetDPIScale()); 136 double device_scale_factor = 1.0;
137 base::StringToDouble(
138 command_line.GetSwitchValueASCII(switches::kDeviceScaleFactor),
139 &device_scale_factor);
140 blink::WebFontRendering::setDeviceScaleFactor(device_scale_factor);
137 141
138 const gfx::FontRenderParams font_params = 142 int antialiasing_enabled = 1;
139 gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr); 143 base::StringToInt(
140 blink::WebFontRendering::setAntialiasedTextEnabled(font_params.antialiasing); 144 command_line.GetSwitchValueASCII(switches::kPpapiAntialiasedTextEnabled),
145 &antialiasing_enabled);
146 blink::WebFontRendering::setAntialiasedTextEnabled(
147 antialiasing_enabled ? true : false);
148
149 int subpixel_rendering = 0;
150 base::StringToInt(command_line.GetSwitchValueASCII(
151 switches::kPpapiSubpixelRenderingSetting),
152 &subpixel_rendering);
141 blink::WebFontRendering::setLCDTextEnabled( 153 blink::WebFontRendering::setLCDTextEnabled(
142 font_params.subpixel_rendering != 154 subpixel_rendering != gfx::FontRenderParams::SUBPIXEL_RENDERING_NONE);
143 gfx::FontRenderParams::SUBPIXEL_RENDERING_NONE);
144 #endif 155 #endif
145 156
146 base::RunLoop().Run(); 157 base::RunLoop().Run();
147 158
148 #if defined(OS_WIN) 159 #if defined(OS_WIN)
149 UninitializeDWriteFontProxy(); 160 UninitializeDWriteFontProxy();
150 #endif 161 #endif
151 return 0; 162 return 0;
152 } 163 }
153 164
154 } // namespace content 165 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/ppapi_plugin_process_host.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698