Bug 1257641 - Remove now-unused code for the lightweight scroll offset update message. r?botond
MozReview-Commit-ID: FEiJUq8wCH7
--- a/gfx/layers/FrameMetrics.h
+++ b/gfx/layers/FrameMetrics.h
@@ -255,22 +255,16 @@ public:
void UpdatePendingScrollInfo(const ScrollUpdateInfo& aInfo)
{
mScrollOffset = aInfo.mScrollOffset;
mScrollGeneration = aInfo.mScrollGeneration;
mScrollUpdateType = ePending;
}
- void UpdateScrollInfo(uint32_t aScrollGeneration, const CSSPoint& aScrollOffset)
- {
- mScrollOffset = aScrollOffset;
- mScrollGeneration = aScrollGeneration;
- }
-
// Make a copy of this FrameMetrics object which does not have any pointers
// to heap-allocated memory (i.e. is Plain Old Data, or 'POD'), and is
// therefore safe to be placed into shared memory.
FrameMetrics MakePODObject() const
{
FrameMetrics copy = *this;
copy.mContentDescription.Truncate();
return copy;
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -3341,21 +3341,17 @@ void AsyncPanZoomController::NotifyLayer
APZThreadUtils::AssertOnCompositorThread();
ReentrantMonitorAutoEnter lock(mMonitor);
bool isDefault = mScrollMetadata.IsDefault();
const FrameMetrics& aLayerMetrics = aScrollMetadata.GetMetrics();
if ((aLayerMetrics == mLastContentPaintMetrics) && !isDefault) {
- // No new information here, skip it. Note that this is not just an
- // optimization; it's correctness too. In the case where we get one of these
- // stale aLayerMetrics *after* a call to NotifyScrollUpdated, processing the
- // stale aLayerMetrics would clobber the more up-to-date information from
- // NotifyScrollUpdated.
+ // No new information here, skip it.
APZC_LOG("%p NotifyLayersUpdated short-circuit\n", this);
return;
}
if (aLayerMetrics.GetScrollUpdateType() != FrameMetrics::ScrollOffsetUpdateType::ePending) {
mLastContentPaintMetrics = aLayerMetrics;
}
mFrameMetrics.SetScrollParentId(aLayerMetrics.GetScrollParentId());
@@ -3547,45 +3543,16 @@ void AsyncPanZoomController::NotifyLayer
if (needContentRepaint) {
RequestContentRepaint();
}
UpdateSharedCompositorFrameMetrics();
}
void
-AsyncPanZoomController::NotifyScrollUpdated(uint32_t aScrollGeneration,
- const CSSPoint& aScrollOffset)
-{
- APZThreadUtils::AssertOnCompositorThread();
- ReentrantMonitorAutoEnter lock(mMonitor);
-
- APZC_LOG("%p NotifyScrollUpdated(%d, %s)\n", this, aScrollGeneration,
- Stringify(aScrollOffset).c_str());
-
- bool scrollOffsetUpdated = aScrollGeneration != mFrameMetrics.GetScrollGeneration();
- if (!scrollOffsetUpdated) {
- return;
- }
- APZC_LOG("%p updating scroll offset from %s to %s\n", this,
- Stringify(mFrameMetrics.GetScrollOffset()).c_str(),
- Stringify(aScrollOffset).c_str());
-
- mFrameMetrics.UpdateScrollInfo(aScrollGeneration, aScrollOffset);
- AcknowledgeScrollUpdate();
- mExpectedGeckoMetrics.UpdateScrollInfo(aScrollGeneration, aScrollOffset);
- CancelAnimation();
- RequestContentRepaint();
- UpdateSharedCompositorFrameMetrics();
- // We don't call ScheduleComposite() here because that happens higher up
- // in the call stack, when LayerTransactionParent handles this message.
- // If we did it here it would incur an extra message posting unnecessarily.
-}
-
-void
AsyncPanZoomController::AcknowledgeScrollUpdate() const
{
// Once layout issues a scroll offset update, it becomes impervious to
// scroll offset updates from APZ until we acknowledge the update it sent.
// This prevents APZ updates from clobbering scroll updates from other
// more "legitimate" sources like content scripts.
RefPtr<GeckoContentController> controller = GetGeckoContentController();
if (controller) {
--- a/gfx/layers/apz/src/AsyncPanZoomController.h
+++ b/gfx/layers/apz/src/AsyncPanZoomController.h
@@ -169,23 +169,16 @@ public:
* |aIsFirstPaint| is a flag passed from the shadow
* layers code indicating that the scroll metadata being sent with this call are
* the initial metadata and the initial paint of the frame has just happened.
*/
void NotifyLayersUpdated(const ScrollMetadata& aScrollMetadata, bool aIsFirstPaint,
bool aThisLayerTreeUpdated);
/**
- * A lightweight version of NotifyLayersUpdated that allows just the scroll
- * offset and scroll generation from the main thread to be propagated to APZ.
- */
- void NotifyScrollUpdated(uint32_t aScrollGeneration,
- const CSSPoint& aScrollOffset);
-
- /**
* The platform implementation must set the compositor parent so that we can
* request composites.
*/
void SetCompositorBridgeParent(CompositorBridgeParent* aCompositorBridgeParent);
/**
* Inform this APZC that it will be sharing its FrameMetrics with a cross-process
* compositor so that the associated content process can access it. This is only
--- a/gfx/layers/ipc/LayerTransactionParent.cpp
+++ b/gfx/layers/ipc/LayerTransactionParent.cpp
@@ -807,35 +807,16 @@ GetAPZCForViewID(Layer* aLayer, FrameMet
return c;
}
}
}
return nullptr;
}
bool
-LayerTransactionParent::RecvUpdateScrollOffset(
- const FrameMetrics::ViewID& aScrollID,
- const uint32_t& aScrollGeneration,
- const CSSPoint& aScrollOffset)
-{
- if (mDestroyed || !layer_manager() || layer_manager()->IsDestroyed()) {
- return false;
- }
-
- AsyncPanZoomController* controller = GetAPZCForViewID(mRoot, aScrollID);
- if (!controller) {
- return false;
- }
- controller->NotifyScrollUpdated(aScrollGeneration, aScrollOffset);
- mShadowLayersManager->ForceComposite(this);
- return true;
-}
-
-bool
LayerTransactionParent::RecvSetAsyncScrollOffset(const FrameMetrics::ViewID& aScrollID,
const float& aX, const float& aY)
{
if (mDestroyed || !layer_manager() || layer_manager()->IsDestroyed()) {
return false;
}
AsyncPanZoomController* controller = GetAPZCForViewID(mRoot, aScrollID);
--- a/gfx/layers/ipc/LayerTransactionParent.h
+++ b/gfx/layers/ipc/LayerTransactionParent.h
@@ -138,19 +138,16 @@ protected:
virtual bool RecvForceComposite() override;
virtual bool RecvSetTestSampleTime(const TimeStamp& aTime) override;
virtual bool RecvLeaveTestMode() override;
virtual bool RecvGetOpacity(PLayerParent* aParent,
float* aOpacity) override;
virtual bool RecvGetAnimationTransform(PLayerParent* aParent,
MaybeTransform* aTransform)
override;
- virtual bool RecvUpdateScrollOffset(const FrameMetrics::ViewID& aScrollId,
- const uint32_t& aScrollGeneration,
- const CSSPoint& aScrollOffset) override;
virtual bool RecvSetAsyncScrollOffset(const FrameMetrics::ViewID& aId,
const float& aX, const float& aY) override;
virtual bool RecvSetAsyncZoom(const FrameMetrics::ViewID& aId,
const float& aValue) override;
virtual bool RecvFlushApzRepaints() override;
virtual bool RecvGetAPZTestData(APZTestData* aOutData) override;
virtual bool RecvRequestProperty(const nsString& aProperty, float* aValue) override;
virtual bool RecvSetConfirmedTargetAPZC(const uint64_t& aBlockId,
--- a/gfx/layers/ipc/PLayerTransaction.ipdl
+++ b/gfx/layers/ipc/PLayerTransaction.ipdl
@@ -17,17 +17,16 @@ include "mozilla/GfxMessageUtils.h";
using struct mozilla::layers::TextureInfo from "mozilla/layers/CompositorTypes.h";
using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
using mozilla::layers::TextureFlags from "mozilla/layers/CompositorTypes.h";
using class mozilla::layers::APZTestData from "mozilla/layers/APZTestData.h";
using mozilla::layers::FrameMetrics::ViewID from "FrameMetrics.h";
using struct mozilla::layers::ScrollableLayerGuid from "FrameMetrics.h";
using mozilla::layers::LayersBackend from "mozilla/layers/LayersTypes.h";
-using mozilla::CSSPoint from "Units.h";
/**
* The layers protocol is spoken between thread contexts that manage
* layer (sub)trees. The protocol comprises atomically publishing
* layer subtrees to a "shadow" thread context (which grafts the
* subtree into its own tree), and atomically updating a published
* subtree. ("Atomic" in this sense is wrt painting.)
*/
@@ -85,20 +84,16 @@ parent:
// Returns the value of the transform applied to the layer by animation after
// factoring out translation components introduced to account for the offset
// of the corresponding frame and transform origin and after converting to CSS
// pixels. If the layer is not transformed by animation, the return value will
// be void_t.
sync GetAnimationTransform(PLayer layer) returns (MaybeTransform transform);
- // Updates the scroll offset and generation counter on the APZC for the
- // given scroll id.
- sync UpdateScrollOffset(ViewID id, uint32_t generation, CSSPoint offset);
-
// The next time the layer tree is composited, add this async scroll offset in
// CSS pixels for the given ViewID.
// Useful for testing rendering of async scrolling.
sync SetAsyncScrollOffset(ViewID id, float x, float y);
// The next time the layer tree is composited, include this async zoom in
// for the given ViewID.
// Useful for testing rendering of async zooming.