summaryrefslogtreecommitdiffstats
path: root/gfx/layers/wr/StackingContextHelper.h
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/layers/wr/StackingContextHelper.h')
-rw-r--r--gfx/layers/wr/StackingContextHelper.h30
1 files changed, 18 insertions, 12 deletions
diff --git a/gfx/layers/wr/StackingContextHelper.h b/gfx/layers/wr/StackingContextHelper.h
index 368449a2fd..8239b2db0d 100644
--- a/gfx/layers/wr/StackingContextHelper.h
+++ b/gfx/layers/wr/StackingContextHelper.h
@@ -56,6 +56,12 @@ class MOZ_RAII StackingContextHelper {
nsDisplayTransform* GetDeferredTransformItem() const;
Maybe<gfx::Matrix4x4> GetDeferredTransformMatrix() const;
+ // Functions for temporarily clearing and restoring the deferred
+ // transform item during WebRender display list building. These are
+ // used to ensure deferred transforms are not applied in duplicate
+ // to nested nodes in the WebRenderScrollData tree.
+ void ClearDeferredTransformItem() const;
+ void RestoreDeferredTransformItem(nsDisplayTransform* aItem) const;
bool AffectsClipPositioning() const { return mAffectsClipPositioning; }
Maybe<wr::WrSpatialId> ReferenceFrameId() const { return mReferenceFrameId; }
@@ -105,19 +111,19 @@ class MOZ_RAII StackingContextHelper {
// item (i.e. the closest ancestor nsDisplayTransform item of the item that
// created this StackingContextHelper). And then we use
// mDeferredAncestorTransform to store the product of all the other transforms
- // that were deferred. As a result, there is an invariant here that if
- // mDeferredTransformItem is nullptr, mDeferredAncestorTransform will also
- // be Nothing(). Note that we can only do this if the nsDisplayTransform items
- // share the same ASR. If we are processing an nsDisplayTransform item with a
- // different ASR than the previously-deferred item, we assume that the
- // previously-deferred transform will get sent to APZ as part of a separate
- // WebRenderLayerScrollData item, and so we don't need to bother with any
- // merging. (The merging probably wouldn't even make sense because the
- // coordinate spaces might be different in the face of async scrolling). This
- // behaviour of forcing a WebRenderLayerScrollData item to be generated when
- // the ASR changes is implemented in
+ // that were deferred. Note that this means we only need to look at
+ // mDeferredAncestorTransform if mDeferredTransformItem is set. Note that we
+ // can only do this if the nsDisplayTransform items share the same ASR. If we
+ // are processing an nsDisplayTransform item with a different ASR than the
+ // previously-deferred item, we assume that the previously-deferred transform
+ // will get sent to APZ as part of a separate WebRenderLayerScrollData item,
+ // and so we don't need to bother with any merging. (The merging probably
+ // wouldn't even make sense because the coordinate spaces might be different
+ // in the face of async scrolling). This behaviour of forcing a
+ // WebRenderLayerScrollData item to be generated when the ASR changes is
+ // implemented in
// WebRenderCommandBuilder::CreateWebRenderCommandsFromDisplayList.
- nsDisplayTransform* mDeferredTransformItem;
+ mutable nsDisplayTransform* mDeferredTransformItem;
Maybe<gfx::Matrix4x4> mDeferredAncestorTransform;
bool mRasterizeLocally;