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

Side by Side Diff: Source/core/rendering/RenderLayerRepainter.cpp

Issue 202433003: Fix NeedsFullRepaintForPositionedMovementLayout (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added some more rebaseline 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderLayerRepainter.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 ASSERT(view); 67 ASSERT(view);
68 // FIXME: LayoutState does not work with RenderLayers as there is not a 1-to-1 68 // FIXME: LayoutState does not work with RenderLayers as there is not a 1-to-1
69 // mapping between them and the RenderObjects. It would be neat to enabl e 69 // mapping between them and the RenderObjects. It would be neat to enabl e
70 // LayoutState outside the layout() phase and use it here. 70 // LayoutState outside the layout() phase and use it here.
71 ASSERT(!view->layoutStateEnabled()); 71 ASSERT(!view->layoutStateEnabled());
72 72
73 RenderLayerModelObject* repaintContainer = m_renderer->containerForRepai nt(); 73 RenderLayerModelObject* repaintContainer = m_renderer->containerForRepai nt();
74 LayoutRect oldRepaintRect = m_repaintRect; 74 LayoutRect oldRepaintRect = m_repaintRect;
75 LayoutRect oldOutlineBox = m_outlineBox; 75 LayoutRect oldOutlineBox = m_outlineBox;
76 computeRepaintRects(repaintContainer, geometryMap); 76 computeRepaintRects(repaintContainer, geometryMap);
77 shouldCheckForRepaint &= shouldRepaintLayer();
77 78
78 // FIXME: Should ASSERT that value calculated for m_outlineBox using the cached offset is the same 79 // FIXME: Should ASSERT that value calculated for m_outlineBox using the cached offset is the same
79 // as the value not using the cached offset, but we can't due to https:/ /bugs.webkit.org/show_bug.cgi?id=37048 80 // as the value not using the cached offset, but we can't due to https:/ /bugs.webkit.org/show_bug.cgi?id=37048
80 if (shouldCheckForRepaint) { 81 if (shouldCheckForRepaint) {
81 if (view && !view->document().printing()) { 82 if (view && !view->document().printing()) {
82 if (m_repaintStatus & NeedsFullRepaint) { 83 if (m_repaintStatus & NeedsFullRepaint) {
83 m_renderer->repaintUsingContainer(repaintContainer, pixelSna ppedIntRect(oldRepaintRect)); 84 m_renderer->repaintUsingContainer(repaintContainer, pixelSna ppedIntRect(oldRepaintRect));
84 if (m_repaintRect != oldRepaintRect) 85 if (m_repaintRect != oldRepaintRect)
85 m_renderer->repaintUsingContainer(repaintContainer, pixe lSnappedIntRect(m_repaintRect)); 86 m_renderer->repaintUsingContainer(repaintContainer, pixe lSnappedIntRect(m_repaintRect));
86 } else if (shouldRepaintAfterLayout()) { 87 } else {
87 m_renderer->repaintAfterLayoutIfNeeded(repaintContainer, m_r enderer->selfNeedsLayout(), oldRepaintRect, oldOutlineBox, &m_repaintRect, &m_ou tlineBox); 88 m_renderer->repaintAfterLayoutIfNeeded(repaintContainer, m_r enderer->selfNeedsLayout(), oldRepaintRect, oldOutlineBox, &m_repaintRect, &m_ou tlineBox);
88 } 89 }
89 } 90 }
90 } 91 }
91 } else { 92 } else {
92 clearRepaintRects(); 93 clearRepaintRects();
93 } 94 }
94 95
95 m_repaintStatus = NeedsNormalRepaint; 96 m_repaintStatus = NeedsNormalRepaint;
96 97
(...skipping 17 matching lines...) Expand all
114 { 115 {
115 // FIXME: computeRepaintRects() has to walk up the parent chain for every la yer to compute the rects. 116 // FIXME: computeRepaintRects() has to walk up the parent chain for every la yer to compute the rects.
116 // We should make this more efficient. 117 // We should make this more efficient.
117 // FIXME: it's wrong to call this when layout is not up-to-date, which we do . 118 // FIXME: it's wrong to call this when layout is not up-to-date, which we do .
118 computeRepaintRects(m_renderer->containerForRepaint()); 119 computeRepaintRects(m_renderer->containerForRepaint());
119 120
120 for (RenderLayer* layer = m_renderer->layer()->firstChild(); layer; layer = layer->nextSibling()) 121 for (RenderLayer* layer = m_renderer->layer()->firstChild(); layer; layer = layer->nextSibling())
121 layer->repainter().computeRepaintRectsIncludingDescendants(); 122 layer->repainter().computeRepaintRectsIncludingDescendants();
122 } 123 }
123 124
124 inline bool RenderLayerRepainter::shouldRepaintAfterLayout() const 125 inline bool RenderLayerRepainter::shouldRepaintLayer() const
125 { 126 {
126 if (m_repaintStatus == NeedsNormalRepaint) 127 if (m_repaintStatus != NeedsFullRepaintForPositionedMovementLayout)
127 return true; 128 return true;
128 129
129 // Composited layers that were moved during a positioned movement only 130 // Composited layers that were moved during a positioned movement only
130 // layout, don't need to be repainted. They just need to be recomposited. 131 // layout, don't need to be repainted. They just need to be recomposited.
131 ASSERT(m_repaintStatus == NeedsFullRepaintForPositionedMovementLayout);
132 return m_renderer->compositingState() != PaintsIntoOwnBacking; 132 return m_renderer->compositingState() != PaintsIntoOwnBacking;
133 } 133 }
134 134
135 // Since we're only painting non-composited layers, we know that they all share the same repaintContainer. 135 // Since we're only painting non-composited layers, we know that they all share the same repaintContainer.
136 void RenderLayerRepainter::repaintIncludingNonCompositingDescendants(RenderLayer ModelObject* repaintContainer) 136 void RenderLayerRepainter::repaintIncludingNonCompositingDescendants(RenderLayer ModelObject* repaintContainer)
137 { 137 {
138 m_renderer->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(m_re nderer->clippedOverflowRectForRepaint(repaintContainer))); 138 m_renderer->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(m_re nderer->clippedOverflowRectForRepaint(repaintContainer)));
139 139
140 for (RenderLayer* curr = m_renderer->layer()->firstChild(); curr; curr = cur r->nextSibling()) { 140 for (RenderLayer* curr = m_renderer->layer()->firstChild(); curr; curr = cur r->nextSibling()) {
141 if (!curr->hasCompositedLayerMapping()) 141 if (!curr->hasCompositedLayerMapping())
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 RenderLayer* RenderLayerRepainter::enclosingFilterRepaintLayer() const 254 RenderLayer* RenderLayerRepainter::enclosingFilterRepaintLayer() const
255 { 255 {
256 for (const RenderLayer* curr = m_renderer->layer(); curr; curr = curr->paren t()) { 256 for (const RenderLayer* curr = m_renderer->layer(); curr; curr = curr->paren t()) {
257 if ((curr != m_renderer->layer() && curr->requiresFullLayerImageForFilte rs()) || curr->compositingState() == PaintsIntoOwnBacking || curr->isRootLayer() ) 257 if ((curr != m_renderer->layer() && curr->requiresFullLayerImageForFilte rs()) || curr->compositingState() == PaintsIntoOwnBacking || curr->isRootLayer() )
258 return const_cast<RenderLayer*>(curr); 258 return const_cast<RenderLayer*>(curr);
259 } 259 }
260 return 0; 260 return 0;
261 } 261 }
262 262
263 } // Namespace WebCore 263 } // Namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayerRepainter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698