mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1247445 - Rename Layer::GetEffectiveVisibleRegion GetLocalVisibleRegion. r=botond
This commit is contained in:
parent
b105bab818
commit
1f2d76da50
@ -76,8 +76,8 @@ static gfxFloat RecoverZDepth(const Matrix4x4& aTransform, const gfxPoint& aPoin
|
||||
* unsolved without changing our rendering code.
|
||||
*/
|
||||
static LayerSortOrder CompareDepth(Layer* aOne, Layer* aTwo) {
|
||||
gfxRect ourRect = ThebesRect(aOne->GetEffectiveVisibleRegion().ToUnknownRegion().GetBounds());
|
||||
gfxRect otherRect = ThebesRect(aTwo->GetEffectiveVisibleRegion().ToUnknownRegion().GetBounds());
|
||||
gfxRect ourRect = ThebesRect(aOne->GetLocalVisibleRegion().ToUnknownRegion().GetBounds());
|
||||
gfxRect otherRect = ThebesRect(aTwo->GetLocalVisibleRegion().ToUnknownRegion().GetBounds());
|
||||
|
||||
MOZ_ASSERT(aOne->GetParent() && aOne->GetParent()->Extend3DContext() &&
|
||||
aTwo->GetParent() && aTwo->GetParent()->Extend3DContext());
|
||||
|
@ -131,7 +131,7 @@ struct LayerPropertiesBase : public LayerProperties
|
||||
explicit LayerPropertiesBase(Layer* aLayer)
|
||||
: mLayer(aLayer)
|
||||
, mMaskLayer(nullptr)
|
||||
, mVisibleRegion(mLayer->GetEffectiveVisibleRegion().ToUnknownRegion())
|
||||
, mVisibleRegion(mLayer->GetLocalVisibleRegion().ToUnknownRegion())
|
||||
, mInvalidRegion(aLayer->GetInvalidRegion())
|
||||
, mPostXScale(aLayer->GetPostXScale())
|
||||
, mPostYScale(aLayer->GetPostYScale())
|
||||
|
@ -602,7 +602,7 @@ Layer::GetEffectiveClipRect()
|
||||
}
|
||||
|
||||
const LayerIntRegion&
|
||||
Layer::GetEffectiveVisibleRegion()
|
||||
Layer::GetLocalVisibleRegion()
|
||||
{
|
||||
if (LayerComposite* shadow = AsLayerComposite()) {
|
||||
return shadow->GetShadowVisibleRegion();
|
||||
@ -1017,7 +1017,7 @@ Layer::GetVisibleRegionRelativeToRootLayer(nsIntRegion& aResult,
|
||||
}
|
||||
|
||||
IntPoint offset;
|
||||
aResult = GetEffectiveVisibleRegion().ToUnknownRegion();
|
||||
aResult = GetLocalVisibleRegion().ToUnknownRegion();
|
||||
for (Layer* layer = this; layer; layer = layer->GetParent()) {
|
||||
gfx::Matrix matrix;
|
||||
if (!layer->GetLocalTransform().Is2D(&matrix) ||
|
||||
@ -1054,7 +1054,7 @@ Layer::GetVisibleRegionRelativeToRootLayer(nsIntRegion& aResult,
|
||||
// Retreive the translation from sibling to |layer|. The accumulated
|
||||
// visible region is currently oriented with |layer|.
|
||||
IntPoint siblingOffset = RoundedToInt(siblingMatrix.GetTranslation());
|
||||
nsIntRegion siblingVisibleRegion(sibling->GetEffectiveVisibleRegion().ToUnknownRegion());
|
||||
nsIntRegion siblingVisibleRegion(sibling->GetLocalVisibleRegion().ToUnknownRegion());
|
||||
// Translate the siblings region to |layer|'s origin.
|
||||
siblingVisibleRegion.MoveBy(-siblingOffset.x, -siblingOffset.y);
|
||||
// Apply the sibling's clip.
|
||||
@ -1443,7 +1443,7 @@ ContainerLayer::DefaultComputeEffectiveTransforms(const Matrix4x4& aTransformToS
|
||||
// transform while 2D is expected.
|
||||
idealTransform.ProjectTo2D();
|
||||
}
|
||||
mUseIntermediateSurface = useIntermediateSurface && !GetEffectiveVisibleRegion().IsEmpty();
|
||||
mUseIntermediateSurface = useIntermediateSurface && !GetLocalVisibleRegion().IsEmpty();
|
||||
if (useIntermediateSurface) {
|
||||
ComputeEffectiveTransformsForChildren(Matrix4x4::From2D(residual));
|
||||
} else {
|
||||
@ -1473,7 +1473,7 @@ ContainerLayer::DefaultComputeSupportsComponentAlphaChildren(bool* aNeedsSurface
|
||||
bool needsSurfaceCopy = false;
|
||||
CompositionOp blendMode = GetEffectiveMixBlendMode();
|
||||
if (UseIntermediateSurface()) {
|
||||
if (GetEffectiveVisibleRegion().GetNumRects() == 1 &&
|
||||
if (GetLocalVisibleRegion().GetNumRects() == 1 &&
|
||||
(GetContentFlags() & Layer::CONTENT_OPAQUE))
|
||||
{
|
||||
mSupportsComponentAlphaChildren = true;
|
||||
|
@ -1485,7 +1485,7 @@ public:
|
||||
// values that should be used when drawing this layer to screen,
|
||||
// accounting for this layer possibly being a shadow.
|
||||
const Maybe<ParentLayerIntRect>& GetEffectiveClipRect();
|
||||
const LayerIntRegion& GetEffectiveVisibleRegion();
|
||||
const LayerIntRegion& GetLocalVisibleRegion();
|
||||
|
||||
bool Extend3DContext() {
|
||||
return GetContentFlags() & CONTENT_EXTEND_3D_CONTEXT;
|
||||
@ -1507,7 +1507,7 @@ public:
|
||||
// For containers extending 3D context, visible region
|
||||
// is meaningless, since they are just intermediate result of
|
||||
// content.
|
||||
return !GetEffectiveVisibleRegion().IsEmpty() || Extend3DContext();
|
||||
return !GetLocalVisibleRegion().IsEmpty() || Extend3DContext();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2100,7 +2100,7 @@ public:
|
||||
RenderTargetIntRect GetIntermediateSurfaceRect()
|
||||
{
|
||||
NS_ASSERTION(mUseIntermediateSurface, "Must have intermediate surface");
|
||||
return RenderTargetIntRect::FromUnknownRect(GetEffectiveVisibleRegion().ToUnknownRegion().GetBounds());
|
||||
return RenderTargetIntRect::FromUnknownRect(GetLocalVisibleRegion().ToUnknownRegion().GetBounds());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -63,7 +63,7 @@ FindBackgroundLayer(ReadbackLayer* aLayer, nsIntPoint* aOffset)
|
||||
|
||||
nsIntPoint backgroundOffset(int32_t(backgroundTransform._31), int32_t(backgroundTransform._32));
|
||||
IntRect rectInBackground(transformOffset - backgroundOffset, aLayer->GetSize());
|
||||
const nsIntRegion visibleRegion = l->GetEffectiveVisibleRegion().ToUnknownRegion();
|
||||
const nsIntRegion visibleRegion = l->GetLocalVisibleRegion().ToUnknownRegion();
|
||||
if (!visibleRegion.Intersects(rectInBackground))
|
||||
continue;
|
||||
// Since l is present in the background, from here on we either choose l
|
||||
|
@ -30,7 +30,7 @@ void RenderTraceLayers(Layer *aLayer, const char *aColor, const gfx::Matrix4x4 a
|
||||
|
||||
gfx::Matrix4x4 trans = aRootTransform * aLayer->GetTransform();
|
||||
trans.ProjectTo2D();
|
||||
gfx::IntRect clipRect = aLayer->GetEffectiveVisibleRegion().GetBounds();
|
||||
gfx::IntRect clipRect = aLayer->GetLocalVisibleRegion().GetBounds();
|
||||
Rect rect(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
|
||||
trans.TransformBounds(rect);
|
||||
|
||||
|
@ -222,13 +222,13 @@ RotatedContentBuffer::DrawTo(PaintedLayer* aLayer,
|
||||
if (!aLayer->GetValidRegion().Contains(BufferRect()) ||
|
||||
(ToData(aLayer)->GetClipToVisibleRegion() &&
|
||||
!aLayer->GetVisibleRegion().ToUnknownRegion().Contains(BufferRect())) ||
|
||||
IsClippingCheap(aTarget, aLayer->GetEffectiveVisibleRegion().ToUnknownRegion())) {
|
||||
IsClippingCheap(aTarget, aLayer->GetLocalVisibleRegion().ToUnknownRegion())) {
|
||||
// We don't want to draw invalid stuff, so we need to clip. Might as
|
||||
// well clip to the smallest area possible --- the visible region.
|
||||
// Bug 599189 if there is a non-integer-translation transform in aTarget,
|
||||
// we might sample pixels outside GetEffectiveVisibleRegion(), which is wrong
|
||||
// we might sample pixels outside GetLocalVisibleRegion(), which is wrong
|
||||
// and may cause gray lines.
|
||||
gfxUtils::ClipToRegion(aTarget, aLayer->GetEffectiveVisibleRegion().ToUnknownRegion());
|
||||
gfxUtils::ClipToRegion(aTarget, aLayer->GetLocalVisibleRegion().ToUnknownRegion());
|
||||
clipped = true;
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ BasicContainerLayer::ChildrenPartitionVisibleRegion(const gfx::IntRect& aInRect)
|
||||
return false;
|
||||
|
||||
nsIntPoint offset(int32_t(transform._31), int32_t(transform._32));
|
||||
gfx::IntRect rect = aInRect.Intersect(GetEffectiveVisibleRegion().ToUnknownRegion().GetBounds() + offset);
|
||||
gfx::IntRect rect = aInRect.Intersect(GetLocalVisibleRegion().ToUnknownRegion().GetBounds() + offset);
|
||||
nsIntRegion covered;
|
||||
|
||||
for (Layer* l = mFirstChild; l; l = l->GetNextSibling()) {
|
||||
@ -121,7 +121,7 @@ BasicContainerLayer::ChildrenPartitionVisibleRegion(const gfx::IntRect& aInRect)
|
||||
ThebesMatrix(childTransform).HasNonIntegerTranslation() ||
|
||||
l->GetEffectiveOpacity() != 1.0)
|
||||
return false;
|
||||
nsIntRegion childRegion = l->GetEffectiveVisibleRegion().ToUnknownRegion();
|
||||
nsIntRegion childRegion = l->GetLocalVisibleRegion().ToUnknownRegion();
|
||||
childRegion.MoveBy(int32_t(childTransform._31), int32_t(childTransform._32));
|
||||
childRegion.And(childRegion, rect);
|
||||
if (l->GetClipRect()) {
|
||||
|
@ -260,7 +260,7 @@ public:
|
||||
// Set the opaque rect to match the bounds of the visible region.
|
||||
void AnnotateOpaqueRect()
|
||||
{
|
||||
const nsIntRegion visibleRegion = mLayer->GetEffectiveVisibleRegion().ToUnknownRegion();
|
||||
const nsIntRegion visibleRegion = mLayer->GetLocalVisibleRegion().ToUnknownRegion();
|
||||
const IntRect& bounds = visibleRegion.GetBounds();
|
||||
|
||||
DrawTarget *dt = mTarget->GetDrawTarget();
|
||||
@ -447,7 +447,7 @@ MarkLayersHidden(Layer* aLayer, const IntRect& aClipRect,
|
||||
return;
|
||||
}
|
||||
|
||||
nsIntRegion region = aLayer->GetEffectiveVisibleRegion().ToUnknownRegion();
|
||||
nsIntRegion region = aLayer->GetLocalVisibleRegion().ToUnknownRegion();
|
||||
IntRect r = region.GetBounds();
|
||||
TransformIntRect(r, transform, ToOutsideIntRect);
|
||||
r.IntersectRect(r, aDirtyRect);
|
||||
@ -932,7 +932,7 @@ BasicLayerManager::FlushGroup(PaintLayerContext& aPaintContext, bool aNeedsClipT
|
||||
if (!mTransactionIncomplete) {
|
||||
if (aNeedsClipToVisibleRegion) {
|
||||
gfxUtils::ClipToRegion(aPaintContext.mTarget,
|
||||
aPaintContext.mLayer->GetEffectiveVisibleRegion().ToUnknownRegion());
|
||||
aPaintContext.mLayer->GetLocalVisibleRegion().ToUnknownRegion());
|
||||
}
|
||||
|
||||
CompositionOp op = GetEffectiveOperator(aPaintContext.mLayer);
|
||||
@ -1043,7 +1043,7 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget,
|
||||
|
||||
paintLayerContext.Apply2DTransform();
|
||||
|
||||
const nsIntRegion visibleRegion = aLayer->GetEffectiveVisibleRegion().ToUnknownRegion();
|
||||
const nsIntRegion visibleRegion = aLayer->GetLocalVisibleRegion().ToUnknownRegion();
|
||||
// If needsGroup is true, we'll clip to the visible region after we've popped the group
|
||||
if (needsClipToVisibleRegion && !needsGroup) {
|
||||
gfxUtils::ClipToRegion(aTarget, visibleRegion);
|
||||
@ -1064,7 +1064,7 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget,
|
||||
if (is2D) {
|
||||
if (needsGroup) {
|
||||
PushedGroup pushedGroup =
|
||||
PushGroupForLayer(aTarget, aLayer, aLayer->GetEffectiveVisibleRegion().ToUnknownRegion());
|
||||
PushGroupForLayer(aTarget, aLayer, aLayer->GetLocalVisibleRegion().ToUnknownRegion());
|
||||
PaintSelfOrChildren(paintLayerContext, pushedGroup.mGroupTarget);
|
||||
PopGroupForLayer(pushedGroup);
|
||||
} else {
|
||||
|
@ -63,7 +63,7 @@ BasicPaintedLayer::PaintThebes(gfxContext* aContext,
|
||||
mValidRegion.SetEmpty();
|
||||
mContentClient->Clear();
|
||||
|
||||
nsIntRegion toDraw = IntersectWithClip(GetEffectiveVisibleRegion().ToUnknownRegion(), aContext);
|
||||
nsIntRegion toDraw = IntersectWithClip(GetLocalVisibleRegion().ToUnknownRegion(), aContext);
|
||||
|
||||
RenderTraceInvalidateStart(this, "FFFF00", toDraw.GetBounds());
|
||||
|
||||
@ -169,7 +169,7 @@ BasicPaintedLayer::Validate(LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
// from RGB to RGBA, because we might need to repaint with
|
||||
// subpixel AA)
|
||||
state.mRegionToInvalidate.And(state.mRegionToInvalidate,
|
||||
GetEffectiveVisibleRegion().ToUnknownRegion());
|
||||
GetLocalVisibleRegion().ToUnknownRegion());
|
||||
SetAntialiasingFlags(this, target);
|
||||
|
||||
RenderTraceInvalidateStart(this, "FFFF00", state.mRegionToDraw.GetBounds());
|
||||
|
@ -75,7 +75,7 @@ ClientPaintedLayer::PaintThebes()
|
||||
// from RGB to RGBA, because we might need to repaint with
|
||||
// subpixel AA)
|
||||
state.mRegionToInvalidate.And(state.mRegionToInvalidate,
|
||||
GetEffectiveVisibleRegion().ToUnknownRegion());
|
||||
GetLocalVisibleRegion().ToUnknownRegion());
|
||||
|
||||
bool didUpdate = false;
|
||||
RotatedContentBuffer::DrawIterator iter;
|
||||
|
@ -97,7 +97,7 @@ static void DrawLayerInfo(const RenderTargetIntRect& aClipRect,
|
||||
template<class ContainerT>
|
||||
static gfx::IntRect ContainerVisibleRect(ContainerT* aContainer)
|
||||
{
|
||||
gfx::IntRect surfaceRect = aContainer->GetEffectiveVisibleRegion().ToUnknownRegion().GetBounds();
|
||||
gfx::IntRect surfaceRect = aContainer->GetLocalVisibleRegion().ToUnknownRegion().GetBounds();
|
||||
return surfaceRect;
|
||||
}
|
||||
|
||||
@ -109,8 +109,8 @@ static void PrintUniformityInfo(Layer* aLayer)
|
||||
}
|
||||
|
||||
// Don't want to print a log for smaller layers
|
||||
if (aLayer->GetEffectiveVisibleRegion().GetBounds().width < 300 ||
|
||||
aLayer->GetEffectiveVisibleRegion().GetBounds().height < 300) {
|
||||
if (aLayer->GetLocalVisibleRegion().GetBounds().width < 300 ||
|
||||
aLayer->GetLocalVisibleRegion().GetBounds().height < 300) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -234,7 +234,7 @@ ContainerRenderVR(ContainerT* aContainer,
|
||||
IntRectToRect(static_cast<CanvasLayer*>(layer)->GetBounds());
|
||||
} else {
|
||||
layerBounds =
|
||||
IntRectToRect(layer->GetEffectiveVisibleRegion().ToUnknownRegion().GetBounds());
|
||||
IntRectToRect(layer->GetLocalVisibleRegion().ToUnknownRegion().GetBounds());
|
||||
}
|
||||
const gfx::Matrix4x4 childTransform = layer->GetEffectiveTransform();
|
||||
layerBounds = childTransform.TransformBounds(layerBounds);
|
||||
@ -625,7 +625,7 @@ CreateOrRecycleTarget(ContainerT* aContainer,
|
||||
Compositor* compositor = aManager->GetCompositor();
|
||||
SurfaceInitMode mode = INIT_MODE_CLEAR;
|
||||
gfx::IntRect surfaceRect = ContainerVisibleRect(aContainer);
|
||||
if (aContainer->GetEffectiveVisibleRegion().GetNumRects() == 1 &&
|
||||
if (aContainer->GetLocalVisibleRegion().GetNumRects() == 1 &&
|
||||
(aContainer->GetContentFlags() & Layer::CONTENT_OPAQUE))
|
||||
{
|
||||
mode = INIT_MODE_NONE;
|
||||
@ -650,7 +650,7 @@ CreateTemporaryTargetAndCopyFromBackground(ContainerT* aContainer,
|
||||
LayerManagerComposite* aManager)
|
||||
{
|
||||
Compositor* compositor = aManager->GetCompositor();
|
||||
gfx::IntRect visibleRect = aContainer->GetEffectiveVisibleRegion().ToUnknownRegion().GetBounds();
|
||||
gfx::IntRect visibleRect = aContainer->GetLocalVisibleRegion().ToUnknownRegion().GetBounds();
|
||||
RefPtr<CompositingRenderTarget> previousTarget = compositor->GetCurrentRenderTarget();
|
||||
gfx::IntRect surfaceRect = gfx::IntRect(visibleRect.x, visibleRect.y,
|
||||
visibleRect.width, visibleRect.height);
|
||||
@ -718,7 +718,7 @@ ContainerRender(ContainerT* aContainer,
|
||||
return;
|
||||
}
|
||||
|
||||
gfx::Rect visibleRect(aContainer->GetEffectiveVisibleRegion().ToUnknownRegion().GetBounds());
|
||||
gfx::Rect visibleRect(aContainer->GetLocalVisibleRegion().ToUnknownRegion().GetBounds());
|
||||
RefPtr<Compositor> compositor = aManager->GetCompositor();
|
||||
#ifdef MOZ_DUMP_PAINTING
|
||||
if (gfxEnv::DumpCompositorTextures()) {
|
||||
|
@ -1207,7 +1207,7 @@ LayerManagerComposite::ComputeRenderIntegrityInternal(Layer* aLayer,
|
||||
}
|
||||
|
||||
// See if there's any incomplete rendering
|
||||
nsIntRegion incompleteRegion = aLayer->GetEffectiveVisibleRegion().ToUnknownRegion();
|
||||
nsIntRegion incompleteRegion = aLayer->GetLocalVisibleRegion().ToUnknownRegion();
|
||||
incompleteRegion.Sub(incompleteRegion, paintedLayer->GetValidRegion());
|
||||
|
||||
if (!incompleteRegion.IsEmpty()) {
|
||||
|
@ -577,7 +577,7 @@ RenderWithAllMasks(Layer* aLayer, Compositor* aCompositor,
|
||||
// into. The final mask gets rendered into the original render target.
|
||||
|
||||
// Calculate the size of the intermediate surfaces.
|
||||
gfx::Rect visibleRect(aLayer->GetEffectiveVisibleRegion().ToUnknownRegion().GetBounds());
|
||||
gfx::Rect visibleRect(aLayer->GetLocalVisibleRegion().ToUnknownRegion().GetBounds());
|
||||
gfx::Matrix4x4 transform = aLayer->GetEffectiveTransform();
|
||||
// TODO: Use RenderTargetIntRect and TransformBy here
|
||||
gfx::IntRect surfaceRect =
|
||||
|
@ -112,7 +112,7 @@ PaintedLayerComposite::RenderLayer(const gfx::IntRect& aClipRect)
|
||||
mBuffer->GetLayer() == this,
|
||||
"buffer is corrupted");
|
||||
|
||||
const nsIntRegion visibleRegion = GetEffectiveVisibleRegion().ToUnknownRegion();
|
||||
const nsIntRegion visibleRegion = GetLocalVisibleRegion().ToUnknownRegion();
|
||||
|
||||
#ifdef MOZ_DUMP_PAINTING
|
||||
if (gfxEnv::DumpCompositorTextures()) {
|
||||
|
@ -280,7 +280,7 @@ HwcComposer2D::PrepareLayerList(Layer* aLayer,
|
||||
|
||||
bool fillColor = false;
|
||||
|
||||
const nsIntRegion visibleRegion = aLayer->GetEffectiveVisibleRegion().ToUnknownRegion();
|
||||
const nsIntRegion visibleRegion = aLayer->GetLocalVisibleRegion().ToUnknownRegion();
|
||||
if (visibleRegion.IsEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user