Bug 1638152 - Inform transform value in the clip rectangle and the offset from the...
commitc74627552354db1f663c5f7347c362e5a216c64b
authorHiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
Tue, 21 Jul 2020 10:09:06 +0000 (21 10:09 +0000)
committerHiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
Tue, 21 Jul 2020 10:09:06 +0000 (21 10:09 +0000)
tree20d568f46baf1ae52c9a96d0acd5b030f3d44849
parent61e3b7323fdbd38b2942f7c2255de4c29731a1c9
Bug 1638152 - Inform transform value in the clip rectangle and the offset from the reference frame for the partial pre-render check on WebRender. r=botond

On WebRender there is no layer tree structures so that we can't accumulate
transform values up to the nearest APZ's scroll layer by walking up the layer
tree, or we can't tell a given transform animation is inside a perspective layer
to decide whether we need to apply the offset from the reference frame or not
[1]. So we get the accumulated transform by using
nsLayoutUtils::GetTransformToAncestor on the main-thread and inform it to the
compositor thread, and also inform the offset which is set conditionally [2]
so that we don't need to tell whether the transform animation is inside a
perspective layer or not on the compositor thread.

I am not yet 100% sure that these values are same both on WebRender and non
WebRender in all cases, once after partial pre-rendering transforms have
been used in the wild well enough and any problem has not appeared, even if
there are problems we should fix them then the non WebRender version should
eventually use this same setup instead of walking up the layer tree.

[1] https://searchfox.org/mozilla-central/rev/85ae3b911d5fcabd38ef315725df32e25edef83b/gfx/layers/CompositorAnimationStorage.cpp#273-275
[2] https://searchfox.org/mozilla-central/rev/85ae3b911d5fcabd38ef315725df32e25edef83b/layout/painting/nsDisplayList.cpp#7879-7891

Differential Revision: https://phabricator.services.mozilla.com/D83201
gfx/layers/AnimationInfo.cpp
gfx/layers/AnimationInfo.h
gfx/layers/ipc/LayersMessages.ipdlh
layout/painting/nsDisplayList.cpp