Fix the firing of m_paintRelatedMilestonesTimer
https://bugs.webkit.org/show_bug.cgi?id=116919
Reviewed by Tim Horton.
r150671 intended to change things so that paint-related milestones
only fire when painting has actually happened, so that WebKit clients
are notified when we actually have bits to present.
However, it made an incorrect assumption that painting would happen
inside of flushCompositingState(). This is not the case; flushCompositingState()
will just dirty CALayers, and later on Core Animation will ask us to paint them.
This incorrect assumption meant that we would never start the
m_paintRelatedMilestonesTimer, so never fire the milestones.
Fix by starting the m_paintRelatedMilestonesTimer via the RenderLayerBacking
paintContents call back. At this time we know we're painting, so we can both
set the FrameView's last paint time, and start up the timer. We also only
want to start the timer if there are pending milestones.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintIntoLayer):
(WebCore::RenderLayerBacking::paintContents):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::didPaintBacking):
* rendering/RenderLayerCompositor.h:
(RenderLayerCompositor):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150898 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp
index 6798d2f..807fd8f 100644
--- a/Source/WebCore/rendering/RenderLayerBacking.cpp
+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp
@@ -58,7 +58,6 @@
#include "Settings.h"
#include "StyleResolver.h"
#include "TiledBacking.h"
-#include <wtf/CurrentTime.h>
#include <wtf/text/StringBuilder.h>
#if ENABLE(CSS_FILTERS)
@@ -1978,6 +1977,8 @@
if (m_owningLayer->containsDirtyOverlayScrollbars())
m_owningLayer->paintLayerContents(context, paintingInfo, paintFlags | RenderLayer::PaintLayerPaintingOverlayScrollbars);
+ compositor()->didPaintBacking(this);
+
ASSERT(!m_owningLayer->m_usedTransparency);
}
@@ -2018,9 +2019,6 @@
// We have to use the same root as for hit testing, because both methods can compute and cache clipRects.
paintIntoLayer(graphicsLayer, &context, dirtyRect, PaintBehaviorNormal, paintingPhase);
- if (m_usingTiledCacheLayer)
- renderer()->frame()->view()->setLastPaintTime(currentTime());
-
InspectorInstrumentation::didPaint(renderer(), &context, clip);
} else if (graphicsLayer == layerForHorizontalScrollbar()) {
paintScrollbar(m_owningLayer->horizontalScrollbar(), context, clip);