Home | History | Annotate | Download | only in compositing

Lines Matching full:layer

84 bool CompositingLayerAssigner::needsOwnBacking(const RenderLayer* layer) const
86 if (!m_compositor->canBeComposited(layer))
90 bool needsOwnBackingForDisabledSquashing = !m_layerSquashingEnabled && requiresSquashing(layer->compositingReasons());
92 return requiresCompositing(layer->compositingReasons()) || needsOwnBackingForDisabledSquashing || (m_compositor->staleInCompositingMode() && layer->isRootLayer());
95 CompositingStateTransitionType CompositingLayerAssigner::computeCompositedLayerUpdate(RenderLayer* layer)
98 if (needsOwnBacking(layer)) {
99 if (!layer->hasCompositedLayerMapping()) {
103 if (layer->hasCompositedLayerMapping())
107 if (!layer->subtreeIsInvisible() && requiresSquashing(layer->compositingReasons())) {
108 // We can't compute at this time whether the squashing layer update is a no-op,
109 // since that requires walking the render layer tree.
111 } else if (layer->groupedMapping() || layer->lostGroupedMapping()) {
119 CompositingReasons CompositingLayerAssigner::getReasonsPreventingSquashing(const RenderLayer* layer, const CompositingLayerAssigner::SquashingState& squashingState)
133 // compositing/video/video-controls-layer-creation.html
134 if (layer->renderer()->isVideo() || squashingLayer.renderer()->isVideo())
139 if (layer->renderer()->isRenderPart() || squashingLayer.renderer()->isRenderPart())
142 if (layer->reflectionInfo())
145 if (squashingWouldExceedSparsityTolerance(layer, squashingState))
148 if (layer->renderer()->hasBlendMode())
152 if (layer->clippingContainer() != squashingLayer.clippingContainer() && !squashingLayer.compositedLayerMapping()->containingSquashedLayer(layer->clippingContainer(), squashingState.nextSquashedLayerIndex))
155 // Composited descendants need to be clipped by a child containment graphics layer, which would not be available if the layer is
156 // squashed (and therefore has no CLM nor a child containment graphics layer).
157 if (m_compositor->clipsCompositingDescendants(layer))
160 if (layer->scrollsWithRespectTo(&squashingLayer))
163 const RenderLayer::AncestorDependentCompositingInputs& compositingInputs = layer->ancestorDependentCompositingInputs();
172 if (layer->hasFilter() || compositingInputs.filterAncestor != squashingLayerCompositingInputs.filterAncestor)
178 void CompositingLayerAssigner::updateSquashingAssignment(RenderLayer* layer, SquashingState& squashingState, const CompositingStateTransitionType compositedLayerUpdate,
181 // NOTE: In the future as we generalize this, the background of this layer may need to be assigned to a different backing than
183 // to paint on top of the background, but below the layer's main contents. For now, because we always composite layers
186 // A layer that is squashed with other layers cannot have its own CompositedLayerMapping.
187 ASSERT(!layer->hasCompositedLayerMapping());
191 squashingState.mostRecentMapping->updateSquashingLayerAssignment(layer, squashingState.mostRecentMapping->owningLayer(), squashingState.nextSquashedLayerIndex);
196 // the graphics layer geometry.
199 layer->clipper().clearClipRectsIncludingDescendants();
201 // Issue a paint invalidation, since |layer| may have been added to an already-existing squashing layer.
202 TRACE_LAYER_INVALIDATION(layer, InspectorLayerInvalidationTrackingEvent::AddedToSquashingLayer);
203 layersNeedingPaintInvalidation.append(layer);
206 if (layer->groupedMapping()) {
207 // Before removing |layer| from an already-existing squashing layer that may have other content, issue a paint invalidation.
208 m_compositor->paintInvalidationOnCompositingChange(layer);
209 layer->groupedMapping()->setNeedsGraphicsLayerUpdate(GraphicsLayerUpdateSubtree);
210 layer->setGroupedMapping(0);
213 // If we need to issue paint invalidations, do so now that we've removed it from a squashed layer.
214 TRACE_LAYER_INVALIDATION(layer, InspectorLayerInvalidationTrackingEvent::RemovedFromSquashingLayer);
215 layersNeedingPaintInvalidation.append(layer);
218 layer->setLostGroupedMapping(false);
238 void CompositingLayerAssigner::assignLayersToBackingsInternal(RenderLayer* layer, SquashingState& squashingState, Vector<RenderLayer*>& layersNeedingPaintInvalidation)
240 if (m_layerSquashingEnabled && requiresSquashing(layer->compositingReasons())) {
241 CompositingReasons reasonsPreventingSquashing = getReasonsPreventingSquashing(layer, squashingState);
243 layer->setCompositingReasons(layer->compositingReasons() | reasonsPreventingSquashing);
246 CompositingStateTransitionType compositedLayerUpdate = computeCompositedLayerUpdate(layer);
248 if (m_compositor->allocateOrClearCompositedLayerMapping(layer, compositedLayerUpdate)) {
249 TRACE_LAYER_INVALIDATION(layer, InspectorLayerInvalidationTrackingEvent::NewCompositedLayer);
250 layersNeedingPaintInvalidation.append(layer);
255 if (layer->reflectionInfo())
256 assignLayersToBackingsForReflectionLayer(layer->reflectionInfo()->reflectionLayer(), layersNeedingPaintInvalidation);
258 // Add this layer to a squashing backing if needed.
260 updateSquashingAssignment(layer, squashingState, compositedLayerUpdate, layersNeedingPaintInvalidation);
262 const bool layerIsSquashed = compositedLayerUpdate == PutInSquashingLayer || (compositedLayerUpdate == NoCompositingStateChange && layer->groupedMapping());
265 IntRect layerBounds = layer->clippedAbsoluteBoundingBox();
271 if (layer->stackingNode()->isStackingContext()) {
272 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NegativeZOrderChildren);
274 assignLayersToBackingsInternal(curNode->layer(), squashingState, layersNeedingPaintInvalidation);
278 // At this point, if the layer is to be "separately" composited, then its backing becomes the most recent in paint-order.
279 if (layer->compositingState() == PaintsIntoOwnBacking || layer->compositingState() == HasOwnBackingButPaintsIntoAncestor) {
280 ASSERT(!requiresSquashing(layer->compositingReasons()));
281 squashingState.updateSquashingStateForNewMapping(layer->compositedLayerMapping(), layer->hasCompositedLayerMapping());
285 if (layer->scrollParent())
286 layer->scrollParent()->scrollableArea()->setTopmostScrollChild(layer);
288 if (layer->needsCompositedScrolling())
289 layer->scrollableArea()->setTopmostScrollChild(0);
291 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowChildren | PositiveZOrderChildren);
293 assignLayersToBackingsInternal(curNode->layer(), squashingState, layersNeedingPaintInvalidation);
295 if (squashingState.hasMostRecentMapping && &squashingState.mostRecentMapping->owningLayer() == layer)