Title: [270292] trunk/Source
- Revision
- 270292
- Author
- [email protected]
- Date
- 2020-12-01 02:26:23 -0800 (Tue, 01 Dec 2020)
Log Message
[GTK][WPE] Async scrolling udpates are blocked in the main thread
https://bugs.webkit.org/show_bug.cgi?id=219308
Patch by Alejandro G. Castro <[email protected]> on 2020-12-01
Reviewed by Simon Fraser.
Source/WebCore:
We need to avoid this performance improvement of avoiding the
refresh for the scrolling thread when no wheel events were
recently sent because GTK and WPE kinetic scrolling does not use
wheel events to control the animation. We are discussing to change
this for the future and make the code more similar for every port.
No new tests, not sure if we can add tests for this situation. We
detected it manually.
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::displayDidRefresh): This function
is also called by the threaded compositor thread in case of GTK
and WPE. We can not use that condition for GTK and WPE, kinetic
animation does not use the wheel events.
Source/WebKit:
We need to use the EventDispatcher from the frameDone callback in
the ThreadedCompositor, for GTK and WPE we receive the frame
information in that thread. We have to notify the scrolling trees
in the scrolling thread even if the main thread is busy or we will
freeze when the main thread is busy. For that we use the API in
the EventDispatcher.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::sceneUpdateFinished): Call the
EventDispatcher to notify the scrolling trees a frame was rendered.
* WebProcess/WebPage/EventDispatcher.cpp: Enable the compilation
of the notify function for all the ports.
* WebProcess/WebPage/EventDispatcher.h: Ditto.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (270291 => 270292)
--- trunk/Source/WebCore/ChangeLog 2020-12-01 09:44:06 UTC (rev 270291)
+++ trunk/Source/WebCore/ChangeLog 2020-12-01 10:26:23 UTC (rev 270292)
@@ -1,3 +1,25 @@
+2020-12-01 Alejandro G. Castro <[email protected]>
+
+ [GTK][WPE] Async scrolling udpates are blocked in the main thread
+ https://bugs.webkit.org/show_bug.cgi?id=219308
+
+ Reviewed by Simon Fraser.
+
+ We need to avoid this performance improvement of avoiding the
+ refresh for the scrolling thread when no wheel events were
+ recently sent because GTK and WPE kinetic scrolling does not use
+ wheel events to control the animation. We are discussing to change
+ this for the future and make the code more similar for every port.
+
+ No new tests, not sure if we can add tests for this situation. We
+ detected it manually.
+
+ * page/scrolling/ThreadedScrollingTree.cpp:
+ (WebCore::ThreadedScrollingTree::displayDidRefresh): This function
+ is also called by the threaded compositor thread in case of GTK
+ and WPE. We can not use that condition for GTK and WPE, kinetic
+ animation does not use the wheel events.
+
2020-12-01 Youenn Fablet <[email protected]>
Add support for readable/writable to RTCRtpSFrameTransform
Modified: trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp (270291 => 270292)
--- trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp 2020-12-01 09:44:06 UTC (rev 270291)
+++ trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp 2020-12-01 10:26:23 UTC (rev 270292)
@@ -342,13 +342,15 @@
void ThreadedScrollingTree::displayDidRefresh(PlatformDisplayID displayID)
{
- // We're on the EventDispatcher thread here.
+ // We're on the EventDispatcher thread or in the ThreadedCompositor thread here.
if (displayID != this->displayID())
return;
-
+
+#if !PLATFORM(WPE) && !PLATFORM(GTK)
if (!hasProcessedWheelEventsRecently())
return;
+#endif
ScrollingThread::dispatch([protectedThis = makeRef(*this)]() {
protectedThis->displayDidRefreshOnScrollingThread();
Modified: trunk/Source/WebKit/ChangeLog (270291 => 270292)
--- trunk/Source/WebKit/ChangeLog 2020-12-01 09:44:06 UTC (rev 270291)
+++ trunk/Source/WebKit/ChangeLog 2020-12-01 10:26:23 UTC (rev 270292)
@@ -1,3 +1,24 @@
+2020-12-01 Alejandro G. Castro <[email protected]>
+
+ [GTK][WPE] Async scrolling udpates are blocked in the main thread
+ https://bugs.webkit.org/show_bug.cgi?id=219308
+
+ Reviewed by Simon Fraser.
+
+ We need to use the EventDispatcher from the frameDone callback in
+ the ThreadedCompositor, for GTK and WPE we receive the frame
+ information in that thread. We have to notify the scrolling trees
+ in the scrolling thread even if the main thread is busy or we will
+ freeze when the main thread is busy. For that we use the API in
+ the EventDispatcher.
+
+ * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
+ (WebKit::ThreadedCompositor::sceneUpdateFinished): Call the
+ EventDispatcher to notify the scrolling trees a frame was rendered.
+ * WebProcess/WebPage/EventDispatcher.cpp: Enable the compilation
+ of the notify function for all the ports.
+ * WebProcess/WebPage/EventDispatcher.h: Ditto.
+
2020-12-01 Tim Horton <[email protected]>
GPU Process: Invalid static_cast from ConcreteImageBuffer to RemoteImageBufferProxy
Modified: trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp (270291 => 270292)
--- trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp 2020-12-01 09:44:06 UTC (rev 270291)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp 2020-12-01 10:26:23 UTC (rev 270292)
@@ -29,7 +29,9 @@
#if USE(COORDINATED_GRAPHICS)
#include "CompositingRunLoop.h"
+#include "EventDispatcher.h"
#include "ThreadedDisplayRefreshMonitor.h"
+#include "WebProcess.h"
#include <WebCore/PlatformDisplay.h>
#include <WebCore/TransformationMatrix.h>
#include <wtf/SetForScope.h>
@@ -253,6 +255,9 @@
if (shouldDispatchDisplayRefreshCallback)
m_displayRefreshMonitor->dispatchDisplayRefreshCallback();
+ // Always notify the ScrollingTrees to make sure scrolling does not depend on the main thread.
+ WebProcess::singleton().eventDispatcher().notifyScrollingTreesDisplayWasRefreshed(m_displayRefreshMonitor->displayID());
+
// Mark the scene update as completed.
m_compositingRunLoop->updateCompleted(stateLocker);
}
Modified: trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp (270291 => 270292)
--- trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp 2020-12-01 09:44:06 UTC (rev 270291)
+++ trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp 2020-12-01 10:26:23 UTC (rev 270292)
@@ -43,9 +43,7 @@
#include <WebCore/AsyncScrollingCoordinator.h>
#endif
-#if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
#include <WebCore/DisplayRefreshMonitorManager.h>
-#endif
#if ENABLE(SCROLLING_THREAD)
#include <WebCore/ScrollingThread.h>
@@ -273,8 +271,6 @@
}
#endif
-#if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
-
void EventDispatcher::notifyScrollingTreesDisplayWasRefreshed(PlatformDisplayID displayID)
{
#if ENABLE(SCROLLING_THREAD)
@@ -284,6 +280,7 @@
#endif
}
+#if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
void EventDispatcher::displayWasRefreshed(PlatformDisplayID displayID)
{
ASSERT(!RunLoop::isMain());
Modified: trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.h (270291 => 270292)
--- trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.h 2020-12-01 09:44:06 UTC (rev 270291)
+++ trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.h 2020-12-01 10:26:23 UTC (rev 270292)
@@ -73,9 +73,7 @@
void initializeConnection(IPC::Connection*);
-#if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
void notifyScrollingTreesDisplayWasRefreshed(WebCore::PlatformDisplayID);
-#endif
private:
EventDispatcher();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes