Bug 1258851 - Propagate the isScrollbarContainer layer flag to the compositor. r?mattwoodrow
MozReview-Commit-ID: F0U0mNTI9i
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -1958,16 +1958,19 @@ Layer::PrintInfo(std::stringstream& aStr
aStream << " [extend3DContext]";
}
if (Combines3DTransformWithAncestors()) {
aStream << " [combines3DTransformWithAncestors]";
}
if (Is3DContextLeaf()) {
aStream << " [is3DContextLeaf]";
}
+ if (IsScrollbarContainer()) {
+ aStream << " [scrollbar]";
+ }
if (GetScrollbarDirection() == VERTICAL) {
aStream << nsPrintfCString(" [vscrollbar=%lld]", GetScrollbarTargetContainerId()).get();
}
if (GetScrollbarDirection() == HORIZONTAL) {
aStream << nsPrintfCString(" [hscrollbar=%lld]", GetScrollbarTargetContainerId()).get();
}
if (GetIsFixedPosition()) {
LayerPoint anchor = GetFixedPositionAnchor();
--- a/gfx/layers/ipc/LayerTransactionParent.cpp
+++ b/gfx/layers/ipc/LayerTransactionParent.cpp
@@ -356,16 +356,19 @@ LayerTransactionParent::RecvUpdate(Infal
if (common.isStickyPosition()) {
layer->SetStickyPositionData(common.stickyScrollContainerId(),
common.stickyScrollRangeOuter(),
common.stickyScrollRangeInner());
}
layer->SetScrollbarData(common.scrollbarTargetContainerId(),
static_cast<Layer::ScrollDirection>(common.scrollbarDirection()),
common.scrollbarThumbRatio());
+ if (common.isScrollbarContainer()) {
+ layer->SetIsScrollbarContainer();
+ }
layer->SetMixBlendMode((gfx::CompositionOp)common.mixBlendMode());
layer->SetForceIsolatedGroup(common.forceIsolatedGroup());
if (PLayerParent* maskLayer = common.maskLayerParent()) {
layer->SetMaskLayer(cast(maskLayer)->AsLayer());
} else {
layer->SetMaskLayer(nullptr);
}
layer->SetAnimations(common.animations());
--- a/gfx/layers/ipc/LayersMessages.ipdlh
+++ b/gfx/layers/ipc/LayersMessages.ipdlh
@@ -225,16 +225,17 @@ struct CommonLayerAttributes {
bool isClipFixed;
bool isStickyPosition;
uint64_t stickyScrollContainerId;
LayerRect stickyScrollRangeOuter;
LayerRect stickyScrollRangeInner;
uint64_t scrollbarTargetContainerId;
uint32_t scrollbarDirection;
float scrollbarThumbRatio;
+ bool isScrollbarContainer;
int8_t mixBlendMode;
bool forceIsolatedGroup;
nullable PLayer maskLayer;
PLayer[] ancestorMaskLayers;
// Animated colors will only honored for ColorLayers.
Animation[] animations;
nsIntRegion invalidRegion;
ScrollMetadata[] scrollMetadata;
--- a/gfx/layers/ipc/ShadowLayers.cpp
+++ b/gfx/layers/ipc/ShadowLayers.cpp
@@ -829,16 +829,17 @@ ShadowLayerForwarder::EndTransaction(Inf
common.stickyScrollContainerId() = 0;
common.stickyScrollRangeOuter() = LayerRect();
common.stickyScrollRangeInner() = LayerRect();
#endif
}
common.scrollbarTargetContainerId() = mutant->GetScrollbarTargetContainerId();
common.scrollbarDirection() = mutant->GetScrollbarDirection();
common.scrollbarThumbRatio() = mutant->GetScrollbarThumbRatio();
+ common.isScrollbarContainer() = mutant->IsScrollbarContainer();
common.mixBlendMode() = (int8_t)mutant->GetMixBlendMode();
common.forceIsolatedGroup() = mutant->GetForceIsolatedGroup();
if (Layer* maskLayer = mutant->GetMaskLayer()) {
common.maskLayerChild() = Shadow(maskLayer->AsShadowableLayer());
} else {
common.maskLayerChild() = nullptr;
}
common.maskLayerParent() = nullptr;