Title: [103185] trunk/Source/WebCore
- Revision
- 103185
- Author
- ander...@apple.com
- Date
- 2011-12-18 12:27:44 -0800 (Sun, 18 Dec 2011)
Log Message
The scrolling coordinator should know about the main frame scroll layer
https://bugs.webkit.org/show_bug.cgi?id=74817
Reviewed by Andreas Kling.
* page/ScrollingCoordinator.h:
* page/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingThread::threadCallback):
Move the * to where it belongs.
(WebCore::ScrollingCoordinator::setFrameScrollLayer):
Keep track of the underlying CALayer of the frame scroll layer.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::ensureRootLayer):
Call ScrollingCoordinator::setFrameScrollLayer.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (103184 => 103185)
--- trunk/Source/WebCore/ChangeLog 2011-12-18 20:09:45 UTC (rev 103184)
+++ trunk/Source/WebCore/ChangeLog 2011-12-18 20:27:44 UTC (rev 103185)
@@ -1,3 +1,22 @@
+2011-12-18 Anders Carlsson <ander...@apple.com>
+
+ The scrolling coordinator should know about the main frame scroll layer
+ https://bugs.webkit.org/show_bug.cgi?id=74817
+
+ Reviewed by Andreas Kling.
+
+ * page/ScrollingCoordinator.h:
+ * page/mac/ScrollingCoordinatorMac.mm:
+ (WebCore::ScrollingThread::threadCallback):
+ Move the * to where it belongs.
+
+ (WebCore::ScrollingCoordinator::setFrameScrollLayer):
+ Keep track of the underlying CALayer of the frame scroll layer.
+
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::ensureRootLayer):
+ Call ScrollingCoordinator::setFrameScrollLayer.
+
2011-12-18 Andreas Kling <kl...@webkit.org>
Interacting with GMail message lists is sluggish.
Modified: trunk/Source/WebCore/page/ScrollingCoordinator.h (103184 => 103185)
--- trunk/Source/WebCore/page/ScrollingCoordinator.h 2011-12-18 20:09:45 UTC (rev 103184)
+++ trunk/Source/WebCore/page/ScrollingCoordinator.h 2011-12-18 20:27:44 UTC (rev 103185)
@@ -28,14 +28,20 @@
#if ENABLE(THREADED_SCROLLING)
+#include "GraphicsLayer.h"
#include "IntRect.h"
#include <wtf/Forward.h>
#include <wtf/ThreadSafeRefCounted.h>
#include <wtf/Threading.h>
+#if PLATFORM(MAC)
+#include <wtf/RetainPtr.h>
+#endif
+
namespace WebCore {
class Frame;
+class GraphicsLayer;
class Page;
class PlatformWheelEvent;
@@ -46,6 +52,9 @@
void pageDestroyed();
+ // Should be called whenever the scroll layer for the given frame changes.
+ void setFrameScrollLayer(Frame*, const GraphicsLayer* scrollLayer);
+
// Should be called whenever the geometry of the given frame changes,
// including the visible content rect and the content size.
void syncFrameGeometry(Frame*);
@@ -68,6 +77,9 @@
Mutex m_mainFrameGeometryMutex;
IntRect m_mainFrameVisibleContentRect;
IntSize m_mainFrameContentsSize;
+#if PLATFORM(MAC)
+ RetainPtr<PlatformLayer> m_mainFrameScrollLayer;
+#endif
};
} // namespace WebCore
Modified: trunk/Source/WebCore/page/mac/ScrollingCoordinatorMac.mm (103184 => 103185)
--- trunk/Source/WebCore/page/mac/ScrollingCoordinatorMac.mm 2011-12-18 20:09:45 UTC (rev 103184)
+++ trunk/Source/WebCore/page/mac/ScrollingCoordinatorMac.mm 2011-12-18 20:27:44 UTC (rev 103185)
@@ -29,6 +29,7 @@
#import "ScrollingCoordinator.h"
+#import "Page.h"
#import <wtf/Functional.h>
#import <wtf/MainThread.h>
#import <wtf/RetainPtr.h>
@@ -92,7 +93,7 @@
}
}
-void* ScrollingThread::threadCallback(void *scrollingThread)
+void* ScrollingThread::threadCallback(void* scrollingThread)
{
static_cast<ScrollingThread*>(scrollingThread)->threadBody();
@@ -158,6 +159,20 @@
return scrollingThread;
}
+void ScrollingCoordinator::setFrameScrollLayer(Frame* frame, const GraphicsLayer* scrollLayer)
+{
+ ASSERT(isMainThread());
+ ASSERT(m_page);
+
+ if (frame != m_page->mainFrame())
+ return;
+
+ MutexLocker locker(m_mainFrameGeometryMutex);
+ m_mainFrameScrollLayer = scrollLayer->platformLayer();
+
+ // FIXME: Inform the scrolling thread?
+}
+
bool ScrollingCoordinator::isScrollingThread()
{
return scrollingThread().isCurrentThread();
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (103184 => 103185)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2011-12-18 20:09:45 UTC (rev 103184)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2011-12-18 20:27:44 UTC (rev 103185)
@@ -1805,6 +1805,11 @@
frameViewDidChangeSize();
frameViewDidScroll(m_renderView->frameView()->scrollPosition());
+
+#if ENABLE(THREADED_SCROLLING)
+ if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
+ scrollingCoordinator->setFrameScrollLayer(m_renderView->frameView()->frame(), m_scrollLayer.get());
+#endif
}
} else {
if (m_overflowControlsHostLayer) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes