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 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 if (!boundsComputed) { | 739 if (!boundsComputed) { |
740 // FIXME: If this layer's overlap bounds include its children, we don't
need to add its | 740 // FIXME: If this layer's overlap bounds include its children, we don't
need to add its |
741 // children's bounds to the overlap map. | 741 // children's bounds to the overlap map. |
742 layerBounds = enclosingIntRect(overlapMap.geometryMap().absoluteRect(lay
er->overlapBounds())); | 742 layerBounds = enclosingIntRect(overlapMap.geometryMap().absoluteRect(lay
er->overlapBounds())); |
743 // Empty rects never intersect, but we need them to for the purposes of
overlap testing. | 743 // Empty rects never intersect, but we need them to for the purposes of
overlap testing. |
744 if (layerBounds.isEmpty()) | 744 if (layerBounds.isEmpty()) |
745 layerBounds.setSize(IntSize(1, 1)); | 745 layerBounds.setSize(IntSize(1, 1)); |
746 boundsComputed = true; | 746 boundsComputed = true; |
747 } | 747 } |
748 | 748 |
749 IntRect clipRect = pixelSnappedIntRect(layer->clipper().backgroundClipRect(C
lipRectsContext(rootRenderLayer(), 0, AbsoluteClipRects)).rect()); // FIXME: Inc
orrect for CSS regions. | 749 IntRect clipRect = pixelSnappedIntRect(layer->clipper().backgroundClipRect(C
lipRectsContext(rootRenderLayer(), AbsoluteClipRects)).rect()); |
750 clipRect.intersect(layerBounds); | 750 clipRect.intersect(layerBounds); |
751 overlapMap.add(layer, clipRect); | 751 overlapMap.add(layer, clipRect); |
752 } | 752 } |
753 | 753 |
754 void RenderLayerCompositor::addToOverlapMapRecursive(OverlapMap& overlapMap, Ren
derLayer* layer, RenderLayer* ancestorLayer) | 754 void RenderLayerCompositor::addToOverlapMapRecursive(OverlapMap& overlapMap, Ren
derLayer* layer, RenderLayer* ancestorLayer) |
755 { | 755 { |
756 if (!canBeComposited(layer) || overlapMap.contains(layer)) | 756 if (!canBeComposited(layer) || overlapMap.contains(layer)) |
757 return; | 757 return; |
758 | 758 |
759 // A null ancestorLayer is an indication that 'layer' has already been pushe
d. | 759 // A null ancestorLayer is an indication that 'layer' has already been pushe
d. |
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1732 if (next == compositingAncestor) { | 1732 if (next == compositingAncestor) { |
1733 computeClipRoot = curr; | 1733 computeClipRoot = curr; |
1734 break; | 1734 break; |
1735 } | 1735 } |
1736 curr = next; | 1736 curr = next; |
1737 } | 1737 } |
1738 | 1738 |
1739 if (!computeClipRoot || computeClipRoot == layer) | 1739 if (!computeClipRoot || computeClipRoot == layer) |
1740 return false; | 1740 return false; |
1741 | 1741 |
1742 return layer->clipper().backgroundClipRect(ClipRectsContext(computeClipRoot,
0, TemporaryClipRects)).rect() != PaintInfo::infiniteRect(); // FIXME: Incorrec
t for CSS regions. | 1742 return layer->clipper().backgroundClipRect(ClipRectsContext(computeClipRoot,
TemporaryClipRects)).rect() != PaintInfo::infiniteRect(); |
1743 } | 1743 } |
1744 | 1744 |
1745 // Return true if the given layer is a stacking context and has compositing chil
d | 1745 // Return true if the given layer is a stacking context and has compositing chil
d |
1746 // layers that it needs to clip. In this case we insert a clipping GraphicsLayer | 1746 // layers that it needs to clip. In this case we insert a clipping GraphicsLayer |
1747 // into the hierarchy between this layer and its children in the z-order hierarc
hy. | 1747 // into the hierarchy between this layer and its children in the z-order hierarc
hy. |
1748 bool RenderLayerCompositor::clipsCompositingDescendants(const RenderLayer* layer
) const | 1748 bool RenderLayerCompositor::clipsCompositingDescendants(const RenderLayer* layer
) const |
1749 { | 1749 { |
1750 return layer->hasCompositingDescendant() && layer->renderer()->hasClipOrOver
flowClip(); | 1750 return layer->hasCompositingDescendant() && layer->renderer()->hasClipOrOver
flowClip(); |
1751 } | 1751 } |
1752 | 1752 |
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2654 } else if (graphicsLayer == m_scrollLayer.get()) { | 2654 } else if (graphicsLayer == m_scrollLayer.get()) { |
2655 name = "Frame Scrolling Layer"; | 2655 name = "Frame Scrolling Layer"; |
2656 } else { | 2656 } else { |
2657 ASSERT_NOT_REACHED(); | 2657 ASSERT_NOT_REACHED(); |
2658 } | 2658 } |
2659 | 2659 |
2660 return name; | 2660 return name; |
2661 } | 2661 } |
2662 | 2662 |
2663 } // namespace WebCore | 2663 } // namespace WebCore |
OLD | NEW |