2011-04-05 David Dorwin <ddorwin@chromium.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Apr 2011 17:40:30 +0000 (17:40 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Apr 2011 17:40:30 +0000 (17:40 +0000)
        Reviewed by David Levin.

        Fullscreen code assumes all layers use GPU compositing when USE(ACCELERATED_COMPOSITING)
        https://bugs.webkit.org/show_bug.cgi?id=57400

        Check whether the full screen renderer layer is being composited by the GPU before assuming that the backing is valid.
        Accelerated compositing may be compiled in but disabled at runtime or for some elements.

        Tests: Fullscreen layout tests on Chromium.

        * dom/Document.cpp:
        (WebCore::Document::webkitWillEnterFullScreenForElement):
        (WebCore::Document::webkitDidEnterFullScreenForElement):
        (WebCore::Document::webkitWillExitFullScreenForElement):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@82956 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp

index ddc326a..85b285d 100644 (file)
@@ -1,3 +1,20 @@
+2011-04-05  David Dorwin  <ddorwin@chromium.org>
+
+        Reviewed by David Levin.
+
+        Fullscreen code assumes all layers use GPU compositing when USE(ACCELERATED_COMPOSITING)
+        https://bugs.webkit.org/show_bug.cgi?id=57400
+
+        Check whether the full screen renderer layer is being composited by the GPU before assuming that the backing is valid. 
+        Accelerated compositing may be compiled in but disabled at runtime or for some elements.
+
+        Tests: Fullscreen layout tests on Chromium.
+
+        * dom/Document.cpp:
+        (WebCore::Document::webkitWillEnterFullScreenForElement):
+        (WebCore::Document::webkitDidEnterFullScreenForElement):
+        (WebCore::Document::webkitWillExitFullScreenForElement):
+
 2011-04-05  Nikolas Zimmermann  <nzimmermann@rim.com>
 
         Reviewed by Dirk Schulze.
index 2793371..3b6b04b 100644 (file)
@@ -4823,8 +4823,8 @@ void Document::webkitWillEnterFullScreenForElement(Element* element)
         m_fullScreenRenderer->setAnimating(true);
 #if USE(ACCELERATED_COMPOSITING)
         view()->updateCompositingLayers();
-        ASSERT(m_fullScreenRenderer->layer()->backing());
-        page()->chrome()->client()->setRootFullScreenLayer(m_fullScreenRenderer->layer()->backing()->graphicsLayer());
+        if (m_fullScreenRenderer->layer()->isComposited())
+            page()->chrome()->client()->setRootFullScreenLayer(m_fullScreenRenderer->layer()->backing()->graphicsLayer());
 #endif
     }
 }
@@ -4835,7 +4835,6 @@ void Document::webkitDidEnterFullScreenForElement(Element*)
         m_fullScreenRenderer->setAnimating(false);
 #if USE(ACCELERATED_COMPOSITING)
         view()->updateCompositingLayers();
-        ASSERT(!m_fullScreenRenderer->layer()->backing());
         page()->chrome()->client()->setRootFullScreenLayer(0);
 #endif
     }
@@ -4849,8 +4848,8 @@ void Document::webkitWillExitFullScreenForElement(Element*)
         m_fullScreenRenderer->setAnimating(true);
 #if USE(ACCELERATED_COMPOSITING)
         view()->updateCompositingLayers();
-        ASSERT(m_fullScreenRenderer->layer()->backing());
-        page()->chrome()->client()->setRootFullScreenLayer(m_fullScreenRenderer->layer()->backing()->graphicsLayer());
+        if (m_fullScreenRenderer->layer()->isComposited())
+            page()->chrome()->client()->setRootFullScreenLayer(m_fullScreenRenderer->layer()->backing()->graphicsLayer());
 #endif
     }
 }