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

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

Issue 1322653002: *** NOT FOR LANDING *** Avoid localToContainerPoint() in DeprecatedPaintLayerClipper::addClipsFromT… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
« 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 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 } 269 }
270 if (layer->stackingNode()->isStackingContext()) { 270 if (layer->stackingNode()->isStackingContext()) {
271 rects.stackingContextClipRects = rects.currentClipRects; 271 rects.stackingContextClipRects = rects.currentClipRects;
272 } 272 }
273 } 273 }
274 274
275 void DeprecatedPaintLayerClipper::addClipsFromThisObject(const ClipRectsContext& context, ClipRects& clipRects) const 275 void DeprecatedPaintLayerClipper::addClipsFromThisObject(const ClipRectsContext& context, ClipRects& clipRects) const
276 { 276 {
277 LayoutView* view = m_layoutObject.view(); 277 LayoutView* view = m_layoutObject.view();
278 ASSERT(view); 278 ASSERT(view);
279 #if 1
280 LayoutPoint offset;
281 m_layoutObject.layer()->convertToLayerCoords(context.rootLayer, offset);
282 #else
279 // This offset cannot use convertToLayerCoords, because sometimes our rootLa yer may be across 283 // This offset cannot use convertToLayerCoords, because sometimes our rootLa yer may be across
280 // some transformed layer boundary, for example, in the DeprecatedPaintLayer Compositor overlapMap, where 284 // some transformed layer boundary, for example, in the DeprecatedPaintLayer Compositor overlapMap, where
281 // clipRects are needed in view space. 285 // clipRects are needed in view space.
282 LayoutPoint offset = roundedLayoutPoint(m_layoutObject.localToContainerPoint (FloatPoint(), context.rootLayer->layoutObject())); 286 LayoutPoint offset = roundedLayoutPoint(m_layoutObject.localToContainerPoint (FloatPoint(), context.rootLayer->layoutObject())); //
287 #endif
283 if (clipRects.fixed() && context.rootLayer->layoutObject() == view) 288 if (clipRects.fixed() && context.rootLayer->layoutObject() == view)
284 offset -= toIntSize(view->frameView()->scrollPosition()); 289 offset -= toIntSize(view->frameView()->scrollPosition());
285 290
286 // The condition for hasClip here seems wrong. See https://crbug.com/504577 291 // The condition for hasClip here seems wrong. See https://crbug.com/504577
287 // (overflowClips can be applied even when shouldRespectOverflowClip returns false) 292 // (overflowClips can be applied even when shouldRespectOverflowClip returns false)
288 if (m_layoutObject.hasOverflowClip() && (shouldRespectOverflowClip(context) || m_layoutObject.hasClip())) { 293 if (m_layoutObject.hasOverflowClip() && (shouldRespectOverflowClip(context) || m_layoutObject.hasClip())) {
289 ClipRect newOverflowClip = toLayoutBox(m_layoutObject).overflowClipRect( offset, context.scrollbarRelevancy); 294 ClipRect newOverflowClip = toLayoutBox(m_layoutObject).overflowClipRect( offset, context.scrollbarRelevancy);
290 newOverflowClip.setHasRadius(m_layoutObject.style()->hasBorderRadius()); 295 newOverflowClip.setHasRadius(m_layoutObject.style()->hasBorderRadius());
291 clipRects.setOverflowClipRect(intersection(newOverflowClip, clipRects.ov erflowClipRect())); 296 clipRects.setOverflowClipRect(intersection(newOverflowClip, clipRects.ov erflowClipRect()));
292 if (m_layoutObject.isPositioned()) 297 if (m_layoutObject.isPositioned())
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 if (context.respectOverflowClip == IgnoreOverflowClip) 462 if (context.respectOverflowClip == IgnoreOverflowClip)
458 return false; 463 return false;
459 464
460 if (layer->isRootLayer() && context.respectOverflowClipForViewport == Ignore OverflowClip) 465 if (layer->isRootLayer() && context.respectOverflowClipForViewport == Ignore OverflowClip)
461 return false; 466 return false;
462 467
463 return true; 468 return true;
464 } 469 }
465 470
466 } // namespace blink 471 } // 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