Metro/HiDPI: Mark Chrome as HiDPI aware on Windows (issue 10086009)

193 views
Skip to first unread message

sa...@chromium.org

unread,
Apr 13, 2012, 5:01:36 PM4/13/12
to c...@chromium.org, j...@chromium.org, chromium...@chromium.org, joi+watc...@chromium.org, dari...@chromium.org, j...@chromium.org
Reviewers: cpu, John Abd-El-Malek,

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

j...@chromium.org

unread,
Apr 15, 2012, 6:23:14 PM4/15/12
to sa...@chromium.org, c...@chromium.org, chromium...@chromium.org, joi+watc...@chromium.org, dari...@chromium.org

j...@chromium.org

unread,
Apr 15, 2012, 6:23:53 PM4/15/12
to sa...@chromium.org, c...@chromium.org, chromium...@chromium.org, joi+watc...@chromium.org, dari...@chromium.org
does this need to be called for all process types, or just the browser
process?

http://codereview.chromium.org/10086009/

sa...@chromium.org

unread,
Apr 16, 2012, 1:30:46 PM4/16/12
to c...@chromium.org, j...@chromium.org, chromium...@chromium.org, joi+watc...@chromium.org, dari...@chromium.org
On 2012/04/15 22:23:53, John Abd-El-Malek wrote:
> does this need to be called for all process types, or just the browser
process?

I thought all processes would need this but now I'm not sure.
CCing fsamuel who should know.

http://codereview.chromium.org/10086009/

sa...@chromium.org

unread,
Apr 16, 2012, 1:31:21 PM4/16/12
to c...@chromium.org, j...@chromium.org, chromium...@chromium.org, joi+watc...@chromium.org, dari...@chromium.org, fsa...@chromium.org
Hi Fady. On Windows do we need to mark all processes as HiDPI aware or just
the
browser process?

http://codereview.chromium.org/10086009/

c...@chromium.org

unread,
Apr 16, 2012, 3:09:15 PM4/16/12
to sa...@chromium.org, j...@chromium.org, chromium...@chromium.org, joi+watc...@chromium.org, dari...@chromium.org, fsa...@chromium.org

fsa...@chromium.org

unread,
Apr 16, 2012, 3:31:25 PM4/16/12
to sa...@chromium.org, c...@chromium.org, j...@chromium.org, chromium...@chromium.org, joi+watc...@chromium.org, dari...@chromium.org
On 2012/04/16 17:31:21, sail wrote:
> Hi Fady. On Windows do we need to mark all processes as HiDPI aware or
> just
the
> browser process?

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.

http://codereview.chromium.org/10086009/

sa...@chromium.org

unread,
Apr 16, 2012, 3:35:45 PM4/16/12
to c...@chromium.org, j...@chromium.org, chromium...@chromium.org, joi+watc...@chromium.org, dari...@chromium.org

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.

http://codereview.chromium.org/10086009/

fsa...@chromium.org

unread,
Apr 16, 2012, 3:41:00 PM4/16/12
to sa...@chromium.org, c...@chromium.org, j...@chromium.org, chromium...@chromium.org, joi+watc...@chromium.org, dari...@chromium.org

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.

http://codereview.chromium.org/10086009/

sa...@chromium.org

unread,
Apr 16, 2012, 3:43:02 PM4/16/12
to c...@chromium.org, j...@chromium.org, chromium...@chromium.org, joi+watc...@chromium.org, dari...@chromium.org

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.

http://codereview.chromium.org/10086009/

j...@chromium.org

unread,
Apr 16, 2012, 11:15:31 PM4/16/12
to sa...@chromium.org, c...@chromium.org, chromium...@chromium.org, joi+watc...@chromium.org, dari...@chromium.org

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)

http://codereview.chromium.org/10086009/

sa...@chromium.org

unread,
Apr 16, 2012, 11:21:00 PM4/16/12
to c...@chromium.org, j...@chromium.org, chromium...@chromium.org, joi+watc...@chromium.org, dari...@chromium.org

> 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.

http://codereview.chromium.org/10086009/

j...@chromium.org

unread,
Apr 17, 2012, 12:34:41 AM4/17/12
to sa...@chromium.org, c...@chromium.org, chromium...@chromium.org, joi+watc...@chromium.org, dari...@chromium.org
On 2012/04/17 03:21:00, sail wrote:
> > 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.

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();

http://codereview.chromium.org/10086009/

Reply all
Reply to author
Forward
0 new messages