Bug 595277 - Part 3: Let Canvas and HTML video get the permanent LayerManager when instantiating their stuff. r=roc
authorBas Schouten <bschouten@mozilla.com>
Tue, 07 Dec 2010 03:05:55 +0100
changeset 58813 a54c3af4c33d75d739ad9a56043460def6d99e5e
parent 58812 e58acf6e5bbcfaae7ddec281f20adb8f0882d6c5
child 58814 aa593835cb8de54a6250539a96f58239b8e18ceb
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersroc
bugs595277
milestone2.0b8pre
Bug 595277 - Part 3: Let Canvas and HTML video get the permanent LayerManager when instantiating their stuff. r=roc
content/canvas/src/nsCanvasRenderingContext2D.cpp
content/html/content/src/nsHTMLMediaElement.cpp
--- a/content/canvas/src/nsCanvasRenderingContext2D.cpp
+++ b/content/canvas/src/nsCanvasRenderingContext2D.cpp
@@ -1073,17 +1073,18 @@ nsCanvasRenderingContext2D::SetDimension
             nsCOMPtr<nsIContent> content =
                 do_QueryInterface(static_cast<nsIDOMHTMLCanvasElement*>(mCanvasElement));
             nsIDocument* ownerDoc = nsnull;
             if (content)
                 ownerDoc = content->GetOwnerDoc();
             nsRefPtr<LayerManager> layerManager = nsnull;
 
             if (ownerDoc)
-              layerManager = nsContentUtils::LayerManagerForDocument(ownerDoc);
+              layerManager =
+                nsContentUtils::PersistentLayerManagerForDocument(ownerDoc);
 
             if (layerManager) {
               surface = layerManager->CreateOptimalSurface(gfxIntSize(width, height), format);
             } else {
               surface = gfxPlatform::GetPlatform()->
                 CreateOffscreenSurface(gfxIntSize(width, height), gfxASurface::ContentFromFormat(format));
             }
         }
--- a/content/html/content/src/nsHTMLMediaElement.cpp
+++ b/content/html/content/src/nsHTMLMediaElement.cpp
@@ -2204,17 +2204,18 @@ ImageContainer* nsHTMLMediaElement::GetI
     return nsnull;
 
   // Only video frames need an image container.
   nsCOMPtr<nsIDOMHTMLVideoElement> video =
     do_QueryInterface(static_cast<nsIContent*>(this));
   if (!video)
     return nsnull;
 
-  nsRefPtr<LayerManager> manager = nsContentUtils::LayerManagerForDocument(GetOwnerDoc());
+  nsRefPtr<LayerManager> manager =
+    nsContentUtils::PersistentLayerManagerForDocument(GetOwnerDoc());
   if (!manager)
     return nsnull;
 
   mImageContainer = manager->CreateImageContainer();
   return mImageContainer;
 }
 
 nsresult nsHTMLMediaElement::DispatchAudioAvailableEvent(float* aFrameBuffer,