X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fcore%2Frendering%2Fcompositing%2FGraphicsLayerTreeBuilder.cpp;h=878776aa162aeb51db7f8867d15f30d67e0bb1ab;hb=4a1a0bdd01eef90b0826a0e761d3379d3715c10f;hp=9826be1185ed18813e8972be622b3a63ceac7416;hpb=b1be5ca53587d23e7aeb77b26861fdc0a181ffd8;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/core/rendering/compositing/GraphicsLayerTreeBuilder.cpp b/src/third_party/WebKit/Source/core/rendering/compositing/GraphicsLayerTreeBuilder.cpp index 9826be1..878776a 100644 --- a/src/third_party/WebKit/Source/core/rendering/compositing/GraphicsLayerTreeBuilder.cpp +++ b/src/third_party/WebKit/Source/core/rendering/compositing/GraphicsLayerTreeBuilder.cpp @@ -35,7 +35,7 @@ #include "core/rendering/compositing/CompositedLayerMapping.h" #include "core/rendering/compositing/RenderLayerCompositor.h" -namespace WebCore { +namespace blink { GraphicsLayerTreeBuilder::GraphicsLayerTreeBuilder() { @@ -55,39 +55,43 @@ static bool shouldAppendLayer(const RenderLayer& layer) return true; } -void GraphicsLayerTreeBuilder::rebuild(RenderLayer& layer, GraphicsLayerVector& childLayersOfEnclosingLayer) +void GraphicsLayerTreeBuilder::rebuild(RenderLayer& layer, AncestorInfo info) { // Make the layer compositing if necessary, and set up clipping and content layers. // Note that we can only do work here that is independent of whether the descendant layers - // have been processed. computeCompositingRequirements() will already have done the repaint if necessary. + // have been processed. computeCompositingRequirements() will already have done the paint invalidation if necessary. layer.stackingNode()->updateLayerListsIfNeeded(); const bool hasCompositedLayerMapping = layer.hasCompositedLayerMapping(); - CompositedLayerMappingPtr currentCompositedLayerMapping = layer.compositedLayerMapping(); + CompositedLayerMapping* currentCompositedLayerMapping = layer.compositedLayerMapping(); // If this layer has a compositedLayerMapping, then that is where we place subsequent children GraphicsLayers. // Otherwise children continue to append to the child list of the enclosing layer. GraphicsLayerVector layerChildren; - GraphicsLayerVector& childList = hasCompositedLayerMapping ? layerChildren : childLayersOfEnclosingLayer; + AncestorInfo infoForChildren(info); + if (hasCompositedLayerMapping) { + infoForChildren.childLayersOfEnclosingCompositedLayer = &layerChildren; + infoForChildren.enclosingCompositedLayer = &layer; + } -#if ASSERT_ENABLED +#if ENABLE(ASSERT) LayerListMutationDetector mutationChecker(layer.stackingNode()); #endif if (layer.stackingNode()->isStackingContext()) { RenderLayerStackingNodeIterator iterator(*layer.stackingNode(), NegativeZOrderChildren); while (RenderLayerStackingNode* curNode = iterator.next()) - rebuild(*curNode->layer(), childList); + rebuild(*curNode->layer(), infoForChildren); // If a negative z-order child is compositing, we get a foreground layer which needs to get parented. if (hasCompositedLayerMapping && currentCompositedLayerMapping->foregroundLayer()) - childList.append(currentCompositedLayerMapping->foregroundLayer()); + infoForChildren.childLayersOfEnclosingCompositedLayer->append(currentCompositedLayerMapping->foregroundLayer()); } RenderLayerStackingNodeIterator iterator(*layer.stackingNode(), NormalFlowChildren | PositiveZOrderChildren); while (RenderLayerStackingNode* curNode = iterator.next()) - rebuild(*curNode->layer(), childList); + rebuild(*curNode->layer(), infoForChildren); if (hasCompositedLayerMapping) { bool parented = false; @@ -99,6 +103,7 @@ void GraphicsLayerTreeBuilder::rebuild(RenderLayer& layer, GraphicsLayerVector& // If the layer has a clipping layer the overflow controls layers will be siblings of the clipping layer. // Otherwise, the overflow control layers are normal children. + // FIXME: Why isn't this handled in CLM updateInternalHierarchy? if (!currentCompositedLayerMapping->hasClippingLayer() && !currentCompositedLayerMapping->hasScrollingLayer()) { if (GraphicsLayer* overflowControlLayer = currentCompositedLayerMapping->layerForHorizontalScrollbar()) { overflowControlLayer->removeFromParent(); @@ -117,8 +122,14 @@ void GraphicsLayerTreeBuilder::rebuild(RenderLayer& layer, GraphicsLayerVector& } if (shouldAppendLayer(layer)) - childLayersOfEnclosingLayer.append(currentCompositedLayerMapping->childForSuperlayers()); + info.childLayersOfEnclosingCompositedLayer->append(currentCompositedLayerMapping->childForSuperlayers()); } + + if (layer.scrollParent() + && layer.scrollParent()->hasCompositedLayerMapping() + && layer.scrollParent()->compositedLayerMapping()->needsToReparentOverflowControls() + && layer.scrollParent()->scrollableArea()->topmostScrollChild() == &layer) + info.childLayersOfEnclosingCompositedLayer->append(layer.scrollParent()->compositedLayerMapping()->detachLayerForOverflowControls(*info.enclosingCompositedLayer)); } }