Title: [175433] trunk/Source/WebCore
- Revision
- 175433
- Author
- [email protected]
- Date
- 2014-10-31 16:14:46 -0700 (Fri, 31 Oct 2014)
Log Message
Change the ScrollingThread code to use RunLoop::main().dispatch() rather than callOnMainThread(), which has Obj-C overhead
https://bugs.webkit.org/show_bug.cgi?id=138263
Reviewed by Geoffrey Garen.
callOnMainThread() uses -performSelector:onMainThread:withObject:waitUntilDone:, so
it's slightly more efficient to use RunLoop::main().dispatch().
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::invalidate):
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::handleWheelEventPhase):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (175432 => 175433)
--- trunk/Source/WebCore/ChangeLog 2014-10-31 23:10:04 UTC (rev 175432)
+++ trunk/Source/WebCore/ChangeLog 2014-10-31 23:14:46 UTC (rev 175433)
@@ -1,3 +1,18 @@
+2014-10-31 Simon Fraser <[email protected]>
+
+ Change the ScrollingThread code to use RunLoop::main().dispatch() rather than callOnMainThread(), which has Obj-C overhead
+ https://bugs.webkit.org/show_bug.cgi?id=138263
+
+ Reviewed by Geoffrey Garen.
+
+ callOnMainThread() uses -performSelector:onMainThread:withObject:waitUntilDone:, so
+ it's slightly more efficient to use RunLoop::main().dispatch().
+
+ * page/scrolling/ThreadedScrollingTree.cpp:
+ (WebCore::ThreadedScrollingTree::invalidate):
+ (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
+ (WebCore::ThreadedScrollingTree::handleWheelEventPhase):
+
2014-10-31 Benjamin Poulain <[email protected]>
Pseudo classes with an escaped parenthesis generate invalid rules
Modified: trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp (175432 => 175433)
--- trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp 2014-10-31 23:10:04 UTC (rev 175432)
+++ trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp 2014-10-31 23:14:46 UTC (rev 175433)
@@ -35,7 +35,7 @@
#include "ScrollingTreeNode.h"
#include "ScrollingTreeScrollingNode.h"
#include "ScrollingTreeStickyNode.h"
-#include <wtf/MainThread.h>
+#include <wtf/RunLoop.h>
#include <wtf/TemporaryChange.h>
namespace WebCore {
@@ -86,7 +86,7 @@
// Since this can potentially be the last reference to the scrolling coordinator,
// we need to release it on the main thread since it has member variables (such as timers)
// that expect to be destroyed from the main thread.
- callOnMainThread(bind(derefScrollingCoordinator, m_scrollingCoordinator.release().leakRef()));
+ RunLoop::main().dispatch(bind(derefScrollingCoordinator, m_scrollingCoordinator.release().leakRef()));
}
void ThreadedScrollingTree::commitNewTreeState(PassOwnPtr<ScrollingStateTree> scrollingStateTree)
@@ -103,7 +103,7 @@
if (nodeID == rootNode()->scrollingNodeID())
setMainFrameScrollPosition(scrollPosition);
- callOnMainThread(bind(&AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll, m_scrollingCoordinator.get(), nodeID, scrollPosition, isHandlingProgrammaticScroll(), scrollingLayerPositionAction));
+ RunLoop::main().dispatch(bind(&AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll, m_scrollingCoordinator.get(), nodeID, scrollPosition, isHandlingProgrammaticScroll(), scrollingLayerPositionAction));
}
#if PLATFORM(MAC)
@@ -112,7 +112,7 @@
if (!m_scrollingCoordinator)
return;
- callOnMainThread(bind(&ScrollingCoordinator::handleWheelEventPhase, m_scrollingCoordinator.get(), phase));
+ RunLoop::main().dispatch(bind(&ScrollingCoordinator::handleWheelEventPhase, m_scrollingCoordinator.get(), phase));
}
#endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes