| 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 * Copyright (C) 2014 Google Inc. All rights reserved. | 3 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "config.h" | 27 #include "config.h" |
| 28 #include "core/rendering/compositing/GraphicsLayerTreeBuilder.h" | 28 #include "core/rendering/compositing/GraphicsLayerTreeBuilder.h" |
| 29 | 29 |
| 30 #include "core/html/HTMLMediaElement.h" | 30 #include "core/html/HTMLMediaElement.h" |
| 31 #include "core/rendering/RenderLayer.h" | 31 #include "core/rendering/RenderLayer.h" |
| 32 #include "core/rendering/RenderPart.h" | |
| 33 #include "core/rendering/RenderView.h" | 32 #include "core/rendering/RenderView.h" |
| 34 #include "core/rendering/compositing/CompositedLayerMapping.h" | 33 #include "core/rendering/compositing/CompositedLayerMapping.h" |
| 35 #include "core/rendering/compositing/RenderLayerCompositor.h" | 34 #include "core/rendering/compositing/RenderLayerCompositor.h" |
| 36 | 35 |
| 37 namespace blink { | 36 namespace blink { |
| 38 | 37 |
| 39 GraphicsLayerTreeBuilder::GraphicsLayerTreeBuilder() | 38 GraphicsLayerTreeBuilder::GraphicsLayerTreeBuilder() |
| 40 { | 39 { |
| 41 } | 40 } |
| 42 | 41 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // If a negative z-order child is compositing, we get a foreground layer
which needs to get parented. | 85 // If a negative z-order child is compositing, we get a foreground layer
which needs to get parented. |
| 87 if (hasCompositedLayerMapping && currentCompositedLayerMapping->foregrou
ndLayer()) | 86 if (hasCompositedLayerMapping && currentCompositedLayerMapping->foregrou
ndLayer()) |
| 88 infoForChildren.childLayersOfEnclosingCompositedLayer->append(curren
tCompositedLayerMapping->foregroundLayer()); | 87 infoForChildren.childLayersOfEnclosingCompositedLayer->append(curren
tCompositedLayerMapping->foregroundLayer()); |
| 89 } | 88 } |
| 90 | 89 |
| 91 RenderLayerStackingNodeIterator iterator(*layer.stackingNode(), NormalFlowCh
ildren | PositiveZOrderChildren); | 90 RenderLayerStackingNodeIterator iterator(*layer.stackingNode(), NormalFlowCh
ildren | PositiveZOrderChildren); |
| 92 while (RenderLayerStackingNode* curNode = iterator.next()) | 91 while (RenderLayerStackingNode* curNode = iterator.next()) |
| 93 rebuild(*curNode->layer(), infoForChildren); | 92 rebuild(*curNode->layer(), infoForChildren); |
| 94 | 93 |
| 95 if (hasCompositedLayerMapping) { | 94 if (hasCompositedLayerMapping) { |
| 96 bool parented = false; | 95 currentCompositedLayerMapping->parentForSublayers()->setChildren(layerCh
ildren); |
| 97 if (layer.renderer()->isRenderPart()) | |
| 98 parented = RenderLayerCompositor::parentFrameContentLayers(toRenderP
art(layer.renderer())); | |
| 99 | |
| 100 if (!parented) | |
| 101 currentCompositedLayerMapping->parentForSublayers()->setChildren(lay
erChildren); | |
| 102 | 96 |
| 103 // If the layer has a clipping layer the overflow controls layers will b
e siblings of the clipping layer. | 97 // If the layer has a clipping layer the overflow controls layers will b
e siblings of the clipping layer. |
| 104 // Otherwise, the overflow control layers are normal children. | 98 // Otherwise, the overflow control layers are normal children. |
| 105 // FIXME: Why isn't this handled in CLM updateInternalHierarchy? | 99 // FIXME: Why isn't this handled in CLM updateInternalHierarchy? |
| 106 if (!currentCompositedLayerMapping->hasClippingLayer() && !currentCompos
itedLayerMapping->hasScrollingLayer()) { | 100 if (!currentCompositedLayerMapping->hasClippingLayer() && !currentCompos
itedLayerMapping->hasScrollingLayer()) { |
| 107 if (GraphicsLayer* overflowControlLayer = currentCompositedLayerMapp
ing->layerForHorizontalScrollbar()) { | 101 if (GraphicsLayer* overflowControlLayer = currentCompositedLayerMapp
ing->layerForHorizontalScrollbar()) { |
| 108 overflowControlLayer->removeFromParent(); | 102 overflowControlLayer->removeFromParent(); |
| 109 currentCompositedLayerMapping->parentForSublayers()->addChild(ov
erflowControlLayer); | 103 currentCompositedLayerMapping->parentForSublayers()->addChild(ov
erflowControlLayer); |
| 110 } | 104 } |
| 111 | 105 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 125 } | 119 } |
| 126 | 120 |
| 127 if (layer.scrollParent() | 121 if (layer.scrollParent() |
| 128 && layer.scrollParent()->hasCompositedLayerMapping() | 122 && layer.scrollParent()->hasCompositedLayerMapping() |
| 129 && layer.scrollParent()->compositedLayerMapping()->needsToReparentOverfl
owControls() | 123 && layer.scrollParent()->compositedLayerMapping()->needsToReparentOverfl
owControls() |
| 130 && layer.scrollParent()->scrollableArea()->topmostScrollChild() == &laye
r) | 124 && layer.scrollParent()->scrollableArea()->topmostScrollChild() == &laye
r) |
| 131 info.childLayersOfEnclosingCompositedLayer->append(layer.scrollParent()-
>compositedLayerMapping()->detachLayerForOverflowControls(*info.enclosingComposi
tedLayer)); | 125 info.childLayersOfEnclosingCompositedLayer->append(layer.scrollParent()-
>compositedLayerMapping()->detachLayerForOverflowControls(*info.enclosingComposi
tedLayer)); |
| 132 } | 126 } |
| 133 | 127 |
| 134 } | 128 } |
| OLD | NEW |