Chromium Code Reviews| Index: Source/core/frame/FrameView.cpp |
| diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp |
| index 0031b06b55015bb8b82f14e47a4c343b5ac9c455..438ee01d576b85673e99404ff77619acd105903e 100644 |
| --- a/Source/core/frame/FrameView.cpp |
| +++ b/Source/core/frame/FrameView.cpp |
| @@ -29,6 +29,7 @@ |
| #include "core/HTMLNames.h" |
| #include "core/MediaTypeNames.h" |
| +#include "core/compositing/DisplayListCompositingBuilder.h" |
| #include "core/css/FontFaceSet.h" |
| #include "core/css/resolver/StyleResolver.h" |
| #include "core/dom/AXObjectCache.h" |
| @@ -92,6 +93,7 @@ |
| #include "platform/graphics/GraphicsContext.h" |
| #include "platform/graphics/GraphicsLayer.h" |
| #include "platform/graphics/GraphicsLayerDebugInfo.h" |
| +#include "platform/graphics/paint/DisplayItemList.h" |
| #include "platform/scroll/ScrollAnimator.h" |
| #include "platform/text/TextStream.h" |
| #include "wtf/CurrentTime.h" |
| @@ -2439,15 +2441,23 @@ void FrameView::updateAllLifecyclePhases() |
| frame().localFrameRoot()->view()->updateAllLifecyclePhasesInternal(); |
| } |
| -// TODO(chrishtr): add a scrolling update lifecycle phase, after compositing and before invalidation. |
| +// TODO(chrishtr): add a scrolling update lifecycle phase. |
| void FrameView::updateLifecycleToCompositingCleanPlusScrolling() |
| { |
| frame().localFrameRoot()->view()->updateStyleAndLayoutIfNeededRecursive(); |
| LayoutView* view = layoutView(); |
| - if (view) |
| + if (view) { |
| + // For SlimmingPaintV2, we still need this to set up the root layer(s). |
| view->compositor()->updateIfNeededRecursive(); |
|
chrishtr
2015/08/13 21:33:16
Change comment to say that this is just needed in
pdr.
2015/08/14 00:10:29
Done
|
| + } |
| + |
| scrollContentsIfNeededRecursive(); |
| + if (view && RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| + paintForSlimmingPaintV2(); |
| + compositeForSlimmingPaintV2(); |
| + } |
| + |
| ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean); |
| } |
| @@ -2465,15 +2475,67 @@ void FrameView::updateAllLifecyclePhasesInternal() |
| if (view) { |
| TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", InspectorUpdateLayerTreeEvent::data(m_frame.get())); |
| + // For SlimmingPaintV2, we still need this to set up the root layer(s). |
|
chrishtr
2015/08/13 21:33:16
Fix comment like above.
pdr.
2015/08/14 00:10:29
Done
|
| view->compositor()->updateIfNeededRecursive(); |
| scrollContentsIfNeededRecursive(); |
| invalidateTreeIfNeededRecursive(); |
| + if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| + paintForSlimmingPaintV2(); |
| + compositeForSlimmingPaintV2(); |
| + } |
| updatePostLifecycleData(); |
| ASSERT(!view->hasPendingSelection()); |
| } |
| - ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean); |
| + ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean |
| + || (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && lifecycle().state() == DocumentLifecycle::CompositingForSlimmingPaintV2Clean)); |
| +} |
| + |
| +void FrameView::paintForSlimmingPaintV2() |
| +{ |
| + ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
| + ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalFrame())); |
| + |
| + LayoutView* view = layoutView(); |
| + ASSERT(view); |
| + GraphicsLayer* rootGraphicsLayer = view->layer()->graphicsLayerBacking(); |
| + |
| + // Detached frames can have no root graphics layer. |
| + if (!rootGraphicsLayer) |
| + return; |
| + |
| + lifecycle().advanceTo(DocumentLifecycle::InPaintForSlimmingPaintV2); |
| + |
| + // TODO: Update callers to pass in the interest rect. |
|
chrishtr
2015/08/13 21:33:16
TODO(pdr)
pdr.
2015/08/14 00:10:29
Done
|
| + IntRect interestRect = LayoutRect::infiniteIntRect(); |
| + GraphicsContext context(rootGraphicsLayer->displayItemList()); |
| + rootGraphicsLayer->paint(context, interestRect); |
| + |
| + lifecycle().advanceTo(DocumentLifecycle::PaintForSlimmingPaintV2Clean); |
| +} |
| + |
| +void FrameView::compositeForSlimmingPaintV2() |
| +{ |
| + ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
| + ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalFrame())); |
| + |
| + GraphicsLayer* rootGraphicsLayer = layoutView()->layer()->graphicsLayerBacking(); |
| + |
| + // Detached frames can have no root graphics layer. |
| + if (!rootGraphicsLayer) |
| + return; |
| + |
| + lifecycle().advanceTo(DocumentLifecycle::InCompositingForSlimmingPaintV2); |
| + |
| + DisplayListDiff displayListDiff; |
| + rootGraphicsLayer->displayItemList()->commitNewDisplayItems(&displayListDiff); |
| + |
| + CompositedDisplayList compositedDisplayList(*rootGraphicsLayer->displayItemList(), displayListDiff, *rootGraphicsLayer); |
| + DisplayListCompositingBuilder compositingBuilder(compositedDisplayList); |
| + compositingBuilder.build(); |
| + |
| + lifecycle().advanceTo(DocumentLifecycle::CompositingForSlimmingPaintV2Clean); |
| } |
| void FrameView::updatePostLifecycleData() |