This patch:
- Maintains a consistent ordering between the lists of fields in the
FrameMetrics constructor, operator==, IPC read/write functions, and the
actual order of fields in FrameMetrics. As part of this, missing default
initializers are added to the FrameMetrics constructor, and fields omitted
from the operator== are explicitly noted.
- Moves all the boolean values to the end of the set of field (for better
packing).
- Moves the scroll id and parent scroll id to the front of the list, so that
the operator== can fail faster in the common case.
--HG--
extra : commitid : 6ink6xmxH38
The bulk of this commit was generated by running:
run-clang-tidy.py \
-checks='-*,llvm-namespace-comment' \
-header-filter=^/.../mozilla-central/.* \
-fix
This field tells us if this frame metrics should be considered the root APZC for its layers id. Without this there doesn't seem to be a way to compute this from just the layers tree.
This makes APZ behave nicely with most uses of a css transform:scale.
Summary of changes:
- FrameMetrics::mCumulativeResolution now includes the css-driven resolution
in addition to the pres-shell resolution.
- Displayports are now stored in Screen pixels rather than Layer pixels.
This is what we want anyways (as we'd like the displayport size to remain
constant as a fraction of the screen size), but it was necessary to make
this change as part of this patch because continuing to store them in
Layer pixels in the presence of a css-driven resolution would have
required a bunch of infrastructure to implement correctly.
Remaining work:
- Layout painting a scrollable layer at a resolution different from the
scale induced by the css transform causes problems. These will go away
with bug 1076192.
- Different resolutions on the x and y axes are not supported. This is
tracked by bug 1039967.
This makes APZ behave nicely with most uses of a css transform:scale.
Summary of changes:
- FrameMetrics::mCumulativeResolution now includes the css-driven resolution
in addition to the pres-shell resolution.
- Displayports are now stored in Screen pixels rather than Layer pixels.
This is what we want anyways (as we'd like the displayport size to remain
constant as a fraction of the screen size), but it was necessary to make
this change as part of this patch because continuing to store them in
Layer pixels in the presence of a css-driven resolution would have
required a bunch of infrastructure to implement correctly.
Remaining work:
- Layout painting a scrollable layer at a resolution different from the
scale induced by the css transform causes problems. These will go away
with bug 1076192.
- Different resolutions on the x and y axes are not supported. This is
tracked by bug 1039967.
- Extended nsIScrollableFrame and nsGfxScrollFrame to return destination
of smooth scrolls which are to be animated on the compositor thread.
- Added apz.smooth_scroll_repaint_interval preference.
- Implemented AsyncPanZoomController::PanZoomState::SMOOTH_MSD_SCROLL state
and AsyncPanZoomController::SmoothScrollAnimation class to animate smooth
scroll animations on the compositor thread.
- Extended FrameMetrics to report requests for smooth scrolls to be animated
on the compositor thread and their corresponding destination positions.
- AsyncPanZoomController now checks FrameMetrics for requests to perform
smooth scrolling on the compositor thread. It will ensure that they
are cancelled as needed by mousewheel, touchpanel, keyboard, and
CSSOM-View instant scrolling DOM methods.
- The layout/generic/test/test_scroll_behavior.html mochitest has been
commented as depending on Bug 1062609 before being enabled for APZ.