void LayerTreeCoordinator::syncFixedLayers() { if (!m_webPage->corePage()->settings() || !m_webPage->corePage()->settings()->acceleratedCompositingForFixedPositionEnabled()) return; if (!m_webPage->mainFrame()->view()->hasViewportConstrainedObjects()) return; RenderLayer* rootRenderLayer = m_webPage->mainFrame()->contentRenderer()->compositor()->rootRenderLayer(); ASSERT(rootRenderLayer); if (rootRenderLayer->firstChild()) updateOffsetFromViewportForLayer(rootRenderLayer->firstChild()); }
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); }
void GraphicsLayerUpdater::update(RenderLayer& layer, UpdateType updateType) { if (layer.hasCompositedLayerMapping()) { CompositedLayerMappingPtr mapping = layer.compositedLayerMapping(); // 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); } mapping->updateGraphicsLayerConfiguration(); updateType = mapping->updateGraphicsLayerGeometry(updateType); mapping->clearNeedsGeometryUpdate(); if (!layer.parent()) layer.compositor()->updateRootLayerPosition(); if (mapping->hasUnpositionedOverflowControlsLayers()) layer.scrollableArea()->positionOverflowControls(); } for (RenderLayer* child = layer.firstChild(); child; child = child->nextSibling()) update(*child, updateType); }
void GraphicsLayerUpdater::assertNeedsToUpdateGraphicsLayerBitsCleared(RenderLayer& layer) { if (layer.hasCompositedLayerMapping()) layer.compositedLayerMapping()->assertNeedsToUpdateGraphicsLayerBitsCleared(); for (RenderLayer* child = layer.firstChild(); child; child = child->nextSibling()) assertNeedsToUpdateGraphicsLayerBitsCleared(*child); }
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); }