Bug 1375949 - Repurpose AsyncPanZoomController::AsyncMode into a more general AsyncTransformConsumer enum. r=kats
The AsyncTransformConsumer enumeration captures the distinction between
the two main categories of consumers of async transforms: those using
it for hit-testing and related purposes, and those using it for
compositing.
MozReview-Commit-ID: 59CICcnPvY6
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -495,17 +495,17 @@ APZCTreeManager::PushStateToWR(wr::WebRe
}
// Use a 0 presShellId because when we do a lookup in this map for the
// scrollbar below we don't have (or care about) the presShellId.
ScrollableLayerGuid guid(lastLayersId, 0, apzc->GetGuid().mScrollId);
httnMap.emplace(guid, aNode);
ParentLayerPoint layerTranslation = apzc->GetCurrentAsyncTransform(
- AsyncPanZoomController::RESPECT_FORCE_DISABLE).mTranslation;
+ AsyncPanZoomController::eForCompositing).mTranslation;
// The positive translation means the painted content is supposed to
// move down (or to the right), and that corresponds to a reduction in
// the scroll offset. Since we are effectively giving WR the async
// scroll delta here, we want to negate the translation.
ParentLayerPoint asyncScrollDelta = -layerTranslation;
aWrApi->UpdateScrollPosition(lastPipelineId, apzc->GetGuid().mScrollId,
wr::ToWrPoint(asyncScrollDelta));
@@ -846,17 +846,17 @@ APZCTreeManager::PrepareNodeForLayer(con
"parentScrollId", apzc->GetParent()->GetGuid().mScrollId);
}
if (aMetrics.IsRootContent()) {
aState.mPaintLogger.LogTestData(aMetrics.GetScrollId(),
"isRootContent", true);
}
// Note that the async scroll offset is in ParentLayer pixels
aState.mPaintLogger.LogTestData(aMetrics.GetScrollId(), "asyncScrollOffset",
- apzc->GetCurrentAsyncScrollOffset(AsyncPanZoomController::NORMAL));
+ apzc->GetCurrentAsyncScrollOffset(AsyncPanZoomController::eForHitTesting));
}
if (newApzc) {
auto it = mZoomConstraints.find(guid);
if (it != mZoomConstraints.end()) {
// We have a zoomconstraints for this guid, apply it.
apzc->UpdateZoomConstraints(it->second);
} else if (!apzc->HasNoParentWithSameLayersId()) {
@@ -951,17 +951,17 @@ APZCTreeManager::ReceiveInputEvent(Input
#if defined(MOZ_WIDGET_ANDROID)
MOZ_ASSERT(mToolbarAnimator);
ScreenPoint scrollOffset;
{
MutexAutoLock lock(mTreeLock);
RefPtr<AsyncPanZoomController> apzc = FindRootContentOrRootApzc();
if (apzc) {
- scrollOffset = ViewAs<ScreenPixel>(apzc->GetCurrentAsyncScrollOffset(AsyncPanZoomController::NORMAL),
+ scrollOffset = ViewAs<ScreenPixel>(apzc->GetCurrentAsyncScrollOffset(AsyncPanZoomController::eForHitTesting),
PixelCastJustification::ScreenIsParentLayerForRoot);
}
}
nsEventStatus isConsumed = mToolbarAnimator->ReceiveInputEvent(aEvent, scrollOffset);
// Check if the mToolbarAnimator consumed the event.
if (isConsumed == nsEventStatus_eConsumeNoDefault) {
APZCTM_LOG("Dynamic toolbar consumed event");
return isConsumed;
@@ -2427,17 +2427,17 @@ APZCTreeManager::GetScreenToApzcTransfor
// result is initialized to PC.Inverse() * OC.Inverse() * NC.Inverse() * MC.Inverse()
result = ancestorUntransform;
for (AsyncPanZoomController* parent = aApzc->GetParent(); parent; parent = parent->GetParent()) {
// ancestorUntransform is updated to RC.Inverse() * QC.Inverse() when parent == P
ancestorUntransform = parent->GetAncestorTransform().Inverse();
// asyncUntransform is updated to PA.Inverse() when parent == P
- Matrix4x4 asyncUntransform = parent->GetCurrentAsyncTransformWithOverscroll(AsyncPanZoomController::NORMAL).Inverse().ToUnknownMatrix();
+ Matrix4x4 asyncUntransform = parent->GetCurrentAsyncTransformWithOverscroll(AsyncPanZoomController::eForHitTesting).Inverse().ToUnknownMatrix();
// untransformSinceLastApzc is RC.Inverse() * QC.Inverse() * PA.Inverse()
Matrix4x4 untransformSinceLastApzc = ancestorUntransform * asyncUntransform;
// result is RC.Inverse() * QC.Inverse() * PA.Inverse() * PC.Inverse() * OC.Inverse() * NC.Inverse() * MC.Inverse()
result = untransformSinceLastApzc * result;
// The above value for result when parent == P matches the required output
// as explained in the comment above this method. Note that any missing
@@ -2459,17 +2459,17 @@ APZCTreeManager::GetApzcToGeckoTransform
// The comments below assume there is a chain of layers L..R with L and P having APZC instances as
// explained in the comment above. This function is called with aApzc at L, and the loop
// below performs one iteration, where parent is at P. The comments explain what values are stored
// in the variables at these two levels. All the comments use standard matrix notation where the
// leftmost matrix in a multiplication is applied first.
// asyncUntransform is LA.Inverse()
- Matrix4x4 asyncUntransform = aApzc->GetCurrentAsyncTransformWithOverscroll(AsyncPanZoomController::NORMAL).Inverse().ToUnknownMatrix();
+ Matrix4x4 asyncUntransform = aApzc->GetCurrentAsyncTransformWithOverscroll(AsyncPanZoomController::eForHitTesting).Inverse().ToUnknownMatrix();
// aTransformToGeckoOut is initialized to LA.Inverse() * LD * MC * NC * OC * PC
result = asyncUntransform * aApzc->GetTransformToLastDispatchedPaint() * aApzc->GetAncestorTransform();
for (AsyncPanZoomController* parent = aApzc->GetParent(); parent; parent = parent->GetParent()) {
// aTransformToGeckoOut is LA.Inverse() * LD * MC * NC * OC * PC * PD * QC * RC
result = result * parent->GetTransformToLastDispatchedPaint() * parent->GetAncestorTransform();
@@ -2554,17 +2554,17 @@ APZCTreeManager::CommonAncestor(AsyncPan
LayerToParentLayerMatrix4x4
APZCTreeManager::ComputeTransformForNode(const HitTestingTreeNode* aNode) const
{
if (AsyncPanZoomController* apzc = aNode->GetApzc()) {
// If the node represents scrollable content, apply the async transform
// from its APZC.
return aNode->GetTransform() *
CompleteAsyncTransform(
- apzc->GetCurrentAsyncTransformWithOverscroll(AsyncPanZoomController::NORMAL));
+ apzc->GetCurrentAsyncTransformWithOverscroll(AsyncPanZoomController::eForHitTesting));
} else if (aNode->IsScrollThumbNode()) {
// If the node represents a scrollbar thumb, compute and apply the
// transformation that will be applied to the thumb in
// AsyncCompositionManager.
ScrollableLayerGuid guid{aNode->GetLayersId(), 0, aNode->GetScrollTargetId()};
if (RefPtr<HitTestingTreeNode> scrollTargetNode = GetTargetNode(guid, &GuidComparatorIgnoringPresShell)) {
AsyncPanZoomController* scrollTargetApzc = scrollTargetNode->GetApzc();
MOZ_ASSERT(scrollTargetApzc);
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -3263,21 +3263,21 @@ bool AsyncPanZoomController::UpdateAnima
}
UpdateSharedCompositorFrameMetrics();
return true;
}
return false;
}
AsyncTransformComponentMatrix
-AsyncPanZoomController::GetOverscrollTransform(AsyncMode aMode) const
+AsyncPanZoomController::GetOverscrollTransform(AsyncTransformConsumer aMode) const
{
ReentrantMonitorAutoEnter lock(mMonitor);
- if (aMode == RESPECT_FORCE_DISABLE && mScrollMetadata.IsApzForceDisabled()) {
+ if (aMode == eForCompositing && mScrollMetadata.IsApzForceDisabled()) {
return AsyncTransformComponentMatrix();
}
if (!IsOverscrolled()) {
return AsyncTransformComponentMatrix();
}
// The overscroll effect is a simple translation by the overscroll offset.
@@ -3332,45 +3332,45 @@ bool AsyncPanZoomController::AdvanceAnim
// One of the deferred tasks may have started a new animation. In this case,
// we want to ask the compositor to schedule a new composite.
requestAnimationFrame |= (mAnimation != nullptr);
return requestAnimationFrame;
}
ParentLayerPoint
-AsyncPanZoomController::GetCurrentAsyncScrollOffset(AsyncMode aMode) const
+AsyncPanZoomController::GetCurrentAsyncScrollOffset(AsyncTransformConsumer aMode) const
{
ReentrantMonitorAutoEnter lock(mMonitor);
- if (aMode == RESPECT_FORCE_DISABLE && mScrollMetadata.IsApzForceDisabled()) {
+ if (aMode == eForCompositing && mScrollMetadata.IsApzForceDisabled()) {
return mLastContentPaintMetrics.GetScrollOffset() * mLastContentPaintMetrics.GetZoom();
}
return (mFrameMetrics.GetScrollOffset() + mTestAsyncScrollOffset)
* mFrameMetrics.GetZoom() * mTestAsyncZoom.scale;
}
CSSPoint
-AsyncPanZoomController::GetCurrentAsyncScrollOffsetInCssPixels(AsyncMode aMode) const {
+AsyncPanZoomController::GetCurrentAsyncScrollOffsetInCssPixels(AsyncTransformConsumer aMode) const {
ReentrantMonitorAutoEnter lock(mMonitor);
- if (aMode == RESPECT_FORCE_DISABLE && mScrollMetadata.IsApzForceDisabled()) {
+ if (aMode == eForCompositing && mScrollMetadata.IsApzForceDisabled()) {
return mLastContentPaintMetrics.GetScrollOffset();
}
return mFrameMetrics.GetScrollOffset() + mTestAsyncScrollOffset;
}
AsyncTransform
-AsyncPanZoomController::GetCurrentAsyncTransform(AsyncMode aMode) const
+AsyncPanZoomController::GetCurrentAsyncTransform(AsyncTransformConsumer aMode) const
{
ReentrantMonitorAutoEnter lock(mMonitor);
- if (aMode == RESPECT_FORCE_DISABLE && mScrollMetadata.IsApzForceDisabled()) {
+ if (aMode == eForCompositing && mScrollMetadata.IsApzForceDisabled()) {
return AsyncTransform();
}
CSSPoint lastPaintScrollOffset;
if (mLastContentPaintMetrics.IsScrollable()) {
lastPaintScrollOffset = mLastContentPaintMetrics.GetScrollOffset();
}
@@ -3399,17 +3399,17 @@ AsyncPanZoomController::GetCurrentAsyncT
* mFrameMetrics.GetZoom() * mTestAsyncZoom.scale;
return AsyncTransform(
LayerToParentLayerScale(mFrameMetrics.GetAsyncZoom().scale * mTestAsyncZoom.scale),
-translation);
}
AsyncTransformComponentMatrix
-AsyncPanZoomController::GetCurrentAsyncTransformWithOverscroll(AsyncMode aMode) const
+AsyncPanZoomController::GetCurrentAsyncTransformWithOverscroll(AsyncTransformConsumer aMode) const
{
return AsyncTransformComponentMatrix(GetCurrentAsyncTransform(aMode))
* GetOverscrollTransform(aMode);
}
Matrix4x4 AsyncPanZoomController::GetTransformToLastDispatchedPaint() const {
ReentrantMonitorAutoEnter lock(mMonitor);
--- a/gfx/layers/apz/src/AsyncPanZoomController.h
+++ b/gfx/layers/apz/src/AsyncPanZoomController.h
@@ -780,61 +780,69 @@ public:
}
/* ===================================================================
* The functions and members in this section are used to expose
* the current async transform state to callers.
*/
public:
/**
- * Allows callers to specify which type of async transform they want:
- * NORMAL provides the actual async transforms of the APZC, whereas
- * RESPECT_FORCE_DISABLE will provide empty async transforms if and only if
- * the metrics has the mForceDisableApz flag set. In general the latter should
- * only be used by call sites that are applying the transform to update
- * a layer's position.
+ * Allows consumers of async transforms to specify for what purpose they are
+ * using the async transform:
+ *
+ * |eForHitTesting| is intended for hit-testing and other uses that need
+ * the most up-to-date transform, reflecting all events
+ * that have been processed so far, even if the transform
+ * is not yet reflected visually.
+ * |eForCompositing| is intended for the transform that should be reflected
+ * visually.
+ *
+ * For example, if an APZC has metrics with the mForceDisableApz flag set,
+ * then the |eForCompositing| async transform will be empty, while the
+ * |eForHitTesting| async transform will reflect processed input events
+ * regardless of mForceDisableApz.
*/
- enum AsyncMode {
- NORMAL,
- RESPECT_FORCE_DISABLE,
+ enum AsyncTransformConsumer {
+ eForHitTesting,
+ eForCompositing,
};
/**
* Get the current scroll offset of the scrollable frame corresponding
* to this APZC, including the effects of any asynchronous panning and
* zooming, in ParentLayer pixels.
*/
- ParentLayerPoint GetCurrentAsyncScrollOffset(AsyncMode aMode) const;
+ ParentLayerPoint GetCurrentAsyncScrollOffset(AsyncTransformConsumer aMode) const;
/**
* Get the current scroll offset of the scrollable frame corresponding
* to this APZC, including the effects of any asynchronous panning, in
* CSS pixels.
*/
- CSSPoint GetCurrentAsyncScrollOffsetInCssPixels(AsyncMode aMode) const;
+ CSSPoint GetCurrentAsyncScrollOffsetInCssPixels(AsyncTransformConsumer aMode) const;
/**
* Return a visual effect that reflects this apzc's
* overscrolled state, if any.
*/
- AsyncTransformComponentMatrix GetOverscrollTransform(AsyncMode aMode) const;
+ AsyncTransformComponentMatrix GetOverscrollTransform(AsyncTransformConsumer aMode) const;
/**
* Returns the incremental transformation corresponding to the async pan/zoom
* in progress. That is, when this transform is multiplied with the layer's
* existing transform, it will make the layer appear with the desired pan/zoom
* amount.
*/
- AsyncTransform GetCurrentAsyncTransform(AsyncMode aMode) const;
+ AsyncTransform GetCurrentAsyncTransform(AsyncTransformConsumer aMode) const;
/**
* Returns the same transform as GetCurrentAsyncTransform(), but includes
* any transform due to axis over-scroll.
*/
- AsyncTransformComponentMatrix GetCurrentAsyncTransformWithOverscroll(AsyncMode aMode) const;
+ AsyncTransformComponentMatrix GetCurrentAsyncTransformWithOverscroll(AsyncTransformConsumer aMode) const;
/* ===================================================================
* The functions and members in this section are used to manage
* the state that tracks what this APZC is doing with the input events.
*/
protected:
enum PanZoomState {
--- a/gfx/layers/apz/test/gtest/APZCBasicTester.h
+++ b/gfx/layers/apz/test/gtest/APZCBasicTester.h
@@ -94,17 +94,17 @@ protected:
ParentLayerPoint pointOut;
AsyncTransform viewTransformOut;
while (apzc->SampleContentTransformForFrame(&viewTransformOut, pointOut)) {
// The reported scroll offset should be the same throughout.
EXPECT_EQ(aExpectedScrollOffset, pointOut);
// Trigger computation of the overscroll tranform, to make sure
// no assetions fire during the calculation.
- apzc->GetOverscrollTransform(AsyncPanZoomController::NORMAL);
+ apzc->GetOverscrollTransform(AsyncPanZoomController::eForHitTesting);
if (!apzc->IsOverscrolled()) {
recoveredFromOverscroll = true;
}
mcc->AdvanceBy(increment);
}
EXPECT_TRUE(recoveredFromOverscroll);
--- a/gfx/layers/apz/test/gtest/APZTestCommon.h
+++ b/gfx/layers/apz/test/gtest/APZTestCommon.h
@@ -285,19 +285,19 @@ public:
}
bool SampleContentTransformForFrame(AsyncTransform* aOutTransform,
ParentLayerPoint& aScrollOffset,
const TimeDuration& aIncrement = TimeDuration::FromMilliseconds(0)) {
mcc->AdvanceBy(aIncrement);
bool ret = AdvanceAnimations(mcc->Time());
if (aOutTransform) {
- *aOutTransform = GetCurrentAsyncTransform(AsyncPanZoomController::NORMAL);
+ *aOutTransform = GetCurrentAsyncTransform(AsyncPanZoomController::eForHitTesting);
}
- aScrollOffset = GetCurrentAsyncScrollOffset(AsyncPanZoomController::NORMAL);
+ aScrollOffset = GetCurrentAsyncScrollOffset(AsyncPanZoomController::eForHitTesting);
return ret;
}
void SetWaitForMainThread() {
mWaitForMainThread = true;
}
private:
--- a/gfx/layers/apz/test/gtest/TestHitTesting.cpp
+++ b/gfx/layers/apz/test/gtest/TestHitTesting.cpp
@@ -502,18 +502,18 @@ TEST_F(APZHitTestingTester, TestForceDis
ParentLayerPoint point;
apzcroot->SampleContentTransformForFrame(&viewTransform, point);
// Since APZ is force-disabled, we expect to see the async transform via
// the NORMAL AsyncMode, but not via the RESPECT_FORCE_DISABLE AsyncMode.
EXPECT_EQ(0, point.x);
EXPECT_EQ(10, point.y);
EXPECT_EQ(0, viewTransform.mTranslation.x);
EXPECT_EQ(-10, viewTransform.mTranslation.y);
- viewTransform = apzcroot->GetCurrentAsyncTransform(AsyncPanZoomController::RESPECT_FORCE_DISABLE);
- point = apzcroot->GetCurrentAsyncScrollOffset(AsyncPanZoomController::RESPECT_FORCE_DISABLE);
+ viewTransform = apzcroot->GetCurrentAsyncTransform(AsyncPanZoomController::eForCompositing);
+ point = apzcroot->GetCurrentAsyncScrollOffset(AsyncPanZoomController::eForCompositing);
EXPECT_EQ(0, point.x);
EXPECT_EQ(0, point.y);
EXPECT_EQ(0, viewTransform.mTranslation.x);
EXPECT_EQ(0, viewTransform.mTranslation.y);
mcc->AdvanceByMillis(10);
// With untransforming events we should get normal behaviour (in this case,
--- a/gfx/layers/apz/test/gtest/TestInputQueue.cpp
+++ b/gfx/layers/apz/test/gtest/TestInputQueue.cpp
@@ -33,12 +33,12 @@ TEST_F(APZCTreeManagerTester, WheelInter
// Continue the drag, check that the block id is the same as before
MouseMove(apzc, ScreenIntPoint(7, 5), mcc->Time(), &tmpBlockId);
EXPECT_EQ(dragBlockId, tmpBlockId);
// Finish the wheel animation
apzc->AdvanceAnimationsUntilEnd();
// Check that it scrolled
- ParentLayerPoint scroll = apzc->GetCurrentAsyncScrollOffset(AsyncPanZoomController::NORMAL);
+ ParentLayerPoint scroll = apzc->GetCurrentAsyncScrollOffset(AsyncPanZoomController::eForHitTesting);
EXPECT_EQ(scroll.x, 0);
EXPECT_EQ(scroll.y, 10); // We scrolled 1 "line" or 10 pixels
}
--- a/gfx/layers/apz/test/gtest/TestSnapping.cpp
+++ b/gfx/layers/apz/test/gtest/TestSnapping.cpp
@@ -42,24 +42,24 @@ TEST_F(APZCSnappingTester, Bug1265510)
// Position the mouse near the bottom of the outer frame and scroll by 60px.
// (6 lines of 10px each). APZC will actually scroll to y=100 because of the
// mandatory snap coordinate there.
TimeStamp now = mcc->Time();
SmoothWheel(manager, ScreenIntPoint(50, 80), ScreenPoint(0, 6), now);
// Advance in 5ms increments until we've scrolled by 70px. At this point, the
// closest snap point is y=100, and the inner frame should be under the mouse
// cursor.
- while (outer->GetCurrentAsyncScrollOffset(AsyncPanZoomController::AsyncMode::NORMAL).y < 70) {
+ while (outer->GetCurrentAsyncScrollOffset(AsyncPanZoomController::AsyncTransformConsumer::eForHitTesting).y < 70) {
mcc->AdvanceByMillis(5);
outer->AdvanceAnimations(mcc->Time());
}
// Now do another wheel in a new transaction. This should start scrolling the
// inner frame; we verify that it does by checking the inner scroll position.
TimeStamp newTransactionTime = now + TimeDuration::FromMilliseconds(gfxPrefs::MouseWheelTransactionTimeoutMs() + 100);
SmoothWheel(manager, ScreenIntPoint(50, 80), ScreenPoint(0, 6), newTransactionTime);
inner->AdvanceAnimationsUntilEnd();
- EXPECT_LT(0.0f, inner->GetCurrentAsyncScrollOffset(AsyncPanZoomController::AsyncMode::NORMAL).y);
+ EXPECT_LT(0.0f, inner->GetCurrentAsyncScrollOffset(AsyncPanZoomController::AsyncTransformConsumer::eForHitTesting).y);
// However, the outer frame should also continue to the snap point, otherwise
// it is demonstrating incorrect behaviour by violating the mandatory snapping.
outer->AdvanceAnimationsUntilEnd();
- EXPECT_EQ(100.0f, outer->GetCurrentAsyncScrollOffset(AsyncPanZoomController::AsyncMode::NORMAL).y);
+ EXPECT_EQ(100.0f, outer->GetCurrentAsyncScrollOffset(AsyncPanZoomController::AsyncTransformConsumer::eForHitTesting).y);
}
--- a/gfx/layers/composite/AsyncCompositionManager.cpp
+++ b/gfx/layers/composite/AsyncCompositionManager.cpp
@@ -912,19 +912,19 @@ AsyncCompositionManager::ApplyAsyncConte
AsyncPanZoomController* controller = layer->GetAsyncPanZoomController(i);
if (!controller) {
continue;
}
hasAsyncTransform = true;
AsyncTransform asyncTransformWithoutOverscroll =
- controller->GetCurrentAsyncTransform(AsyncPanZoomController::RESPECT_FORCE_DISABLE);
+ controller->GetCurrentAsyncTransform(AsyncPanZoomController::eForCompositing);
AsyncTransformComponentMatrix overscrollTransform =
- controller->GetOverscrollTransform(AsyncPanZoomController::RESPECT_FORCE_DISABLE);
+ controller->GetOverscrollTransform(AsyncPanZoomController::eForCompositing);
AsyncTransformComponentMatrix asyncTransform =
AsyncTransformComponentMatrix(asyncTransformWithoutOverscroll)
* overscrollTransform;
if (!layer->IsScrollInfoLayer()) {
controller->MarkAsyncTransformAppliedToContent();
}
@@ -1150,17 +1150,17 @@ AsyncCompositionManager::ComputeTransfor
// disparity between scrollbars and visible content.
if (aMetrics.IsScrollInfoLayer()) {
return LayerToParentLayerMatrix4x4{};
}
MOZ_RELEASE_ASSERT(aApzc);
AsyncTransformComponentMatrix asyncTransform =
- aApzc->GetCurrentAsyncTransform(AsyncPanZoomController::RESPECT_FORCE_DISABLE);
+ aApzc->GetCurrentAsyncTransform(AsyncPanZoomController::eForCompositing);
// |asyncTransform| represents the amount by which we have scrolled and
// zoomed since the last paint. Because the scrollbar was sized and positioned based
// on the painted content, we need to adjust it based on asyncTransform so that
// it reflects what the user is actually seeing now.
AsyncTransformComponentMatrix scrollbarTransform;
if (aThumbData.mDirection == ScrollDirection::VERTICAL) {
const ParentLayerCoord asyncScrollY = asyncTransform._42;
@@ -1266,17 +1266,17 @@ AsyncCompositionManager::ComputeTransfor
// wrong place.
//
// Note that since the async transform is applied on top of the content's
// regular transform, we need to make sure to unapply the async transform in
// the same coordinate space. This requires applying the content transform
// and then unapplying it after unapplying the async transform.
if (aScrollbarIsDescendant) {
AsyncTransformComponentMatrix overscroll =
- aApzc->GetOverscrollTransform(AsyncPanZoomController::RESPECT_FORCE_DISABLE);
+ aApzc->GetOverscrollTransform(AsyncPanZoomController::eForCompositing);
Matrix4x4 asyncUntransform = (asyncTransform * overscroll).Inverse().ToUnknownMatrix();
Matrix4x4 contentTransform = aScrollableContentTransform;
Matrix4x4 contentUntransform = contentTransform.Inverse();
AsyncTransformComponentMatrix asyncCompensation =
ViewAs<AsyncTransformComponentMatrix>(
contentTransform
* asyncUntransform
--- a/gfx/layers/composite/ContainerLayerComposite.cpp
+++ b/gfx/layers/composite/ContainerLayerComposite.cpp
@@ -282,17 +282,17 @@ RenderMinimap(ContainerT* aContainer, La
return;
}
AsyncPanZoomController* controller = aLayer->GetAsyncPanZoomController(0);
if (!controller) {
return;
}
- ParentLayerPoint scrollOffset = controller->GetCurrentAsyncScrollOffset(AsyncPanZoomController::RESPECT_FORCE_DISABLE);
+ ParentLayerPoint scrollOffset = controller->GetCurrentAsyncScrollOffset(AsyncPanZoomController::eForCompositing);
// Options
const int verticalPadding = 10;
const int horizontalPadding = 5;
gfx::Color backgroundColor(0.3f, 0.3f, 0.3f, 0.3f);
gfx::Color tileActiveColor(1, 1, 1, 0.4f);
gfx::Color tileBorderColor(0, 0, 0, 0.1f);
gfx::Color pageBorderColor(0, 0, 0);
@@ -472,17 +472,17 @@ RenderLayers(ContainerT* aContainer, Lay
// use the parent's effective transform rather than the layer's own.
ParentLayerRect compositionBounds = layer->GetFrameMetrics(i - 1).GetCompositionBounds();
aManager->GetCompositor()->DrawDiagnostics(DiagnosticFlags::CONTAINER,
compositionBounds.ToUnknownRect(),
aClipRect.ToUnknownRect(),
asyncTransform * aContainer->GetEffectiveTransform());
if (AsyncPanZoomController* apzc = layer->GetAsyncPanZoomController(i - 1)) {
asyncTransform =
- apzc->GetCurrentAsyncTransformWithOverscroll(AsyncPanZoomController::RESPECT_FORCE_DISABLE).ToUnknownMatrix()
+ apzc->GetCurrentAsyncTransformWithOverscroll(AsyncPanZoomController::eForCompositing).ToUnknownMatrix()
* asyncTransform;
}
}
}
if (gfxPrefs::APZMinimap()) {
RenderMinimap(aContainer, aManager, aClipRect, layer);
}
@@ -623,17 +623,17 @@ ContainerRender(ContainerT* aContainer,
// enabled).
if (gfxPrefs::LayersDrawFPS() && aContainer->IsScrollInfoLayer()) {
// Since aContainer doesn't have any children we can just iterate from the top metrics
// on it down to the bottom using GetFirstChild and not worry about walking onto another
// underlying layer.
for (LayerMetricsWrapper i(aContainer); i; i = i.GetFirstChild()) {
if (AsyncPanZoomController* apzc = i.GetApzc()) {
if (!apzc->GetAsyncTransformAppliedToContent()
- && !AsyncTransformComponentMatrix(apzc->GetCurrentAsyncTransform(AsyncPanZoomController::NORMAL)).IsIdentity()) {
+ && !AsyncTransformComponentMatrix(apzc->GetCurrentAsyncTransform(AsyncPanZoomController::eForHitTesting)).IsIdentity()) {
aManager->UnusedApzTransformWarning();
break;
}
}
}
}
}