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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp

Issue 2802443002: Compute rounded-ness of visual rects (Closed)
Patch Set: none Created 3 years, 8 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 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@web.de> 10 * Christian Biesinger <cbiesinger@web.de>
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 ancestorOverflowClip) 419 ancestorOverflowClip)
420 destinationPropertyTreeState.setClip(ancestorOverflowClip); 420 destinationPropertyTreeState.setClip(ancestorOverflowClip);
421 } 421 }
422 422
423 // The background rect applies all clips *above* m_layer, but not the overflow 423 // The background rect applies all clips *above* m_layer, but not the overflow
424 // clip of m_layer. It also applies a clip to the total painting bounds 424 // clip of m_layer. It also applies a clip to the total painting bounds
425 // of m_layer, because nothing in m_layer or its children within the clip can 425 // of m_layer, because nothing in m_layer or its children within the clip can
426 // paint outside of those bounds. 426 // paint outside of those bounds.
427 // The total painting bounds includes any visual overflow (such as shadow) and 427 // The total painting bounds includes any visual overflow (such as shadow) and
428 // filter bounds. 428 // filter bounds.
429 //
430 // TODO(chrishtr): sourceToDestinationVisualRect and
431 // sourceToDestinationClipRect may not compute tight results in the presence
432 // of transforms. Tight results are required for most use cases of these
433 // rects, so we should add methods to GeometryMapper that guarantee there
434 // are tight results, or else signal an error.
429 if (shouldClipOverflow(context)) { 435 if (shouldClipOverflow(context)) {
430 FloatRect clipRect(localVisualRect()); 436 FloatClipRect clipRect((FloatRect(localVisualRect())));
431 clipRect.moveBy(FloatPoint(m_layer.layoutObject().paintOffset())); 437 clipRect.moveBy(FloatPoint(m_layer.layoutObject().paintOffset()));
432 GeometryMapper::sourceToDestinationVisualRect( 438 GeometryMapper::sourceToDestinationVisualRect(
433 sourcePropertyTreeState, destinationPropertyTreeState, clipRect); 439 sourcePropertyTreeState, destinationPropertyTreeState, clipRect);
434 output.setRect(FloatClipRect(clipRect)); 440 output.setRect(clipRect);
435 } else { 441 } else {
436 const FloatClipRect& clippedRectInRootLayerSpace = 442 const FloatClipRect& clippedRectInRootLayerSpace =
437 GeometryMapper::sourceToDestinationClipRect( 443 GeometryMapper::sourceToDestinationClipRect(
438 sourcePropertyTreeState, destinationPropertyTreeState); 444 sourcePropertyTreeState, destinationPropertyTreeState);
439 output.setRect(clippedRectInRootLayerSpace); 445 output.setRect(clippedRectInRootLayerSpace);
440 } 446 }
441 447
442 output.moveBy(-context.rootLayer->layoutObject().paintOffset()); 448 output.moveBy(-context.rootLayer->layoutObject().paintOffset());
443 } 449 }
444 450
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 DCHECK(!m_useGeometryMapper); 618 DCHECK(!m_useGeometryMapper);
613 ClipRectsContext context(rootLayer, PaintingClipRects, 619 ClipRectsContext context(rootLayer, PaintingClipRects,
614 IgnorePlatformOverlayScrollbarSize, 620 IgnorePlatformOverlayScrollbarSize,
615 subpixelAccumulation); 621 subpixelAccumulation);
616 if (respectOverflowClip == IgnoreOverflowClip) 622 if (respectOverflowClip == IgnoreOverflowClip)
617 context.setIgnoreOverflowClip(); 623 context.setIgnoreOverflowClip();
618 return getClipRects(context); 624 return getClipRects(context);
619 } 625 }
620 626
621 } // namespace blink 627 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698