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

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

Issue 1349473003: Remove DeprecatedPaintLayerFragment::outlineRect (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed line, added rebaselines. Created 5 years, 3 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
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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 layer->clipper().clearClipRectsIncludingDescendants(cacheSlot); 168 layer->clipper().clearClipRectsIncludingDescendants(cacheSlot);
169 } 169 }
170 } 170 }
171 171
172 LayoutRect DeprecatedPaintLayerClipper::childrenClipRect() const 172 LayoutRect DeprecatedPaintLayerClipper::childrenClipRect() const
173 { 173 {
174 // FIXME: border-radius not accounted for. 174 // FIXME: border-radius not accounted for.
175 // FIXME: Flow thread based columns not accounted for. 175 // FIXME: Flow thread based columns not accounted for.
176 DeprecatedPaintLayer* clippingRootLayer = clippingRootForPainting(); 176 DeprecatedPaintLayer* clippingRootLayer = clippingRootForPainting();
177 LayoutRect layerBounds; 177 LayoutRect layerBounds;
178 ClipRect backgroundRect, foregroundRect, outlineRect; 178 ClipRect backgroundRect, foregroundRect;
179 // Need to use uncached clip rects, because the value of 'dontClipToOverflow ' may be different from the painting path (<rdar://problem/11844909>). 179 // Need to use uncached clip rects, because the value of 'dontClipToOverflow ' may be different from the painting path (<rdar://problem/11844909>).
180 ClipRectsContext context(clippingRootLayer, UncachedClipRects); 180 ClipRectsContext context(clippingRootLayer, UncachedClipRects);
181 calculateRects(context, LayoutRect(m_layoutObject.view()->unscaledDocumentRe ct()), layerBounds, backgroundRect, foregroundRect, outlineRect); 181 calculateRects(context, LayoutRect(m_layoutObject.view()->unscaledDocumentRe ct()), layerBounds, backgroundRect, foregroundRect);
182 return LayoutRect(clippingRootLayer->layoutObject()->localToAbsoluteQuad(Flo atQuad(FloatRect(foregroundRect.rect()))).enclosingBoundingBox()); 182 return LayoutRect(clippingRootLayer->layoutObject()->localToAbsoluteQuad(Flo atQuad(FloatRect(foregroundRect.rect()))).enclosingBoundingBox());
183 } 183 }
184 184
185 LayoutRect DeprecatedPaintLayerClipper::localClipRect() const 185 LayoutRect DeprecatedPaintLayerClipper::localClipRect() const
186 { 186 {
187 // FIXME: border-radius not accounted for. 187 // FIXME: border-radius not accounted for.
188 DeprecatedPaintLayer* clippingRootLayer = clippingRootForPainting(); 188 DeprecatedPaintLayer* clippingRootLayer = clippingRootForPainting();
189 LayoutRect layerBounds; 189 LayoutRect layerBounds;
190 ClipRect backgroundRect, foregroundRect, outlineRect; 190 ClipRect backgroundRect, foregroundRect;
191 ClipRectsContext context(clippingRootLayer, PaintingClipRects); 191 ClipRectsContext context(clippingRootLayer, PaintingClipRects);
192 calculateRects(context, LayoutRect(LayoutRect::infiniteIntRect()), layerBoun ds, backgroundRect, foregroundRect, outlineRect); 192 calculateRects(context, LayoutRect(LayoutRect::infiniteIntRect()), layerBoun ds, backgroundRect, foregroundRect);
193 193
194 LayoutRect clipRect = backgroundRect.rect(); 194 LayoutRect clipRect = backgroundRect.rect();
195 // TODO(chrishtr): avoid converting to IntRect and back. 195 // TODO(chrishtr): avoid converting to IntRect and back.
196 if (clipRect == LayoutRect(LayoutRect::infiniteIntRect())) 196 if (clipRect == LayoutRect(LayoutRect::infiniteIntRect()))
197 return clipRect; 197 return clipRect;
198 198
199 LayoutPoint clippingRootOffset; 199 LayoutPoint clippingRootOffset;
200 m_layoutObject.layer()->convertToLayerCoords(clippingRootLayer, clippingRoot Offset); 200 m_layoutObject.layer()->convertToLayerCoords(clippingRootLayer, clippingRoot Offset);
201 clipRect.moveBy(-clippingRootOffset); 201 clipRect.moveBy(-clippingRootOffset);
202 202
203 return clipRect; 203 return clipRect;
204 } 204 }
205 205
206 void DeprecatedPaintLayerClipper::calculateRects(const ClipRectsContext& context , const LayoutRect& paintDirtyRect, LayoutRect& layerBounds, 206 void DeprecatedPaintLayerClipper::calculateRects(const ClipRectsContext& context , const LayoutRect& paintDirtyRect, LayoutRect& layerBounds,
207 ClipRect& backgroundRect, ClipRect& foregroundRect, ClipRect& outlineRect, c onst LayoutPoint* offsetFromRoot) const 207 ClipRect& backgroundRect, ClipRect& foregroundRect, const LayoutPoint* offse tFromRoot) const
208 { 208 {
209 bool isClippingRoot = m_layoutObject.layer() == context.rootLayer; 209 bool isClippingRoot = m_layoutObject.layer() == context.rootLayer;
210 210
211 if (!isClippingRoot && m_layoutObject.layer()->parent()) { 211 if (!isClippingRoot && m_layoutObject.layer()->parent()) {
212 backgroundRect = backgroundClipRect(context); 212 backgroundRect = backgroundClipRect(context);
213 backgroundRect.move(context.subPixelAccumulation); 213 backgroundRect.move(context.subPixelAccumulation);
214 backgroundRect.intersect(paintDirtyRect); 214 backgroundRect.intersect(paintDirtyRect);
215 } else { 215 } else {
216 backgroundRect = paintDirtyRect; 216 backgroundRect = paintDirtyRect;
217 } 217 }
218 218
219 foregroundRect = backgroundRect; 219 foregroundRect = backgroundRect;
220 outlineRect = backgroundRect;
221 220
222 LayoutPoint offset; 221 LayoutPoint offset;
223 if (offsetFromRoot) 222 if (offsetFromRoot)
224 offset = *offsetFromRoot; 223 offset = *offsetFromRoot;
225 else 224 else
226 m_layoutObject.layer()->convertToLayerCoords(context.rootLayer, offset); 225 m_layoutObject.layer()->convertToLayerCoords(context.rootLayer, offset);
227 layerBounds = LayoutRect(offset, LayoutSize(m_layoutObject.layer()->size())) ; 226 layerBounds = LayoutRect(offset, LayoutSize(m_layoutObject.layer()->size())) ;
228 227
229 // Update the clip rects that will be passed to child layers. 228 // Update the clip rects that will be passed to child layers.
230 if (m_layoutObject.hasOverflowClip() && shouldRespectOverflowClip(context)) { 229 if (m_layoutObject.hasOverflowClip() && shouldRespectOverflowClip(context)) {
(...skipping 12 matching lines...) Expand all
243 } 242 }
244 243
245 // CSS clip (different than clipping due to overflow) can clip to any box, e ven if it falls outside of the border box. 244 // CSS clip (different than clipping due to overflow) can clip to any box, e ven if it falls outside of the border box.
246 if (m_layoutObject.hasClip()) { 245 if (m_layoutObject.hasClip()) {
247 // Clip applies to *us* as well, so go ahead and update the damageRect. 246 // Clip applies to *us* as well, so go ahead and update the damageRect.
248 LayoutRect newPosClip = toLayoutBox(m_layoutObject).clipRect(offset); 247 LayoutRect newPosClip = toLayoutBox(m_layoutObject).clipRect(offset);
249 backgroundRect.intersect(newPosClip); 248 backgroundRect.intersect(newPosClip);
250 backgroundRect.setIsClippedByClipCss(); 249 backgroundRect.setIsClippedByClipCss();
251 foregroundRect.intersect(newPosClip); 250 foregroundRect.intersect(newPosClip);
252 foregroundRect.setIsClippedByClipCss(); 251 foregroundRect.setIsClippedByClipCss();
253 outlineRect.intersect(newPosClip);
254 outlineRect.setIsClippedByClipCss();
255 } 252 }
256 } 253 }
257 254
258 void DeprecatedPaintLayerClipper::calculateClipRects(const ClipRectsContext& con text, ClipRects& clipRects) const 255 void DeprecatedPaintLayerClipper::calculateClipRects(const ClipRectsContext& con text, ClipRects& clipRects) const
259 { 256 {
260 bool rootLayerScrolls = m_layoutObject.document().settings() && m_layoutObje ct.document().settings()->rootLayerScrolls(); 257 bool rootLayerScrolls = m_layoutObject.document().settings() && m_layoutObje ct.document().settings()->rootLayerScrolls();
261 if (!m_layoutObject.layer()->parent() && !rootLayerScrolls) { 258 if (!m_layoutObject.layer()->parent() && !rootLayerScrolls) {
262 // The root layer's clip rect is always infinite. 259 // The root layer's clip rect is always infinite.
263 clipRects.reset(LayoutRect(LayoutRect::infiniteIntRect())); 260 clipRects.reset(LayoutRect(LayoutRect::infiniteIntRect()));
264 return; 261 return;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 if (context.respectOverflowClip == IgnoreOverflowClip) 360 if (context.respectOverflowClip == IgnoreOverflowClip)
364 return false; 361 return false;
365 362
366 if (layer->isRootLayer() && context.respectOverflowClipForViewport == Ignore OverflowClip) 363 if (layer->isRootLayer() && context.respectOverflowClipForViewport == Ignore OverflowClip)
367 return false; 364 return false;
368 365
369 return true; 366 return true;
370 } 367 }
371 368
372 } // namespace blink 369 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayerClipper.h ('k') | Source/core/paint/DeprecatedPaintLayerFragment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698