TopControls height is overly plumbed/complex |
|||
Issue description- It's set in the ChromeFullscreenManager.java's constructor, and doesn't change. So it's a constant. - CompositorViewHolder.java also can give a different size, but it uses the one from ChromeFullscreenManager.java unless it has a null pointer, then it uses 0. - The browser divides the size by the DSF to get a value in DIP. - We send it to the renderer in every resize instead of sending it when the renderer (or even the view) is constructed/initialized. - From there it goes into blink via eventually WebViewImpl::resizeWithTopControls. - From there-after it's a constant in blink, but it is repeatedly passed back to WebViewImpl::resizeWithTopControls from WebViewImpl::resize as if it can be changing. - From WebViewImpl, it goes to the compositor (why did it go through blink to do that. does blink even use it? unclear!). We could send it from the RenderWidget to the compositor directly at startup (as a setting maybe?) - In the compositor we have a number in DIP, so we have to multiply by the DSF of the renderer to get back the number from ChromeFullscreenManager. If they didn't match (moving renderers between external/dual screens, the dream) then it will be a different number, but one that represents the right intention, I think. Probably there will be rounding problems.
,
Jun 25 2016
It is intentional. iOS Safari has a dynamically changing top controls height and we wanted to leave open the possibility of doing the same thing. Secondly there are scenarios like devtools emulation where it may be more dynamic. And I don't think plumbing a constant instead of a variable would be significantly less code. I agree the DIP backconversion is a problem but the rest is fine.
,
Jun 25 2016
I recommend making tile size independent of top controls height (always use the size assuming that top controls are hidden) It's quite important for it to match width exactly, but because most pages scroll vertically, a small mismatch there doesn't matter as long as it's stable over time.
,
Jun 25 2016
Oh, huh. Do you know offhand if the viewport size has the top controls removed from it?
,
Jun 25 2016
> would be significantly less code. I agree, but it would be a lot easier to reason about given that it doesn't change. But I guess it's meant to change so it's meant to be thought of that way.
,
Jun 25 2016
> Oh, huh. Do you know offhand if the viewport size has the top controls removed from it? It depends. That is also dynamically specified as part of ResizeParams: // Whether or not Blink's viewport size should be shrunk by the height of the // URL-bar (always false on platforms where URL-bar hiding isn't supported). bool top_controls_shrink_blink_size; I realize this also may strike you as overcomplicated but we didn't add the complexity casually. It's more that the problem is more complicated than one's initial intuition of it.
,
Jun 25 2016
Ya, I was trying to find a way to get a "screen size" that will be stable so that we don't make new tiles every time the top controls changes. How would you recommend doing it? Is there some max size that top controls can be somewhere?
,
Jun 25 2016
Hm, I was trying to find an easier way than giving a "screen size" to the LayerTreeHost, with the intention to do that eventually. Maybe I need to do that in the same patch tho.
,
Jun 25 2016
Hmm, I had to look it up a bit. Unfortunately, physical_backing_size_/device_viewport_size is not stable. There are two reasonable ways to get a stable viewport size in physical pixels: 1) OutputSurface::SurfaceSize() 2) (viewport_size + top_controls_shrink_blink_size ? top_controls_height : 0) * device_scale_factor I actually propose that you take the intersection (min) of those two sizes. The reason is WebView. WebView can have the viewport (Android View size) either much larger or much smaller than the OutputSurface size (GL framebuffer size). Taking the smaller of the two will solve http://crbug.com/472813 while avoiding introducing the inverse problem for tiny WebViews.
,
Jun 25 2016
Ok thanks for all the info and help. I'll port this over to 622885. |
|||
►
Sign in to add a comment |
|||
Comment 1 by danakj@chromium.org
, Jun 25 2016Labels: -Type-Bug Type-Feature