void GraphicsLayerUpdater::updateRecursive(RenderLayer& layer, UpdateType updateType, const UpdateContext& context, Vector<RenderLayer*>& layersNeedingPaintInvalidation) { if (layer.hasCompositedLayerMapping()) { CompositedLayerMapping* mapping = layer.compositedLayerMapping(); if (updateType == ForceUpdate || mapping->needsGraphicsLayerUpdate()) { const RenderLayer* compositingContainer = context.compositingContainer(layer); ASSERT(compositingContainer == layer.enclosingLayerWithCompositedLayerMapping(ExcludeSelf)); if (mapping->updateGraphicsLayerConfiguration()) m_needsRebuildTree = true; mapping->updateGraphicsLayerGeometry(compositingContainer, context.compositingStackingContext(), layersNeedingPaintInvalidation); if (mapping->hasUnpositionedOverflowControlsLayers()) layer.scrollableArea()->positionOverflowControls(IntSize()); updateType = mapping->updateTypeForChildren(updateType); mapping->clearNeedsGraphicsLayerUpdate(); } } UpdateContext childContext(context, layer); for (RenderLayer* child = layer.firstChild(); child; child = child->nextSibling()) updateRecursive(*child, updateType, childContext, layersNeedingPaintInvalidation); }
UpdateContext(const UpdateContext& other, const RenderLayer& layer) : m_compositingStackingContext(other.m_compositingStackingContext) , m_compositingAncestor(other.compositingContainer(layer)) { CompositingState compositingState = layer.compositingState(); if (compositingState != NotComposited && compositingState != PaintsIntoGroupedBacking) { m_compositingAncestor = &layer; if (layer.stackingNode()->isStackingContext()) m_compositingStackingContext = &layer; } }
void GraphicsLayerUpdater::update(RenderLayer& layer, UpdateType updateType, const UpdateContext& context) { if (layer.hasCompositedLayerMapping()) { CompositedLayerMappingPtr mapping = layer.compositedLayerMapping(); const RenderLayer* compositingContainer = context.compositingContainer(layer); ASSERT(compositingContainer == layer.ancestorCompositingLayer()); if (mapping->updateRequiresOwnBackingStoreForAncestorReasons(compositingContainer)) updateType = ForceUpdate; // Note carefully: here we assume that the compositing state of all descendants have been updated already, // so it is legitimate to compute and cache the composited bounds for this layer. mapping->updateCompositedBounds(updateType); if (RenderLayerReflectionInfo* reflection = layer.reflectionInfo()) { if (reflection->reflectionLayer()->hasCompositedLayerMapping()) reflection->reflectionLayer()->compositedLayerMapping()->updateCompositedBounds(ForceUpdate); } if (mapping->updateGraphicsLayerConfiguration(updateType)) m_needsRebuildTree = true; mapping->updateGraphicsLayerGeometry(updateType, compositingContainer); updateType = mapping->updateTypeForChildren(updateType); mapping->clearNeedsGraphicsLayerUpdate(); if (!layer.parent()) layer.compositor()->updateRootLayerPosition(); if (mapping->hasUnpositionedOverflowControlsLayers()) layer.scrollableArea()->positionOverflowControls(); } UpdateContext childContext(context, layer); for (RenderLayer* child = layer.firstChild(); child; child = child->nextSibling()) update(*child, updateType, childContext); }