Message:
jam: OWNERS review
cpu: HiDPI code
Description:
Metro/HiDPI: Mark Chrome as HiDPI aware on Windows
With this CL Chrome is marked as HiDPI aware if the enable_hidpi build flag
is
set.
BUG=114311
TEST=Changed Windows to 2x DPI scale. Ran Chrome. Verified that 2x icons
were
used.
Please review this at http://codereview.chromium.org/10086009/
SVN Base: svn://svn.chromium.org/chrome/trunk/src
Affected files:
M content/app/content_main_runner.cc
Index: content/app/content_main_runner.cc
diff --git a/content/app/content_main_runner.cc
b/content/app/content_main_runner.cc
index
d19499f7aa5eeab69baac0c79034716ab18b1258..9b97639de1e5a187063f2de6f8870f8ff5c7f0a2
100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -33,6 +33,7 @@
#include "sandbox/src/sandbox_types.h"
#include "ui/base/ui_base_switches.h"
#include "ui/base/ui_base_paths.h"
+#include "ui/base/win/dpi.h"
#include "webkit/glue/webkit_glue.h"
#if defined(OS_WIN)
@@ -417,6 +418,9 @@ class ContentMainRunnerImpl : public
content::ContentMainRunner {
SendTaskPortToParentProcess();
}
#elif defined(OS_WIN)
+#if defined(ENABLE_HIDPI)
+ ui::EnableHighDPISupport();
+#endif
content::SetupCRT(command_line);
#endif
I thought all processes would need this but now I'm not sure.
CCing fsamuel who should know.
Hi, right now to enable high DPI in WebKit, you would use the
--default-device-scale-factor=x where x > 1. This needs to be passed to all
the
renderers (and is). However, this flag currently exists for debugging
purposes
and things may be done differently a little later.
Hi Fady. I'm asking a slightly different question.
On Windows, does the renderer process need to be HiDPI aware? If a process
is
not marked as HiDPI aware then when it calls system APIs everything is
given in
logical coordinates. So for example, mouse coordinates might be different
between the browser and the renderer.
I haven't really played with High DPI on Windows, unfortunately so I'm not
sure
of the answer to your question. I want to say yes, since WebKit is High-DPI
aware, the renderers should be marked as high-DPI aware, but I'm not sure,
sorry.
Sounds good. I think it's probably worth landing as is just so we can start
testing things. We can always move this out to the exe_main code if needed.
can you please confirm before landing? it seems easy to do so (i.e. you can
even
just get the process-type switch and only do it if it's empty)
Hi John, I'm not sure how to confirm before landing.
> Hi John, I'm not sure how to confirm before landing.
see a few lines above where you added for an example of checking when
you're in
the browser process:
if (!process_type.empty())
ui::EnableHighDPISupport();