Remove compositing states from DocumentLifeCycle.
We not longer have compositing, so these states are gone.
This was causing asserts to hit because we'd go from
PaintInvalidationClean to InPaintInvalidation, which is
now a valid transition if a new frame is pumped without
style or layout being dirtied.
Unfortunately, we can't test this until we fix test_sky
to actually pump fake frames.
R=esprehn@chromium.org
Review URL: https://codereview.chromium.org/755843003
diff --git a/sky/engine/core/animation/DocumentAnimations.cpp b/sky/engine/core/animation/DocumentAnimations.cpp
index ab8a32e..a3699a1 100644
--- a/sky/engine/core/animation/DocumentAnimations.cpp
+++ b/sky/engine/core/animation/DocumentAnimations.cpp
@@ -86,7 +86,7 @@
// FIXME: Rename to updateCompositorAnimations
void DocumentAnimations::startPendingAnimations(Document& document)
{
- ASSERT(document.lifecycle().state() == DocumentLifecycle::CompositingClean);
+ ASSERT(document.lifecycle().state() == DocumentLifecycle::PaintInvalidationClean);
if (document.compositorPendingAnimations().update()) {
ASSERT(document.view());
document.view()->scheduleAnimation();
diff --git a/sky/engine/core/dom/DocumentLifecycle.cpp b/sky/engine/core/dom/DocumentLifecycle.cpp
index 77763d2..484d82c 100644
--- a/sky/engine/core/dom/DocumentLifecycle.cpp
+++ b/sky/engine/core/dom/DocumentLifecycle.cpp
@@ -127,15 +127,6 @@
return true;
return false;
}
- if (m_state == CompositingClean) {
- if (state == InStyleRecalc)
- return true;
- if (state == InCompositingUpdate)
- return true;
- if (state == InPaintInvalidation)
- return true;
- return false;
- }
if (m_state == InPaintInvalidation) {
if (state == PaintInvalidationClean)
return true;
@@ -146,7 +137,7 @@
return true;
if (state == InPreLayout)
return true;
- if (state == InCompositingUpdate)
+ if (state == InPaintInvalidation)
return true;
return false;
}
@@ -158,7 +149,7 @@
// This transition is bogus, but we've whitelisted it anyway.
if (s_deprecatedTransitionStack && m_state == s_deprecatedTransitionStack->from() && state == s_deprecatedTransitionStack->to())
return true;
- return m_state == StyleClean || m_state == AfterPerformLayout || m_state == LayoutClean || m_state == CompositingClean || m_state == PaintInvalidationClean;
+ return m_state == StyleClean || m_state == AfterPerformLayout || m_state == LayoutClean || m_state == PaintInvalidationClean;
}
#endif
diff --git a/sky/engine/core/dom/DocumentLifecycle.h b/sky/engine/core/dom/DocumentLifecycle.h
index 2ef2c21..bee63b0 100644
--- a/sky/engine/core/dom/DocumentLifecycle.h
+++ b/sky/engine/core/dom/DocumentLifecycle.h
@@ -55,9 +55,6 @@
AfterPerformLayout,
LayoutClean,
- InCompositingUpdate,
- CompositingClean,
-
InPaintInvalidation,
PaintInvalidationClean,
@@ -146,11 +143,7 @@
inline bool DocumentLifecycle::stateAllowsTreeMutations() const
{
- // FIXME: We should not allow mutations in InPreLayout or AfterPerformLayout either,
- // but we need to fix MediaList listeners and plugins first.
- return m_state != InStyleRecalc
- && m_state != InPerformLayout
- && m_state != InCompositingUpdate;
+ return m_state != InStyleRecalc && m_state != InPerformLayout;
}
inline bool DocumentLifecycle::stateAllowsRenderTreeMutations() const
@@ -165,7 +158,6 @@
|| m_state == StyleClean
|| m_state == InPreLayout
|| m_state == LayoutClean
- || m_state == CompositingClean
|| m_state == PaintInvalidationClean
|| m_state == Stopping;
}
diff --git a/sky/engine/core/frame/FrameView.cpp b/sky/engine/core/frame/FrameView.cpp
index ea35547..0737f1d 100644
--- a/sky/engine/core/frame/FrameView.cpp
+++ b/sky/engine/core/frame/FrameView.cpp
@@ -409,6 +409,8 @@
void FrameView::invalidateTreeIfNeeded()
{
+ lifecycle().advanceTo(DocumentLifecycle::InPaintInvalidation);
+
ASSERT(renderView());
RenderView& rootForPaintInvalidation = *renderView();
ASSERT(!rootForPaintInvalidation.needsLayout());
@@ -426,6 +428,8 @@
if (m_frame->selection().isCaretBoundsDirty())
m_frame->selection().invalidateCaretRect();
+
+ lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean);
}
DocumentLifecycle& FrameView::lifecycle() const
@@ -798,7 +802,7 @@
}
RELEASE_ASSERT(!needsLayout());
- ASSERT(document->lifecycle().state() >= DocumentLifecycle::CompositingClean);
+ ASSERT(document->lifecycle().state() >= DocumentLifecycle::PaintInvalidationClean);
TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Paint", "data", InspectorPaintEvent::data(renderView, rect));
TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", TRACE_EVENT_SCOPE_PROCESS, "stack", InspectorCallStackEvent::currentCallStack());
@@ -872,7 +876,7 @@
if (RenderView* view = renderView()) {
TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "InvalidateTreeAndUpdateIframes", TRACE_EVENT_SCOPE_PROCESS, "frame", m_frame.get());
- invalidateTreeIfNeededRecursive();
+ invalidateTreeIfNeeded();
view->updateIFramesAfterLayout();
}
@@ -904,14 +908,6 @@
}
-void FrameView::invalidateTreeIfNeededRecursive()
-{
- // FIXME: We should be more aggressive at cutting tree traversals.
- lifecycle().advanceTo(DocumentLifecycle::InPaintInvalidation);
- invalidateTreeIfNeeded();
- lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean);
-}
-
void FrameView::forceLayout(bool allowSubtree)
{
layout(allowSubtree);
diff --git a/sky/engine/core/frame/FrameView.h b/sky/engine/core/frame/FrameView.h
index c92936c..1750bc0 100644
--- a/sky/engine/core/frame/FrameView.h
+++ b/sky/engine/core/frame/FrameView.h
@@ -151,8 +151,6 @@
void updateLayoutAndStyleForPainting();
void updateLayoutAndStyleIfNeededRecursive();
- void invalidateTreeIfNeededRecursive();
-
void forceLayout(bool allowSubtree = false);
// Methods to convert points and rects between the coordinate space of the renderer, and this view.