diff --git a/gfx/layers/LayerTreeInvalidation.cpp b/gfx/layers/LayerTreeInvalidation.cpp index 0cce0958da44..531f04ebc611 100644 --- a/gfx/layers/LayerTreeInvalidation.cpp +++ b/gfx/layers/LayerTreeInvalidation.cpp @@ -404,9 +404,14 @@ struct ImageLayerProperties : public LayerPropertiesBase , mFilter(aImage->GetFilter()) , mScaleToSize(aImage->GetScaleToSize()) , mScaleMode(aImage->GetScaleMode()) + , mLastProducerID(-1) + , mLastFrameID(-1) , mIsMask(aIsMask) { - mFrameID = mImageHost ? mImageHost->GetFrameID() : -1; + if (mImageHost) { + mLastProducerID = mImageHost->GetLastProducerID(); + mLastFrameID = mImageHost->GetLastFrameID(); + } } virtual nsIntRegion ComputeChangeInternal(NotifySubDocInvalidationFunc aCallback, @@ -428,7 +433,8 @@ struct ImageLayerProperties : public LayerPropertiesBase mScaleToSize != imageLayer->GetScaleToSize() || mScaleMode != imageLayer->GetScaleMode() || host != mImageHost || - (host && host->GetFrameID() != mFrameID)) { + (host && host->GetProducerID() != mLastProducerID) || + (host && host->GetFrameID() != mLastFrameID)) { aGeometryChanged = true; if (mIsMask) { @@ -454,8 +460,9 @@ struct ImageLayerProperties : public LayerPropertiesBase nsRefPtr mImageHost; GraphicsFilter mFilter; gfx::IntSize mScaleToSize; - int32_t mFrameID; ScaleMode mScaleMode; + int32_t mLastProducerID; + int32_t mLastFrameID; bool mIsMask; }; diff --git a/gfx/layers/composite/ImageHost.h b/gfx/layers/composite/ImageHost.h index a8316376901c..e77afa9a0067 100644 --- a/gfx/layers/composite/ImageHost.h +++ b/gfx/layers/composite/ImageHost.h @@ -91,6 +91,15 @@ public: return img ? img->mFrameID : -1; } + int32_t GetProducerID() + { + const TimedImage* img = ChooseImage(); + return img ? img->mProducerID : -1; + } + + int32_t GetLastFrameID() const { return mLastFrameID; } + int32_t GetLastProducerID() const { return mLastProducerID; } + enum Bias { // Don't apply bias to frame times BIAS_NONE,