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

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

Issue 270903002: Add defensive code for now to RenderLayerRepainter to prevent squashing crashes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 return; 196 return;
197 197
198 RenderView* view = m_renderer.view(); 198 RenderView* view = m_renderer.view();
199 if (view) 199 if (view)
200 view->repaintViewRectangle(absRect); 200 view->repaintViewRectangle(absRect);
201 return; 201 return;
202 } 202 }
203 if (m_renderer.compositingState() == PaintsIntoGroupedBacking) { 203 if (m_renderer.compositingState() == PaintsIntoGroupedBacking) {
204 LayoutRect updatedRect(r); 204 LayoutRect updatedRect(r);
205 205
206 RenderLayerModelObject* transformedAncestor = m_renderer.layer()->enclos ingTransformedAncestor()->renderer(); 206 ASSERT(m_renderer.layer());
207 ASSERT(m_renderer.layer()->enclosingTransformedAncestor());
208 ASSERT(m_renderer.layer()->enclosingTransformedAncestor()->renderer());
209
210 // FIXME: this defensive code should not have to exist. None of these po inters should ever be 0. See crbug.com/370410.
211 RenderLayerModelObject* transformedAncestor = 0;
212 if (RenderLayer* layer = m_renderer.layer()) {
abarth-chromium 2014/05/08 16:59:34 I don't think it's worth null checking m_renderer.
chrishtr 2014/05/08 17:02:24 Done.
213 if (RenderLayer* ancestor = layer->enclosingTransformedAncestor())
214 transformedAncestor = ancestor->renderer();
215 }
216 if (!transformedAncestor)
217 return;
207 218
208 // If the transformedAncestor is actually the RenderView, we might get 219 // If the transformedAncestor is actually the RenderView, we might get
209 // confused and think that we can use LayoutState. Ideally, we'd made 220 // confused and think that we can use LayoutState. Ideally, we'd made
210 // LayoutState work for all composited layers as well, but until then 221 // LayoutState work for all composited layers as well, but until then
211 // we need to disable LayoutState for squashed layers. 222 // we need to disable LayoutState for squashed layers.
212 LayoutStateDisabler layoutStateDisabler(*transformedAncestor); 223 LayoutStateDisabler layoutStateDisabler(*transformedAncestor);
213 224
214 // This code adjusts the repaint rectangle to be in the space of the tra nsformed ancestor of the grouped (i.e. squashed) 225 // This code adjusts the repaint rectangle to be in the space of the tra nsformed ancestor of the grouped (i.e. squashed)
215 // layer. This is because all layers that squash together need to repain t w.r.t. a single container that is 226 // layer. This is because all layers that squash together need to repain t w.r.t. a single container that is
216 // an ancestor of all of them, in order to properly take into account an y local transforms etc. 227 // an ancestor of all of them, in order to properly take into account an y local transforms etc.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 RenderLayer* RenderLayerRepainter::enclosingFilterRepaintLayer() const 280 RenderLayer* RenderLayerRepainter::enclosingFilterRepaintLayer() const
270 { 281 {
271 for (const RenderLayer* curr = m_renderer.layer(); curr; curr = curr->parent ()) { 282 for (const RenderLayer* curr = m_renderer.layer(); curr; curr = curr->parent ()) {
272 if ((curr != m_renderer.layer() && curr->requiresFullLayerImageForFilter s()) || curr->compositingState() == PaintsIntoOwnBacking || curr->isRootLayer()) 283 if ((curr != m_renderer.layer() && curr->requiresFullLayerImageForFilter s()) || curr->compositingState() == PaintsIntoOwnBacking || curr->isRootLayer())
273 return const_cast<RenderLayer*>(curr); 284 return const_cast<RenderLayer*>(curr);
274 } 285 }
275 return 0; 286 return 0;
276 } 287 }
277 288
278 } // Namespace WebCore 289 } // Namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698