Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 LayoutRect DeprecatedPaintLayerClipper::childrenClipRect() const | 75 LayoutRect DeprecatedPaintLayerClipper::childrenClipRect() const |
| 76 { | 76 { |
| 77 // FIXME: border-radius not accounted for. | 77 // FIXME: border-radius not accounted for. |
| 78 // FIXME: Flow thread based columns not accounted for. | 78 // FIXME: Flow thread based columns not accounted for. |
| 79 DeprecatedPaintLayer* clippingRootLayer = clippingRootForPainting(); | 79 DeprecatedPaintLayer* clippingRootLayer = clippingRootForPainting(); |
| 80 LayoutRect layerBounds; | 80 LayoutRect layerBounds; |
| 81 ClipRect backgroundRect, foregroundRect, outlineRect; | 81 ClipRect backgroundRect, foregroundRect, outlineRect; |
| 82 // Need to use uncached clip rects, because the value of 'dontClipToOverflow ' may be different from the painting path (<rdar://problem/11844909>). | 82 // Need to use uncached clip rects, because the value of 'dontClipToOverflow ' may be different from the painting path (<rdar://problem/11844909>). |
| 83 ClipRectsContext context(clippingRootLayer, UncachedClipRects); | 83 ClipRectsContext context(clippingRootLayer, UncachedClipRects); |
| 84 calculateRects(context, LayoutRect(m_layoutObject.view()->unscaledDocumentRe ct()), layerBounds, backgroundRect, foregroundRect, outlineRect); | 84 calculateRects(context, LayoutRect(m_layoutObject.view()->unscaledDocumentRe ct()), layerBounds, backgroundRect, foregroundRect, outlineRect); |
| 85 return LayoutRect(clippingRootLayer->layoutObject()->localToAbsoluteQuad(Flo atQuad(foregroundRect.rect())).enclosingBoundingBox()); | 85 return LayoutRect(clippingRootLayer->layoutObject()->localToAbsoluteQuad(Flo atQuad(FloatRect(foregroundRect.rect()))).enclosingBoundingBox()); |
| 86 } | 86 } |
| 87 | 87 |
| 88 LayoutRect DeprecatedPaintLayerClipper::localClipRect() const | 88 LayoutRect DeprecatedPaintLayerClipper::localClipRect() const |
| 89 { | 89 { |
| 90 // FIXME: border-radius not accounted for. | 90 // FIXME: border-radius not accounted for. |
| 91 DeprecatedPaintLayer* clippingRootLayer = clippingRootForPainting(); | 91 DeprecatedPaintLayer* clippingRootLayer = clippingRootForPainting(); |
| 92 LayoutRect layerBounds; | 92 LayoutRect layerBounds; |
| 93 ClipRect backgroundRect, foregroundRect, outlineRect; | 93 ClipRect backgroundRect, foregroundRect, outlineRect; |
| 94 ClipRectsContext context(clippingRootLayer, PaintingClipRects); | 94 ClipRectsContext context(clippingRootLayer, PaintingClipRects); |
| 95 calculateRects(context, LayoutRect(LayoutRect::infiniteIntRect()), layerBoun ds, backgroundRect, foregroundRect, outlineRect); | 95 calculateRects(context, LayoutRect(LayoutRect::infiniteIntRect()), layerBoun ds, backgroundRect, foregroundRect, outlineRect); |
| 96 | 96 |
| 97 LayoutRect clipRect = backgroundRect.rect(); | 97 LayoutRect clipRect = backgroundRect.rect(); |
| 98 if (clipRect == LayoutRect::infiniteIntRect()) | 98 if (IntRect(clipRect) == LayoutRect::infiniteIntRect()) |
|
eae
2015/08/25 17:47:17
This looks odd, why would we compare a LayoutRect
chrishtr
2015/08/25 18:30:44
The presence of this weird code is already tracked
| |
| 99 return clipRect; | 99 return clipRect; |
| 100 | 100 |
| 101 LayoutPoint clippingRootOffset; | 101 LayoutPoint clippingRootOffset; |
| 102 m_layoutObject.layer()->convertToLayerCoords(clippingRootLayer, clippingRoot Offset); | 102 m_layoutObject.layer()->convertToLayerCoords(clippingRootLayer, clippingRoot Offset); |
| 103 clipRect.moveBy(-clippingRootOffset); | 103 clipRect.moveBy(-clippingRootOffset); |
| 104 | 104 |
| 105 return clipRect; | 105 return clipRect; |
| 106 } | 106 } |
| 107 | 107 |
| 108 void DeprecatedPaintLayerClipper::calculateRects(const ClipRectsContext& context , const LayoutRect& paintDirtyRect, LayoutRect& layerBounds, | 108 void DeprecatedPaintLayerClipper::calculateRects(const ClipRectsContext& context , const LayoutRect& paintDirtyRect, LayoutRect& layerBounds, |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 446 if (context.respectOverflowClip == IgnoreOverflowClip) | 446 if (context.respectOverflowClip == IgnoreOverflowClip) |
| 447 return false; | 447 return false; |
| 448 | 448 |
| 449 if (layer->isRootLayer() && context.respectOverflowClipForViewport == Ignore OverflowClip) | 449 if (layer->isRootLayer() && context.respectOverflowClipForViewport == Ignore OverflowClip) |
| 450 return false; | 450 return false; |
| 451 | 451 |
| 452 return true; | 452 return true; |
| 453 } | 453 } |
| 454 | 454 |
| 455 } // namespace blink | 455 } // namespace blink |
| OLD | NEW |