void CompositingLayerAssigner::assignLayersToBackingsInternal(DeprecatedPaintLayer* layer, SquashingState& squashingState, Vector<DeprecatedPaintLayer*>& layersNeedingPaintInvalidation) { if (requiresSquashing(layer->compositingReasons())) { CompositingReasons reasonsPreventingSquashing = getReasonsPreventingSquashing(layer, squashingState); if (reasonsPreventingSquashing) layer->setCompositingReasons(layer->compositingReasons() | reasonsPreventingSquashing); } CompositingStateTransitionType compositedLayerUpdate = computeCompositedLayerUpdate(layer); if (m_compositor->allocateOrClearCompositedDeprecatedPaintLayerMapping(layer, compositedLayerUpdate)) { TRACE_LAYER_INVALIDATION(layer, InspectorLayerInvalidationTrackingEvent::NewCompositedLayer); layersNeedingPaintInvalidation.append(layer); m_layersChanged = true; if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLayer(*layer)) { if (layer->layoutObject()->style()->hasViewportConstrainedPosition()) scrollingCoordinator->frameViewFixedObjectsDidChange(layer->layoutObject()->view()->frameView()); } } // FIXME: special-casing reflection layers here is not right. if (layer->reflectionInfo()) assignLayersToBackingsForReflectionLayer(layer->reflectionInfo()->reflectionLayer(), layersNeedingPaintInvalidation); // Add this layer to a squashing backing if needed. updateSquashingAssignment(layer, squashingState, compositedLayerUpdate, layersNeedingPaintInvalidation); const bool layerIsSquashed = compositedLayerUpdate == PutInSquashingLayer || (compositedLayerUpdate == NoCompositingStateChange && layer->groupedMapping()); if (layerIsSquashed) { squashingState.nextSquashedLayerIndex++; IntRect layerBounds = layer->clippedAbsoluteBoundingBox(); squashingState.totalAreaOfSquashedRects += layerBounds.size().area(); squashingState.boundingRect.unite(layerBounds); } if (layer->stackingNode()->isStackingContext()) { DeprecatedPaintLayerStackingNodeIterator iterator(*layer->stackingNode(), NegativeZOrderChildren); while (DeprecatedPaintLayerStackingNode* curNode = iterator.next()) assignLayersToBackingsInternal(curNode->layer(), squashingState, layersNeedingPaintInvalidation); } // At this point, if the layer is to be separately composited, then its backing becomes the most recent in paint-order. if (layer->compositingState() == PaintsIntoOwnBacking) { ASSERT(!requiresSquashing(layer->compositingReasons())); squashingState.updateSquashingStateForNewMapping(layer->compositedDeprecatedPaintLayerMapping(), layer->hasCompositedDeprecatedPaintLayerMapping()); } if (layer->scrollParent()) layer->scrollParent()->scrollableArea()->setTopmostScrollChild(layer); if (layer->needsCompositedScrolling()) layer->scrollableArea()->setTopmostScrollChild(nullptr); DeprecatedPaintLayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowChildren | PositiveZOrderChildren); while (DeprecatedPaintLayerStackingNode* curNode = iterator.next()) assignLayersToBackingsInternal(curNode->layer(), squashingState, layersNeedingPaintInvalidation); if (squashingState.hasMostRecentMapping && &squashingState.mostRecentMapping->owningLayer() == layer) squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree = true; }
void CompositingLayerAssigner::assignLayersToBackingsInternal(RenderLayer* layer, SquashingState& squashingState, bool& layersChanged, Vector<RenderLayer*>& layersNeedingRepaint) { if (m_layerSquashingEnabled && requiresSquashing(layer->compositingReasons())) { CompositingReasons reasonsPreventingSquashing = getReasonsPreventingSquashing(layer, squashingState); if (reasonsPreventingSquashing) layer->setCompositingReasons(layer->compositingReasons() | reasonsPreventingSquashing); } CompositingStateTransitionType compositedLayerUpdate = computeCompositedLayerUpdate(layer); if (m_compositor->allocateOrClearCompositedLayerMapping(layer, compositedLayerUpdate)) { layersNeedingRepaint.append(layer); layersChanged = true; } // FIXME: special-casing reflection layers here is not right. if (layer->reflectionInfo()) assignLayersToBackingsForReflectionLayer(layer->reflectionInfo()->reflectionLayer(), layersChanged, layersNeedingRepaint); // Add this layer to a squashing backing if needed. if (m_layerSquashingEnabled) { if (updateSquashingAssignment(layer, squashingState, compositedLayerUpdate, layersNeedingRepaint)) layersChanged = true; const bool layerIsSquashed = compositedLayerUpdate == PutInSquashingLayer || (compositedLayerUpdate == NoCompositingStateChange && layer->groupedMapping()); if (layerIsSquashed) { squashingState.nextSquashedLayerIndex++; IntRect layerBounds = layer->compositingInputs().clippedAbsoluteBoundingBox; squashingState.totalAreaOfSquashedRects += layerBounds.size().area(); squashingState.boundingRect.unite(layerBounds); } } if (layer->stackingNode()->isStackingContext()) { RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NegativeZOrderChildren); while (RenderLayerStackingNode* curNode = iterator.next()) assignLayersToBackingsInternal(curNode->layer(), squashingState, layersChanged, layersNeedingRepaint); } if (m_layerSquashingEnabled) { // At this point, if the layer is to be "separately" composited, then its backing becomes the most recent in paint-order. if (layer->compositingState() == PaintsIntoOwnBacking || layer->compositingState() == HasOwnBackingButPaintsIntoAncestor) { ASSERT(!requiresSquashing(layer->compositingReasons())); squashingState.updateSquashingStateForNewMapping(layer->compositedLayerMapping(), layer->hasCompositedLayerMapping()); } } RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowChildren | PositiveZOrderChildren); while (RenderLayerStackingNode* curNode = iterator.next()) assignLayersToBackingsInternal(curNode->layer(), squashingState, layersChanged, layersNeedingRepaint); if (squashingState.hasMostRecentMapping && &squashingState.mostRecentMapping->owningLayer() == layer) squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree = true; }
void CompositingLayerAssigner::assignLayersToBackingsForReflectionLayer(RenderLayer* reflectionLayer, bool& layersChanged) { CompositingStateTransitionType compositedLayerUpdate = computeCompositedLayerUpdate(reflectionLayer); if (compositedLayerUpdate != NoCompositingStateChange) { layersChanged = true; m_compositor->allocateOrClearCompositedLayerMapping(reflectionLayer, compositedLayerUpdate); } m_compositor->updateDirectCompositingReasons(reflectionLayer); if (reflectionLayer->hasCompositedLayerMapping()) reflectionLayer->compositedLayerMapping()->updateGraphicsLayerConfiguration(GraphicsLayerUpdater::ForceUpdate); }
void CompositingLayerAssigner::assignLayersToBackingsForReflectionLayer(DeprecatedPaintLayer* reflectionLayer, Vector<DeprecatedPaintLayer*>& layersNeedingPaintInvalidation) { CompositingStateTransitionType compositedLayerUpdate = computeCompositedLayerUpdate(reflectionLayer); if (compositedLayerUpdate != NoCompositingStateChange) { TRACE_LAYER_INVALIDATION(reflectionLayer, InspectorLayerInvalidationTrackingEvent::ReflectionLayerChanged); layersNeedingPaintInvalidation.append(reflectionLayer); m_layersChanged = true; m_compositor->allocateOrClearCompositedDeprecatedPaintLayerMapping(reflectionLayer, compositedLayerUpdate); } m_compositor->updateDirectCompositingReasons(reflectionLayer); // FIXME: Why do we updateGraphicsLayerConfiguration here instead of in the GraphicsLayerUpdater? if (reflectionLayer->hasCompositedDeprecatedPaintLayerMapping()) reflectionLayer->compositedDeprecatedPaintLayerMapping()->updateGraphicsLayerConfiguration(); }