Fix the issue that accelerated overflow scrolling become invisible
[framework/web/webkit-efl.git] / Source / WebKit2 / WebProcess / WebPage / LayerTreeCoordinator / LayerTreeCoordinator.cpp
index 015e539..576d024 100644 (file)
@@ -99,9 +99,6 @@ LayerTreeCoordinator::LayerTreeCoordinator(WebPage* webPage)
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
     , m_suspendedJavaScript(false)
 #endif
-#if ENABLE(TIZEN_RECORDING_SURFACE_SET)
-    , m_compositedContentLayersCount(0)
-#endif
 #if ENABLE(TIZEN_ONESHOT_DRAWING_SYNCHRONIZATION)
     , m_needsOneShotDrawingSynchronization(false)
 #endif
@@ -122,11 +119,6 @@ LayerTreeCoordinator::LayerTreeCoordinator(WebPage* webPage)
     m_layerTreeContext.webLayerID = toWebGraphicsLayer(webRootLayer)->id();
 
     m_nonCompositedContentLayer = GraphicsLayer::create(this);
-#if ENABLE(TIZEN_RECORDING_SURFACE_SET)
-    WebGraphicsLayer* webNonCompositedLayer = toWebGraphicsLayer(m_nonCompositedContentLayer.get());
-    webNonCompositedLayer->setNonCompositedLayer(true);
-#endif
-
     toWebGraphicsLayer(m_rootLayer.get())->setWebGraphicsLayerClient(this);
 #ifndef NDEBUG
     m_nonCompositedContentLayer->setName("LayerTreeCoordinator non-composited content");
@@ -204,10 +196,6 @@ void LayerTreeCoordinator::setRootCompositingLayer(WebCore::GraphicsLayer* graph
     // Add the accelerated layer tree hierarchy.
     if (graphicsLayer)
         m_nonCompositedContentLayer->addChild(graphicsLayer);
-
-#if ENABLE(TIZEN_RECORDING_SURFACE_SET)
-    m_compositedContentLayersCount = compositedContentLayersCount(m_nonCompositedContentLayer.get());
-#endif
 }
 
 void LayerTreeCoordinator::invalidate()
@@ -391,10 +379,6 @@ void LayerTreeCoordinator::attachLayer(WebGraphicsLayer* layer)
 
     layer->setContentsScale(m_contentsScale);
     layer->adjustVisibleRect();
-
-#if ENABLE(TIZEN_RECORDING_SURFACE_SET)
-    m_compositedContentLayersCount = compositedContentLayersCount(m_nonCompositedContentLayer.get());
-#endif
 }
 
 void LayerTreeCoordinator::detachLayer(WebGraphicsLayer* layer)
@@ -403,10 +387,6 @@ void LayerTreeCoordinator::detachLayer(WebGraphicsLayer* layer)
     m_shouldSyncFrame = true;
     m_webPage->send(Messages::LayerTreeCoordinatorProxy::DeleteCompositingLayer(layer->id()));
 
-#if ENABLE(TIZEN_RECORDING_SURFACE_SET)
-    m_compositedContentLayersCount = compositedContentLayersCount(m_nonCompositedContentLayer.get());
-#endif
-
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
     m_compositedContentLayers.remove(layer->id());
 #endif
@@ -814,6 +794,21 @@ PassOwnPtr<WebCore::GraphicsContext> LayerTreeCoordinator::beginContentUpdate(co
     return m_updateAtlases.last()->beginPaintingOnAvailableBuffer(handle, size, offset);
 }
 
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC) && !ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
+void LayerTreeCoordinator::pauseRendering()
+{
+    m_isSuspended = true;
+#if ENABLE(WEBGL)
+    // Make sure compositing webgl layer after returning from home screen.
+    HashSet<WebCore::WebGraphicsLayer*>::iterator end = m_registeredLayers.end();
+    for (HashSet<WebCore::WebGraphicsLayer*>::iterator it = m_registeredLayers.begin(); it != end; ++it) {
+        if ((*it)->contentType() == WebLayerInfo::Canvas3DContentType)
+            (*it)->markCanvasPlatformLayerNeedsUpdate();
+    }
+#endif
+}
+#endif
+
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 void LayerTreeCoordinator::freePlatformSurface(int layerID, int platformSurfaceId)
 {
@@ -846,54 +841,6 @@ void LayerTreeCoordinator::removePlatformSurface(int layerID, int platformSurfac
 }
 #endif
 
-#if ENABLE(TIZEN_RECORDING_SURFACE_SET)
-bool LayerTreeCoordinator::recordingSurfaceSetEnableGet()
-{
-    return recordingSurfaceAllowed() && m_webPage->recordingSurfaceEnabled();
-}
-
-bool LayerTreeCoordinator::recordingSurfaceSetLoadStartGet()
-{
-    if (m_webPage->recordingSurfaceLoadStart()) {
-        m_webPage->setRecordingSurfaceLoadStart(false);
-        return true;
-    }
-    return false;
-}
-
-bool LayerTreeCoordinator::recordingSurfaceSetLoadFinishedGet()
-{
-    if (m_webPage->recordingSurfaceLoadFinish()) {
-        m_webPage->setRecordingSurfaceLoadFinish(false);
-        return true;
-    }
-    return false;
-}
-
-bool LayerTreeCoordinator::recordingSurfaceAllowed()
-{
-    if (m_compositedContentLayersCount > 0)
-        return false;
-
-    return true;
-}
-
-int LayerTreeCoordinator::compositedContentLayersCount(GraphicsLayer* layer)
-{
-    int count = 0;
-    int contentType = toWebGraphicsLayer(layer)->contentType();
-
-    if (contentType == WebLayerInfo::Canvas3DContentType || contentType == WebLayerInfo::MediaContentType || contentType == WebLayerInfo::Canvas2DContentType)
-        count = 1;
-
-    const Vector<GraphicsLayer*>& childLayers = layer->children();
-    for (int i = 0; i < childLayers.size(); ++i)
-        count += compositedContentLayersCount(childLayers[i]);
-
-    return count;
-}
-#endif
-
 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION_ON_UI_SIDE)
 void LayerTreeCoordinator::setVisibleContentsRectAndTrajectoryVectorForLayer(int layerID, const WebCore::IntRect& visibleRect, const WebCore::FloatPoint& trajectoryVector)
 {
@@ -901,7 +848,6 @@ void LayerTreeCoordinator::setVisibleContentsRectAndTrajectoryVectorForLayer(int
     if (!contentsLayer)
         return;
 
-    toWebGraphicsLayer(contentsLayer)->setVisibleRect(visibleRect);
     if (trajectoryVector != FloatPoint::zero()) {
         m_webPage->scrollOverflowWithTrajectoryVector(trajectoryVector);
         toWebGraphicsLayer(contentsLayer)->setVisibleContentRectTrajectoryVector(trajectoryVector);
@@ -935,7 +881,6 @@ void LayerTreeCoordinator::addOrUpdateScrollingLayer(WebCore::GraphicsLayer* scr
     contentsLayer->setPosition(-offset);
 
     IntRect visibleRect(FloatRect(offset, scrollingLayer->size()));
-    toWebGraphicsLayer(contentsLayer)->setVisibleRect(visibleRect);
 
     // FIXME: Need to set trajectoryVector?
     // FloatPoint trajectoryVector(scrollingLayer->trajectoryVector());