Initialize fixedToViewport flags to false when synchronizing the compositing layers.
authorHurnjoo Lee <hurnjoo.lee@samsung.com>
Tue, 4 Jun 2013 05:21:28 +0000 (14:21 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Mon, 16 Sep 2013 06:40:22 +0000 (06:40 +0000)
[Title] Initialize fixedToViewport flags to false when synchronizing the compositing layers.
[Issue#] N_SE-51581, N_SE-52068
[Problem] A element has fixed location after exiting fullscreen.
[Cause] After exiting fullscreen, the position:fixed property of element was removed,
        but the GraphicsLayer still has fixedToViewport flag.
[Solution] Initialize fixedToViewport flags to false when synchronizing the compositing layers.

Change-Id: Ie1a4100932fc90c9fb2eb7701e67fdee29402002

Source/WebCore/platform/graphics/GraphicsLayer.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp
Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/WebGraphicsLayer.cpp
Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/WebGraphicsLayer.h

index 2f11f88..ba0d4fb 100644 (file)
@@ -422,6 +422,9 @@ public:
         return false;
 #endif
     }
+#if ENABLE(TIZEN_CSS_FIXED_ACCELERATION)
+    virtual void syncFixedLayers() { }
+#endif
 
 protected:
     // Should be called from derived class destructors. Should call willBeDestroyed() on super.
index 2049a15..6baeafa 100644 (file)
@@ -309,6 +309,9 @@ void RenderLayerCompositor::flushPendingLayerChanges(bool isFlushRoot)
     if (GraphicsLayer* rootLayer = rootGraphicsLayer()) {
         FrameView* frameView = m_renderView ? m_renderView->frameView() : 0;
         if (frameView) {
+#if ENABLE(TIZEN_CSS_FIXED_ACCELERATION)
+            rootLayer->syncFixedLayers();
+#endif
             // 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
             rootLayer->syncCompositingState(frameView->frameRect());
index 20da4a6..8f6d427 100644 (file)
@@ -402,6 +402,11 @@ static void updateOffsetFromViewportForSelf(RenderLayer* renderLayer)
     if (!backing)
         return;
 
+#if ENABLE(TIZEN_CSS_FIXED_ACCELERATION)
+    WebGraphicsLayer* graphicsLayer = toWebGraphicsLayer(backing->graphicsLayer());
+    graphicsLayer->setFixedToViewport(false);
+#endif
+
     RenderStyle* style = renderLayer->renderer()->style();
     if (!style)
         return;
@@ -415,7 +420,9 @@ static void updateOffsetFromViewportForSelf(RenderLayer* renderLayer)
     if (!renderLayer->isStackingContext())
         return;
 
+#if !ENABLE(TIZEN_CSS_FIXED_ACCELERATION)
     WebGraphicsLayer* graphicsLayer = toWebGraphicsLayer(backing->graphicsLayer());
+#endif
     graphicsLayer->setFixedToViewport(true);
 }
 
@@ -434,8 +441,10 @@ void LayerTreeCoordinator::syncFixedLayers()
     if (!m_webPage->corePage()->settings() || !m_webPage->corePage()->settings()->acceleratedCompositingForFixedPositionEnabled())
         return;
 
+#if !ENABLE(TIZEN_CSS_FIXED_ACCELERATION)
     if (!m_webPage->mainFrame()->view()->hasFixedObjects())
         return;
+#endif
 
     RenderLayer* rootRenderLayer = m_webPage->mainFrame()->contentRenderer()->compositor()->rootRenderLayer();
     ASSERT(rootRenderLayer);
index 7eed379..6573648 100755 (executable)
@@ -501,7 +501,9 @@ void WebGraphicsLayer::syncCompositingState(const FloatRect& rect)
     if (WebGraphicsLayer* replica = toWebGraphicsLayer(replicaLayer()))
         replica->syncCompositingStateForThisLayerOnly();
 
+#if !ENABLE(TIZEN_CSS_FIXED_ACCELERATION)
     m_webGraphicsLayerClient->syncFixedLayers();
+#endif
 
     syncCompositingStateForThisLayerOnly();
 
@@ -1154,5 +1156,13 @@ bool WebGraphicsLayer::drawTileInfo() const
     return drawTileInfo;
 }
 #endif
+
+#if ENABLE(TIZEN_CSS_FIXED_ACCELERATION)
+void WebGraphicsLayer::syncFixedLayers()
+{
+    if (m_webGraphicsLayerClient)
+        m_webGraphicsLayerClient->syncFixedLayers();
+}
+#endif
 }
 #endif
index 4c2cc7f..4a42d31 100755 (executable)
@@ -230,6 +230,9 @@ public:
     FloatRect clippingBounds();
 #endif
 
+#if ENABLE(TIZEN_CSS_FIXED_ACCELERATION)
+    virtual void syncFixedLayers();
+#endif
 private:
     virtual void willBeDestroyed();
     WebKit::WebLayerID m_id;