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

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

Issue 204813002: Optimize layout/repaint on FrameView resize (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Is it better to let layout fully control what to repaint? Created 6 years, 9 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.h
diff --git a/Source/core/rendering/RenderView.h b/Source/core/rendering/RenderView.h
index a3b2e9dce17c16b03dc51b3f84d22b126735dcfa..118cc95f98a0448a165749a31dcc390580a22b94 100644
--- a/Source/core/rendering/RenderView.h
+++ b/Source/core/rendering/RenderView.h
@@ -133,8 +133,6 @@ public:
}
#endif
- bool doingFullRepaint() const { return m_frameView->needsFullRepaint(); }
-
// Subtree push
void pushLayoutState(RenderObject&);
@@ -218,18 +216,10 @@ private:
bool rootFillsViewportBackground(RenderBox* rootBox) const;
// These functions may only be accessed by LayoutStateMaintainer.
- bool pushLayoutState(RenderBox& renderer, const LayoutSize& offset, LayoutUnit pageHeight = 0, bool pageHeightChanged = false, ColumnInfo* colInfo = 0)
+ void pushLayoutState(RenderBox& renderer, const LayoutSize& offset, LayoutUnit pageHeight = 0, bool pageHeightChanged = false, ColumnInfo* colInfo = 0)
{
- // We push LayoutState even if layoutState is disabled because it stores layoutDelta too.
- if (!doingFullRepaint() || m_layoutState->isPaginated() || renderer.hasColumns() || renderer.flowThreadContainingBlock()
- || (renderer.isRenderBlock() && toRenderBlock(renderer).shapeInsideInfo())
- || (m_layoutState->shapeInsideInfo() && renderer.isRenderBlock() && !toRenderBlock(renderer).allowsShapeInsideInfoSharing(&m_layoutState->shapeInsideInfo()->owner()))
- ) {
- pushLayoutStateForCurrentFlowThread(renderer);
- m_layoutState = new LayoutState(m_layoutState, renderer, offset, pageHeight, pageHeightChanged, colInfo);
- return true;
- }
- return false;
+ pushLayoutStateForCurrentFlowThread(renderer);
+ m_layoutState = new LayoutState(m_layoutState, renderer, offset, pageHeight, pageHeightChanged, colInfo);
}
void layoutContent(const LayoutState&);
@@ -283,7 +273,6 @@ public:
, m_disabled(root.shouldDisableLayoutState())
, m_didStart(false)
, m_didEnd(false)
- , m_didCreateLayoutState(false)
{
push(root, offset, pageHeight, pageHeightChanged, colInfo);
}
@@ -294,7 +283,6 @@ public:
, m_disabled(false)
, m_didStart(false)
, m_didEnd(false)
- , m_didCreateLayoutState(false)
{
}
@@ -307,8 +295,8 @@ public:
{
ASSERT(!m_didStart);
// We push state even if disabled, because we still need to store layoutDelta
- m_didCreateLayoutState = m_view.pushLayoutState(root, offset, pageHeight, pageHeightChanged, colInfo);
- if (m_disabled && m_didCreateLayoutState)
+ m_view.pushLayoutState(root, offset, pageHeight, pageHeightChanged, colInfo);
+ if (m_disabled)
m_view.disableLayoutState();
m_didStart = true;
}
@@ -317,11 +305,9 @@ public:
{
if (m_didStart) {
ASSERT(!m_didEnd);
- if (m_didCreateLayoutState) {
- m_view.popLayoutState();
- if (m_disabled)
- m_view.enableLayoutState();
- }
+ m_view.popLayoutState();
+ if (m_disabled)
+ m_view.enableLayoutState();
m_didEnd = true;
}
@@ -334,7 +320,6 @@ private:
bool m_disabled : 1; // true if the offset and clip part of layoutState is disabled
bool m_didStart : 1; // true if we did a push or disable
bool m_didEnd : 1; // true if we popped or re-enabled
- bool m_didCreateLayoutState : 1; // true if we actually made a layout state.
};
class LayoutStateDisabler {

Powered by Google App Engine
This is Rietveld 408576698