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::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); }
WebCore::GraphicsLayer* ChromeClientAndroid::layersSync() { if (m_rootGraphicsLayer && m_needsLayerSync && m_webFrame) { // We may have more than one frame, so let's first update all of them // (webkit may want to update the GraphicsLayer tree, and we do *not* want // to find this out when we are painting, as it means we could be summarily // deallocated while painting...) GraphicsLayerAndroid* rootLayer = static_cast<GraphicsLayerAndroid*>(m_rootGraphicsLayer); Vector<const RenderLayer*> listRootLayers; rootLayer->gatherRootLayers(listRootLayers); for (unsigned int i = 0; i < listRootLayers.size(); i++) { RenderLayer* layer = const_cast<RenderLayer*>(listRootLayers[i]); layer->compositor()->updateCompositingLayers(); } Frame* frame = m_webFrame->page()->mainFrame(); if (FrameView* frameView = frame->view()) frameView->syncCompositingStateIncludingSubframes(); } m_needsLayerSync = false; return m_rootGraphicsLayer; }
void GraphicsLayerUpdater::update(RenderLayer& layer, Vector<RenderLayer*>& layersNeedingPaintInvalidation) { TRACE_EVENT0("blink", "GraphicsLayerUpdater::update"); updateRecursive(layer, DoNotForceUpdate, UpdateContext(), layersNeedingPaintInvalidation); layer.compositor()->updateRootLayerPosition(); }