VR: Optimize VR Shell UI element rendering calculations |
|||||||
Issue descriptionAs of now, we recompute the transformation of each element, according to all parents, on every frame. The waste isn't visible because we don't have many elements, but we should address this. Considerations: 1. Don't recompute parent transforms multiple times in the render loop. 2. Don't recompute transforms (other than pose-related) for elements that haven't changed (animation or explicit update). Proposed solution: - Add links from parents to children (we currently only link children to parents). - When an element changes (directly or via animation), set a "dirty" flag on the element, and any children. - Before rendering, use the same recursion approach, but recurse only if an element is dirty.
,
Jan 20 2017
,
Jan 26 2017
Given the nature of this work, I think it'd be ideal to do Z-order sorting at the same time.
,
Jan 26 2017
,
Jan 27 2017
The work referenced in #3 is issue 648955.
,
Feb 16 2017
,
Feb 16 2017
,
Feb 24 2017
,
Mar 27 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5513e50629e5cb3d2bea187c6c8eaab7922c5fdf commit 5513e50629e5cb3d2bea187c6c8eaab7922c5fdf Author: cjgrant <cjgrant@chromium.org> Date: Mon Mar 27 17:09:07 2017 Avoid duplicate math when computing VR scene hierarchy. When computing the transformations of UI elements in the scene, re-use the calculations done by parents when computing child element transforms. BUG= 680253 Review-Url: https://codereview.chromium.org/2777633003 Cr-Commit-Position: refs/heads/master@{#459807} [modify] https://crrev.com/5513e50629e5cb3d2bea187c6c8eaab7922c5fdf/chrome/browser/android/vr_shell/ui_elements.cc [modify] https://crrev.com/5513e50629e5cb3d2bea187c6c8eaab7922c5fdf/chrome/browser/android/vr_shell/ui_elements.h [modify] https://crrev.com/5513e50629e5cb3d2bea187c6c8eaab7922c5fdf/chrome/browser/android/vr_shell/ui_scene.cc [modify] https://crrev.com/5513e50629e5cb3d2bea187c6c8eaab7922c5fdf/chrome/browser/android/vr_shell/ui_scene.h [modify] https://crrev.com/5513e50629e5cb3d2bea187c6c8eaab7922c5fdf/chrome/browser/android/vr_shell/ui_scene_unittest.cc
,
Mar 27 2017
The above CL ensures we don't duplicate calculations mulitple times for the same element, per frame. It doesn't attempt to optimize across frames, and this might be good for now, as at least the per-frame overhead will be consistent. Lets save further optimization for if/when the animation framework is amended or overhauled. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by mthiesse@chromium.org
, Jan 11 2017