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

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: Merge branch 'master' into paintlayerclipper 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 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 // This means that we need to check if we are actually clipped before 540 // This means that we need to check if we are actually clipped before
541 // setting up m_ancestorClippingLayer otherwise 541 // setting up m_ancestorClippingLayer otherwise
542 // updateAncestorClippingLayerGeometry will fail as the clip rect will be 542 // updateAncestorClippingLayerGeometry will fail as the clip rect will be
543 // infinite. 543 // infinite.
544 // FIXME: this should use cached clip rects, but this sometimes give 544 // FIXME: this should use cached clip rects, but this sometimes give
545 // inaccurate results (and trips the ASSERTS in PaintLayerClipper). 545 // inaccurate results (and trips the ASSERTS in PaintLayerClipper).
546 ClipRectsContext clipRectsContext(compositingAncestor, UncachedClipRects, 546 ClipRectsContext clipRectsContext(compositingAncestor, UncachedClipRects,
547 IgnoreOverlayScrollbarSize); 547 IgnoreOverlayScrollbarSize);
548 clipRectsContext.setIgnoreOverflowClip(); 548 clipRectsContext.setIgnoreOverflowClip();
549 LayoutRect unsnappedParentClipRect = 549 LayoutRect unsnappedParentClipRect =
550 m_owningLayer.clipper().backgroundClipRect(clipRectsContext).rect(); 550 m_owningLayer.clipper(PaintLayer::DoNotUseGeometryMapper)
551 .backgroundClipRect(clipRectsContext)
552 .rect();
551 IntRect parentClipRect = pixelSnappedIntRect(unsnappedParentClipRect); 553 IntRect parentClipRect = pixelSnappedIntRect(unsnappedParentClipRect);
552 owningLayerIsClipped = parentClipRect != LayoutRect::infiniteIntRect(); 554 owningLayerIsClipped = parentClipRect != LayoutRect::infiniteIntRect();
553 555
554 // TODO(schenney): CSS clips are not applied to composited children, and 556 // TODO(schenney): CSS clips are not applied to composited children, and
555 // should be via mask or by compositing the parent too. 557 // should be via mask or by compositing the parent too.
556 // https://bugs.chromium.org/p/chromium/issues/detail?id=615870 558 // https://bugs.chromium.org/p/chromium/issues/detail?id=615870
557 DCHECK(clippingContainer->style()); 559 DCHECK(clippingContainer->style());
558 owningLayerIsMasked = 560 owningLayerIsMasked =
559 owningLayerIsClipped && clippingContainer->style()->hasBorderRadius() && 561 owningLayerIsClipped && clippingContainer->style()->hasBorderRadius() &&
560 !ancestorRoundedCornersWontClip(layoutObject(), clippingContainer); 562 !ancestorRoundedCornersWontClip(layoutObject(), clippingContainer);
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 const PaintLayer* compositingContainer, 1137 const PaintLayer* compositingContainer,
1136 const IntPoint& snappedOffsetFromCompositedAncestor, 1138 const IntPoint& snappedOffsetFromCompositedAncestor,
1137 IntPoint& graphicsLayerParentLocation) { 1139 IntPoint& graphicsLayerParentLocation) {
1138 if (!compositingContainer || !m_ancestorClippingLayer) 1140 if (!compositingContainer || !m_ancestorClippingLayer)
1139 return; 1141 return;
1140 1142
1141 ClipRectsContext clipRectsContext(compositingContainer, 1143 ClipRectsContext clipRectsContext(compositingContainer,
1142 PaintingClipRectsIgnoringOverflowClip, 1144 PaintingClipRectsIgnoringOverflowClip,
1143 IgnoreOverlayScrollbarSize); 1145 IgnoreOverlayScrollbarSize);
1144 IntRect parentClipRect = pixelSnappedIntRect( 1146 IntRect parentClipRect = pixelSnappedIntRect(
1145 m_owningLayer.clipper().backgroundClipRect(clipRectsContext).rect()); 1147 m_owningLayer.clipper(PaintLayer::DoNotUseGeometryMapper)
1148 .backgroundClipRect(clipRectsContext)
1149 .rect());
1146 ASSERT(parentClipRect != LayoutRect::infiniteIntRect()); 1150 ASSERT(parentClipRect != LayoutRect::infiniteIntRect());
1147 m_ancestorClippingLayer->setPosition( 1151 m_ancestorClippingLayer->setPosition(
1148 FloatPoint(parentClipRect.location() - graphicsLayerParentLocation)); 1152 FloatPoint(parentClipRect.location() - graphicsLayerParentLocation));
1149 m_ancestorClippingLayer->setSize(FloatSize(parentClipRect.size())); 1153 m_ancestorClippingLayer->setSize(FloatSize(parentClipRect.size()));
1150 1154
1151 // backgroundRect is relative to compositingContainer, so subtract 1155 // backgroundRect is relative to compositingContainer, so subtract
1152 // snappedOffsetFromCompositedAncestor.X/snappedOffsetFromCompositedAncestor.Y 1156 // snappedOffsetFromCompositedAncestor.X/snappedOffsetFromCompositedAncestor.Y
1153 // to get back to local coords. 1157 // to get back to local coords.
1154 m_ancestorClippingLayer->setOffsetFromLayoutObject( 1158 m_ancestorClippingLayer->setOffsetFromLayoutObject(
1155 parentClipRect.location() - snappedOffsetFromCompositedAncestor); 1159 parentClipRect.location() - snappedOffsetFromCompositedAncestor);
(...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after
2853 containingSquashedLayer(clippingContainer, layers, layers.size()); 2857 containingSquashedLayer(clippingContainer, layers, layers.size());
2854 // Must be there, otherwise 2858 // Must be there, otherwise
2855 // CompositingLayerAssigner::canSquashIntoCurrentSquashingOwner would have 2859 // CompositingLayerAssigner::canSquashIntoCurrentSquashingOwner would have
2856 // disallowed squashing. 2860 // disallowed squashing.
2857 ASSERT(ancestorPaintInfo); 2861 ASSERT(ancestorPaintInfo);
2858 2862
2859 // FIXME: this is a potential performance issue. We should consider caching 2863 // FIXME: this is a potential performance issue. We should consider caching
2860 // these clip rects or otherwise optimizing. 2864 // these clip rects or otherwise optimizing.
2861 ClipRectsContext clipRectsContext(ancestorPaintInfo->paintLayer, 2865 ClipRectsContext clipRectsContext(ancestorPaintInfo->paintLayer,
2862 UncachedClipRects); 2866 UncachedClipRects);
2863 IntRect parentClipRect = 2867 IntRect parentClipRect = pixelSnappedIntRect(
2864 pixelSnappedIntRect(paintInfo.paintLayer->clipper() 2868 paintInfo.paintLayer->clipper(PaintLayer::DoNotUseGeometryMapper)
2865 .backgroundClipRect(clipRectsContext) 2869 .backgroundClipRect(clipRectsContext)
2866 .rect()); 2870 .rect());
2867 ASSERT(parentClipRect != LayoutRect::infiniteIntRect()); 2871 ASSERT(parentClipRect != LayoutRect::infiniteIntRect());
2868 2872
2869 // Convert from ancestor to local coordinates. 2873 // Convert from ancestor to local coordinates.
2870 IntSize ancestorToLocalOffset = paintInfo.offsetFromLayoutObject - 2874 IntSize ancestorToLocalOffset = paintInfo.offsetFromLayoutObject -
2871 ancestorPaintInfo->offsetFromLayoutObject; 2875 ancestorPaintInfo->offsetFromLayoutObject;
2872 parentClipRect.move(ancestorToLocalOffset); 2876 parentClipRect.move(ancestorToLocalOffset);
2873 return parentClipRect; 2877 return parentClipRect;
2874 } 2878 }
2875 2879
2876 void CompositedLayerMapping::doPaintTask( 2880 void CompositedLayerMapping::doPaintTask(
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
3473 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { 3477 } else if (graphicsLayer == m_decorationOutlineLayer.get()) {
3474 name = "Decoration Layer"; 3478 name = "Decoration Layer";
3475 } else { 3479 } else {
3476 ASSERT_NOT_REACHED(); 3480 ASSERT_NOT_REACHED();
3477 } 3481 }
3478 3482
3479 return name; 3483 return name;
3480 } 3484 }
3481 3485
3482 } // namespace blink 3486 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698