Bug 1726708 - Add stable key for spatial nodes r=gfx-reviewers,kvark

Add an interface (and update Gecko to provide) a stable unique
identifier for each spatial node that is consistent across
display lists.

Although this patch doesn't _do_ anything useful with this yet,
we'll use this in future to allow interning, persisting and caching
a lot more information related to primitives and clips.

For now, it just asserts that the calling code never supplies a
duplicate unique identifier - which will be useful to have running
in nightly for a couple of weeks before starting to make use of
these identifiers.

Differential Revision: https://phabricator.services.mozilla.com/D123177
This commit is contained in:
Glenn Watson
2021-08-25 21:52:13 +00:00
parent 9706f6bae2
commit 26d453e633
17 changed files with 298 additions and 48 deletions

View File

@@ -421,6 +421,9 @@ void AsyncImagePipelineManager::ApplyAsyncImageForPipeline(
float(aPipeline->mCurrentTexture->GetSize().width),
float(aPipeline->mCurrentTexture->GetSize().height)};
computedTransform.rotation = ToWrRotation(aPipeline->mRotation);
// We don't have a frame / per-frame key here, but we can use the pipeline id and
// the key kind to create a unique stable key.
computedTransform.key = wr::SpatialKey(aPipelineId.mNamespace, aPipelineId.mHandle, wr::SpatialKeyKind::APZ);
params.computed_transform = &computedTransform;
Maybe<wr::WrSpatialId> referenceFrameId = builder.PushStackingContext(