mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1021085 - Refactor code to ensure we use the same scrolling ancestor layer everywhere. r=Cwiiis
This commit is contained in:
parent
6ed830eb0e
commit
5a886a99f9
@ -85,6 +85,32 @@ GetTransformToAncestorsParentLayer(Layer* aStart, Layer* aAncestor)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
ClientTiledThebesLayer::GetAncestorLayers(ContainerLayer** aOutScrollAncestor,
|
||||
ContainerLayer** aOutDisplayPortAncestor)
|
||||
{
|
||||
ContainerLayer* scrollAncestor = nullptr;
|
||||
ContainerLayer* displayPortAncestor = nullptr;
|
||||
for (ContainerLayer* ancestor = GetParent(); ancestor; ancestor = ancestor->GetParent()) {
|
||||
const FrameMetrics& metrics = ancestor->GetFrameMetrics();
|
||||
if (!scrollAncestor && metrics.GetScrollId() != FrameMetrics::NULL_SCROLL_ID) {
|
||||
scrollAncestor = ancestor;
|
||||
}
|
||||
if (!metrics.mDisplayPort.IsEmpty()) {
|
||||
displayPortAncestor = ancestor;
|
||||
// Any layer that has a displayport must be scrollable, so we can break
|
||||
// here.
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (aOutScrollAncestor) {
|
||||
*aOutScrollAncestor = scrollAncestor;
|
||||
}
|
||||
if (aOutDisplayPortAncestor) {
|
||||
*aOutDisplayPortAncestor = displayPortAncestor;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ClientTiledThebesLayer::BeginPaint()
|
||||
{
|
||||
@ -104,18 +130,7 @@ ClientTiledThebesLayer::BeginPaint()
|
||||
// with a displayport.
|
||||
ContainerLayer* scrollAncestor = nullptr;
|
||||
ContainerLayer* displayPortAncestor = nullptr;
|
||||
for (ContainerLayer* ancestor = GetParent(); ancestor; ancestor = ancestor->GetParent()) {
|
||||
const FrameMetrics& metrics = ancestor->GetFrameMetrics();
|
||||
if (!scrollAncestor && metrics.GetScrollId() != FrameMetrics::NULL_SCROLL_ID) {
|
||||
scrollAncestor = ancestor;
|
||||
}
|
||||
if (!metrics.mDisplayPort.IsEmpty()) {
|
||||
displayPortAncestor = ancestor;
|
||||
// Any layer that has a displayport must be scrollable, so we can break
|
||||
// here.
|
||||
break;
|
||||
}
|
||||
}
|
||||
GetAncestorLayers(&scrollAncestor, &displayPortAncestor);
|
||||
|
||||
if (!displayPortAncestor || !scrollAncestor) {
|
||||
// No displayport or scroll ancestor, so we can't do progressive rendering.
|
||||
|
@ -69,6 +69,14 @@ public:
|
||||
|
||||
virtual void ClearCachedResources() MOZ_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Helper method to find the nearest ancestor layers which
|
||||
* scroll and have a displayport. The parameters are out-params
|
||||
* which hold the return values; the values passed in may be null.
|
||||
*/
|
||||
void GetAncestorLayers(ContainerLayer** aOutScrollAncestor,
|
||||
ContainerLayer** aOutDisplayPortAncestor);
|
||||
|
||||
private:
|
||||
ClientLayerManager* ClientManager()
|
||||
{
|
||||
|
@ -1011,11 +1011,12 @@ ClientTiledLayerBuffer::ComputeProgressiveUpdateRegion(const nsIntRegion& aInval
|
||||
#else
|
||||
MOZ_ASSERT(mSharedFrameMetricsHelper);
|
||||
|
||||
ContainerLayer* parent = mThebesLayer->AsLayer()->GetParent();
|
||||
ContainerLayer* scrollAncestor = nullptr;
|
||||
mThebesLayer->GetAncestorLayers(&scrollAncestor, nullptr);
|
||||
|
||||
bool abortPaint =
|
||||
mSharedFrameMetricsHelper->UpdateFromCompositorFrameMetrics(
|
||||
parent,
|
||||
scrollAncestor,
|
||||
!staleRegion.Contains(aInvalidRegion),
|
||||
drawingLowPrecision,
|
||||
compositionBounds,
|
||||
|
Loading…
Reference in New Issue
Block a user