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

Unified Diff: Source/core/rendering/RenderView.cpp

Issue 335963002: Change LayoutState to be stack-allocated (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix assert Created 6 years, 6 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/rendering/RenderView.cpp
diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp
index 766ec5282298f141e7ac050277e6ab11ef6ad78d..7015c1ef43507f3b1f272f85dad34df1d075bfda 100644
--- a/Source/core/rendering/RenderView.cpp
+++ b/Source/core/rendering/RenderView.cpp
@@ -57,7 +57,6 @@ RenderView::RenderView(Document* document)
, m_pageLogicalHeight(0)
, m_pageLogicalHeightChanged(false)
, m_layoutState(0)
- , m_layoutStateDisableCount(0)
, m_renderQuoteHead(0)
, m_renderCounterCount(0)
{
@@ -183,7 +182,6 @@ void RenderView::checkLayoutState()
if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) {
ASSERT(layoutDeltaMatches(LayoutSize()));
}
- ASSERT(!m_layoutStateDisableCount);
ASSERT(!m_layoutState->next());
}
#endif
@@ -252,7 +250,7 @@ void RenderView::layout()
if (!needsLayout())
return;
- RootLayoutStateScope rootLayoutStateScope(*this);
+ LayoutState rootLayoutState(pageLogicalHeight(), pageLogicalHeightChanged(), *this);
m_pageLogicalHeightChanged = false;
@@ -458,6 +456,7 @@ void RenderView::invalidateTreeAfterLayout(const RenderLayerModelObject& paintIn
if (doingFullRepaint() && !viewRect().isEmpty())
repaintViewRectangle(viewRect());
+ LayoutState rootLayoutState(0, false, *this);
RenderBlock::invalidateTreeAfterLayout(paintInvalidationContainer);
}
@@ -907,26 +906,6 @@ float RenderView::zoomFactor() const
return m_frameView->frame().pageZoomFactor();
}
-void RenderView::pushLayoutState(RenderObject& root)
-{
- ASSERT(m_layoutStateDisableCount == 0);
- ASSERT(m_layoutState == 0);
-
- pushLayoutStateForCurrentFlowThread(root);
- m_layoutState = new LayoutState(root);
-}
-
-bool RenderView::shouldDisableLayoutStateForSubtree(RenderObject& renderer) const
-{
- RenderObject* o = &renderer;
- while (o) {
- if (o->shouldDisableLayoutState())
- return true;
- o = o->container();
- }
- return false;
-}
-
void RenderView::updateHitTestResult(HitTestResult& result, const LayoutPoint& point)
{
if (result.innerNode())
@@ -972,8 +951,9 @@ FlowThreadController* RenderView::flowThreadController()
return m_flowThreadController.get();
}
-void RenderView::pushLayoutStateForCurrentFlowThread(const RenderObject& object)
+void RenderView::pushLayoutState(LayoutState& layoutState)
{
+ m_layoutState = &layoutState;
esprehn 2014/06/13 23:25:26 Can we unify the pushLayoutState and setLayoutStat
leviw_travelin_and_unemployed 2014/06/13 23:46:16 This is actually leftover from where I broke multi
if (!m_flowThreadController)
return;
@@ -981,11 +961,13 @@ void RenderView::pushLayoutStateForCurrentFlowThread(const RenderObject& object)
if (!currentFlowThread)
return;
- currentFlowThread->pushFlowThreadLayoutState(object);
+ currentFlowThread->pushFlowThreadLayoutState(layoutState.renderer());
}
-void RenderView::popLayoutStateForCurrentFlowThread()
+void RenderView::popLayoutState()
{
+ ASSERT(m_layoutState);
+ m_layoutState = m_layoutState->next();
if (!m_flowThreadController)
return;

Powered by Google App Engine
This is Rietveld 408576698