void RenderLayerModelObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvalidationState) { ASSERT(!needsLayout()); if (!shouldCheckForPaintInvalidation(paintInvalidationState)) return; bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer(); const RenderLayerModelObject& newPaintInvalidationContainer = *adjustCompositedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this : &paintInvalidationState.paintInvalidationContainer()); ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation()); InvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContainer); clearPaintInvalidationState(paintInvalidationState); PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, newPaintInvalidationContainer); if (reason == InvalidationLocationChange || reason == InvalidationFull) childTreeWalkState.setForceCheckForPaintInvalidation(); invalidatePaintOfSubtreesIfNeeded(childTreeWalkState); }
void RenderLayerModelObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvalidationState) { ASSERT(!needsLayout()); if (!shouldCheckForPaintInvalidation(paintInvalidationState)) return; bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer(); const RenderLayerModelObject& newPaintInvalidationContainer = *adjustCompositedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this : &paintInvalidationState.paintInvalidationContainer()); // FIXME: This assert should be re-enabled when we move paint invalidation to after compositing update. crbug.com/360286 // ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation()); PaintInvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContainer); clearPaintInvalidationState(paintInvalidationState); PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, newPaintInvalidationContainer); if (reason == PaintInvalidationLocationChange) childTreeWalkState.setForceCheckForPaintInvalidation(); invalidatePaintOfSubtreesIfNeeded(childTreeWalkState); }
void RenderSVGModelObject::invalidateTreeAfterLayout(const RenderLayerModelObject& paintInvalidationContainer) { // Note: This is a reduced version of RenderBox::invalidateTreeAfterLayout(). // FIXME: Should share code with RenderBox::invalidateTreeAfterLayout(). ASSERT(!needsLayout()); if (!shouldCheckForPaintInvalidationAfterLayout()) return; ForceHorriblySlowRectMapping slowRectMapping(*this); const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect(); const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositionFromPaintInvalidationContainer(); ASSERT(&paintInvalidationContainer == containerForPaintInvalidation()); setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&paintInvalidationContainer)); setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromPaintInvalidationContainer(this, &paintInvalidationContainer)); // If an ancestor container had its transform changed, then we just // need to update the RenderSVGModelObject's repaint rect above. The invalidation // will be handled by the container where the transform changed. This essentially // means that we prune the entire branch for performance. if (!SVGRenderSupport::parentTransformDidChange(this)) return; // If we are set to do a full paint invalidation that means the RenderView will be // issue paint invalidations. We can then skip issuing of paint invalidations for the child // renderers as they'll be covered by the RenderView. if (view()->doingFullRepaint()) { RenderObject::invalidateTreeAfterLayout(paintInvalidationContainer); return; } invalidatePaintIfNeeded(containerForPaintInvalidation(), oldPaintInvalidationRect, oldPositionFromPaintInvalidationContainer); RenderObject::invalidateTreeAfterLayout(paintInvalidationContainer); }