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

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

Issue 59063003: Don't coerce pointers to compositor layer mappings to booleans. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaaaase Created 7 years, 1 month 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
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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 ASSERT(m_repaintStatus == NeedsFullRepaintForPositionedMovementLayout); 128 ASSERT(m_repaintStatus == NeedsFullRepaintForPositionedMovementLayout);
129 return m_renderer->compositingState() != PaintsIntoOwnBacking; 129 return m_renderer->compositingState() != PaintsIntoOwnBacking;
130 } 130 }
131 131
132 // Since we're only painting non-composited layers, we know that they all share the same repaintContainer. 132 // Since we're only painting non-composited layers, we know that they all share the same repaintContainer.
133 void RenderLayerRepainter::repaintIncludingNonCompositingDescendants(RenderLayer ModelObject* repaintContainer) 133 void RenderLayerRepainter::repaintIncludingNonCompositingDescendants(RenderLayer ModelObject* repaintContainer)
134 { 134 {
135 m_renderer->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(m_re nderer->clippedOverflowRectForRepaint(repaintContainer))); 135 m_renderer->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(m_re nderer->clippedOverflowRectForRepaint(repaintContainer)));
136 136
137 for (RenderLayer* curr = m_renderer->layer()->firstChild(); curr; curr = cur r->nextSibling()) { 137 for (RenderLayer* curr = m_renderer->layer()->firstChild(); curr; curr = cur r->nextSibling()) {
138 if (!curr->compositedLayerMapping()) 138 if (curr->compositingState() != PaintsIntoOwnBacking)
139 curr->repainter().repaintIncludingNonCompositingDescendants(repaintC ontainer); 139 curr->repainter().repaintIncludingNonCompositingDescendants(repaintC ontainer);
140 } 140 }
141 } 141 }
142 142
143 LayoutRect RenderLayerRepainter::repaintRectIncludingNonCompositingDescendants() const 143 LayoutRect RenderLayerRepainter::repaintRectIncludingNonCompositingDescendants() const
144 { 144 {
145 LayoutRect repaintRect = m_repaintRect; 145 LayoutRect repaintRect = m_repaintRect;
146 for (RenderLayer* child = m_renderer->layer()->firstChild(); child; child = child->nextSibling()) { 146 for (RenderLayer* child = m_renderer->layer()->firstChild(); child; child = child->nextSibling()) {
147 // Don't include repaint rects for composited child layers; they will pa int themselves and have a different origin. 147 // Don't include repaint rects for composited child layers; they will pa int themselves and have a different origin.
148 if (child->compositedLayerMapping()) 148 if (child->compositingState() == PaintsIntoOwnBacking)
149 continue; 149 continue;
150 150
151 repaintRect.unite(child->repainter().repaintRectIncludingNonCompositingD escendants()); 151 repaintRect.unite(child->repainter().repaintRectIncludingNonCompositingD escendants());
152 } 152 }
153 return repaintRect; 153 return repaintRect;
154 } 154 }
155 155
156 void RenderLayerRepainter::setBackingNeedsRepaint() 156 void RenderLayerRepainter::setBackingNeedsRepaint()
157 { 157 {
158 ASSERT(m_renderer->compositedLayerMapping()); 158 ASSERT(m_renderer->compositedLayerMapping());
159 m_renderer->compositedLayerMapping()->setContentsNeedDisplay(); 159 m_renderer->compositedLayerMapping()->setContentsNeedDisplay();
160 } 160 }
161 161
162 void RenderLayerRepainter::setBackingNeedsRepaintInRect(const LayoutRect& r) 162 void RenderLayerRepainter::setBackingNeedsRepaintInRect(const LayoutRect& r)
163 { 163 {
164 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here, 164 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here,
165 // so assert but check that the layer is composited. 165 // so assert but check that the layer is composited.
166 ASSERT(m_renderer->compositedLayerMapping()); 166 ASSERT(m_renderer->compositedLayerMapping());
167 if (!m_renderer->compositedLayerMapping()) { 167 if (m_renderer->compositingState() != PaintsIntoOwnBacking) {
168 // If we're trying to repaint the placeholder document layer, propagate the 168 // If we're trying to repaint the placeholder document layer, propagate the
169 // repaint to the native view system. 169 // repaint to the native view system.
170 LayoutRect absRect(r); 170 LayoutRect absRect(r);
171 LayoutPoint delta; 171 LayoutPoint delta;
172 m_renderer->layer()->convertToLayerCoords(m_renderer->layer()->root(), d elta); 172 m_renderer->layer()->convertToLayerCoords(m_renderer->layer()->root(), d elta);
173 absRect.moveBy(delta); 173 absRect.moveBy(delta);
174 174
175 RenderView* view = m_renderer->view(); 175 RenderView* view = m_renderer->view();
176 if (view) 176 if (view)
177 view->repaintViewRectangle(absRect); 177 view->repaintViewRectangle(absRect);
(...skipping 27 matching lines...) Expand all
205 // shader can address any ouput pixel. 205 // shader can address any ouput pixel.
206 // Note: This is only for output rect, so there's no need to expand the dirty source rect. 206 // Note: This is only for output rect, so there's no need to expand the dirty source rect.
207 rectForRepaint.unite(m_renderer->layer()->calculateLayerBounds(m_rendere r->layer())); 207 rectForRepaint.unite(m_renderer->layer()->calculateLayerBounds(m_rendere r->layer()));
208 } 208 }
209 209
210 RenderLayer* parentLayer = enclosingFilterRepaintLayer(); 210 RenderLayer* parentLayer = enclosingFilterRepaintLayer();
211 ASSERT(parentLayer); 211 ASSERT(parentLayer);
212 FloatQuad repaintQuad(rectForRepaint); 212 FloatQuad repaintQuad(rectForRepaint);
213 LayoutRect parentLayerRect = m_renderer->localToContainerQuad(repaintQuad, p arentLayer->renderer()).enclosingBoundingBox(); 213 LayoutRect parentLayerRect = m_renderer->localToContainerQuad(repaintQuad, p arentLayer->renderer()).enclosingBoundingBox();
214 214
215 if (parentLayer->compositedLayerMapping()) { 215 if (parentLayer->compositingState() == PaintsIntoOwnBacking) {
216 parentLayer->repainter().setBackingNeedsRepaintInRect(parentLayerRect); 216 parentLayer->repainter().setBackingNeedsRepaintInRect(parentLayerRect);
217 return; 217 return;
218 } 218 }
219 219
220 if (parentLayer->paintsWithFilters()) { 220 if (parentLayer->paintsWithFilters()) {
221 parentLayer->repainter().setFilterBackendNeedsRepaintingInRect(parentLay erRect); 221 parentLayer->repainter().setFilterBackendNeedsRepaintingInRect(parentLay erRect);
222 return; 222 return;
223 } 223 }
224 224
225 if (parentLayer->isRootLayer()) { 225 if (parentLayer->isRootLayer()) {
226 RenderView* view = toRenderView(parentLayer->renderer()); 226 RenderView* view = toRenderView(parentLayer->renderer());
227 view->repaintViewRectangle(parentLayerRect); 227 view->repaintViewRectangle(parentLayerRect);
228 return; 228 return;
229 } 229 }
230 230
231 ASSERT_NOT_REACHED(); 231 ASSERT_NOT_REACHED();
232 } 232 }
233 233
234 RenderLayer* RenderLayerRepainter::enclosingFilterRepaintLayer() const 234 RenderLayer* RenderLayerRepainter::enclosingFilterRepaintLayer() const
235 { 235 {
236 for (const RenderLayer* curr = m_renderer->layer(); curr; curr = curr->paren t()) { 236 for (const RenderLayer* curr = m_renderer->layer(); curr; curr = curr->paren t()) {
237 if ((curr != m_renderer->layer() && curr->requiresFullLayerImageForFilte rs()) || curr->compositingState() == PaintsIntoOwnBacking || curr->isRootLayer() ) 237 if ((curr != m_renderer->layer() && curr->requiresFullLayerImageForFilte rs()) || curr->compositingState() == PaintsIntoOwnBacking || curr->isRootLayer() )
238 return const_cast<RenderLayer*>(curr); 238 return const_cast<RenderLayer*>(curr);
239 } 239 }
240 return 0; 240 return 0;
241 } 241 }
242 242
243 } // Namespace WebCore 243 } // Namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698