mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 773469 - Remove unnecessary layer transactions when using async-video. r=roc
This commit is contained in:
parent
e2cd029b19
commit
e3b4b9229b
@ -49,6 +49,14 @@ double VideoFrameContainer::GetFrameDelay()
|
||||
void VideoFrameContainer::Invalidate()
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Must call on main thread");
|
||||
|
||||
if (!mNeedInvalidation) {
|
||||
return;
|
||||
}
|
||||
if (mImageContainer && mImageContainer->IsAsync()) {
|
||||
mNeedInvalidation = false;
|
||||
}
|
||||
|
||||
if (!mElement) {
|
||||
// Element has been destroyed
|
||||
return;
|
||||
|
@ -37,11 +37,13 @@ public:
|
||||
already_AddRefed<ImageContainer> aContainer)
|
||||
: mElement(aElement),
|
||||
mImageContainer(aContainer), mMutex("nsVideoFrameContainer"),
|
||||
mIntrinsicSizeChanged(false), mImageSizeChanged(false)
|
||||
mIntrinsicSizeChanged(false), mImageSizeChanged(false),
|
||||
mNeedInvalidation(true)
|
||||
{
|
||||
NS_ASSERTION(aElement, "aElement must not be null");
|
||||
NS_ASSERTION(mImageContainer, "aContainer must not be null");
|
||||
}
|
||||
|
||||
// Call on any thread
|
||||
void SetCurrentFrame(const gfxIntSize& aIntrinsicSize, Image* aImage,
|
||||
TimeStamp aTargetTime);
|
||||
@ -86,6 +88,8 @@ protected:
|
||||
// frame is fully invalidated instead of just invalidating for the image change
|
||||
// in the ImageLayer.
|
||||
bool mImageSizeChanged;
|
||||
|
||||
bool mNeedInvalidation;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user