REGRESSION(r233325): [GTK] Broke 40 animations tests
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Jul 2018 06:54:12 +0000 (06:54 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Jul 2018 06:54:12 +0000 (06:54 +0000)
commit28081d6e3788f93237eed23849470edc1c4e2629
tree165da0ac451fa14f6aec932132093a0a4e4390f9
parent82374c4a1ecf509b9288177353f569601017544a
REGRESSION(r233325): [GTK] Broke 40 animations tests
https://bugs.webkit.org/show_bug.cgi?id=187264

Reviewed by Žan Doberšek.

Source/WebCore:

This is because DocumentAnimationScheduler uses DisplayRefreshMonitor, that is only used by GTK port when
accelerated compositing is enabled. Add a GTK display refresh monitor implementation to be used as the default.

* PlatformGTK.cmake: Add new file to compilation.
* platform/graphics/DisplayRefreshMonitor.cpp:
(WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor): Create DisplayRefreshMonitorGtk in GTK.
* platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp: Added.
(WebCore::DisplayRefreshMonitorGtk::DisplayRefreshMonitorGtk):
(WebCore::DisplayRefreshMonitorGtk::~DisplayRefreshMonitorGtk):
(WebCore::onFrameClockUpdate):
(WebCore::DisplayRefreshMonitorGtk::requestRefreshCallback):
(WebCore::DisplayRefreshMonitorGtk::displayLinkFired):
* platform/graphics/gtk/DisplayRefreshMonitorGtk.h: Added.
(WebCore::DisplayRefreshMonitorGtk::create):

Source/WebKit:

Use a different PlatformDisplayID for compositing in the GTK port. This way, when entering AC a window screen
changed is emitted and the GTK default display refresh monitor is destroyed, ensuring the one created by the
threaded compositor is used.

* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::create): Remove unused WebPage parameter and add PlatformDisplayID.
(WebKit::ThreadedCompositor::ThreadedCompositor): Create the display refresh monitor with the given displayID.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
(WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor): Pass the given displayID to the parent constructor.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
(WebKit::ThreadedDisplayRefreshMonitor::create): Add PlatformDisplayID parameter.
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Use compositingDisplayID when
creating the threaded compositor and notify about the window screen change.
(WebKit::ThreadedCoordinatedLayerTreeHost::setIsDiscardable): Use primaryDisplayID when leaving AC and
compositingDisplayID when re-entering.

LayoutTests:

Remove expectations for tests that are passing now.

* platform/gtk/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233512 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/gtk/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/PlatformGTK.cmake
Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp
Source/WebCore/platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/gtk/DisplayRefreshMonitorGtk.h [new file with mode: 0644]
Source/WebKit/ChangeLog
Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h
Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp
Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp