| 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 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 | 801 |
| 802 void RenderLayerCompositor::addToOverlapMap(OverlapMap& overlapMap, RenderLayer*
layer, IntRect& layerBounds, bool& boundsComputed) | 802 void RenderLayerCompositor::addToOverlapMap(OverlapMap& overlapMap, RenderLayer*
layer, IntRect& layerBounds, bool& boundsComputed) |
| 803 { | 803 { |
| 804 if (layer->isRootLayer()) | 804 if (layer->isRootLayer()) |
| 805 return; | 805 return; |
| 806 | 806 |
| 807 if (!boundsComputed) { | 807 if (!boundsComputed) { |
| 808 // FIXME: If this layer's overlap bounds include its children, we don't
need to add its | 808 // FIXME: If this layer's overlap bounds include its children, we don't
need to add its |
| 809 // children's bounds to the overlap map. | 809 // children's bounds to the overlap map. |
| 810 layerBounds = enclosingIntRect(overlapMap.geometryMap().absoluteRect(lay
er->overlapBounds())); | 810 layerBounds = enclosingIntRect(overlapMap.geometryMap().absoluteRect(lay
er->overlapBounds())); |
| 811 // Empty rects never intersect, but we need them to for the purposes of
overlap testing. | 811 boundsComputed = true; |
| 812 if (layerBounds.isEmpty()) | 812 if (layerBounds.isEmpty()) |
| 813 layerBounds.setSize(IntSize(1, 1)); | 813 return; |
| 814 boundsComputed = true; | |
| 815 } | 814 } |
| 816 | 815 |
| 817 IntRect clipRect = pixelSnappedIntRect(layer->backgroundClipRect(RenderLayer
::ClipRectsContext(rootRenderLayer(), 0, AbsoluteClipRects)).rect()); // FIXME:
Incorrect for CSS regions. | 816 IntRect clipRect = pixelSnappedIntRect(layer->backgroundClipRect(RenderLayer
::ClipRectsContext(rootRenderLayer(), 0, AbsoluteClipRects)).rect()); // FIXME:
Incorrect for CSS regions. |
| 818 if (Settings* settings = m_renderView->document()->settings()) | 817 if (Settings* settings = m_renderView->document()->settings()) |
| 819 if (!settings->applyPageScaleFactorInCompositor()) | 818 if (!settings->applyPageScaleFactorInCompositor()) |
| 820 clipRect.scale(pageScaleFactor()); | 819 clipRect.scale(pageScaleFactor()); |
| 821 clipRect.intersect(layerBounds); | 820 clipRect.intersect(layerBounds); |
| 822 overlapMap.add(layer, clipRect); | 821 overlapMap.add(layer, clipRect); |
| 823 } | 822 } |
| 824 | 823 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 layer->setHasCompositingDescendant(false); | 890 layer->setHasCompositingDescendant(false); |
| 892 | 891 |
| 893 RenderLayer::IndirectCompositingReason compositingReason = compositingState.
m_subtreeIsCompositing ? RenderLayer::IndirectCompositingForStacking : RenderLay
er::NoIndirectCompositingReason; | 892 RenderLayer::IndirectCompositingReason compositingReason = compositingState.
m_subtreeIsCompositing ? RenderLayer::IndirectCompositingForStacking : RenderLay
er::NoIndirectCompositingReason; |
| 894 | 893 |
| 895 bool haveComputedBounds = false; | 894 bool haveComputedBounds = false; |
| 896 IntRect absBounds; | 895 IntRect absBounds; |
| 897 if (overlapMap && !overlapMap->isEmpty() && compositingState.m_testingOverla
p) { | 896 if (overlapMap && !overlapMap->isEmpty() && compositingState.m_testingOverla
p) { |
| 898 // If we're testing for overlap, we only need to composite if we overlap
something that is already composited. | 897 // If we're testing for overlap, we only need to composite if we overlap
something that is already composited. |
| 899 absBounds = enclosingIntRect(overlapMap->geometryMap().absoluteRect(laye
r->overlapBounds())); | 898 absBounds = enclosingIntRect(overlapMap->geometryMap().absoluteRect(laye
r->overlapBounds())); |
| 900 | 899 |
| 901 // Empty rects never intersect, but we need them to for the purposes of
overlap testing. | |
| 902 if (absBounds.isEmpty()) | |
| 903 absBounds.setSize(IntSize(1, 1)); | |
| 904 haveComputedBounds = true; | 900 haveComputedBounds = true; |
| 905 compositingReason = overlapMap->overlapsLayers(absBounds) ? RenderLayer:
:IndirectCompositingForOverlap : RenderLayer::NoIndirectCompositingReason; | 901 compositingReason = overlapMap->overlapsLayers(absBounds) ? RenderLayer:
:IndirectCompositingForOverlap : RenderLayer::NoIndirectCompositingReason; |
| 906 } | 902 } |
| 907 | 903 |
| 908 #if ENABLE(VIDEO) | 904 #if ENABLE(VIDEO) |
| 909 // Video is special. It's the only RenderLayer type that can both have | 905 // Video is special. It's the only RenderLayer type that can both have |
| 910 // RenderLayer children and whose children can't use its backing to render | 906 // RenderLayer children and whose children can't use its backing to render |
| 911 // into. These children (the controls) always need to be promoted into their | 907 // into. These children (the controls) always need to be promoted into their |
| 912 // own layers to draw on top of the accelerated video. | 908 // own layers to draw on top of the accelerated video. |
| 913 if (compositingState.m_compositingAncestor && compositingState.m_compositing
Ancestor->renderer()->isVideo()) | 909 if (compositingState.m_compositingAncestor && compositingState.m_compositing
Ancestor->renderer()->isVideo()) |
| (...skipping 2243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3157 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea"); | 3153 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea"); |
| 3158 info.addMember(m_layerForHeader, "layerForHeader"); | 3154 info.addMember(m_layerForHeader, "layerForHeader"); |
| 3159 info.addMember(m_layerForFooter, "layerForFooter"); | 3155 info.addMember(m_layerForFooter, "layerForFooter"); |
| 3160 #endif | 3156 #endif |
| 3161 info.addMember(m_layerUpdater, "layerUpdater"); | 3157 info.addMember(m_layerUpdater, "layerUpdater"); |
| 3162 } | 3158 } |
| 3163 | 3159 |
| 3164 } // namespace WebCore | 3160 } // namespace WebCore |
| 3165 | 3161 |
| 3166 #endif // USE(ACCELERATED_COMPOSITING) | 3162 #endif // USE(ACCELERATED_COMPOSITING) |
| OLD | NEW |