mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 982888 - Add a mScrollHandoffParent field to ContainerLayers. r=
This commit is contained in:
parent
058f67f786
commit
7c9a50e4de
@ -733,6 +733,7 @@ ContainerLayer::ContainerLayer(LayerManager* aManager, void* aImplData)
|
||||
: Layer(aManager, aImplData),
|
||||
mFirstChild(nullptr),
|
||||
mLastChild(nullptr),
|
||||
mScrollHandoffParentId(FrameMetrics::NULL_SCROLL_ID),
|
||||
mPreXScale(1.0f),
|
||||
mPreYScale(1.0f),
|
||||
mInheritedXScale(1.0f),
|
||||
@ -893,7 +894,8 @@ ContainerLayer::RepositionChild(Layer* aChild, Layer* aAfter)
|
||||
void
|
||||
ContainerLayer::FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
|
||||
{
|
||||
aAttrs = ContainerLayerAttributes(GetFrameMetrics(), mPreXScale, mPreYScale,
|
||||
aAttrs = ContainerLayerAttributes(GetFrameMetrics(), mScrollHandoffParentId,
|
||||
mPreXScale, mPreYScale,
|
||||
mInheritedXScale, mInheritedYScale);
|
||||
}
|
||||
|
||||
@ -1381,6 +1383,9 @@ ContainerLayer::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
if (!mFrameMetrics.IsDefault()) {
|
||||
AppendToString(aTo, mFrameMetrics, " [metrics=", "]");
|
||||
}
|
||||
if (mScrollHandoffParentId != FrameMetrics::NULL_SCROLL_ID) {
|
||||
aTo.AppendPrintf(" [scrollParent=%llu]", mScrollHandoffParentId);
|
||||
}
|
||||
if (UseIntermediateSurface()) {
|
||||
aTo += " [usesTmpSurf]";
|
||||
}
|
||||
|
@ -1627,6 +1627,22 @@ public:
|
||||
void SetAsyncPanZoomController(AsyncPanZoomController *controller);
|
||||
AsyncPanZoomController* GetAsyncPanZoomController() const;
|
||||
|
||||
/**
|
||||
* CONSTRUCTION PHASE ONLY
|
||||
* Set the ViewID of the ContainerLayer to which overscroll should be handed
|
||||
* off. A value of NULL_SCROLL_ID means that the default handoff-parent-finding
|
||||
* behaviour should be used (i.e. walk up the layer tree to find the next
|
||||
* scrollable ancestor layer).
|
||||
*/
|
||||
void SetScrollHandoffParentId(FrameMetrics::ViewID aScrollParentId)
|
||||
{
|
||||
if (mScrollHandoffParentId != aScrollParentId) {
|
||||
MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) ScrollHandoffParentId", this));
|
||||
mScrollHandoffParentId = aScrollParentId;
|
||||
Mutated();
|
||||
}
|
||||
}
|
||||
|
||||
void SetPreScale(float aXScale, float aYScale)
|
||||
{
|
||||
if (mPreXScale == aXScale && mPreYScale == aYScale) {
|
||||
@ -1663,6 +1679,7 @@ public:
|
||||
virtual Layer* GetFirstChild() const { return mFirstChild; }
|
||||
virtual Layer* GetLastChild() const { return mLastChild; }
|
||||
const FrameMetrics& GetFrameMetrics() const { return mFrameMetrics; }
|
||||
FrameMetrics::ViewID GetScrollHandoffParentId() const { return mScrollHandoffParentId; }
|
||||
float GetPreXScale() const { return mPreXScale; }
|
||||
float GetPreYScale() const { return mPreYScale; }
|
||||
float GetInheritedXScale() const { return mInheritedXScale; }
|
||||
@ -1734,6 +1751,7 @@ protected:
|
||||
Layer* mLastChild;
|
||||
FrameMetrics mFrameMetrics;
|
||||
nsRefPtr<AsyncPanZoomController> mAPZC;
|
||||
FrameMetrics::ViewID mScrollHandoffParentId;
|
||||
float mPreXScale;
|
||||
float mPreYScale;
|
||||
// The resolution scale inherited from the parent layer. This will already
|
||||
|
@ -346,6 +346,7 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
||||
const ContainerLayerAttributes& attrs =
|
||||
specific.get_ContainerLayerAttributes();
|
||||
containerLayer->SetFrameMetrics(attrs.metrics());
|
||||
containerLayer->SetScrollHandoffParentId(attrs.scrollParentId());
|
||||
containerLayer->SetPreScale(attrs.preXScale(), attrs.preYScale());
|
||||
containerLayer->SetInheritedScale(attrs.inheritedXScale(), attrs.inheritedYScale());
|
||||
break;
|
||||
|
@ -39,6 +39,7 @@ using mozilla::layers::ScaleMode from "mozilla/layers/LayersTypes.h";
|
||||
using mozilla::layers::EventRegions from "mozilla/layers/LayersTypes.h";
|
||||
using mozilla::layers::DiagnosticTypes from "mozilla/layers/CompositorTypes.h";
|
||||
using struct mozilla::layers::FrameMetrics from "FrameMetrics.h";
|
||||
using mozilla::layers::FrameMetrics::ViewID from "FrameMetrics.h";
|
||||
using struct mozilla::layers::FenceHandle from "mozilla/layers/FenceUtils.h";
|
||||
|
||||
namespace mozilla {
|
||||
@ -216,6 +217,7 @@ struct ThebesLayerAttributes {
|
||||
};
|
||||
struct ContainerLayerAttributes {
|
||||
FrameMetrics metrics;
|
||||
ViewID scrollParentId;
|
||||
float preXScale;
|
||||
float preYScale;
|
||||
float inheritedXScale;
|
||||
|
Loading…
Reference in New Issue
Block a user