Bug 620665 - Part 4: Also recreate container when types don't match. r=roc a=blocking-beta9

This commit is contained in:
Bas Schouten 2010-12-29 01:07:09 +00:00
parent 0c30be213f
commit a218a71e7c
2 changed files with 13 additions and 5 deletions

View File

@ -1722,7 +1722,11 @@ nsObjectFrame::GetImageContainer()
return nsnull;
}
if (mImageContainer && mImageContainer->Manager() == manager) {
// XXX - in the future image containers will be manager independent and
// we can remove the manager equals check and only check the backend type.
if (mImageContainer &&
(!mImageContainer->Manager() || mImageContainer->Manager() == manager) &&
mImageContainer->GetBackendType() == manager->GetBackendType()) {
return mImageContainer;
}

View File

@ -193,11 +193,15 @@ nsVideoFrame::BuildLayer(nsDisplayListBuilder* aBuilder,
container->SetLayerManager(aManager);
}
// If we have a container with the right layer manager already, we don't
// need to do anything here. Otherwise we need to set up a temporary
// If we have a container of the correct type already, we don't need
// to do anything here. Otherwise we need to set up a temporary
// ImageContainer, capture the video data and store it in the temp
// container.
if (!container || container->Manager() != aManager) {
// container. For now we also check if the manager is equal since not all
// image containers are manager independent yet.
if (!container ||
(container->Manager() && container->Manager() != aManager) ||
container->GetBackendType() != aManager->GetBackendType())
{
nsRefPtr<ImageContainer> tmpContainer = aManager->CreateImageContainer();
if (!tmpContainer)
return nsnull;