Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(757)

Unified Diff: Source/core/frame/FrameView.cpp

Issue 1238123004: Slimming Paint phase 2 compositing algorithm plumbing & skeleton display list API. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index 502b7651f7e56a73e9f769bb0d15f57d2c667cfd..1d47f0a08048c2108107b766005b72df1e4b6cc1 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"
@@ -2458,9 +2459,16 @@ void FrameView::updateLifecycleToCompositingCleanPlusScrolling()
{
frame().localFrameRoot()->view()->updateStyleAndLayoutIfNeededRecursive();
LayoutView* view = layoutView();
- if (view)
+ if (view) {
+ // If SlimmingPaintCompositorLayerizationEnabled is on, we still need this to set up the root layer(s).
view->compositor()->updateIfNeededRecursive();
- scrollContentsIfNeededRecursive();
+
+ if (RuntimeEnabledFeatures::slimmingPaintCompositorLayerizationEnabled()) {
+ invalidateTreeIfNeededRecursive();
+ paintAndComposite();
+ }
+ scrollContentsIfNeededRecursive();
+ }
ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean);
}
@@ -2478,16 +2486,45 @@ void FrameView::updateAllLifecyclePhasesInternal()
LayoutView* view = layoutView();
if (view) {
TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", InspectorUpdateLayerTreeEvent::data(m_frame.get()));
-
+ // If SlimmingPaintCompositorLayerizationEnabled is on, we still need this to set up the root layer(s).
view->compositor()->updateIfNeededRecursive();
+
+ if (RuntimeEnabledFeatures::slimmingPaintCompositorLayerizationEnabled()) {
+ invalidateTreeIfNeededRecursive();
+ paintAndComposite();
+ }
scrollContentsIfNeededRecursive();
- invalidateTreeIfNeededRecursive();
updatePostLifecycleData();
ASSERT(!view->hasPendingSelection());
}
- ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean);
+ ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean
+ || (RuntimeEnabledFeatures::slimmingPaintCompositorLayerizationEnabled() && lifecycle().state() == DocumentLifecycle::CompositingClean));
+}
+
+void FrameView::paintAndComposite()
+{
+ 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;
+
+ GraphicsContext context(rootGraphicsLayer->displayItemList());
+ rootGraphicsLayer->paint(context);
+
+ DisplayListDiff displayListDiff;
+ rootGraphicsLayer->displayItemList()->commitNewDisplayItems(&displayListDiff);
+
+ lifecycle().advanceTo(DocumentLifecycle::InCompositingUpdate);
+
+ DisplayListCompositingBuilder compositingBuilder(*rootGraphicsLayer->displayItemList(), displayListDiff, *rootGraphicsLayer);
+ compositingBuilder.build();
+
+ lifecycle().advanceTo(DocumentLifecycle::CompositingClean);
}
void FrameView::updatePostLifecycleData()

Powered by Google App Engine
This is Rietveld 408576698