Bug 1247452 - Use the effective visible region rather than the visible region where appropriate in the compositor. r=mattwoodrow

MozReview-Commit-ID: 6wbe0kUWh9h
This commit is contained in:
Botond Ballo 2016-02-12 20:24:38 -05:00
parent 5d1c8cbbb5
commit b333a36318
4 changed files with 14 additions and 9 deletions

View File

@ -123,7 +123,7 @@ NotifySubdocumentInvalidationRecursive(Layer* aLayer, NotifySubDocInvalidationFu
NotifySubdocumentInvalidationRecursive(child, aCallback);
}
aCallback(container, container->GetVisibleRegion().ToUnknownRegion());
aCallback(container, container->GetLocalVisibleRegion().ToUnknownRegion());
}
struct LayerPropertiesBase : public LayerProperties
@ -233,7 +233,7 @@ struct LayerPropertiesBase : public LayerProperties
virtual IntRect NewTransformedBounds()
{
return TransformRect(mLayer->GetVisibleRegion().ToUnknownRegion().GetBounds(),
return TransformRect(mLayer->GetLocalVisibleRegion().ToUnknownRegion().GetBounds(),
GetTransformForInvalidation(mLayer));
}
@ -345,7 +345,7 @@ struct ContainerLayerProperties : public LayerPropertiesBase
}
if (invalidateChildsCurrentArea) {
aGeometryChanged = true;
AddTransformedRegion(result, child->GetVisibleRegion().ToUnknownRegion(),
AddTransformedRegion(result, child->GetLocalVisibleRegion().ToUnknownRegion(),
GetTransformForInvalidation(child));
if (aCallback) {
NotifySubdocumentInvalidationRecursive(child, aCallback);
@ -477,7 +477,7 @@ struct ImageLayerProperties : public LayerPropertiesBase
{
ImageLayer* imageLayer = static_cast<ImageLayer*>(mLayer.get());
if (!imageLayer->GetVisibleRegion().ToUnknownRegion().IsEqual(mVisibleRegion)) {
if (!imageLayer->GetLocalVisibleRegion().ToUnknownRegion().IsEqual(mVisibleRegion)) {
aGeometryChanged = true;
IntRect result = NewTransformedBounds();
result = result.Union(OldTransformedBounds());
@ -619,7 +619,7 @@ LayerPropertiesBase::ComputeDifferences(Layer* aRoot, NotifySubDocInvalidationFu
} else {
ClearInvalidations(aRoot);
}
IntRect result = TransformRect(aRoot->GetVisibleRegion().ToUnknownRegion().GetBounds(),
IntRect result = TransformRect(aRoot->GetLocalVisibleRegion().ToUnknownRegion().GetBounds(),
aRoot->GetLocalTransform());
result = result.Union(OldTransformedBounds());
if (aGeometryChanged != nullptr) {

View File

@ -799,6 +799,11 @@ Layer::CalculateScissorRect(const RenderTargetIntRect& aCurrentScissorRect)
// When our visible region is empty, our parent may not have created the
// intermediate surface that we would require for correct clipping; however,
// this does not matter since we are invisible.
// Note that we do not use GetLocalVisibleRegion(), because that can be
// empty for a layer whose rendered contents have been async-scrolled
// completely offscreen, but for which we still need to draw a
// checkerboarding backround color, and calculating an empty scissor rect
// for such a layer would prevent that (see bug 1247452 comment 10).
return RenderTargetIntRect(currentClip.TopLeft(), RenderTargetIntSize(0, 0));
}
@ -1301,7 +1306,7 @@ ContainerLayer::HasMultipleChildren()
const Maybe<ParentLayerIntRect>& clipRect = child->GetEffectiveClipRect();
if (clipRect && clipRect->IsEmpty())
continue;
if (child->GetVisibleRegion().IsEmpty())
if (child->GetLocalVisibleRegion().IsEmpty())
continue;
++count;
if (count > 1)
@ -1417,7 +1422,7 @@ ContainerLayer::DefaultComputeEffectiveTransforms(const Matrix4x4& aTransformToS
* the calculations performed by CalculateScissorRect above.
* Nor for a child with a mask layer.
*/
if (checkClipRect && (clipRect && !clipRect->IsEmpty() && !child->GetVisibleRegion().IsEmpty())) {
if (checkClipRect && (clipRect && !clipRect->IsEmpty() && !child->GetLocalVisibleRegion().IsEmpty())) {
useIntermediateSurface = true;
break;
}

View File

@ -83,7 +83,7 @@ WalkTheTree(Layer* aLayer,
aHasRemote = true;
if (const CompositorParent::LayerTreeState* state = CompositorParent::GetIndirectShadowTree(ref->GetReferentId())) {
if (Layer* referent = state->mRoot) {
if (!ref->GetVisibleRegion().IsEmpty()) {
if (!ref->GetLocalVisibleRegion().IsEmpty()) {
dom::ScreenOrientationInternal chromeOrientation = aTargetConfig.orientation();
dom::ScreenOrientationInternal contentOrientation = state->mTargetConfig.orientation();
if (!IsSameDimension(chromeOrientation, contentOrientation) &&

View File

@ -887,7 +887,7 @@ CompositorParent::Invalidate()
{
if (mLayerManager && mLayerManager->GetRoot()) {
mLayerManager->AddInvalidRegion(
mLayerManager->GetRoot()->GetVisibleRegion().ToUnknownRegion().GetBounds());
mLayerManager->GetRoot()->GetLocalVisibleRegion().ToUnknownRegion().GetBounds());
}
}