REGRESSION (r206247): Painting milestones can be delayed until the next layer flush
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Nov 2016 16:19:48 +0000 (16:19 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Nov 2016 16:19:48 +0000 (16:19 +0000)
commit168e0bba349bc0fd5daa37e794bbd808df4aca71
treee68bb818bd3c30438e651adf138dc4fdd81f4b3e
parentea6c0c72a6f76ccf23c484e2b78dbfb5b1d03a21
REGRESSION (r206247): Painting milestones can be delayed until the next layer flush
https://bugs.webkit.org/show_bug.cgi?id=164340
<rdar://problem/29074344>

Reviewed by Tim Horton.

Source/WebCore:

To give WebKit a chance to deliver the painting milestones to its client after the commit,
we must tell it about them before or during the commit. To that end, we should not defer
the call to firePaintRelatedMilestonesIfNeeded until after the commit.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::RenderLayerCompositor): Removed
  m_paintRelatedMilestonesTimer initializer.
(WebCore::RenderLayerCompositor::didPaintBacking): Call
  FrameView::firePaintRelatedMilestonesIfNeeded directly from here.
(WebCore::RenderLayerCompositor::paintRelatedMilestonesTimerFired): Deleted.
* rendering/RenderLayerCompositor.h:

Source/WebKit2:

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Declared new helper function.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones): Helper
  function that sends the message to the UI process and resets
  m_pendingNewlyReachedLayoutMilestones.
(WebKit::TiledCoreAnimationDrawingArea::flushLayers): Wait until after the commit to get the
  pending milestones and send them to the UI process. This way we don’t miss milestones that
  fire during the commit.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208328 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm