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

Issue 1409833004: Add DeviceDisplayInfo getter in WindowAndroid.

Created:
5 years, 2 months ago by gsennton
Modified:
3 years, 11 months ago
CC:
chromium-reviews, yusukes+watch_chromium.org, shuchen+watch_chromium.org, jam, nona+watch_chromium.org, darin-cc_chromium.org, piman+watch_chromium.org, James Su, sadrul
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add DeviceDisplayInfo getter in WindowAndroid. To support external displays (i.e. use the metrics of those displays) we need to fetch Context specific display metrics. This will be done through WindowAndroid and in this CL we add the interface for doing so and also start using that interface. The actual functionality for using the metrics of the current context/display rather than the application context will be added in a follow-up. BUG=310763

Patch Set 1 #

Total comments: 4

Patch Set 2 : Fixed variable naming and jdduke nit. #

Total comments: 3

Patch Set 3 : Pass display area instead of NativeWindow to GLHelperHolder. #

Total comments: 39

Patch Set 4 : Add screen_android stub and minor fixes like const-qualifiers. #

Patch Set 5 : Call Screen.SetScreenInstance before any calls to Screen.GetScreen to allow implementing ScreenAndr… #

Patch Set 6 : Revert (unnecessary) changes caused by rebasing. #

Total comments: 14

Patch Set 7 : Some minor/comment/nits changes for sky@ and boliu@. #

Total comments: 6

Patch Set 8 : Fix failing bot, revert RWHVA changes, add NOTIMPLEMENTED to some functions in screen_android #

Unified diffs Side-by-side diffs Delta from patch set Stats (+169 lines, -88 lines) Patch
M android_webview/browser/aw_browser_main_parts.cc View 1 2 3 4 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/chrome_browser_main_android.cc View 1 2 3 4 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/android/content_view_core_impl.h View 1 2 3 4 5 1 chunk +3 lines, -3 lines 0 comments Download
M content/browser/android/content_view_core_impl.cc View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/gpu/gpu_data_manager_impl_private.cc View 1 2 3 4 1 chunk +0 lines, -3 lines 0 comments Download
M content/browser/renderer_host/compositor_impl_android.cc View 1 2 3 4 2 chunks +6 lines, -3 lines 0 comments Download
M ui/android/BUILD.gn View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
A ui/android/screen_android.h View 1 2 3 4 5 6 7 1 chunk +15 lines, -0 lines 0 comments Download
A ui/android/screen_android.cc View 1 2 3 4 5 6 7 1 chunk +103 lines, -0 lines 0 comments Download
M ui/android/ui_android.gyp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M ui/android/window_android.h View 1 2 3 4 5 6 3 chunks +8 lines, -0 lines 0 comments Download
M ui/android/window_android.cc View 1 2 3 4 5 6 2 chunks +11 lines, -3 lines 0 comments Download
M ui/gfx/screen_android.cc View 1 2 3 4 5 1 chunk +2 lines, -73 lines 0 comments Download
M ui/snapshot/snapshot_android.cc View 1 2 3 4 2 chunks +6 lines, -2 lines 0 comments Download

Messages

Total messages: 48 (9 generated)
gsennton
Second part of https://codereview.chromium.org/1144333004/ boliu@ doesn't own anything here but I'm adding you so you ...
5 years, 2 months ago (2015-10-21 16:38:00 UTC) #2
jdduke (slow)
+sievers for content/browser/renderer_host/ bits, as I technically only own input-related code there. https://codereview.chromium.org/1409833004/diff/1/content/browser/renderer_host/render_widget_host_view_android.h File content/browser/renderer_host/render_widget_host_view_android.h ...
5 years, 2 months ago (2015-10-21 17:18:25 UTC) #4
gsennton
Adding sadrul@chromium.org for ui/gfx/BUILD.gn ui/gfx/screen_android.cc ui/snapshot/snapshot_android.cc i.e. snapshot and the moving of screen_android. I moved ...
5 years, 2 months ago (2015-10-22 11:17:27 UTC) #6
jdduke (slow)
https://codereview.chromium.org/1409833004/diff/20001/content/browser/renderer_host/render_widget_host_view_android.cc File content/browser/renderer_host/render_widget_host_view_android.cc (right): https://codereview.chromium.org/1409833004/diff/20001/content/browser/renderer_host/render_widget_host_view_android.cc#newcode2026 content/browser/renderer_host/render_widget_host_view_android.cc:2026: start_time, base::Passed(&bitmap_pixels_lock), native_window), sievers@ is it safe to bind ...
5 years, 2 months ago (2015-10-22 15:37:05 UTC) #7
no sievers
It would be really cool if we could keep the platform abstraction, rather than making ...
5 years, 2 months ago (2015-10-22 20:17:30 UTC) #8
gsennton
On 2015/10/22 20:17:30, sievers wrote: > It would be really cool if we could keep ...
5 years, 2 months ago (2015-10-23 16:45:53 UTC) #9
no sievers
On 2015/10/23 16:45:53, gsennton wrote: > On 2015/10/22 20:17:30, sievers wrote: > > It would ...
5 years, 2 months ago (2015-10-23 17:13:06 UTC) #10
gsennton
On 2015/10/23 17:13:06, sievers wrote: > On 2015/10/23 16:45:53, gsennton wrote: > > On 2015/10/22 ...
5 years, 1 month ago (2015-10-26 14:41:56 UTC) #11
no sievers
https://codereview.chromium.org/1409833004/diff/20001/content/browser/renderer_host/render_widget_host_view_android.cc File content/browser/renderer_host/render_widget_host_view_android.cc (right): https://codereview.chromium.org/1409833004/diff/20001/content/browser/renderer_host/render_widget_host_view_android.cc#newcode2026 content/browser/renderer_host/render_widget_host_view_android.cc:2026: start_time, base::Passed(&bitmap_pixels_lock), native_window), On 2015/10/22 15:37:05, jdduke (slow) wrote: ...
5 years, 1 month ago (2015-10-26 20:42:25 UTC) #12
no sievers
On 2015/10/26 14:41:56, gsennton wrote: > On 2015/10/23 17:13:06, sievers wrote: > > On 2015/10/23 ...
5 years, 1 month ago (2015-10-26 20:43:12 UTC) #13
gsennton
ptal :) sievers@ for content/ sadrul@ for ui/ https://codereview.chromium.org/1409833004/diff/20001/content/browser/renderer_host/render_widget_host_view_android.cc File content/browser/renderer_host/render_widget_host_view_android.cc (right): https://codereview.chromium.org/1409833004/diff/20001/content/browser/renderer_host/render_widget_host_view_android.cc#newcode2026 content/browser/renderer_host/render_widget_host_view_android.cc:2026: start_time, ...
5 years, 1 month ago (2015-10-27 11:40:24 UTC) #14
no sievers
lgtm On 2015/10/27 11:40:24, gsennton wrote: > To make sure that I follow the discussion: ...
5 years, 1 month ago (2015-10-27 15:12:24 UTC) #15
gsennton
> > Regarding moving screens, if I understand correctly WindowAndroid is basically > a > ...
5 years, 1 month ago (2015-10-30 14:37:23 UTC) #16
sadrul
Can you add an owner from ui/android/ for changes in there? https://codereview.chromium.org/1409833004/diff/40001/ui/android/screen_android.cc File ui/android/screen_android.cc (right): ...
5 years, 1 month ago (2015-11-03 18:14:27 UTC) #17
AKV
Please check in line comments. https://codereview.chromium.org/1409833004/diff/40001/ui/android/window_android.cc File ui/android/window_android.cc (right): https://codereview.chromium.org/1409833004/diff/40001/ui/android/window_android.cc#newcode139 ui/android/window_android.cc:139: const gfx::DeviceDisplayInfo& WindowAndroid::GetDeviceDisplayInfo() { ...
5 years, 1 month ago (2015-11-04 14:20:48 UTC) #19
gsennton
Ok, adding tedchoc@ here for ui/android. This change is related to https://codereview.chromium.org/1419843002/ (these changes are ...
5 years, 1 month ago (2015-11-04 23:23:31 UTC) #21
Ted C
https://codereview.chromium.org/1409833004/diff/40001/ui/android/screen_android.cc File ui/android/screen_android.cc (right): https://codereview.chromium.org/1409833004/diff/40001/ui/android/screen_android.cc#newcode56 ui/android/screen_android.cc:56: return DisplayFromDeviceDisplayInfo(device_info); What is gfx::Display used for? How do ...
5 years, 1 month ago (2015-11-05 23:15:58 UTC) #22
gsennton
https://codereview.chromium.org/1409833004/diff/40001/ui/android/screen_android.cc File ui/android/screen_android.cc (right): https://codereview.chromium.org/1409833004/diff/40001/ui/android/screen_android.cc#newcode56 ui/android/screen_android.cc:56: return DisplayFromDeviceDisplayInfo(device_info); On 2015/11/05 23:15:58, Ted C wrote: > ...
5 years, 1 month ago (2015-11-06 16:52:15 UTC) #23
gsennton
@tedchoc did #23 answer your questions sufficiently or is there something I should rethink here?
5 years ago (2015-11-24 18:06:33 UTC) #24
Ted C
Sadly, it seems Bo is out for a while :-/. If you investigate and see ...
5 years ago (2015-11-25 19:35:52 UTC) #25
gsennton
Thanks for being skeptical :) https://codereview.chromium.org/1409833004/diff/40001/ui/android/screen_android.cc File ui/android/screen_android.cc (right): https://codereview.chromium.org/1409833004/diff/40001/ui/android/screen_android.cc#newcode56 ui/android/screen_android.cc:56: return DisplayFromDeviceDisplayInfo(device_info); On 2015/11/25 ...
5 years ago (2015-12-02 15:37:05 UTC) #26
Ted C
https://codereview.chromium.org/1409833004/diff/40001/ui/android/screen_android.cc File ui/android/screen_android.cc (right): https://codereview.chromium.org/1409833004/diff/40001/ui/android/screen_android.cc#newcode56 ui/android/screen_android.cc:56: return DisplayFromDeviceDisplayInfo(device_info); On 2015/12/02 15:37:05, gsennton wrote: > On ...
5 years ago (2015-12-03 04:23:56 UTC) #27
boliu
/me no owner review https://codereview.chromium.org/1409833004/diff/40001/ui/android/screen_android.cc File ui/android/screen_android.cc (right): https://codereview.chromium.org/1409833004/diff/40001/ui/android/screen_android.cc#newcode14 ui/android/screen_android.cc:14: namespace gfx { On 2015/11/03 ...
5 years ago (2015-12-08 08:21:54 UTC) #28
gsennton
https://codereview.chromium.org/1409833004/diff/40001/ui/android/screen_android.cc File ui/android/screen_android.cc (right): https://codereview.chromium.org/1409833004/diff/40001/ui/android/screen_android.cc#newcode16 ui/android/screen_android.cc:16: gfx::Display DisplayFromDeviceDisplayInfo( On 2015/12/08 08:21:54, boliu wrote: > should ...
5 years ago (2015-12-10 12:29:54 UTC) #29
boliu
https://codereview.chromium.org/1409833004/diff/40001/ui/android/screen_android.cc File ui/android/screen_android.cc (right): https://codereview.chromium.org/1409833004/diff/40001/ui/android/screen_android.cc#newcode22 ui/android/screen_android.cc:22: const gfx::Rect bounds_in_pixels = On 2015/12/10 12:29:54, gsennton wrote: ...
5 years ago (2015-12-10 16:38:20 UTC) #30
Ted C
I'd say this looks fine to me at this point. I think sievers should take ...
5 years ago (2015-12-13 00:29:38 UTC) #31
gsennton
So I've fixed the minor stuff, still need to find a way of setting the ...
5 years ago (2015-12-14 18:10:32 UTC) #32
Ted C
On 2015/12/14 18:10:32, gsennton wrote: > So I've fixed the minor stuff, still need to ...
5 years ago (2015-12-15 00:27:52 UTC) #33
gsennton
On 2015/12/15 00:27:52, Ted C wrote: > On 2015/12/14 18:10:32, gsennton wrote: > > So ...
5 years ago (2015-12-15 19:55:08 UTC) #34
gsennton
Hey everyone, sorry for putting this CL on hold, I have been working on more ...
4 years, 10 months ago (2016-02-24 15:55:40 UTC) #38
sky
https://codereview.chromium.org/1409833004/diff/100001/ui/android/screen_android.cc File ui/android/screen_android.cc (right): https://codereview.chromium.org/1409833004/diff/100001/ui/android/screen_android.cc#newcode17 ui/android/screen_android.cc:17: gfx::Display DisplayFromDeviceDisplayInfo( If ScreenAndroid only ever returns a single ...
4 years, 10 months ago (2016-02-24 19:18:48 UTC) #39
sky
https://codereview.chromium.org/1409833004/diff/100001/ui/android/screen_android.cc File ui/android/screen_android.cc (right): https://codereview.chromium.org/1409833004/diff/100001/ui/android/screen_android.cc#newcode1 ui/android/screen_android.cc:1: // Copyright (c) 2012 The Chromium Authors. All rights ...
4 years, 10 months ago (2016-02-24 19:19:09 UTC) #40
boliu
I'll approve once UI owners are happy. Also wondering, can DeviceDisplayInfo constructor be made private ...
4 years, 10 months ago (2016-02-25 05:33:36 UTC) #41
gsennton
'Also wondering, can DeviceDisplayInfo constructor be made private now, and make WindowAndroid a friend? Would ...
4 years, 10 months ago (2016-02-25 17:08:05 UTC) #42
boliu
https://codereview.chromium.org/1409833004/diff/100001/ui/android/screen_android.cc File ui/android/screen_android.cc (right): https://codereview.chromium.org/1409833004/diff/100001/ui/android/screen_android.cc#newcode17 ui/android/screen_android.cc:17: gfx::Display DisplayFromDeviceDisplayInfo( On 2016/02/25 17:08:04, gsennton wrote: > On ...
4 years, 10 months ago (2016-02-25 18:11:34 UTC) #43
no sievers
https://codereview.chromium.org/1409833004/diff/120001/content/browser/renderer_host/render_widget_host_view_android.cc File content/browser/renderer_host/render_widget_host_view_android.cc (right): https://codereview.chromium.org/1409833004/diff/120001/content/browser/renderer_host/render_widget_host_view_android.cc#newcode1537 content/browser/renderer_host/render_widget_host_view_android.cc:1537: if (content_view_core_) { I'm wondering if it's worth plumbing ...
4 years, 10 months ago (2016-02-27 01:11:52 UTC) #44
boliu
https://codereview.chromium.org/1409833004/diff/120001/content/browser/renderer_host/render_widget_host_view_android.cc File content/browser/renderer_host/render_widget_host_view_android.cc (right): https://codereview.chromium.org/1409833004/diff/120001/content/browser/renderer_host/render_widget_host_view_android.cc#newcode1537 content/browser/renderer_host/render_widget_host_view_android.cc:1537: if (content_view_core_) { On 2016/02/27 01:11:52, sievers wrote: > ...
4 years, 10 months ago (2016-02-27 01:30:56 UTC) #45
no sievers
https://codereview.chromium.org/1409833004/diff/40001/ui/android/screen_android.cc File ui/android/screen_android.cc (right): https://codereview.chromium.org/1409833004/diff/40001/ui/android/screen_android.cc#newcode14 ui/android/screen_android.cc:14: namespace gfx { On 2015/12/08 08:21:54, boliu wrote: > ...
4 years, 9 months ago (2016-02-29 18:16:03 UTC) #46
gsennton
4 years, 8 months ago (2016-04-25 18:55:58 UTC) #47
https://codereview.chromium.org/1409833004/diff/120001/content/browser/render...
File content/browser/renderer_host/render_widget_host_view_android.cc (right):

https://codereview.chromium.org/1409833004/diff/120001/content/browser/render...
content/browser/renderer_host/render_widget_host_view_android.cc:1537: if
(content_view_core_) {
On 2016/02/29 18:16:03, sievers wrote:
> On 2016/02/27 01:30:56, boliu wrote:
> > On 2016/02/27 01:11:52, sievers wrote:
> > > I'm wondering if it's worth plumbing all this info through all the static
> > > functions and callbacks here, because... well it's all static... so if
there
> > are
> > > multiple displays somebody is using the wrong dimensions.
> > 
> > It's also used to determine stuff like screen density.
> > 
> > > 
> > > We also don't want to create a context per display just for this.
> > > Maybe just keep going with GetDefaultScreenInfo() here?
> > 
> > I assume you mean CreateContext3D? I don't see how this CL creates more
> > Context3D now? The work is to add multi display support for android webview,
> not
> > chrome..
> > 
> > > 
> 
> 
> The point was: If this is for multi-display, then there's no need to plumb
this
> through to the static shared context (and I don't think we want to create one
> context per display either). And I'd just leave this file untouched as far as
> possible and use the default screen info as before.

I experimented a bit by setting different device scale factors at different
points in the code and it seems the main point which actually makes a WebView on
a Presentation, targeting a virtual display, look OK is
RenderWidgetHostViewAndroid::GetScreenInfo (i.e. if I hardcode the scale factor
in GetDefaultScreenInfo to be that of the primary display, even if all other
locations use the correct value - the scale factor for the virtual display -
then we display content in an incorrect way). :/

Powered by Google App Engine
This is Rietveld 408576698