| 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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 | 538 |
| 539 // We ignore overflow clip here; we want composited overflow content to | 539 // We ignore overflow clip here; we want composited overflow content to |
| 540 // behave as if it lives in an unclipped universe so it can prepaint, etc. | 540 // behave as if it lives in an unclipped universe so it can prepaint, etc. |
| 541 // This means that we need to check if we are actually clipped before | 541 // This means that we need to check if we are actually clipped before |
| 542 // setting up m_ancestorClippingLayer otherwise | 542 // setting up m_ancestorClippingLayer otherwise |
| 543 // updateAncestorClippingLayerGeometry will fail as the clip rect will be | 543 // updateAncestorClippingLayerGeometry will fail as the clip rect will be |
| 544 // infinite. | 544 // infinite. |
| 545 // FIXME: this should use cached clip rects, but this sometimes give | 545 // FIXME: this should use cached clip rects, but this sometimes give |
| 546 // inaccurate results (and trips the ASSERTS in PaintLayerClipper). | 546 // inaccurate results (and trips the ASSERTS in PaintLayerClipper). |
| 547 ClipRectsContext clipRectsContext(compositingAncestor, UncachedClipRects, | 547 ClipRectsContext clipRectsContext(compositingAncestor, UncachedClipRects, |
| 548 IgnoreOverlayScrollbarSize); | 548 IgnorePlatformOverlayScrollbarSize); |
| 549 clipRectsContext.setIgnoreOverflowClip(); | 549 clipRectsContext.setIgnoreOverflowClip(); |
| 550 LayoutRect unsnappedParentClipRect = | 550 LayoutRect unsnappedParentClipRect = |
| 551 m_owningLayer.clipper(PaintLayer::DoNotUseGeometryMapper) | 551 m_owningLayer.clipper(PaintLayer::DoNotUseGeometryMapper) |
| 552 .backgroundClipRect(clipRectsContext) | 552 .backgroundClipRect(clipRectsContext) |
| 553 .rect(); | 553 .rect(); |
| 554 IntRect parentClipRect = pixelSnappedIntRect(unsnappedParentClipRect); | 554 IntRect parentClipRect = pixelSnappedIntRect(unsnappedParentClipRect); |
| 555 owningLayerIsClipped = parentClipRect != LayoutRect::infiniteIntRect(); | 555 owningLayerIsClipped = parentClipRect != LayoutRect::infiniteIntRect(); |
| 556 | 556 |
| 557 // TODO(schenney): CSS clips are not applied to composited children, and | 557 // TODO(schenney): CSS clips are not applied to composited children, and |
| 558 // should be via mask or by compositing the parent too. | 558 // should be via mask or by compositing the parent too. |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 | 1136 |
| 1137 void CompositedLayerMapping::updateAncestorClippingLayerGeometry( | 1137 void CompositedLayerMapping::updateAncestorClippingLayerGeometry( |
| 1138 const PaintLayer* compositingContainer, | 1138 const PaintLayer* compositingContainer, |
| 1139 const IntPoint& snappedOffsetFromCompositedAncestor, | 1139 const IntPoint& snappedOffsetFromCompositedAncestor, |
| 1140 IntPoint& graphicsLayerParentLocation) { | 1140 IntPoint& graphicsLayerParentLocation) { |
| 1141 if (!compositingContainer || !m_ancestorClippingLayer) | 1141 if (!compositingContainer || !m_ancestorClippingLayer) |
| 1142 return; | 1142 return; |
| 1143 | 1143 |
| 1144 ClipRectsContext clipRectsContext(compositingContainer, | 1144 ClipRectsContext clipRectsContext(compositingContainer, |
| 1145 PaintingClipRectsIgnoringOverflowClip, | 1145 PaintingClipRectsIgnoringOverflowClip, |
| 1146 IgnoreOverlayScrollbarSize); | 1146 IgnorePlatformOverlayScrollbarSize); |
| 1147 IntRect parentClipRect = pixelSnappedIntRect( | 1147 IntRect parentClipRect = pixelSnappedIntRect( |
| 1148 m_owningLayer.clipper(PaintLayer::DoNotUseGeometryMapper) | 1148 m_owningLayer.clipper(PaintLayer::DoNotUseGeometryMapper) |
| 1149 .backgroundClipRect(clipRectsContext) | 1149 .backgroundClipRect(clipRectsContext) |
| 1150 .rect()); | 1150 .rect()); |
| 1151 ASSERT(parentClipRect != LayoutRect::infiniteIntRect()); | 1151 ASSERT(parentClipRect != LayoutRect::infiniteIntRect()); |
| 1152 m_ancestorClippingLayer->setPosition( | 1152 m_ancestorClippingLayer->setPosition( |
| 1153 FloatPoint(parentClipRect.location() - graphicsLayerParentLocation)); | 1153 FloatPoint(parentClipRect.location() - graphicsLayerParentLocation)); |
| 1154 m_ancestorClippingLayer->setSize(FloatSize(parentClipRect.size())); | 1154 m_ancestorClippingLayer->setSize(FloatSize(parentClipRect.size())); |
| 1155 | 1155 |
| 1156 // backgroundRect is relative to compositingContainer, so subtract | 1156 // backgroundRect is relative to compositingContainer, so subtract |
| (...skipping 2324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3481 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { | 3481 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { |
| 3482 name = "Decoration Layer"; | 3482 name = "Decoration Layer"; |
| 3483 } else { | 3483 } else { |
| 3484 ASSERT_NOT_REACHED(); | 3484 ASSERT_NOT_REACHED(); |
| 3485 } | 3485 } |
| 3486 | 3486 |
| 3487 return name; | 3487 return name; |
| 3488 } | 3488 } |
| 3489 | 3489 |
| 3490 } // namespace blink | 3490 } // namespace blink |
| OLD | NEW |