OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 if (!boundsComputed) { | 795 if (!boundsComputed) { |
796 // FIXME: If this layer's overlap bounds include its children, we don't
need to add its | 796 // FIXME: If this layer's overlap bounds include its children, we don't
need to add its |
797 // children's bounds to the overlap map. | 797 // children's bounds to the overlap map. |
798 layerBounds = enclosingIntRect(overlapMap.geometryMap().absoluteRect(lay
er->overlapBounds())); | 798 layerBounds = enclosingIntRect(overlapMap.geometryMap().absoluteRect(lay
er->overlapBounds())); |
799 // Empty rects never intersect, but we need them to for the purposes of
overlap testing. | 799 // Empty rects never intersect, but we need them to for the purposes of
overlap testing. |
800 if (layerBounds.isEmpty()) | 800 if (layerBounds.isEmpty()) |
801 layerBounds.setSize(IntSize(1, 1)); | 801 layerBounds.setSize(IntSize(1, 1)); |
802 boundsComputed = true; | 802 boundsComputed = true; |
803 } | 803 } |
804 | 804 |
805 IntRect clipRect = pixelSnappedIntRect(layer->clipper().backgroundClipRect(C
lipRectsContext(rootRenderLayer(), 0, AbsoluteClipRects)).rect()); // FIXME: Inc
orrect for CSS regions. | 805 IntRect clipRect = pixelSnappedIntRect(layer->clipper().backgroundClipRect(C
lipRectsContext(rootRenderLayer(), AbsoluteClipRects)).rect()); |
806 clipRect.intersect(layerBounds); | 806 clipRect.intersect(layerBounds); |
807 overlapMap.add(layer, clipRect); | 807 overlapMap.add(layer, clipRect); |
808 } | 808 } |
809 | 809 |
810 void RenderLayerCompositor::addToOverlapMapRecursive(OverlapMap& overlapMap, Ren
derLayer* layer, RenderLayer* ancestorLayer) | 810 void RenderLayerCompositor::addToOverlapMapRecursive(OverlapMap& overlapMap, Ren
derLayer* layer, RenderLayer* ancestorLayer) |
811 { | 811 { |
812 if (!canBeComposited(layer) || overlapMap.contains(layer)) | 812 if (!canBeComposited(layer) || overlapMap.contains(layer)) |
813 return; | 813 return; |
814 | 814 |
815 // A null ancestorLayer is an indication that 'layer' has already been pushe
d. | 815 // A null ancestorLayer is an indication that 'layer' has already been pushe
d. |
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1802 if (next == compositingAncestor) { | 1802 if (next == compositingAncestor) { |
1803 computeClipRoot = curr; | 1803 computeClipRoot = curr; |
1804 break; | 1804 break; |
1805 } | 1805 } |
1806 curr = next; | 1806 curr = next; |
1807 } | 1807 } |
1808 | 1808 |
1809 if (!computeClipRoot || computeClipRoot == layer) | 1809 if (!computeClipRoot || computeClipRoot == layer) |
1810 return false; | 1810 return false; |
1811 | 1811 |
1812 return layer->clipper().backgroundClipRect(ClipRectsContext(computeClipRoot,
0, TemporaryClipRects)).rect() != PaintInfo::infiniteRect(); // FIXME: Incorrec
t for CSS regions. | 1812 return layer->clipper().backgroundClipRect(ClipRectsContext(computeClipRoot,
TemporaryClipRects)).rect() != PaintInfo::infiniteRect(); |
1813 } | 1813 } |
1814 | 1814 |
1815 // Return true if the given layer is a stacking context and has compositing chil
d | 1815 // Return true if the given layer is a stacking context and has compositing chil
d |
1816 // layers that it needs to clip. In this case we insert a clipping GraphicsLayer | 1816 // layers that it needs to clip. In this case we insert a clipping GraphicsLayer |
1817 // into the hierarchy between this layer and its children in the z-order hierarc
hy. | 1817 // into the hierarchy between this layer and its children in the z-order hierarc
hy. |
1818 bool RenderLayerCompositor::clipsCompositingDescendants(const RenderLayer* layer
) const | 1818 bool RenderLayerCompositor::clipsCompositingDescendants(const RenderLayer* layer
) const |
1819 { | 1819 { |
1820 return layer->hasCompositingDescendant() && layer->renderer()->hasClipOrOver
flowClip(); | 1820 return layer->hasCompositingDescendant() && layer->renderer()->hasClipOrOver
flowClip(); |
1821 } | 1821 } |
1822 | 1822 |
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2724 } else if (graphicsLayer == m_scrollLayer.get()) { | 2724 } else if (graphicsLayer == m_scrollLayer.get()) { |
2725 name = "Frame Scrolling Layer"; | 2725 name = "Frame Scrolling Layer"; |
2726 } else { | 2726 } else { |
2727 ASSERT_NOT_REACHED(); | 2727 ASSERT_NOT_REACHED(); |
2728 } | 2728 } |
2729 | 2729 |
2730 return name; | 2730 return name; |
2731 } | 2731 } |
2732 | 2732 |
2733 } // namespace WebCore | 2733 } // namespace WebCore |
OLD | NEW |