Bug 1190117 - Track mLastProducerID and mLastFrameID explicitly in ImageLayerProperties. r=roc

This commit is contained in:
Bobby Holley 2015-08-03 10:36:06 -07:00
parent 78e39b283c
commit 71c3de0d20
2 changed files with 19 additions and 3 deletions

View File

@ -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<ImageHost> mImageHost;
GraphicsFilter mFilter;
gfx::IntSize mScaleToSize;
int32_t mFrameID;
ScaleMode mScaleMode;
int32_t mLastProducerID;
int32_t mLastFrameID;
bool mIsMask;
};

View File

@ -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,