Title: [110213] trunk/Source/WebCore
Revision
110213
Author
[email protected]
Date
2012-03-08 15:14:46 -0800 (Thu, 08 Mar 2012)

Log Message

Full Screen Refactor Part 1: Remove special-case rendering code for Full Screen animation.
https://bugs.webkit.org/show_bug.cgi?id=78925

Reviewed by John Sullivan.

No new tests; no net change in functionality so covered by existing tests.

The following functions had special case code for rendering full-screen elements removed:
* dom/Document.cpp:
(WebCore::Document::webkitWillEnterFullScreenForElement):
(WebCore::Document::webkitDidEnterFullScreenForElement):
(WebCore::Document::webkitWillExitFullScreenForElement):
(WebCore::Document::webkitDidExitFullScreenForElement):
(WebCore::Document::setAnimatingFullScreen):
* page/FrameView.cpp:
(WebCore):
(WebCore::FrameView::updateCompositingLayers):
(WebCore::FrameView::syncCompositingStateForThisFrame):
* rendering/RenderLayerBacking.cpp:
(WebCore::layerOrAncestorIsTransformed):
(WebCore::RenderLayerBacking::updateCompositedBounds):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::requiresCompositingLayer):
* rendering/RenderLayerCompositor.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (110212 => 110213)


--- trunk/Source/WebCore/ChangeLog	2012-03-08 23:08:56 UTC (rev 110212)
+++ trunk/Source/WebCore/ChangeLog	2012-03-08 23:14:46 UTC (rev 110213)
@@ -1,3 +1,31 @@
+2012-03-08  Jer Noble  <[email protected]>
+
+        Full Screen Refactor Part 1: Remove special-case rendering code for Full Screen animation.
+        https://bugs.webkit.org/show_bug.cgi?id=78925
+
+        Reviewed by John Sullivan.
+
+        No new tests; no net change in functionality so covered by existing tests.
+
+        The following functions had special case code for rendering full-screen elements removed:
+        * dom/Document.cpp:
+        (WebCore::Document::webkitWillEnterFullScreenForElement):
+        (WebCore::Document::webkitDidEnterFullScreenForElement):
+        (WebCore::Document::webkitWillExitFullScreenForElement):
+        (WebCore::Document::webkitDidExitFullScreenForElement):
+        (WebCore::Document::setAnimatingFullScreen):
+        * page/FrameView.cpp:
+        (WebCore):
+        (WebCore::FrameView::updateCompositingLayers):
+        (WebCore::FrameView::syncCompositingStateForThisFrame):
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::layerOrAncestorIsTransformed):
+        (WebCore::RenderLayerBacking::updateCompositedBounds):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
+        (WebCore::RenderLayerCompositor::requiresCompositingLayer):
+        * rendering/RenderLayerCompositor.h:
+
 2012-03-08  Matt Lilek  <[email protected]>
 
         Don't enable VIDEO_TRACK on all OS X platforms

Modified: trunk/Source/WebCore/dom/Document.cpp (110212 => 110213)


--- trunk/Source/WebCore/dom/Document.cpp	2012-03-08 23:08:56 UTC (rev 110212)
+++ trunk/Source/WebCore/dom/Document.cpp	2012-03-08 23:14:46 UTC (rev 110213)
@@ -5111,28 +5111,12 @@
     m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(true);
     
     recalcStyle(Force);
-    
-    if (m_fullScreenRenderer) {
-        setAnimatingFullScreen(true);
-#if USE(ACCELERATED_COMPOSITING)
-        view()->updateCompositingLayers();
-        if (m_fullScreenRenderer->layer() && m_fullScreenRenderer->layer()->isComposited())
-            page()->chrome()->client()->setRootFullScreenLayer(m_fullScreenRenderer->layer()->backing()->graphicsLayer());
-#endif
-    }
 }
     
 void Document::webkitDidEnterFullScreenForElement(Element*)
 {
     m_fullScreenElement->didBecomeFullscreenElement();
 
-    if (m_fullScreenRenderer) {
-        setAnimatingFullScreen(false);
-#if USE(ACCELERATED_COMPOSITING)
-        view()->updateCompositingLayers();
-        page()->chrome()->client()->setRootFullScreenLayer(0);
-#endif
-    }
     m_fullScreenChangeEventTargetQueue.append(m_fullScreenElement);
     m_fullScreenChangeDelayTimer.startOneShot(0);
 }
@@ -5142,29 +5126,16 @@
     m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false);
     
     m_fullScreenElement->willStopBeingFullscreenElement();
-
-    if (m_fullScreenRenderer) {
-        setAnimatingFullScreen(true);
-#if USE(ACCELERATED_COMPOSITING)
-        view()->updateCompositingLayers();
-        if (m_fullScreenRenderer->layer() && m_fullScreenRenderer->layer()->isComposited())
-            page()->chrome()->client()->setRootFullScreenLayer(m_fullScreenRenderer->layer()->backing()->graphicsLayer());
-#endif
-    }
 }
 
 void Document::webkitDidExitFullScreenForElement(Element*)
 {
     m_areKeysEnabledInFullScreen = false;
-    setAnimatingFullScreen(false);
     
     if (m_fullScreenRenderer)
         m_fullScreenRenderer->unwrapRenderer();
 
     m_fullScreenChangeEventTargetQueue.append(m_fullScreenElement.release());
-#if USE(ACCELERATED_COMPOSITING)
-    page()->chrome()->client()->setRootFullScreenLayer(0);
-#endif
     scheduleForcedStyleRecalc();
     
     m_fullScreenChangeDelayTimer.startOneShot(0);
@@ -5291,15 +5262,6 @@
         m_fullScreenElement->setNeedsStyleRecalc();
         scheduleForcedStyleRecalc();
     }
-
-#if USE(ACCELERATED_COMPOSITING)
-    if (m_fullScreenRenderer && m_fullScreenRenderer->layer()) {
-        m_fullScreenRenderer->layer()->contentChanged(RenderLayer::FullScreenChanged);
-        // Clearing the layer's backing will force the compositor to reparent
-        // the layer the next time layers are synchronized.
-        m_fullScreenRenderer->layer()->clearBacking();
-    }
-#endif
 }
 #endif
 

Modified: trunk/Source/WebCore/page/FrameView.cpp (110212 => 110213)


--- trunk/Source/WebCore/page/FrameView.cpp	2012-03-08 23:08:56 UTC (rev 110212)
+++ trunk/Source/WebCore/page/FrameView.cpp	2012-03-08 23:14:46 UTC (rev 110213)
@@ -631,13 +631,6 @@
 
 #if USE(ACCELERATED_COMPOSITING)
 
-#if ENABLE(FULLSCREEN_API)
-static bool isDocumentRunningFullScreenAnimation(Document* document)
-{
-    return document->webkitIsFullScreen() && document->fullScreenRenderer() && document->isAnimatingFullScreen();
-}
-#endif
-
 void FrameView::updateCompositingLayers()
 {
     RenderView* root = rootRenderer(this);
@@ -647,12 +640,6 @@
     // This call will make sure the cached hasAcceleratedCompositing is updated from the pref
     root->compositor()->cacheAcceleratedCompositingFlags();
     root->compositor()->updateCompositingLayers(CompositingUpdateAfterLayoutOrStyleChange);
-    
-#if ENABLE(FULLSCREEN_API)
-    Document* document = m_frame->document();
-    if (isDocumentRunningFullScreenAnimation(document))
-        root->compositor()->updateCompositingLayers(CompositingUpdateAfterLayoutOrStyleChange, document->fullScreenRenderer()->layer());
-#endif
 }
 
 void FrameView::clearBackingStores()
@@ -727,20 +714,6 @@
 
     root->compositor()->flushPendingLayerChanges(rootFrameForSync == m_frame);
 
-#if ENABLE(FULLSCREEN_API)
-    // The fullScreenRenderer's graphicsLayer has been re-parented, and the above recursive syncCompositingState
-    // call will not cause the subtree under it to repaint.  Explicitly call the syncCompositingState on 
-    // the fullScreenRenderer's graphicsLayer here:
-    Document* document = m_frame->document();
-    if (isDocumentRunningFullScreenAnimation(document)) {
-        RenderLayerBacking* backing = document->fullScreenRenderer()->layer()->backing();
-        if (GraphicsLayer* fullScreenLayer = backing->graphicsLayer()) {
-            // FIXME: Passing frameRect() is correct only when RenderLayerCompositor uses a ScrollLayer (as in WebKit2)
-            // otherwise, the passed clip rect needs to take scrolling into account
-            fullScreenLayer->syncCompositingState(frameRect());
-        }
-    }
-#endif
     return true;
 }
 

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (110212 => 110213)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2012-03-08 23:08:56 UTC (rev 110212)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2012-03-08 23:14:46 UTC (rev 110213)
@@ -210,23 +210,7 @@
     
     return false;
 }
-    
-#if ENABLE(FULLSCREEN_API)
-static bool layerOrAncestorIsFullScreen(RenderLayer* layer)
-{
-    // Don't traverse through the render layer tree if we do not yet have a full screen renderer.        
-    if (!layer->renderer()->document()->fullScreenRenderer())
-        return false;
 
-    for (RenderLayer* curr = layer; curr; curr = curr->parent()) {
-        if (curr->renderer()->isRenderFullScreen())
-            return true;
-    }
-    
-    return false;
-}
-#endif
-
 bool RenderLayerBacking::shouldClipCompositedBounds() const
 {
     if (m_usingTiledCacheLayer)
@@ -238,11 +222,6 @@
     if (layerOrAncestorIsTransformed(m_owningLayer))
         return false;
 
-#if ENABLE(FULLSCREEN_API)
-    if (layerOrAncestorIsFullScreen(m_owningLayer))
-        return false;
-#endif
-
     return true;
 }
 
@@ -253,9 +232,7 @@
 
     // Clip to the size of the document or enclosing overflow-scroll layer.
     // If this or an ancestor is transformed, we can't currently compute the correct rect to intersect with.
-    // We'd need RenderObject::convertContainerToLocalQuad(), which doesn't yet exist.  If this
-    // is a fullscreen renderer, don't clip to the viewport, as the renderer will be asked to
-    // display outside of the viewport bounds.
+    // We'd need RenderObject::convertContainerToLocalQuad(), which doesn't yet exist.
     if (shouldClipCompositedBounds()) {
         RenderView* view = m_owningLayer->renderer()->view();
         RenderLayer* rootLayer = view->layer();

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (110212 => 110213)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2012-03-08 23:08:56 UTC (rev 110212)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2012-03-08 23:14:46 UTC (rev 110213)
@@ -991,13 +991,6 @@
             }
         }
 
-#if ENABLE(FULLSCREEN_API)
-        // For the sake of clients of the full screen renderer, don't reparent
-        // the full screen layer out from under them if they're in the middle of
-        // animating.
-        if (layer->renderer()->isRenderFullScreen() && m_renderView->document()->isAnimatingFullScreen())
-            return;
-#endif
         childLayersOfEnclosingLayer.append(layerBacking->childForSuperlayers());
     }
 }
@@ -1390,7 +1383,6 @@
              || (canRender3DTransforms() && renderer->style()->backfaceVisibility() == BackfaceVisibilityHidden)
              || clipsCompositingDescendants(layer)
              || requiresCompositingForAnimation(renderer)
-             || requiresCompositingForFullScreen(renderer)
              || requiresCompositingForFilters(renderer)
              || requiresCompositingForPosition(renderer, layer);
 }
@@ -1573,16 +1565,6 @@
     return renderer->hasTransform() || renderer->isTransparent() || renderer->hasMask() || renderer->hasReflection() || renderer->hasFilter();
 }
     
-bool RenderLayerCompositor::requiresCompositingForFullScreen(RenderObject* renderer) const
-{
-#if ENABLE(FULLSCREEN_API)
-    return renderer->isRenderFullScreen() && m_renderView->document()->isAnimatingFullScreen();
-#else
-    UNUSED_PARAM(renderer);
-    return false;
-#endif
-}
-
 bool RenderLayerCompositor::requiresCompositingForFilters(RenderObject* renderer) const
 {
 #if ENABLE(CSS_FILTERS)

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (110212 => 110213)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h	2012-03-08 23:08:56 UTC (rev 110212)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h	2012-03-08 23:14:46 UTC (rev 110213)
@@ -282,7 +282,6 @@
     bool requiresCompositingForPlugin(RenderObject*) const;
     bool requiresCompositingForFrame(RenderObject*) const;
     bool requiresCompositingWhenDescendantsAreCompositing(RenderObject*) const;
-    bool requiresCompositingForFullScreen(RenderObject*) const;
     bool requiresCompositingForFilters(RenderObject*) const;
     bool requiresCompositingForScrollableFrame() const;
     bool requiresCompositingForPosition(RenderObject*, const RenderLayer*) const;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to