From a218a71e7cece03ffc9ed7dd09adfdc2750b071c Mon Sep 17 00:00:00 2001 From: Bas Schouten Date: Wed, 29 Dec 2010 01:07:09 +0000 Subject: [PATCH] Bug 620665 - Part 4: Also recreate container when types don't match. r=roc a=blocking-beta9 --- layout/generic/nsObjectFrame.cpp | 6 +++++- layout/generic/nsVideoFrame.cpp | 12 ++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index 3fa3e633722..24902d5aebb 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -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; } diff --git a/layout/generic/nsVideoFrame.cpp b/layout/generic/nsVideoFrame.cpp index 0cb275a953a..f9d50484b38 100644 --- a/layout/generic/nsVideoFrame.cpp +++ b/layout/generic/nsVideoFrame.cpp @@ -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 tmpContainer = aManager->CreateImageContainer(); if (!tmpContainer) return nsnull;