| Index: Source/core/frame/FrameView.cpp
|
| diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
|
| index ccf279ced34c747303233d82d8a61c4e77b73a0e..1432240325fd570e797f6aa3ef3f0ce29cdc30b2 100644
|
| --- a/Source/core/frame/FrameView.cpp
|
| +++ b/Source/core/frame/FrameView.cpp
|
| @@ -2548,6 +2548,9 @@ void FrameView::updateLayoutAndStyleForPaintingInternal()
|
|
|
| updateCompositedSelectionIfNeeded();
|
|
|
| + if (RuntimeEnabledFeatures::frameTimingSupportEnabled())
|
| + updateFrameTimingRequestsIfNeeded();
|
| +
|
| scrollContentsIfNeededRecursive();
|
|
|
| invalidateTreeIfNeededRecursive();
|
| @@ -2558,6 +2561,18 @@ void FrameView::updateLayoutAndStyleForPaintingInternal()
|
| ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean);
|
| }
|
|
|
| +void FrameView::updateFrameTimingRequestsIfNeeded()
|
| +{
|
| + GraphicsLayerFrameTimingRequests graphicsLayerTimingRequests;
|
| + // TODO(mpb) use a 'dirty' bit to not call this every time.
|
| + collectFrameTimingRequestsRecursive(graphicsLayerTimingRequests);
|
| +
|
| + for (const auto& iter : graphicsLayerTimingRequests) {
|
| + const GraphicsLayer* graphicsLayer = iter.key;
|
| + graphicsLayer->platformLayer()->setFrameTimingRequests(iter.value);
|
| + }
|
| +}
|
| +
|
| void FrameView::updateLayoutAndStyleIfNeededRecursive()
|
| {
|
| // We have to crawl our entire subtree looking for any FrameViews that need
|
| @@ -4029,4 +4044,34 @@ void FrameView::collectAnnotatedRegions(LayoutObject& layoutObject, Vector<Annot
|
| collectAnnotatedRegions(*curr, regions);
|
| }
|
|
|
| +void FrameView::collectFrameTimingRequestsRecursive(GraphicsLayerFrameTimingRequests& graphicsLayerTimingRequests)
|
| +{
|
| + collectFrameTimingRequests(graphicsLayerTimingRequests);
|
| +
|
| + for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree().nextSibling()) {
|
| + if (!child->isLocalFrame())
|
| + continue;
|
| +
|
| + toLocalFrame(child)->view()->collectFrameTimingRequestsRecursive(graphicsLayerTimingRequests);
|
| + }
|
| +}
|
| +
|
| +void FrameView::collectFrameTimingRequests(GraphicsLayerFrameTimingRequests& graphicsLayerTimingRequests)
|
| +{
|
| + if (!m_frame->isLocalFrame())
|
| + return;
|
| + Frame* frame = m_frame.get();
|
| + LocalFrame* localFrame = toLocalFrame(frame);
|
| + LayoutRect viewRect = localFrame->contentLayoutObject()->viewRect();
|
| + const LayoutBoxModelObject* paintInvalidationContainer = localFrame->contentLayoutObject()->containerForPaintInvalidation();
|
| + const GraphicsLayer* graphicsLayer = paintInvalidationContainer->enclosingLayer()->graphicsLayerBacking();
|
| +
|
| + if (!graphicsLayer)
|
| + return;
|
| +
|
| + DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentLayoutObject(), paintInvalidationContainer, viewRect);
|
| +
|
| + graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, WebRect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosingIntRect(viewRect)));
|
| +}
|
| +
|
| } // namespace blink
|
|
|