Bug 1503616 - Set a animatable transform property on the root content WR stacking context. r=mstange

This sets a placeholder transform on the root stacking context for the
content display list, and allows us to modify that transform directly in
the compositor. This is similar to what
nsDisplayOwnLayer::CreateWebRenderCommands does for scroll thumb layers,
which are similarly manipulated by APZ for async scrolling.

Differential Revision: https://phabricator.services.mozilla.com/D11180

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kartikaya Gupta 2018-11-09 21:14:27 +00:00
Родитель b8deeabac0
Коммит 1b737d162d
2 изменённых файлов: 13 добавлений и 1 удалений

Просмотреть файл

@ -1321,7 +1321,14 @@ WebRenderCommandBuilder::BuildWebRenderCommands(wr::DisplayListBuilder& aBuilder
mClipManager.BeginBuild(mManager, aBuilder); mClipManager.BeginBuild(mManager, aBuilder);
{ {
StackingContextHelper pageRootSc(sc, nullptr, aBuilder, aFilters); if (!mZoomProp && gfxPrefs::APZAllowZooming() && XRE_IsContentProcess()) {
mZoomProp.emplace();
mZoomProp->effect_type = wr::WrAnimationType::Transform;
mZoomProp->id = AnimationHelper::GetNextCompositorAnimationsId();
}
StackingContextHelper pageRootSc(sc, nullptr, aBuilder, aFilters,
LayoutDeviceRect(), nullptr, mZoomProp.ptrOr(nullptr));
if (ShouldDumpDisplayList(aDisplayListBuilder)) { if (ShouldDumpDisplayList(aDisplayListBuilder)) {
mBuilderDumpIndex = aBuilder.Dump(mDumpIndent + 1, Some(mBuilderDumpIndex), Nothing()); mBuilderDumpIndex = aBuilder.Dump(mDumpIndent + 1, Some(mBuilderDumpIndex), Nothing());
} }

Просмотреть файл

@ -193,6 +193,11 @@ private:
wr::usize mBuilderDumpIndex; wr::usize mBuilderDumpIndex;
wr::usize mDumpIndent; wr::usize mDumpIndent;
// When zooming is enabled, this stores the animation property that we use
// to manipulate the zoom from APZ.
Maybe<wr::WrAnimationProperty> mZoomProp;
public: public:
// Whether consecutive inactive display items should be grouped into one // Whether consecutive inactive display items should be grouped into one
// blob image. // blob image.