OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 2431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2442 } | 2442 } |
2443 } | 2443 } |
2444 | 2444 |
2445 if (phases == AllPhases) { | 2445 if (phases == AllPhases) { |
2446 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 2446 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
2447 updatePaintProperties(); | 2447 updatePaintProperties(); |
2448 | 2448 |
2449 if (!m_frame->document()->printing()) | 2449 if (!m_frame->document()->printing()) |
2450 synchronizedPaint(); | 2450 synchronizedPaint(); |
2451 | 2451 |
2452 if (RuntimeEnabledFeatures::frameTimingSupportEnabled()) | |
2453 updateFrameTimingRequestsIfNeeded(); | |
2454 | |
2455 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 2452 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
2456 pushPaintArtifactToCompositor(); | 2453 pushPaintArtifactToCompositor(); |
2457 | 2454 |
2458 ASSERT(!view.hasPendingSelection()); | 2455 ASSERT(!view.hasPendingSelection()); |
2459 ASSERT((m_frame->document()->printing() && lifecycle().state() == Do
cumentLifecycle::PaintInvalidationClean) | 2456 ASSERT((m_frame->document()->printing() && lifecycle().state() == Do
cumentLifecycle::PaintInvalidationClean) |
2460 || lifecycle().state() == DocumentLifecycle::PaintClean); | 2457 || lifecycle().state() == DocumentLifecycle::PaintClean); |
2461 } | 2458 } |
2462 } | 2459 } |
2463 | 2460 |
2464 updateViewportIntersectionsForSubtree(phases); | 2461 updateViewportIntersectionsForSubtree(phases); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2545 if (!rootGraphicsLayer->drawsContent()) | 2542 if (!rootGraphicsLayer->drawsContent()) |
2546 return; | 2543 return; |
2547 const PaintArtifact& paintArtifact = rootGraphicsLayer->getPaintController()
.paintArtifact(); | 2544 const PaintArtifact& paintArtifact = rootGraphicsLayer->getPaintController()
.paintArtifact(); |
2548 | 2545 |
2549 Page* page = frame().page(); | 2546 Page* page = frame().page(); |
2550 if (!page) | 2547 if (!page) |
2551 return; | 2548 return; |
2552 page->chromeClient().didPaint(paintArtifact); | 2549 page->chromeClient().didPaint(paintArtifact); |
2553 } | 2550 } |
2554 | 2551 |
2555 void FrameView::updateFrameTimingRequestsIfNeeded() | |
2556 { | |
2557 GraphicsLayerFrameTimingRequests graphicsLayerTimingRequests; | |
2558 // TODO(mpb) use a 'dirty' bit to not call this every time. | |
2559 collectFrameTimingRequestsRecursive(graphicsLayerTimingRequests); | |
2560 | |
2561 for (const auto& iter : graphicsLayerTimingRequests) { | |
2562 const GraphicsLayer* graphicsLayer = iter.key; | |
2563 graphicsLayer->platformLayer()->setFrameTimingRequests(iter.value); | |
2564 } | |
2565 } | |
2566 | |
2567 void FrameView::updateStyleAndLayoutIfNeededRecursive() | 2552 void FrameView::updateStyleAndLayoutIfNeededRecursive() |
2568 { | 2553 { |
2569 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.StyleAndLayout.UpdateTime"); | 2554 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.StyleAndLayout.UpdateTime"); |
2570 updateStyleAndLayoutIfNeededRecursiveInternal(); | 2555 updateStyleAndLayoutIfNeededRecursiveInternal(); |
2571 } | 2556 } |
2572 | 2557 |
2573 void FrameView::updateStyleAndLayoutIfNeededRecursiveInternal() | 2558 void FrameView::updateStyleAndLayoutIfNeededRecursiveInternal() |
2574 { | 2559 { |
2575 if (shouldThrottleRendering()) | 2560 if (shouldThrottleRendering()) |
2576 return; | 2561 return; |
(...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3941 // LayoutTexts don't have their own style, they just use their parent's styl
e, | 3926 // LayoutTexts don't have their own style, they just use their parent's styl
e, |
3942 // so we don't want to include them. | 3927 // so we don't want to include them. |
3943 if (layoutObject.isText()) | 3928 if (layoutObject.isText()) |
3944 return; | 3929 return; |
3945 | 3930 |
3946 layoutObject.addAnnotatedRegions(regions); | 3931 layoutObject.addAnnotatedRegions(regions); |
3947 for (LayoutObject* curr = layoutObject.slowFirstChild(); curr; curr = curr->
nextSibling()) | 3932 for (LayoutObject* curr = layoutObject.slowFirstChild(); curr; curr = curr->
nextSibling()) |
3948 collectAnnotatedRegions(*curr, regions); | 3933 collectAnnotatedRegions(*curr, regions); |
3949 } | 3934 } |
3950 | 3935 |
3951 void FrameView::collectFrameTimingRequestsRecursive(GraphicsLayerFrameTimingRequ
ests& graphicsLayerTimingRequests) | |
3952 { | |
3953 if (!m_frameTimingRequestsDirty) | |
3954 return; | |
3955 | |
3956 collectFrameTimingRequests(graphicsLayerTimingRequests); | |
3957 | |
3958 for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree
().nextSibling()) { | |
3959 if (!child->isLocalFrame()) | |
3960 continue; | |
3961 | |
3962 toLocalFrame(child)->view()->collectFrameTimingRequestsRecursive(graphic
sLayerTimingRequests); | |
3963 } | |
3964 m_frameTimingRequestsDirty = false; | |
3965 } | |
3966 | |
3967 void FrameView::collectFrameTimingRequests(GraphicsLayerFrameTimingRequests& gra
phicsLayerTimingRequests) | |
3968 { | |
3969 if (!m_frame->isLocalFrame()) | |
3970 return; | |
3971 Frame* frame = m_frame.get(); | |
3972 LocalFrame* localFrame = toLocalFrame(frame); | |
3973 LayoutRect viewRect = localFrame->contentLayoutItem().viewRect(); | |
3974 const LayoutBoxModelObject& paintInvalidationContainer = localFrame->content
LayoutObject()->containerForPaintInvalidation(); | |
3975 // If the frame is being throttled, its compositing state may not be up to d
ate. | |
3976 if (!paintInvalidationContainer.enclosingLayer()->isAllowedToQueryCompositin
gState()) | |
3977 return; | |
3978 const GraphicsLayer* graphicsLayer = paintInvalidationContainer.enclosingLay
er()->graphicsLayerBacking(); | |
3979 | |
3980 if (!graphicsLayer) | |
3981 return; | |
3982 | |
3983 PaintLayer::mapRectToPaintInvalidationBacking(*localFrame->contentLayoutObje
ct(), paintInvalidationContainer, viewRect); | |
3984 | |
3985 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web
Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing
IntRect(viewRect))); | |
3986 } | |
3987 | |
3988 void FrameView::setNeedsUpdateViewportIntersection() | 3936 void FrameView::setNeedsUpdateViewportIntersection() |
3989 { | 3937 { |
3990 m_needsUpdateViewportIntersection = true; | 3938 m_needsUpdateViewportIntersection = true; |
3991 for (FrameView* parent = parentFrameView(); parent; parent = parent->parentF
rameView()) | 3939 for (FrameView* parent = parentFrameView(); parent; parent = parent->parentF
rameView()) |
3992 parent->m_needsUpdateViewportIntersectionInSubtree = true; | 3940 parent->m_needsUpdateViewportIntersectionInSubtree = true; |
3993 } | 3941 } |
3994 | 3942 |
3995 void FrameView::updateViewportIntersectionIfNeeded() | 3943 void FrameView::updateViewportIntersectionIfNeeded() |
3996 { | 3944 { |
3997 if (!m_needsUpdateViewportIntersection) | 3945 if (!m_needsUpdateViewportIntersection) |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4106 return m_hiddenForThrottling && m_crossOriginForThrottling; | 4054 return m_hiddenForThrottling && m_crossOriginForThrottling; |
4107 } | 4055 } |
4108 | 4056 |
4109 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const | 4057 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const |
4110 { | 4058 { |
4111 ASSERT(layoutView()); | 4059 ASSERT(layoutView()); |
4112 return *layoutView(); | 4060 return *layoutView(); |
4113 } | 4061 } |
4114 | 4062 |
4115 } // namespace blink | 4063 } // namespace blink |
OLD | NEW |