Bug 1199371 - Don't create TextureClients for video when the video isn't visible. r=nical

This commit is contained in:
Matt Woodrow
2015-09-01 15:35:55 -04:00
parent 59913621a2
commit a91f95030c
5 changed files with 84 additions and 1 deletions

View File

@@ -170,6 +170,7 @@ ImageContainer::ImageContainer(Mode flag)
: mReentrantMonitor("ImageContainer.mReentrantMonitor"),
mGenerationCounter(++sGenerationCounter),
mPaintCount(0),
mAttachCount(0),
mDroppedImageCount(0),
mImageFactory(new ImageFactory()),
mRecycleBin(new BufferRecycleBin()),
@@ -234,6 +235,28 @@ ImageContainer::CreateImage(ImageFormat aFormat)
return mImageFactory->CreateImage(aFormat, mScaleHint, mRecycleBin);
}
void
ImageContainer::NotifyAttached()
{
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
if (!mAttachCount++) {
if (IsAsync()) {
ImageBridgeChild::DispatchImageClientUpdate(mImageClient, this);
}
}
}
void
ImageContainer::NotifyDetached()
{
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
if (!--mAttachCount) {
if (IsAsync()) {
ImageBridgeChild::FlushAllImagesAsync(mImageClient);
}
}
}
void
ImageContainer::SetCurrentImageInternal(const nsTArray<NonOwningImage>& aImages)
{