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

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

Issue 270663003: Remove FrameView::m_doFullRepaint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 7 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 9eee49932edd4e058f125b34ea1196fc5e63875e..cd68405c161fee1c8dd5c682fe05351e6c963bf7 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -220,7 +220,6 @@ void FrameView::reset()
m_contentIsOpaque = false;
m_hasPendingLayout = false;
m_layoutSubtreeRoot = 0;
- m_doFullRepaint = false;
m_layoutSchedulingEnabled = true;
m_inPerformLayout = false;
m_canRepaintDuringPerformLayout = false;
@@ -894,7 +893,6 @@ void FrameView::layout(bool allowSubtree)
return;
}
- bool shouldDoFullLayout = false;
FontCachePurgePreventer fontCachePurgePreventer;
RenderLayer* layer;
{
@@ -920,14 +918,13 @@ void FrameView::layout(bool allowSubtree)
ScrollbarMode vMode;
calculateScrollbarModesForLayoutAndSetViewportRenderer(hMode, vMode);
- shouldDoFullLayout = !inSubtreeLayout && (m_firstLayout || toRenderView(rootForThisLayout)->document().printing());
dsinclair 2014/05/20 17:37:39 What about the document().printing() case? I don't
Xianzhu 2014/05/20 18:32:21 The full repaint logic is moved into RenderView wh
-
if (!inSubtreeLayout) {
// Now set our scrollbar state for the layout.
ScrollbarMode currentHMode = horizontalScrollbarMode();
ScrollbarMode currentVMode = verticalScrollbarMode();
if (m_firstLayout) {
+ renderView()->setShouldDoFullRepaintAfterLayout(true);
setScrollbarsSuppressed(true);
m_firstLayout = false;
@@ -952,25 +949,18 @@ void FrameView::layout(bool allowSubtree)
m_size = LayoutSize(layoutSize().width(), layoutSize().height());
- if (oldSize != m_size) {
- shouldDoFullLayout = true;
- if (!m_firstLayout) {
- RenderBox* rootRenderer = document->documentElement() ? document->documentElement()->renderBox() : 0;
- RenderBox* bodyRenderer = rootRenderer && document->body() ? document->body()->renderBox() : 0;
- if (bodyRenderer && bodyRenderer->stretchesToViewport())
- bodyRenderer->setChildNeedsLayout();
- else if (rootRenderer && rootRenderer->stretchesToViewport())
- rootRenderer->setChildNeedsLayout();
- }
+ if (oldSize != m_size && !m_firstLayout) {
+ RenderBox* rootRenderer = document->documentElement() ? document->documentElement()->renderBox() : 0;
+ RenderBox* bodyRenderer = rootRenderer && document->body() ? document->body()->renderBox() : 0;
+ if (bodyRenderer && bodyRenderer->stretchesToViewport())
+ bodyRenderer->setChildNeedsLayout();
+ else if (rootRenderer && rootRenderer->stretchesToViewport())
+ rootRenderer->setChildNeedsLayout();
}
}
layer = rootForThisLayout->enclosingLayer();
- // We need to set m_doFullRepaint before triggering layout as RenderObject::checkForRepaint
- // checks the boolean to disable local repaints.
- m_doFullRepaint |= shouldDoFullLayout;
-
performLayout(rootForThisLayout, inSubtreeLayout);
m_layoutSubtreeRoot = 0;
@@ -979,7 +969,7 @@ void FrameView::layout(bool allowSubtree)
if (!inSubtreeLayout && !toRenderView(rootForThisLayout)->document().printing())
adjustViewSize();
- layer->updateLayerPositionsAfterLayout(renderView()->layer(), updateLayerPositionFlags(layer, inSubtreeLayout, m_doFullRepaint));
+ layer->updateLayerPositionsAfterLayout(renderView()->layer(), updateLayerPositionFlags(layer, inSubtreeLayout, renderView()->shouldDoFullRepaintAfterLayout()));
renderView()->compositor()->setNeedsCompositingUpdate(CompositingUpdateAfterLayout);
m_layoutCount++;
@@ -1008,15 +998,13 @@ void FrameView::layout(bool allowSubtree)
if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) {
repaintTree(rootForThisLayout);
- } else if (m_doFullRepaint) {
+ } else if (renderView()->shouldDoFullRepaintAfterLayout()) {
// FIXME: This isn't really right, since the RenderView doesn't fully encompass
// the visibleContentRect(). It just happens to work out most of the time,
// since first layouts and printing don't have you scrolled anywhere.
renderView()->repaint();
}
- m_doFullRepaint = false;
-
#ifndef NDEBUG
// Post-layout assert that nobody was re-marked as needing layout during layout.
document->renderer()->assertSubtreeIsLaidOut();

Powered by Google App Engine
This is Rietveld 408576698