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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2671853003: [SPInvalidation] Use GeometryMapper in PaintLayerClipper for paint. (Closed)
Patch Set: none Created 3 years, 10 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) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 // This means that we need to check if we are actually clipped before 539 // This means that we need to check if we are actually clipped before
540 // setting up m_ancestorClippingLayer otherwise 540 // setting up m_ancestorClippingLayer otherwise
541 // updateAncestorClippingLayerGeometry will fail as the clip rect will be 541 // updateAncestorClippingLayerGeometry will fail as the clip rect will be
542 // infinite. 542 // infinite.
543 // FIXME: this should use cached clip rects, but this sometimes give 543 // FIXME: this should use cached clip rects, but this sometimes give
544 // inaccurate results (and trips the ASSERTS in PaintLayerClipper). 544 // inaccurate results (and trips the ASSERTS in PaintLayerClipper).
545 ClipRectsContext clipRectsContext(compositingAncestor, UncachedClipRects, 545 ClipRectsContext clipRectsContext(compositingAncestor, UncachedClipRects,
546 IgnoreOverlayScrollbarSize); 546 IgnoreOverlayScrollbarSize);
547 clipRectsContext.setIgnoreOverflowClip(); 547 clipRectsContext.setIgnoreOverflowClip();
548 LayoutRect unsnappedParentClipRect = 548 LayoutRect unsnappedParentClipRect =
549 m_owningLayer.clipper().backgroundClipRect(clipRectsContext).rect(); 549 m_owningLayer.clipper(false).backgroundClipRect(clipRectsContext).rect();
550 IntRect parentClipRect = pixelSnappedIntRect(unsnappedParentClipRect); 550 IntRect parentClipRect = pixelSnappedIntRect(unsnappedParentClipRect);
551 owningLayerIsClipped = parentClipRect != LayoutRect::infiniteIntRect(); 551 owningLayerIsClipped = parentClipRect != LayoutRect::infiniteIntRect();
552 552
553 // TODO(schenney): CSS clips are not applied to composited children, and 553 // TODO(schenney): CSS clips are not applied to composited children, and
554 // should be via mask or by compositing the parent too. 554 // should be via mask or by compositing the parent too.
555 // https://bugs.chromium.org/p/chromium/issues/detail?id=615870 555 // https://bugs.chromium.org/p/chromium/issues/detail?id=615870
556 DCHECK(clippingContainer->style()); 556 DCHECK(clippingContainer->style());
557 owningLayerIsMasked = 557 owningLayerIsMasked =
558 owningLayerIsClipped && clippingContainer->style()->hasBorderRadius() && 558 owningLayerIsClipped && clippingContainer->style()->hasBorderRadius() &&
559 !ancestorRoundedCornersWontClip(layoutObject(), clippingContainer); 559 !ancestorRoundedCornersWontClip(layoutObject(), clippingContainer);
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 const PaintLayer* compositingContainer, 1129 const PaintLayer* compositingContainer,
1130 const IntPoint& snappedOffsetFromCompositedAncestor, 1130 const IntPoint& snappedOffsetFromCompositedAncestor,
1131 IntPoint& graphicsLayerParentLocation) { 1131 IntPoint& graphicsLayerParentLocation) {
1132 if (!compositingContainer || !m_ancestorClippingLayer) 1132 if (!compositingContainer || !m_ancestorClippingLayer)
1133 return; 1133 return;
1134 1134
1135 ClipRectsContext clipRectsContext(compositingContainer, 1135 ClipRectsContext clipRectsContext(compositingContainer,
1136 PaintingClipRectsIgnoringOverflowClip, 1136 PaintingClipRectsIgnoringOverflowClip,
1137 IgnoreOverlayScrollbarSize); 1137 IgnoreOverlayScrollbarSize);
1138 IntRect parentClipRect = pixelSnappedIntRect( 1138 IntRect parentClipRect = pixelSnappedIntRect(
1139 m_owningLayer.clipper().backgroundClipRect(clipRectsContext).rect()); 1139 m_owningLayer.clipper(false).backgroundClipRect(clipRectsContext).rect());
1140 ASSERT(parentClipRect != LayoutRect::infiniteIntRect()); 1140 ASSERT(parentClipRect != LayoutRect::infiniteIntRect());
1141 m_ancestorClippingLayer->setPosition( 1141 m_ancestorClippingLayer->setPosition(
1142 FloatPoint(parentClipRect.location() - graphicsLayerParentLocation)); 1142 FloatPoint(parentClipRect.location() - graphicsLayerParentLocation));
1143 m_ancestorClippingLayer->setSize(FloatSize(parentClipRect.size())); 1143 m_ancestorClippingLayer->setSize(FloatSize(parentClipRect.size()));
1144 1144
1145 // backgroundRect is relative to compositingContainer, so subtract 1145 // backgroundRect is relative to compositingContainer, so subtract
1146 // snappedOffsetFromCompositedAncestor.X/snappedOffsetFromCompositedAncestor.Y 1146 // snappedOffsetFromCompositedAncestor.X/snappedOffsetFromCompositedAncestor.Y
1147 // to get back to local coords. 1147 // to get back to local coords.
1148 m_ancestorClippingLayer->setOffsetFromLayoutObject( 1148 m_ancestorClippingLayer->setOffsetFromLayoutObject(
1149 parentClipRect.location() - snappedOffsetFromCompositedAncestor); 1149 parentClipRect.location() - snappedOffsetFromCompositedAncestor);
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after
2850 // Must be there, otherwise 2850 // Must be there, otherwise
2851 // CompositingLayerAssigner::canSquashIntoCurrentSquashingOwner would have 2851 // CompositingLayerAssigner::canSquashIntoCurrentSquashingOwner would have
2852 // disallowed squashing. 2852 // disallowed squashing.
2853 ASSERT(ancestorPaintInfo); 2853 ASSERT(ancestorPaintInfo);
2854 2854
2855 // FIXME: this is a potential performance issue. We should consider caching 2855 // FIXME: this is a potential performance issue. We should consider caching
2856 // these clip rects or otherwise optimizing. 2856 // these clip rects or otherwise optimizing.
2857 ClipRectsContext clipRectsContext(ancestorPaintInfo->paintLayer, 2857 ClipRectsContext clipRectsContext(ancestorPaintInfo->paintLayer,
2858 UncachedClipRects); 2858 UncachedClipRects);
2859 IntRect parentClipRect = 2859 IntRect parentClipRect =
2860 pixelSnappedIntRect(paintInfo.paintLayer->clipper() 2860 pixelSnappedIntRect(paintInfo.paintLayer->clipper(false)
2861 .backgroundClipRect(clipRectsContext) 2861 .backgroundClipRect(clipRectsContext)
2862 .rect()); 2862 .rect());
2863 ASSERT(parentClipRect != LayoutRect::infiniteIntRect()); 2863 ASSERT(parentClipRect != LayoutRect::infiniteIntRect());
2864 2864
2865 // Convert from ancestor to local coordinates. 2865 // Convert from ancestor to local coordinates.
2866 IntSize ancestorToLocalOffset = paintInfo.offsetFromLayoutObject - 2866 IntSize ancestorToLocalOffset = paintInfo.offsetFromLayoutObject -
2867 ancestorPaintInfo->offsetFromLayoutObject; 2867 ancestorPaintInfo->offsetFromLayoutObject;
2868 parentClipRect.move(ancestorToLocalOffset); 2868 parentClipRect.move(ancestorToLocalOffset);
2869 return parentClipRect; 2869 return parentClipRect;
2870 } 2870 }
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
3469 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { 3469 } else if (graphicsLayer == m_decorationOutlineLayer.get()) {
3470 name = "Decoration Layer"; 3470 name = "Decoration Layer";
3471 } else { 3471 } else {
3472 ASSERT_NOT_REACHED(); 3472 ASSERT_NOT_REACHED();
3473 } 3473 }
3474 3474
3475 return name; 3475 return name;
3476 } 3476 }
3477 3477
3478 } // namespace blink 3478 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698