diff --git a/gfx/layers/NativeLayerCA.h b/gfx/layers/NativeLayerCA.h index 6e4540dc548b..6d4a974c13c0 100644 --- a/gfx/layers/NativeLayerCA.h +++ b/gfx/layers/NativeLayerCA.h @@ -276,6 +276,7 @@ class NativeLayerCA : public NativeLayer { CALayer* UnderlyingCALayer(WhichRepresentation aRepresentation); void ApplyChanges(WhichRepresentation aRepresentation); bool HasUpdate(WhichRepresentation aRepresentation); + bool HasUpdateAffectingLayers(WhichRepresentation aRepresentation); void SetBackingScale(float aBackingScale); // Invalidates the specified region in all surfaces that are tracked by this diff --git a/gfx/layers/NativeLayerCA.mm b/gfx/layers/NativeLayerCA.mm index 89c5f20ba153..f8c050aa08a6 100644 --- a/gfx/layers/NativeLayerCA.mm +++ b/gfx/layers/NativeLayerCA.mm @@ -335,6 +335,7 @@ void NativeLayerRootCA::Representation::Commit(WhichRepresentation aRepresentati // list of sublayers. The order is important because we need layer->UnderlyingCALayer() // to be non-null, and the underlying CALayer gets lazily initialized in ApplyChanges(). for (auto layer : aSublayers) { + mustRebuild |= layer->HasUpdateAffectingLayers(aRepresentation); layer->ApplyChanges(aRepresentation); } @@ -1194,6 +1195,11 @@ bool NativeLayerCA::HasUpdate(WhichRepresentation aRepresentation) { return GetRepresentation(aRepresentation).HasUpdate(); } +bool NativeLayerCA::HasUpdateAffectingLayers(WhichRepresentation aRepresentation) { + MutexAutoLock lock(mMutex); + return GetRepresentation(aRepresentation).mMutatedSpecializeVideo; +} + CALayer* NativeLayerCA::UnderlyingCALayer(WhichRepresentation aRepresentation) { MutexAutoLock lock(mMutex); return GetRepresentation(aRepresentation).UnderlyingCALayer();