This allows the feature to ride the trains later than async scrollbar
dragging itself, if desired.
MozReview-Commit-ID: 73ZlCqM5hMN
--HG--
extra : rebase_source : dabc4a4b72210133d8b62256510213183312f18f
Also add a comment to AsyncDragMetrics documenting that mScrollbarDragOffset
is relative to the thumb's start offset.
MozReview-Commit-ID: uipsOCzs2N
--HG--
extra : rebase_source : 25183e22cb7ffb9995a2594d6aea106cdef7924a
To conserve space in LayerAttributes, we only store the extents along the
relevant axis.
MozReview-Commit-ID: GAL8Oa2NOde
--HG--
extra : rebase_source : 9420d0fb36175e190cbff6e162fd41d8e5240c81
This flag is set to false if there are any conditions that only the main
thread knows about that prevent the thumb from being async-dragged.
MozReview-Commit-ID: Gl7f7bY0QnA
--HG--
extra : rebase_source : 60ab680a3995e3b5c0e1b4482ca0e7142352bbd2
This is preparation for future changes that will add fields to ScrollThumbData
that will be accessed via HitTestingTreeNode.
To accomplish this, this patch also exposes the entire ScrollThumbData via
LayerMetricsWrapper and WebRenderScrollDataWrapper.
MozReview-Commit-ID: 1Ed8Z80Wk1V
--HG--
extra : rebase_source : 86cce84eab0cd8bcd2998f1682137e9514bb1fb5
Also remove a vestigial declaration of the previously removed method
HitTestingTreeNode::GetScrollThumbLength().
MozReview-Commit-ID: 3BvFNeGwPXd
--HG--
extra : rebase_source : 6cc6d2f2e3ecc4dedce2b83f6b0faf819f4be0f8
The patch also renames Layer::SetScrollbarData() to Layer::SetScrollThumbData()
for clarity.
MozReview-Commit-ID: DVwJ3DMl3Zs
--HG--
extra : rebase_source : 7b2bfccf1351c82bb16296635e69d5488c87a50f
This should fix some wrong-looking code that computes the clip for
WebRenderDisplayItemLayer instances. As this code is not exercised very
much it's hard to know if this change is actually correct.
MozReview-Commit-ID: BSsBpBmzWgd
These functions also have built-in assumptions about the stacking
context structure mapping to the layer tree structure which are not
necessarily valid. So we remove these functions and update code that
uses them.
MozReview-Commit-ID: UkXXAF59qv
The only remaining callers of RelativeToParent() are in
StackingContextHelper itself, which we can remove now by having the SCH
take a parent SCH and use it instead of RelativeToParent(). This patch
implements this change.
This makes a failing test pass, because of how preserve-3d container
layers work. Specifically, preserve-3d container layers render their
descendants in z-order, not in tree order. If those children were assuming
that their parent had already pushed a stacking context, that assumption
may have been false because the parent might have not yet been rendered
because of z-ordering. By using the StackingContextHelper chain instead
of the layer tree ancestry, we fix the stacking-context-relative coordinates
being used in the descendant subtree of preserve-3d container layers.
MozReview-Commit-ID: HzZvBuAlMdB
This updates more code that was using RelativeToParent() to use the
stacking context helper's ToRelativeWr* functions instead. This get us
closer to breaking the assumption that the WR stacking context order maps
1:1 to the layer tree structure.
MozReview-Commit-ID: HQrbvCgPOW4
This propagates the StackingContextHelper to the rest of the code that
builds WR display items, because we will need it in future patches to
stop using RelativeToParent.
MozReview-Commit-ID: 3PlQrJRhH36
This cleans up WebRenderRefLayer::RenderLayer to use typed coordinate
systems and the StackingContextHelper. Note that this patch contains a
functional change, because the clip rect pushed no longer includes the
transform on the ref layer itself. It's not clear to me why we were doing
that, and didn't seem correct.
MozReview-Commit-ID: K7FoeLnXc56
This uses the StackingContextHelper and typed helper functions in
WebRenderLayer to simplify WebRenderTextLayer::RenderLayer. It also
removes the implicit assumption in WebRenderTextLayer that the parent
layer pushed a stacking context, which is an assumption we will
probably break in the future.
MozReview-Commit-ID: CARoGVQd56i
This is needed for the next patch, because the bullet frame WR rendering
code will need a StackingContextHelper to pass to the PushGlyphs call.
It also helps with some of the later patches in this series, when we get
rid of the RelativeToParent calls.
MozReview-Commit-ID: Is0aciHhy2N
This is needed in part 3 to update WebRenderTextLayer::RenderLayer, so
that it no longer assumes the parent container layer has pushed a
stacking context, and instead explicitly uses the StackingContextHelper.
MozReview-Commit-ID: 9twUmDgUipX
Need to pass the default transform/opacity to compositor if animations
exist because it is possible that gecko fails to get animated value
after animation sampling, like an animation with delay.
MozReview-Commit-ID: IK06hWvaSPf
Pass empty opacity(transform) in stacking context when there exists opacity(transform) animations and
the final opacity(transform) value will be resolved on the compositor after animation sampling
MozReview-Commit-ID: 6pF9Oe8Ks2I
First, hook the Layer's ClearAnimation API to delete unnecessary
animations in next layer transaction. Second, add another async
DeleteCompositorAnimations API to delete animations on the compositor,
especially calling this API before WebRenderLayerManager got destroyed.
MozReview-Commit-ID: 4mbj5IgsXYa
We are seeing occasional failed release assertions from calling
animation.startTime().get_TimeDuration() in SampleAnimationForEachNode on
Windows.
My theory is that in some circumstances (perhaps graphic-driver related?) when
creating a layer transaction we fail to call Layer::StartPendingAnimations and
end up sending pending animations to the compositor. Prior to bug 1334583 that
would have only triggered a debug assertion so it may have gone unnoticed if it
depends on the system configuration.
This patch makes us check that the startTime is set before we try to access it
in order to avoid triggering a release-time assertion. If the startTime is not
set we will use the hold time which should give us the correct behavior for
a still-pending animation. (Furthermore, the holdTime is set unconditionally
when we create animations so it should be correct -- but even if it were not
set explicitly, its initial zero value would still likely produce a reasonable
result until the start time was updated on a subsequent layer transaction. At
very least, it should not crash. Likewise, if it was set to an incorrect value.)
This patch also strengthens the debug assertion in SampleAnimationForEachNode to
check that not only is start time not-null, but that it is set to a TimeDuration
since MaybeTimeDuration also includes a third uninitialized "None" state.
The patch also adds another gtest that exercises hit testing, and fixes a
coordinate space bug in the gtest fixture.
MozReview-Commit-ID: 3QYTofkKSZj
--HG--
extra : rebase_source : 7108c4b57bdd3ada41dc57ab022825a1057b899d
By passing the startTime as a TimeDuration we are able to represent times in the
distant past (and with the same range as we can represent on the main thread so
that if we do encounter range errors in future, they should not differ between
the main thread and the compositor).
This patch includes a crashtest. I have verified that, without the code changes
included in this patch, this crashtest fails on debug builds on OSX.
MozReview-Commit-ID: EDuKLzfEC0K
--HG--
extra : rebase_source : 1883080fdfac8c33f70698145f21e67cbdfdd4f2
In bug 1223658 we separated out the delay from the start time but we failed to
remove it from this calculation. As a result, when a pending animation begins it
will have the delay applied twice (once here, and once when it is sampled on the
compositor). This will happen until the layer is next updated.
This bug was not exposed by any existing tests since we don't use this code path
when the refresh driver is under test control. Furthermore, the one test that
was supposed to cover this was refactored in such a way that it stopped testing
this code path. That test is restored earlier in this patch series and enabled
in this patch.
MozReview-Commit-ID: B2KR7YaPsMK
--HG--
extra : rebase_source : 6c888252813fbfc01baf5d4bb1728d989ee1586c
The MultiTouchInput::MULTITOUCH_END generated from transitioning from
multiple touch sources to a single source would often cause the content
to shift under the remaining finger which would look like a fling and
cause the content to rapidly scroll. This patch treats the transition from
multiple touch source to a single source as if the touch event were
starting over by resetting all the variables tracking the touch drag
that is in progress.
MozReview-Commit-ID: 42L1Q622fww
PLayerTransaction's constructor was previously synchronous so we could
return a TextureFactoryIdentifier. This is quite reliably available
already in the case of opening a tab, due to RenderFrameParent knowing
which compositor it is attached to, so we can make the constructor
asynchronous.
In the top-level widget case, we add a new synchronous message to find
the TextureFactoryIdentifier.
Because ProfilerMarkerPayload is the main type defined in these files, and
because the next patch is going to introduce ProfilerMarker.{h,cpp}, which
would be confusingly similar to the old names.
--HG--
rename : tools/profiler/core/ProfilerMarkers.cpp => tools/profiler/core/ProfilerMarkerPayload.cpp
rename : tools/profiler/public/ProfilerMarkers.h => tools/profiler/public/ProfilerMarkerPayload.h
extra : rebase_source : df22a2ab3867650348ae78fe959ff0366aff230b
PLayerTransaction's constructor was previously synchronous so we could
return a TextureFactoryIdentifier. This is quite reliably available
already in the case of opening a tab, due to RenderFrameParent knowing
which compositor it is attached to, so we can make the constructor
asynchronous.
In the top-level widget case, we add a new synchronous message to find
the TextureFactoryIdentifier.
--HG--
extra : rebase_source : 4b29b859aa5745fabe3db0fe68742328fc0af175
This is functionally equivalent since one variant of the
PushStackingContext was already delegating to the other (in
DisplayListBuilder).
MozReview-Commit-ID: 8PfMm3bHeSZ
This class is a RAII class that can be used to push a stacking context
with properties from a WebRenderLayer. It can also then be used to
convert rects in the layer coordinate system to be relative to the
stacking context, which is what we want for passing to WR.
MozReview-Commit-ID: 1WVrfRYqLqc
As we are often converting from LayoutDevicePixel to LayerPixel types
in WebRenderDisplayItem code, I added a convenience overload of
RelativeToParent that takes a LayoutDeviceRect and returns a LayerRect,
even though this is a potential footgun if abused.
MozReview-Commit-ID: DABAWdOBsbV
This extracts a strongly-typed ClipRect() function from GetWrClipRect.
GetWrClipRect is left as a weakly-typed wrapper for existing call sites,
and also does the necessary reference point conversions.
MozReview-Commit-ID: EuyzYIYLR6S
This moves the bulk of the meaningful work done by GetWrRelBounds into
strongly-typed helper functions. GetWrRelBounds is left as a wrapper so
call sites don't need to be updated yet. Note also that the
strongly-typed functions do not do any conversions from one reference
point from another (e.g. by calling the RelativeToXXX functions).
MozReview-Commit-ID: B3nPbOJOf9o
In addition to updating the Cargo.toml/Cargo.lock files and generated FFI header,
this patch also:
- Updates a couple of field names in the IPC serialization code as a result
of webrender cset 8ca10a8
- Removes z-index related goop, since it's no longer needed as of webrender
cset c872232
When APZ traverses a tree using LayerMetricsWrapper, the layer tree
already has its RefLayers connected because of the in-scope
AutoResolveRefLayers. When traversing using the
WebRenderScrollDataWrapper though, this is not the case, and we need to
explicitly jump from one layer tree to another during the walk.
Thankfully we don't require upwards traversal in the tree or this would
be much more complicated.
MozReview-Commit-ID: 8gbvUlzghLx
This puts all the other things that APZ needs into the
WebRenderScrollData object. The main exception is the scroll clip - I'm
not totally sure how that will be handled yet, so for now we just return
no clip from WebRenderScrollDataWrapper.
MozReview-Commit-ID: 1IhGhSFiPYi
This mainly implements the GetLastChild and GetPreviousSibling functions
in the WebRenderScrollDataWrapper, and adds helper functions that are
needed to make that possible. This allows the WebRenderScrollDataWrapper
to simulate a full "LayerMetrics" tree using the information in the
underlying WebRenderScrollData object.
MozReview-Commit-ID: K82Ud2gAo8K
This adds the WebRenderScrollDataWrapper class which is
template-compatible with LayerMetricsWrapper. While the
LayerMetricsWrapper operates on an underlying layer tree, the
WebRenderScrollDataWrapper will simulate a layer tree based on an
underlying WebRenderScrollData object. The class is stubbed out here,
functions will be implemented in subsequent patches.
MozReview-Commit-ID: 9exnFRI6tOW
This further abstracts away the direct dependence on particular layer
types. This is needed in particular for the APZCTreeManager call site
since it will need to operate on non-layer-tree data which is hard if it
relies specifically on RefLayer.
MozReview-Commit-ID: zbK3oTNHJc
Currently the public UpdateHitTestingTree function takes a Layer* which
assumes there is a layer tree to traverse. However, with WebRender, that
is not the case. This patch has two conceptual changes.
The first change is to extract the innards of UpdateHitTestingTree to take
a LayerMetricsWrapper instead of a Layer* and traverse the layer tree
using that. This was already mostly happening but this makes the
Layer*/LayerMetricsWrapper boundary a little more explicit.
The second change is to make the extracted helper function templated, so
it accepts anything that is template-compatible with
LayerMetricsWrapper. I chose to use a template rather inheritance to
avoid the performance hit of virtual functions, since this code runs
relatively often.
This paves the way for adding a different kind of tree-traversal object
instead of the LayerMetricsWrapper while reusing the same logic to build
the hit-testing tree and APZC nodes.
MozReview-Commit-ID: 6SmnX6Bn2QV
This adds a WebRenderScrollData class (which contains a list of
WebRenderLayerScrollData objects, among other things), and adds it to
the DPEnd/DPSyncEnd messages sent across PWebRenderBridge. These classes are
skeletons for now (more stuff will be added to them in future patches).
MozReview-Commit-ID: 9duxwlUpdu7
Android Dynamic Toolbar v3 toolbar height between controller
and compostior threads would get out sync during animation. Added code
to insure they stay in sync while the compositor thread is updating the
toolbar height during an animation. Also, when the controller thread was
canceling an animation, the compositor thread was not checking that it
was still animating before unlocking the toolbar.
MozReview-Commit-ID: 1TSfaRD0lMj
Note that in upstream WR the push_scroll_layer API has already been
renamed to push_clip_node, so conceptually the same API covers both
"scrolling clips" (aka scroll layers) and non-scrolling clips. So using
the same underlying API for two different WebRenderAPI.h functions makes
sense.
MozReview-Commit-ID: He7jBVqZuLn
Animations in content side could be removed easily by changing CSS, but the
CompositorAnimationStorage in parent side doesn't get updated. Therefore,
we store the layer's CompositorAnimationsId before layer is destroyed in
WebRenderLayerManager and then send out these discarded ids to parent on
the next layer transaction.
MozReview-Commit-ID: D4kbYsgLl4P