mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
Allow ContainerLayers to track their invalid regions. (bug 1365879 part 16, r=mattwoodrow)
This commit is contained in:
parent
5c3229c7cc
commit
452df9e9d2
@ -123,7 +123,7 @@ NotifySubdocumentInvalidation(Layer* aLayer, NotifySubDocInvalidationFunc aCallb
|
||||
aLayer,
|
||||
[aCallback] (Layer* layer)
|
||||
{
|
||||
layer->ClearInvalidRect();
|
||||
layer->ClearInvalidRegion();
|
||||
if (layer->GetMaskLayer()) {
|
||||
NotifySubdocumentInvalidation(layer->GetMaskLayer(), aCallback);
|
||||
}
|
||||
@ -252,7 +252,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
mLayer->ClearInvalidRect();
|
||||
mLayer->ClearInvalidRegion();
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -322,12 +322,13 @@ public:
|
||||
container->CheckCanary();
|
||||
|
||||
bool childrenChanged = false;
|
||||
|
||||
bool invalidateWholeLayer = false;
|
||||
if (mPreXScale != container->GetPreXScale() ||
|
||||
mPreYScale != container->GetPreYScale()) {
|
||||
invalidOfLayer = OldTransformedBounds();
|
||||
AddRegion(invalidOfLayer, NewTransformedBounds());
|
||||
childrenChanged = true;
|
||||
invalidateWholeLayer = true;
|
||||
|
||||
// Can't bail out early, we need to update the child container layers
|
||||
}
|
||||
@ -419,6 +420,13 @@ public:
|
||||
container->SetChildrenChanged(true);
|
||||
}
|
||||
|
||||
if (container->UseIntermediateSurface()) {
|
||||
IntRect bounds = invalidateWholeLayer
|
||||
? mLayer->GetLocalVisibleRegion().ToUnknownRegion().GetBounds()
|
||||
: result.GetBounds();
|
||||
container->SetInvalidCompositeRect(bounds);
|
||||
}
|
||||
|
||||
if (!mLayer->Extend3DContext()) {
|
||||
// |result| contains invalid regions only of children.
|
||||
result.Transform(GetTransformForInvalidation(mLayer));
|
||||
@ -427,7 +435,6 @@ public:
|
||||
|
||||
LTI_DUMP(invalidOfLayer, "invalidOfLayer");
|
||||
result.OrWith(invalidOfLayer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -739,7 +746,7 @@ LayerProperties::ClearInvalidations(Layer *aLayer)
|
||||
aLayer,
|
||||
[] (Layer* layer)
|
||||
{
|
||||
layer->ClearInvalidRect();
|
||||
layer->ClearInvalidRegion();
|
||||
if (layer->GetMaskLayer()) {
|
||||
ClearInvalidations(layer->GetMaskLayer());
|
||||
}
|
||||
|
@ -1806,7 +1806,7 @@ public:
|
||||
* Clear the invalid rect, marking the layer as being identical to what is currently
|
||||
* composited.
|
||||
*/
|
||||
virtual void ClearInvalidRect() { mInvalidRegion.SetEmpty(); }
|
||||
virtual void ClearInvalidRegion() { mInvalidRegion.SetEmpty(); }
|
||||
|
||||
// These functions allow attaching an AsyncPanZoomController to this layer,
|
||||
// and can be used anytime.
|
||||
@ -2044,7 +2044,7 @@ public:
|
||||
mValidRegionIsCurrent = false;
|
||||
}
|
||||
|
||||
void ClearInvalidRect() override
|
||||
void ClearInvalidRegion() override
|
||||
{
|
||||
// mInvalidRegion is about to be reset. This is the last chance to apply
|
||||
// any pending changes from it to mValidRegion. Do that by calling
|
||||
@ -2335,6 +2335,8 @@ public:
|
||||
}
|
||||
|
||||
nsTArray<CSSFilter>& GetFilterChain() { return mFilterChain; }
|
||||
|
||||
virtual void SetInvalidCompositeRect(const gfx::IntRect& aRect) {}
|
||||
|
||||
protected:
|
||||
friend class ReadbackProcessor;
|
||||
|
Loading…
Reference in New Issue
Block a user