gecko-dev/gfx/wr/example-compositor
Jamie Nicol 3e85fea00a Bug 1694707 - Select correct scroll root within fixed position items with dynamic toolbar. r=gw
Currently when selecting the scroll root for picture caching, if a
non-Zoom transform is encountered we give up and select the root
spatial node. This is because the transform may be non-axis aligned.

When the Fenix dynamic toolbar is enabled, fixed position items must
create a spatial node with an animated transform, so that they can be
positioned asynchronously by APZ when the toolbar moves.

The combination of these two things means for that scroll frames
within fixed position items we always select the root spatial node,
meaning that the entire contents invalidates continuously while
scrolling.

To fix this, add a flag to the Transform ReferenceFrameKind which
marks the transform as always being a 2D scale or translation. When
selecting the scroll root, we can continue searching through such
reference frames, as we already do for Zoom frames. Set this flag true
for references frames created due to the dynamic toolbar.
Additionally, assert that the transform is indeed a 2d scale or
translation after it is resolved.

The condition of the transform being only a 2d scale and translation
is shared with ReferenceFrameKind::Zoom, so that has been removed and
its uses updated to use this new flag instead. An additional
should_snap flag has also been added, so that we continue to snap zoom
transforms, and additionally snap the dynamic-toolbar related
transforms too.

Lastly, this adds some unit tests for find_scroll_root.

Differential Revision: https://phabricator.services.mozilla.com/D106809
2021-03-02 21:53:41 +00:00
..
compositor Bug 1694707 - Select correct scroll root within fixed position items with dynamic toolbar. r=gw 2021-03-02 21:53:41 +00:00
compositor-windows Bug 1686635 - Reformat example-compositor C++ code. r=gw 2021-01-14 04:25:21 +00:00