Fix the issue that accelerated overflow scrolling become invisible
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / WebLayerTreeRenderer.cpp
index 5583da4..118ec26 100755 (executable)
@@ -371,9 +371,9 @@ void WebLayerTreeRenderer::adjustPositionForOverflowLayers()
         const Vector<GraphicsLayer*>& childLayers = contentsLayer->children();
         for (size_t i = 0; i < childLayers.size(); ++i)
             if (childLayers[i]->isScrollbar())
-                toTextureMapperLayer(childLayers[i])->setScrollPositionDeltaIfNeeded(FloatSize(contentsLayer->boundsOrigin().x(), contentsLayer->boundsOrigin().y()));
+                toTextureMapperLayer(childLayers[i])->setScrollPositionDeltaIfNeeded(FloatSize(-contentsLayer->boundsOrigin().x(), -contentsLayer->boundsOrigin().y()));
 #endif
-        textureMapperLayer->setScrollPositionDeltaIfNeeded(FloatSize(-contentsLayer->boundsOrigin().x(), -contentsLayer->boundsOrigin().y()));
+        textureMapperLayer->setScrollPositionDeltaIfNeeded(FloatSize(contentsLayer->boundsOrigin() - contentsLayer->position()));
     }
 }
 
@@ -389,8 +389,12 @@ bool WebLayerTreeRenderer::setOffset(const WebLayerID id, const FloatPoint& offs
         return false;
 
     const IntSize contentLayerSize(contentsLayer->size().width(), contentsLayer->size().height());
-    const IntRect boundaryRect(FloatRect(scrollingLayer->position(), scrollingLayer->size()));
-    const IntRect visibleRect(FloatRect(contentsLayer->boundsOrigin(), scrollingLayer->size()));
+    const IntRect boundaryRect(FloatRect(FloatPoint(0, 0), scrollingLayer->size()));
+    const IntRect visibleRect(FloatRect(-contentsLayer->boundsOrigin().x(),
+                                        -contentsLayer->boundsOrigin().y(),
+                                        scrollingLayer->size().width(),
+                                        scrollingLayer->size().height()));
+
 
     IntRect newVisibleRect = visibleRect;
     newVisibleRect.moveBy(flooredIntPoint(offset));
@@ -407,7 +411,7 @@ bool WebLayerTreeRenderer::setOffset(const WebLayerID id, const FloatPoint& offs
     if (visibleRect == newVisibleRect)
         return false;
 
-    contentsLayer->setBoundsOrigin(newVisibleRect.location());
+    contentsLayer->setBoundsOrigin(FloatPoint(-newVisibleRect.x(), -newVisibleRect.y()));
 
     m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeCoordinator::SetVisibleContentsRectAndTrajectoryVectorForLayer(id, visibleRect, offset), m_drawingAreaProxy->page()->pageID());