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

Unified 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 side-by-side diff with in-line comments
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 »
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 2afc58d2f776f1a37d537a2ca57965c7b9065822..fcc23cbfa7f3cd0eccc6746a801c57b9a376940a 100644
--- a/content/ppapi_plugin/ppapi_plugin_main.cc
+++ b/content/ppapi_plugin/ppapi_plugin_main.cc
@@ -11,6 +11,7 @@
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "base/run_loop.h"
+#include "base/strings/string_number_conversions.h"
#include "base/threading/platform_thread.h"
#include "build/build_config.h"
#include "content/child/child_process.h"
@@ -32,7 +33,6 @@
#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/display/win/dpi.h"
#include "ui/gfx/font_render_params.h"
#include "ui/gfx/win/direct_write.h"
#endif
@@ -133,14 +133,25 @@ int PpapiPluginMain(const MainFunctionParams& parameters) {
gfx::win::MaybeInitializeDirectWrite();
InitializeDWriteFontProxy();
- blink::WebFontRendering::setDeviceScaleFactor(display::win::GetDPIScale());
-
- const gfx::FontRenderParams font_params =
- gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr);
- blink::WebFontRendering::setAntialiasedTextEnabled(font_params.antialiasing);
+ double device_scale_factor = 1.0;
+ base::StringToDouble(
+ command_line.GetSwitchValueASCII(switches::kDeviceScaleFactor),
+ &device_scale_factor);
+ blink::WebFontRendering::setDeviceScaleFactor(device_scale_factor);
+
+ int antialiasing_enabled = 1;
+ base::StringToInt(
+ command_line.GetSwitchValueASCII(switches::kPpapiAntialiasedTextEnabled),
+ &antialiasing_enabled);
+ blink::WebFontRendering::setAntialiasedTextEnabled(
+ antialiasing_enabled ? true : false);
+
+ int subpixel_rendering = 0;
+ base::StringToInt(command_line.GetSwitchValueASCII(
+ switches::kPpapiSubpixelRenderingSetting),
+ &subpixel_rendering);
blink::WebFontRendering::setLCDTextEnabled(
- font_params.subpixel_rendering !=
- gfx::FontRenderParams::SUBPIXEL_RENDERING_NONE);
+ subpixel_rendering != gfx::FontRenderParams::SUBPIXEL_RENDERING_NONE);
#endif
base::RunLoop().Run();
« 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