| OLD | NEW |
| 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 Loading... |
| 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(PaintLayer::DoNotUseGeometryMapper) |
| 550 .backgroundClipRect(clipRectsContext) |
| 551 .rect(); |
| 550 IntRect parentClipRect = pixelSnappedIntRect(unsnappedParentClipRect); | 552 IntRect parentClipRect = pixelSnappedIntRect(unsnappedParentClipRect); |
| 551 owningLayerIsClipped = parentClipRect != LayoutRect::infiniteIntRect(); | 553 owningLayerIsClipped = parentClipRect != LayoutRect::infiniteIntRect(); |
| 552 | 554 |
| 553 // TODO(schenney): CSS clips are not applied to composited children, and | 555 // TODO(schenney): CSS clips are not applied to composited children, and |
| 554 // should be via mask or by compositing the parent too. | 556 // should be via mask or by compositing the parent too. |
| 555 // https://bugs.chromium.org/p/chromium/issues/detail?id=615870 | 557 // https://bugs.chromium.org/p/chromium/issues/detail?id=615870 |
| 556 DCHECK(clippingContainer->style()); | 558 DCHECK(clippingContainer->style()); |
| 557 owningLayerIsMasked = | 559 owningLayerIsMasked = |
| 558 owningLayerIsClipped && clippingContainer->style()->hasBorderRadius() && | 560 owningLayerIsClipped && clippingContainer->style()->hasBorderRadius() && |
| 559 !ancestorRoundedCornersWontClip(layoutObject(), clippingContainer); | 561 !ancestorRoundedCornersWontClip(layoutObject(), clippingContainer); |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1129 const PaintLayer* compositingContainer, | 1131 const PaintLayer* compositingContainer, |
| 1130 const IntPoint& snappedOffsetFromCompositedAncestor, | 1132 const IntPoint& snappedOffsetFromCompositedAncestor, |
| 1131 IntPoint& graphicsLayerParentLocation) { | 1133 IntPoint& graphicsLayerParentLocation) { |
| 1132 if (!compositingContainer || !m_ancestorClippingLayer) | 1134 if (!compositingContainer || !m_ancestorClippingLayer) |
| 1133 return; | 1135 return; |
| 1134 | 1136 |
| 1135 ClipRectsContext clipRectsContext(compositingContainer, | 1137 ClipRectsContext clipRectsContext(compositingContainer, |
| 1136 PaintingClipRectsIgnoringOverflowClip, | 1138 PaintingClipRectsIgnoringOverflowClip, |
| 1137 IgnoreOverlayScrollbarSize); | 1139 IgnoreOverlayScrollbarSize); |
| 1138 IntRect parentClipRect = pixelSnappedIntRect( | 1140 IntRect parentClipRect = pixelSnappedIntRect( |
| 1139 m_owningLayer.clipper().backgroundClipRect(clipRectsContext).rect()); | 1141 m_owningLayer.clipper(PaintLayer::DoNotUseGeometryMapper) |
| 1142 .backgroundClipRect(clipRectsContext) |
| 1143 .rect()); |
| 1140 ASSERT(parentClipRect != LayoutRect::infiniteIntRect()); | 1144 ASSERT(parentClipRect != LayoutRect::infiniteIntRect()); |
| 1141 m_ancestorClippingLayer->setPosition( | 1145 m_ancestorClippingLayer->setPosition( |
| 1142 FloatPoint(parentClipRect.location() - graphicsLayerParentLocation)); | 1146 FloatPoint(parentClipRect.location() - graphicsLayerParentLocation)); |
| 1143 m_ancestorClippingLayer->setSize(FloatSize(parentClipRect.size())); | 1147 m_ancestorClippingLayer->setSize(FloatSize(parentClipRect.size())); |
| 1144 | 1148 |
| 1145 // backgroundRect is relative to compositingContainer, so subtract | 1149 // backgroundRect is relative to compositingContainer, so subtract |
| 1146 // snappedOffsetFromCompositedAncestor.X/snappedOffsetFromCompositedAncestor.Y | 1150 // snappedOffsetFromCompositedAncestor.X/snappedOffsetFromCompositedAncestor.Y |
| 1147 // to get back to local coords. | 1151 // to get back to local coords. |
| 1148 m_ancestorClippingLayer->setOffsetFromLayoutObject( | 1152 m_ancestorClippingLayer->setOffsetFromLayoutObject( |
| 1149 parentClipRect.location() - snappedOffsetFromCompositedAncestor); | 1153 parentClipRect.location() - snappedOffsetFromCompositedAncestor); |
| (...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2847 containingSquashedLayer(clippingContainer, layers, layers.size()); | 2851 containingSquashedLayer(clippingContainer, layers, layers.size()); |
| 2848 // Must be there, otherwise | 2852 // Must be there, otherwise |
| 2849 // CompositingLayerAssigner::canSquashIntoCurrentSquashingOwner would have | 2853 // CompositingLayerAssigner::canSquashIntoCurrentSquashingOwner would have |
| 2850 // disallowed squashing. | 2854 // disallowed squashing. |
| 2851 ASSERT(ancestorPaintInfo); | 2855 ASSERT(ancestorPaintInfo); |
| 2852 | 2856 |
| 2853 // FIXME: this is a potential performance issue. We should consider caching | 2857 // FIXME: this is a potential performance issue. We should consider caching |
| 2854 // these clip rects or otherwise optimizing. | 2858 // these clip rects or otherwise optimizing. |
| 2855 ClipRectsContext clipRectsContext(ancestorPaintInfo->paintLayer, | 2859 ClipRectsContext clipRectsContext(ancestorPaintInfo->paintLayer, |
| 2856 UncachedClipRects); | 2860 UncachedClipRects); |
| 2857 IntRect parentClipRect = | 2861 IntRect parentClipRect = pixelSnappedIntRect( |
| 2858 pixelSnappedIntRect(paintInfo.paintLayer->clipper() | 2862 paintInfo.paintLayer->clipper(PaintLayer::DoNotUseGeometryMapper) |
| 2859 .backgroundClipRect(clipRectsContext) | 2863 .backgroundClipRect(clipRectsContext) |
| 2860 .rect()); | 2864 .rect()); |
| 2861 ASSERT(parentClipRect != LayoutRect::infiniteIntRect()); | 2865 ASSERT(parentClipRect != LayoutRect::infiniteIntRect()); |
| 2862 | 2866 |
| 2863 // Convert from ancestor to local coordinates. | 2867 // Convert from ancestor to local coordinates. |
| 2864 IntSize ancestorToLocalOffset = paintInfo.offsetFromLayoutObject - | 2868 IntSize ancestorToLocalOffset = paintInfo.offsetFromLayoutObject - |
| 2865 ancestorPaintInfo->offsetFromLayoutObject; | 2869 ancestorPaintInfo->offsetFromLayoutObject; |
| 2866 parentClipRect.move(ancestorToLocalOffset); | 2870 parentClipRect.move(ancestorToLocalOffset); |
| 2867 return parentClipRect; | 2871 return parentClipRect; |
| 2868 } | 2872 } |
| 2869 | 2873 |
| 2870 void CompositedLayerMapping::doPaintTask( | 2874 void CompositedLayerMapping::doPaintTask( |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3467 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { | 3471 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { |
| 3468 name = "Decoration Layer"; | 3472 name = "Decoration Layer"; |
| 3469 } else { | 3473 } else { |
| 3470 ASSERT_NOT_REACHED(); | 3474 ASSERT_NOT_REACHED(); |
| 3471 } | 3475 } |
| 3472 | 3476 |
| 3473 return name; | 3477 return name; |
| 3474 } | 3478 } |
| 3475 | 3479 |
| 3476 } // namespace blink | 3480 } // namespace blink |
| OLD | NEW |