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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp

Issue 2697863002: Adjust workaround for crash bug to move up the stack. (Closed)
Patch Set: Created 3 years, 10 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
« 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 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@web.de> 10 * Christian Biesinger <cbiesinger@web.de>
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 rectToMap.moveBy(-context.rootLayer->layoutObject()->paintOffset()); 274 rectToMap.moveBy(-context.rootLayer->layoutObject()->paintOffset());
275 } 275 }
276 276
277 void PaintLayerClipper::calculateRectsWithGeometryMapper( 277 void PaintLayerClipper::calculateRectsWithGeometryMapper(
278 const ClipRectsContext& context, 278 const ClipRectsContext& context,
279 const LayoutRect& paintDirtyRect, 279 const LayoutRect& paintDirtyRect,
280 LayoutRect& layerBounds, 280 LayoutRect& layerBounds,
281 ClipRect& backgroundRect, 281 ClipRect& backgroundRect,
282 ClipRect& foregroundRect, 282 ClipRect& foregroundRect,
283 const LayoutPoint* offsetFromRoot) const { 283 const LayoutPoint* offsetFromRoot) const {
284 backgroundRect = clipRectWithGeometryMapper(context, false); 284 const auto* properties = m_layer.layoutObject()->paintProperties();
285 applyOverflowClipToBackgroundRectWithGeometryMapper(context, backgroundRect); 285 // TODO(chrishtr): fix the underlying bug that causes this situation.
286 if (!properties) {
287 backgroundRect = ClipRect(LayoutRect(LayoutRect::infiniteIntRect()));
288 foregroundRect = ClipRect(LayoutRect(LayoutRect::infiniteIntRect()));
289 } else {
290 backgroundRect = clipRectWithGeometryMapper(context, false);
291 applyOverflowClipToBackgroundRectWithGeometryMapper(context,
292 backgroundRect);
286 293
287 backgroundRect.move( 294 backgroundRect.move(
288 context.subPixelAccumulation); // TODO(chrishtr): is this needed? 295 context.subPixelAccumulation); // TODO(chrishtr): is this needed?
289 backgroundRect.intersect(paintDirtyRect); 296 backgroundRect.intersect(paintDirtyRect);
290 297
291 foregroundRect.move( 298 foregroundRect.move(
292 context.subPixelAccumulation); // TODO(chrishtr): is this needed? 299 context.subPixelAccumulation); // TODO(chrishtr): is this needed?
293 foregroundRect = clipRectWithGeometryMapper(context, true); 300 foregroundRect = clipRectWithGeometryMapper(context, true);
294 foregroundRect.intersect(paintDirtyRect); 301 foregroundRect.intersect(paintDirtyRect);
302 }
295 LayoutPoint offset; 303 LayoutPoint offset;
296 if (offsetFromRoot) 304 if (offsetFromRoot)
297 offset = *offsetFromRoot; 305 offset = *offsetFromRoot;
298 else 306 else
299 m_layer.convertToLayerCoords(context.rootLayer, offset); 307 m_layer.convertToLayerCoords(context.rootLayer, offset);
300 layerBounds = LayoutRect(offset, LayoutSize(m_layer.size())); 308 layerBounds = LayoutRect(offset, LayoutSize(m_layer.size()));
301 309
302 #ifdef CHECK_CLIP_RECTS 310 #ifdef CHECK_CLIP_RECTS
303 ClipRect testBackgroundRect, testForegroundRect; 311 ClipRect testBackgroundRect, testForegroundRect;
304 LayoutRect testLayerBounds; 312 LayoutRect testLayerBounds;
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 439
432 return parentRects.overflowClipRect(); 440 return parentRects.overflowClipRect();
433 } 441 }
434 442
435 ClipRect PaintLayerClipper::clipRectWithGeometryMapper( 443 ClipRect PaintLayerClipper::clipRectWithGeometryMapper(
436 const ClipRectsContext& context, 444 const ClipRectsContext& context,
437 bool isForeground) const { 445 bool isForeground) const {
438 DCHECK(m_geometryMapper); 446 DCHECK(m_geometryMapper);
439 LayoutRect source(LayoutRect::infiniteIntRect()); 447 LayoutRect source(LayoutRect::infiniteIntRect());
440 const auto* properties = m_layer.layoutObject()->paintProperties(); 448 const auto* properties = m_layer.layoutObject()->paintProperties();
441 // TODO(chrishtr): fix the underlying bug that causes this situation. 449 // TODO(chrishtr): fix the underlying bug that causes this situation.
pdr. 2017/02/14 19:26:45 This guy got left behind
442 if (!properties)
443 return ClipRect(source);
444 DCHECK(properties && properties->localBorderBoxProperties()); 450 DCHECK(properties && properties->localBorderBoxProperties());
445 451
446 PropertyTreeState propertyTreeState = *properties->localBorderBoxProperties(); 452 PropertyTreeState propertyTreeState = *properties->localBorderBoxProperties();
447 const auto* ancestorProperties = 453 const auto* ancestorProperties =
448 context.rootLayer->layoutObject()->paintProperties(); 454 context.rootLayer->layoutObject()->paintProperties();
449 DCHECK(ancestorProperties && ancestorProperties->localBorderBoxProperties()); 455 DCHECK(ancestorProperties && ancestorProperties->localBorderBoxProperties());
450 PropertyTreeState destinationPropertyTreeState = 456 PropertyTreeState destinationPropertyTreeState =
451 *ancestorProperties->localBorderBoxProperties(); 457 *ancestorProperties->localBorderBoxProperties();
452 458
453 if (&m_layer == context.rootLayer) { 459 if (&m_layer == context.rootLayer) {
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 const LayoutSize& subpixelAccumulation) const { 584 const LayoutSize& subpixelAccumulation) const {
579 DCHECK(!m_geometryMapper); 585 DCHECK(!m_geometryMapper);
580 ClipRectsContext context(rootLayer, PaintingClipRects, 586 ClipRectsContext context(rootLayer, PaintingClipRects,
581 IgnoreOverlayScrollbarSize, subpixelAccumulation); 587 IgnoreOverlayScrollbarSize, subpixelAccumulation);
582 if (respectOverflowClip == IgnoreOverflowClip) 588 if (respectOverflowClip == IgnoreOverflowClip)
583 context.setIgnoreOverflowClip(); 589 context.setIgnoreOverflowClip();
584 return getClipRects(context); 590 return getClipRects(context);
585 } 591 }
586 592
587 } // namespace blink 593 } // namespace blink
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