diff --git a/gfx/layers/apz/public/APZSampler.h b/gfx/layers/apz/public/APZSampler.h index b520982c0873..15aff4f9d4aa 100644 --- a/gfx/layers/apz/public/APZSampler.h +++ b/gfx/layers/apz/public/APZSampler.h @@ -92,13 +92,6 @@ public: void MarkAsyncTransformAppliedToContent(const LayerMetricsWrapper& aLayer); bool HasUnusedAsyncTransform(const LayerMetricsWrapper& aLayer); - /** - * Return a new AutoApplyAsyncTestAttributes instance. This should be called - * whenever we need to apply async attributes for test purposes (namely - * reftest-async-scroll-{x,y} and reftest-async-zoom). - */ - UniquePtr ApplyAsyncTestAttributes(const LayerMetricsWrapper& aLayer); - /** * This can be used to assert that the current thread is the * sampler thread (which samples the async transform). diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index 719642f3c67a..723b2fd38622 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -604,7 +604,7 @@ APZCTreeManager::SampleForWebRender(wr::TransactionWrapper& aTxn, // Apply any additional async scrolling for testing purposes (used for // reftest-async-scroll and reftest-async-zoom). - auto _ = MakeUnique(apzc); + AutoApplyAsyncTestAttributes testAttributeApplier(apzc); ParentLayerPoint layerTranslation = apzc->GetCurrentAsyncTransform( AsyncPanZoomController::eForCompositing).mTranslation; @@ -3061,7 +3061,7 @@ APZCTreeManager::ComputeTransformForNode(const HitTestingTreeNode* aNode) const if (AsyncPanZoomController* apzc = aNode->GetApzc()) { // Apply any additional async scrolling for testing purposes (used for // reftest-async-scroll and reftest-async-zoom). - auto _ = MakeUnique(apzc); + AutoApplyAsyncTestAttributes testAttributeApplier(apzc); // If the node represents scrollable content, apply the async transform // from its APZC. return aNode->GetTransform() * @@ -3153,7 +3153,7 @@ APZCTreeManager::ComputeTransformForScrollThumb( // Apply any additional async scrolling for testing purposes (used for // reftest-async-scroll and reftest-async-zoom). - auto _ = MakeUnique(aApzc); + AutoApplyAsyncTestAttributes testAttributeApplier(aApzc); AsyncTransformComponentMatrix asyncTransform = aApzc->GetCurrentAsyncTransform(AsyncPanZoomController::eForCompositing); diff --git a/gfx/layers/apz/src/APZSampler.cpp b/gfx/layers/apz/src/APZSampler.cpp index 3e41e5b20513..0350ad6ad2c5 100644 --- a/gfx/layers/apz/src/APZSampler.cpp +++ b/gfx/layers/apz/src/APZSampler.cpp @@ -233,16 +233,6 @@ APZSampler::HasUnusedAsyncTransform(const LayerMetricsWrapper& aLayer) && !AsyncTransformComponentMatrix(apzc->GetCurrentAsyncTransform(AsyncPanZoomController::eForCompositing)).IsIdentity(); } -UniquePtr -APZSampler::ApplyAsyncTestAttributes(const LayerMetricsWrapper& aLayer) -{ - MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread()); - AssertOnSamplerThread(); - - MOZ_ASSERT(aLayer.GetApzc()); - return MakeUnique(aLayer.GetApzc()); -} - void APZSampler::AssertOnSamplerThread() const { diff --git a/gfx/layers/apz/src/APZUtils.h b/gfx/layers/apz/src/APZUtils.h index 38468af71947..593e2ca186fa 100644 --- a/gfx/layers/apz/src/APZUtils.h +++ b/gfx/layers/apz/src/APZUtils.h @@ -104,7 +104,7 @@ struct TargetConfirmationFlags { * An RAII class to temporarily apply async test attributes to the provided * AsyncPanZoomController. */ -class AutoApplyAsyncTestAttributes { +class MOZ_RAII AutoApplyAsyncTestAttributes { public: explicit AutoApplyAsyncTestAttributes(AsyncPanZoomController*); ~AutoApplyAsyncTestAttributes(); diff --git a/gfx/layers/composite/AsyncCompositionManager.cpp b/gfx/layers/composite/AsyncCompositionManager.cpp index 7e1eff23073c..3273ca99487f 100644 --- a/gfx/layers/composite/AsyncCompositionManager.cpp +++ b/gfx/layers/composite/AsyncCompositionManager.cpp @@ -979,7 +979,7 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(Layer *aLayer, // Apply any additional async scrolling for testing purposes (used // for reftest-async-scroll and reftest-async-zoom). - auto _ = sampler->ApplyAsyncTestAttributes(wrapper); + AutoApplyAsyncTestAttributes testAttributeApplier(wrapper.GetApzc()); const FrameMetrics& metrics = wrapper.Metrics(); MOZ_ASSERT(metrics.IsScrollable());