Triage all uses of CompositorFrameMetadata on Android |
||||||
Issue descriptionChrome for Android is the port with the heaviest use of CompositorFrameMetadata. The various fields are passed into Java code as RenderCoordinates object and then passed around from there, so there is a lot of usage overall. With Viz architecture, we can still forward all the same metadata to this browser code, but the usefulness of the information will be significantly degraded because it'll be asynchronous, and we cannot affect the associated frame from the browser process. Metadata uses falls into these categories: 1. Synchronous positioning of visible UI relative to scroll. Already tracked in http://crbug.com/689754 and http://crbug.com/713696 . 2. Translate/scale of input events. 3. Sizing/positioning of random UI which does not especially care about precise synchronization with renderer. 4. Fixing "flickers": identifying incorrectly sized, obsolete, or otherwise "bad" renderer frames and papering them over with a background color, a thumbnail screenshot, or a big Android View. 5. (Other?) Use cases 2 and 3 I believe will usually not be visibly affected by making metadata asynchronous (but we should still examine them to make sure). Use cases 1 and 4 are more concerning. In particular, we have not given much thought about flickers yet. It's a racy and subtle problem space, and synchronous CompositorFrameMetadata is a powerful and reliable tool to solve bugs in this class. Because of this, there are still additional uses threatening to accumulate in the codebase such as https://codereview.chromium.org/2810813004 (patchset 14 at time of writing).
,
Jun 23 2017
I spoke with Fady today and it looks like there would be a straightforward way to achieve what 4) is doing with surface synchronization. What this patch is trying to achieve using the metadata is the following: 1) A transition is initiated in the browser (fullscreening of an element, resize during fullscreen) that requires synchronization with the renderer's frame. During the transition, we'd rather just cover with a black frame. 2) The property required to be synchronized is pushed through the complete pipeline (render thread tree -> pending tree -> active tree -> CompositorFrame), the metadata has that property bundled with the frame so the browser can know that this is the desired frame. At which point the Surface with this frame is embedded by the browser. The size is already there on the frame's root pass, the additional bit this patch is adding to the metadata is whether an element was fullscreen in this frame. With Surface synchronization enabled, instead of reading the metadata to know if all the bits were reflected in a frame, this is what would happen: 1) The browser would generate a new Surface id and add it to the Resize IPC sent to the renderer that takes the fullscreen/size update that we want synchronized. This surface id goes through the pipeline in the same way and gets added to the frame metadata. 2) The browser compositor produces a frame that embeds the renderer's frame using this surface id that's submitted to viz, and a fallback surface which for the fullscreen transition would just be a pass with a black solid draw quad (you have to give viz something otherwise it won't activate your frame until the dependency is satisfied). 3) Once it receives the surface id embeded in the browser's frame, it will use that instead. For synchronization issues where the parent initiates a change it wants to synchronize with the child, using the metadata is consistent with the pattern that surface synchronization is providing. The cases that are concerning are the anti pattern, where the child is initiating a change that affects the parent's frame which is the category top controls and selection handles fall in. And we can not move to surface synchronization until these are resolved. As for this change, I don't think it is adding a dependency that will be difficult to move to surface synchronization. And given that resolving blockers to enabling it for android is not trivial, we shouldn't block the change on it. Fady, feel free to add if I misunderstood something.
,
Jun 23 2017
Makes sense, thanks. My intent in filing this bug was to make sure we have a plan to transition these flicker fixes to Viz, it sounds like we have formulated such a plan. I'm only interested in blocking new metadata from being added if they make it qualitatively harder to transition to Viz -- which seems like it's not the case here given surface synchronization is designed to address precisely this use class.
,
Jun 25 2018
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jun 25 2018
Was fixed in the de-sniffing work? jonross@ to triage.
,
Jun 25 2018
I think I'm currently the owner for this.
,
Jul 17
I believe this is fixed but I'll leave this bug open until surface synchronization hits stable.
,
Aug 13
We already have a bug tracking surface sync for android so I'll just mark this as fixed. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by fsam...@chromium.org
, Jun 22 2017