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

Side by Side Diff: Source/core/paint/DeprecatedPaintLayerClipper.cpp

Issue 1303413004: Convert some call sites to use explicit LayoutRect->FloatRect conversion. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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/paint/BoxPainter.cpp ('k') | Source/core/paint/HTMLCanvasPainter.cpp » ('j') | 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
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())
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
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
OLDNEW
« no previous file with comments | « Source/core/paint/BoxPainter.cpp ('k') | Source/core/paint/HTMLCanvasPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698