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 aefe948c73
commit de7e8fb583
4 changed files with 14 additions and 9 deletions

View File

@ -123,7 +123,7 @@ NotifySubdocumentInvalidationRecursive(Layer* aLayer, NotifySubDocInvalidationFu
NotifySubdocumentInvalidationRecursive(child, aCallback); NotifySubdocumentInvalidationRecursive(child, aCallback);
} }
aCallback(container, container->GetVisibleRegion().ToUnknownRegion()); aCallback(container, container->GetLocalVisibleRegion().ToUnknownRegion());
} }
struct LayerPropertiesBase : public LayerProperties struct LayerPropertiesBase : public LayerProperties
@ -233,7 +233,7 @@ struct LayerPropertiesBase : public LayerProperties
virtual IntRect NewTransformedBounds() virtual IntRect NewTransformedBounds()
{ {
return TransformRect(mLayer->GetVisibleRegion().ToUnknownRegion().GetBounds(), return TransformRect(mLayer->GetLocalVisibleRegion().ToUnknownRegion().GetBounds(),
GetTransformForInvalidation(mLayer)); GetTransformForInvalidation(mLayer));
} }
@ -345,7 +345,7 @@ struct ContainerLayerProperties : public LayerPropertiesBase
} }
if (invalidateChildsCurrentArea) { if (invalidateChildsCurrentArea) {
aGeometryChanged = true; aGeometryChanged = true;
AddTransformedRegion(result, child->GetVisibleRegion().ToUnknownRegion(), AddTransformedRegion(result, child->GetLocalVisibleRegion().ToUnknownRegion(),
GetTransformForInvalidation(child)); GetTransformForInvalidation(child));
if (aCallback) { if (aCallback) {
NotifySubdocumentInvalidationRecursive(child, aCallback); NotifySubdocumentInvalidationRecursive(child, aCallback);
@ -477,7 +477,7 @@ struct ImageLayerProperties : public LayerPropertiesBase
{ {
ImageLayer* imageLayer = static_cast<ImageLayer*>(mLayer.get()); ImageLayer* imageLayer = static_cast<ImageLayer*>(mLayer.get());
if (!imageLayer->GetVisibleRegion().ToUnknownRegion().IsEqual(mVisibleRegion)) { if (!imageLayer->GetLocalVisibleRegion().ToUnknownRegion().IsEqual(mVisibleRegion)) {
aGeometryChanged = true; aGeometryChanged = true;
IntRect result = NewTransformedBounds(); IntRect result = NewTransformedBounds();
result = result.Union(OldTransformedBounds()); result = result.Union(OldTransformedBounds());
@ -619,7 +619,7 @@ LayerPropertiesBase::ComputeDifferences(Layer* aRoot, NotifySubDocInvalidationFu
} else { } else {
ClearInvalidations(aRoot); ClearInvalidations(aRoot);
} }
IntRect result = TransformRect(aRoot->GetVisibleRegion().ToUnknownRegion().GetBounds(), IntRect result = TransformRect(aRoot->GetLocalVisibleRegion().ToUnknownRegion().GetBounds(),
aRoot->GetLocalTransform()); aRoot->GetLocalTransform());
result = result.Union(OldTransformedBounds()); result = result.Union(OldTransformedBounds());
if (aGeometryChanged != nullptr) { 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 // When our visible region is empty, our parent may not have created the
// intermediate surface that we would require for correct clipping; however, // intermediate surface that we would require for correct clipping; however,
// this does not matter since we are invisible. // 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)); return RenderTargetIntRect(currentClip.TopLeft(), RenderTargetIntSize(0, 0));
} }
@ -1301,7 +1306,7 @@ ContainerLayer::HasMultipleChildren()
const Maybe<ParentLayerIntRect>& clipRect = child->GetEffectiveClipRect(); const Maybe<ParentLayerIntRect>& clipRect = child->GetEffectiveClipRect();
if (clipRect && clipRect->IsEmpty()) if (clipRect && clipRect->IsEmpty())
continue; continue;
if (child->GetVisibleRegion().IsEmpty()) if (child->GetLocalVisibleRegion().IsEmpty())
continue; continue;
++count; ++count;
if (count > 1) if (count > 1)
@ -1417,7 +1422,7 @@ ContainerLayer::DefaultComputeEffectiveTransforms(const Matrix4x4& aTransformToS
* the calculations performed by CalculateScissorRect above. * the calculations performed by CalculateScissorRect above.
* Nor for a child with a mask layer. * 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; useIntermediateSurface = true;
break; break;
} }

View File

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

View File

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