Bug 791711 - Invalidate again if the SharedImageID was removed. r=nical, a=blocking-basecamp

This commit is contained in:
Kan-Ru Chen (???) 2012-10-20 08:18:31 +08:00
Родитель 546996ad91
Коммит b0e66f0e5c
3 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

@ -2792,7 +2792,7 @@ void nsHTMLMediaElement::EndSrcMediaStreamPlayback()
VideoFrameContainer* container = GetVideoFrameContainer();
if (container) {
GetSrcMediaStream()->RemoveVideoOutput(container);
container->GetImageContainer()->SetCurrentImage(nullptr);
container->ClearCurrentFrame();
}
if (mPaused) {
GetSrcMediaStream()->ChangeExplicitBlockerCount(-1);

Просмотреть файл

@ -77,6 +77,10 @@ void VideoFrameContainer::ClearCurrentFrame()
mImageContainer->UnlockCurrentImage();
mImageContainer->SetCurrentImage(nullptr);
// We removed the current image so we will have to invalidate once
// again to setup the ImageContainer <-> Compositor pair.
mNeedInvalidation = true;
}
ImageContainer* VideoFrameContainer::GetImageContainer() {
@ -97,7 +101,10 @@ void VideoFrameContainer::Invalidate()
if (!mNeedInvalidation) {
return;
}
if (mImageContainer && mImageContainer->IsAsync()) {
if (mImageContainer &&
mImageContainer->IsAsync() &&
mImageContainer->HasCurrentImage()) {
mNeedInvalidation = false;
}

Просмотреть файл

@ -118,7 +118,7 @@ SharedImage* ImageContainerParent::SwapSharedImage(uint64_t aID,
int idx = IndexOf(aID);
if (idx == SHAREDIMAGEMAP_INVALID_INDEX) {
sSharedImageMap->AppendElement(ImageIDPair(aImage,aID));
return nullptr;
return nullptr;
}
SharedImage *prev = (*sSharedImageMap)[idx].image;
(*sSharedImageMap)[idx].image = aImage;