CoordinatedLayerTreeHost: properly support async force repaints
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 May 2017 08:51:24 +0000 (08:51 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 May 2017 08:51:24 +0000 (08:51 +0000)
commit633f5bf4fa11fe3fc9d7f175855b4a5d3727ffc8
treed058cf5a95a5c0105df27257794069f6bd5e8c55
parentf3e3f6843d1c3df94b520addbdaf8fa6a2d5ffab
CoordinatedLayerTreeHost: properly support async force repaints
https://bugs.webkit.org/show_bug.cgi?id=172444

Reviewed by Carlos Garcia Campos.

Before these changes the force-repaint callbacks were executed once
the next layer flush was performed. This is not appropriate since
with the threaded compositor this was done even before the flushed
state was handled on the rendering thread.

Instead, the callback should be invoked once the first following
flushed state is rendered through the compositor and the update
finish is reported back to CoordinatedLayerTreeHost through invoking
the renderNextFrame() method.

If the force-repaint callback is registered while a state update is
already being processed by the renderer (i.e. the threaded compositor),
the callback is invoked only after the following flush, which is
executed when renderNextFrame() is called for the current state update.

* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
Add the forceFrameSync() method that forces the following state flush
to produce a state update that will be handled by the compositor.
This ensures that the compositor informs the CoordinatedLayerTreeHost
once this state update is done, invoking renderNextFrame() which would
handle the force-repaint callback.
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::forceRepaintAsync):
(WebKit::CoordinatedLayerTreeHost::renderNextFrame):
(WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
Remove the forceRepaintAsync() override that returned false.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@217595 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h