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

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

Issue 1122323002: Cleanup: Remove LayoutRegion. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase master Created 5 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 | « Source/core/paint/DeprecatedPaintLayer.cpp ('k') | Source/core/paint/MultiColumnSetPainter.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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 if (m_cache) 171 if (m_cache)
172 m_cache->clear(cacheSlot); 172 m_cache->clear(cacheSlot);
173 173
174 for (DeprecatedPaintLayer* layer = m_layoutObject.layer()->firstChild(); lay er; layer = layer->nextSibling()) 174 for (DeprecatedPaintLayer* layer = m_layoutObject.layer()->firstChild(); lay er; layer = layer->nextSibling())
175 layer->clipper().clearClipRectsIncludingDescendants(cacheSlot); 175 layer->clipper().clearClipRectsIncludingDescendants(cacheSlot);
176 } 176 }
177 177
178 LayoutRect DeprecatedPaintLayerClipper::childrenClipRect() const 178 LayoutRect DeprecatedPaintLayerClipper::childrenClipRect() const
179 { 179 {
180 // FIXME: border-radius not accounted for. 180 // FIXME: border-radius not accounted for.
181 // FIXME: Regions not accounted for. 181 // FIXME: Flow thread based columns not accounted for.
182 DeprecatedPaintLayer* clippingRootLayer = clippingRootForPainting(); 182 DeprecatedPaintLayer* clippingRootLayer = clippingRootForPainting();
183 LayoutRect layerBounds; 183 LayoutRect layerBounds;
184 ClipRect backgroundRect, foregroundRect, outlineRect; 184 ClipRect backgroundRect, foregroundRect, outlineRect;
185 // Need to use uncached clip rects, because the value of 'dontClipToOverflow ' may be different from the painting path (<rdar://problem/11844909>). 185 // Need to use uncached clip rects, because the value of 'dontClipToOverflow ' may be different from the painting path (<rdar://problem/11844909>).
186 ClipRectsContext context(clippingRootLayer, UncachedClipRects); 186 ClipRectsContext context(clippingRootLayer, UncachedClipRects);
187 calculateRects(context, LayoutRect(m_layoutObject.view()->unscaledDocumentRe ct()), layerBounds, backgroundRect, foregroundRect, outlineRect); 187 calculateRects(context, LayoutRect(m_layoutObject.view()->unscaledDocumentRe ct()), layerBounds, backgroundRect, foregroundRect, outlineRect);
188 return LayoutRect(clippingRootLayer->layoutObject()->localToAbsoluteQuad(Flo atQuad(foregroundRect.rect())).enclosingBoundingBox()); 188 return LayoutRect(clippingRootLayer->layoutObject()->localToAbsoluteQuad(Flo atQuad(foregroundRect.rect())).enclosingBoundingBox());
189 } 189 }
190 190
191 LayoutRect DeprecatedPaintLayerClipper::localClipRect() const 191 LayoutRect DeprecatedPaintLayerClipper::localClipRect() const
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 if (m_layoutObject.style()->hasBorderRadius()) 239 if (m_layoutObject.style()->hasBorderRadius())
240 foregroundRect.setHasRadius(true); 240 foregroundRect.setHasRadius(true);
241 } 241 }
242 242
243 // If we establish an overflow clip at all, then go ahead and make sure our background 243 // If we establish an overflow clip at all, then go ahead and make sure our background
244 // rect is intersected with our layer's bounds including our visual over flow, 244 // rect is intersected with our layer's bounds including our visual over flow,
245 // since any visual overflow like box-shadow or border-outset is not cli pped by overflow:auto/hidden. 245 // since any visual overflow like box-shadow or border-outset is not cli pped by overflow:auto/hidden.
246 if (toLayoutBox(m_layoutObject).hasVisualOverflow()) { 246 if (toLayoutBox(m_layoutObject).hasVisualOverflow()) {
247 // FIXME: Perhaps we should be propagating the borderbox as the clip rect for children, even though 247 // FIXME: Perhaps we should be propagating the borderbox as the clip rect for children, even though
248 // we may need to inflate our clip specifically for shadows o r outsets. 248 // we may need to inflate our clip specifically for shadows o r outsets.
249 // FIXME: Does not do the right thing with CSS regions yet, since we don't yet factor in the 249 // FIXME: Does not do the right thing with columns yet, since we don 't yet factor in the
250 // individual region boxes as overflow. 250 // individual column boxes as overflow.
251 LayoutRect layerBoundsWithVisualOverflow = toLayoutBox(m_layoutObjec t).visualOverflowRect(); 251 LayoutRect layerBoundsWithVisualOverflow = toLayoutBox(m_layoutObjec t).visualOverflowRect();
252 toLayoutBox(m_layoutObject).flipForWritingMode(layerBoundsWithVisual Overflow); // DeprecatedPaintLayer are in physical coordinates, so the overflow has to be flipped. 252 toLayoutBox(m_layoutObject).flipForWritingMode(layerBoundsWithVisual Overflow); // DeprecatedPaintLayer are in physical coordinates, so the overflow has to be flipped.
253 layerBoundsWithVisualOverflow.moveBy(offset); 253 layerBoundsWithVisualOverflow.moveBy(offset);
254 if (!isClippingRoot || context.respectOverflowClip == RespectOverflo wClip) 254 if (!isClippingRoot || context.respectOverflowClip == RespectOverflo wClip)
255 backgroundRect.intersect(layerBoundsWithVisualOverflow); 255 backgroundRect.intersect(layerBoundsWithVisualOverflow);
256 } else { 256 } else {
257 LayoutRect bounds = toLayoutBox(m_layoutObject).borderBoxRect(); 257 LayoutRect bounds = toLayoutBox(m_layoutObject).borderBoxRect();
258 bounds.moveBy(offset); 258 bounds.moveBy(offset);
259 if (!isClippingRoot || context.respectOverflowClip == RespectOverflo wClip) 259 if (!isClippingRoot || context.respectOverflowClip == RespectOverflo wClip)
260 backgroundRect.intersect(bounds); 260 backgroundRect.intersect(bounds);
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 ASSERT(current); 365 ASSERT(current);
366 if (current->transform() || current->isPaintInvalidationContainer()) 366 if (current->transform() || current->isPaintInvalidationContainer())
367 return const_cast<DeprecatedPaintLayer*>(current); 367 return const_cast<DeprecatedPaintLayer*>(current);
368 } 368 }
369 369
370 ASSERT_NOT_REACHED(); 370 ASSERT_NOT_REACHED();
371 return 0; 371 return 0;
372 } 372 }
373 373
374 } // namespace blink 374 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayer.cpp ('k') | Source/core/paint/MultiColumnSetPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698