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

Issue 10837154: Mac HiDPI: Fix scale factor on external display (Closed)

Created:
8 years, 4 months ago by sail
Modified:
8 years, 4 months ago
Reviewers:
Avi (use Gerrit), Nico, sky
CC:
chromium-reviews, yusukes+watch_chromium.org, jam, penghuang+watch_chromium.org, joi+watch-content_chromium.org, darin-cc_chromium.org, James Su
Visibility:
Public.

Description

Mac HiDPI: Fix scale factor on external display On Mac OS 10.8, opening a page on external monitor would cause the page to be rendered at the scale factor of the primary display. The problem is in RenderViewHostImpl::CreateRenderView. It uses the view to calculate the display scale factor but this doesn't work because the view hasn't been added to a window yet. My fix is to update the scale factor when -[RenderWidgetHostViewCocoa viewDidMoveToWindow:] is called. This CL also caches the scale factor. Note, for some reason I can't reproduce the bug on 10.7. On 10.7 the scale factor is also incorrect but for some reason the page is displayed correctly. I'm not sure what's going on. BUG=138039 TBR=sky Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=150973

Patch Set 1 #

Patch Set 2 : switch to viewDidMoveToWindow: #

Patch Set 3 : " #

Total comments: 2

Patch Set 4 : address review comments #

Total comments: 5

Patch Set 5 : address review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -14 lines) Patch
M content/browser/renderer_host/render_widget_host_view_mac.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.mm View 1 2 3 4 5 chunks +10 lines, -6 lines 0 comments Download
M ui/base/layout_mac.mm View 1 2 3 4 1 chunk +10 lines, -8 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
sail
8 years, 4 months ago (2012-08-07 23:29:30 UTC) #1
Nico
Should the rwhvmac remember the dpi it last sent to the web, and only do ...
8 years, 4 months ago (2012-08-07 23:36:59 UTC) #2
Avi (use Gerrit)
That's a long description... I'm not sure viewDidMoveToWindow is where we want to put it. ...
8 years, 4 months ago (2012-08-07 23:47:39 UTC) #3
Nico
On 2012/08/07 23:47:39, Avi wrote: > That's a long description... > > I'm not sure ...
8 years, 4 months ago (2012-08-07 23:50:55 UTC) #4
Avi (use Gerrit)
First, I don't want to add anything to viewDidMoveToWindow. We already override viewWillMoveToWindow, so if ...
8 years, 4 months ago (2012-08-08 00:18:25 UTC) #5
sail
On 2012/08/08 00:18:25, Avi wrote: > First, I don't want to add anything to viewDidMoveToWindow. ...
8 years, 4 months ago (2012-08-08 00:22:57 UTC) #6
Avi (use Gerrit)
On 2012/08/08 00:22:57, sail wrote: > We currently override both will move and did move. ...
8 years, 4 months ago (2012-08-08 00:29:34 UTC) #7
sail
Moved to viewDidMoveToWindow.
8 years, 4 months ago (2012-08-08 00:33:49 UTC) #8
Nico
this looks much better imho, thanks https://chromiumcodereview.appspot.com/10837154/diff/8001/content/browser/renderer_host/render_widget_host_view_mac.mm File content/browser/renderer_host/render_widget_host_view_mac.mm (right): https://chromiumcodereview.appspot.com/10837154/diff/8001/content/browser/renderer_host/render_widget_host_view_mac.mm#newcode2996 content/browser/renderer_host/render_widget_host_view_mac.mm:2996: [self updateTabBackingStoreScaleFactor]; why ...
8 years, 4 months ago (2012-08-08 00:35:16 UTC) #9
sail
https://chromiumcodereview.appspot.com/10837154/diff/8001/content/browser/renderer_host/render_widget_host_view_mac.mm File content/browser/renderer_host/render_widget_host_view_mac.mm (right): https://chromiumcodereview.appspot.com/10837154/diff/8001/content/browser/renderer_host/render_widget_host_view_mac.mm#newcode2996 content/browser/renderer_host/render_widget_host_view_mac.mm:2996: [self updateTabBackingStoreScaleFactor]; On 2012/08/08 00:35:17, Nico wrote: > why ...
8 years, 4 months ago (2012-08-08 00:45:00 UTC) #10
Nico
lgtm https://chromiumcodereview.appspot.com/10837154/diff/10001/content/browser/renderer_host/render_widget_host_view_mac.mm File content/browser/renderer_host/render_widget_host_view_mac.mm (right): https://chromiumcodereview.appspot.com/10837154/diff/10001/content/browser/renderer_host/render_widget_host_view_mac.mm#newcode2984 content/browser/renderer_host/render_widget_host_view_mac.mm:2984: if ([self window] != lastWindow_) nit: I'd just ...
8 years, 4 months ago (2012-08-08 00:47:52 UTC) #11
Avi (use Gerrit)
https://chromiumcodereview.appspot.com/10837154/diff/10001/content/browser/renderer_host/render_widget_host_view_mac.mm File content/browser/renderer_host/render_widget_host_view_mac.mm (right): https://chromiumcodereview.appspot.com/10837154/diff/10001/content/browser/renderer_host/render_widget_host_view_mac.mm#newcode2052 content/browser/renderer_host/render_widget_host_view_mac.mm:2052: // active, in WasShown(). This comment is no longer ...
8 years, 4 months ago (2012-08-08 01:01:28 UTC) #12
sail
Addressed review comments. I also updated layout_mac.mm/GetScaleFactorScaleForNativeView() so that it's implementation matches WebScreenInfoFactory.mm/deviceScaleFactor(). I also ...
8 years, 4 months ago (2012-08-09 00:25:18 UTC) #13
Nico
lgtm!
8 years, 4 months ago (2012-08-09 00:56:16 UTC) #14
Avi (use Gerrit)
lgtm!
8 years, 4 months ago (2012-08-09 04:11:50 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sail@chromium.org/10837154/5
8 years, 4 months ago (2012-08-09 04:14:32 UTC) #16
commit-bot: I haz the power
Presubmit check for 10837154-5 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 4 months ago (2012-08-09 04:14:38 UTC) #17
sail
+sky for ui/base OWNERS review
8 years, 4 months ago (2012-08-09 04:32:20 UTC) #18
Nico
sky tbr
8 years, 4 months ago (2012-08-10 00:54:52 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sail@chromium.org/10837154/5
8 years, 4 months ago (2012-08-10 00:55:06 UTC) #20
commit-bot: I haz the power
8 years, 4 months ago (2012-08-10 02:00:50 UTC) #21
Change committed as 150973

Powered by Google App Engine
This is Rietveld 408576698