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); }
void RenderReplaced::setSelectionState(SelectionState state) { // The selection state for our containing block hierarchy is updated by the base class call. RenderBox::setSelectionState(state); if (!inlineBoxWrapper()) return; // We only include the space below the baseline in our layer's cached paint invalidation rect if the // image is selected. Since the selection state has changed update the rect. if (hasLayer()) setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(containerForPaintInvalidation())); if (canUpdateSelectionOnRootLineBoxes()) inlineBoxWrapper()->root().setHasSelectedChildren(isSelected()); }
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 LayoutReplaced::setSelectionState(SelectionState state) { // The selection state for our containing block hierarchy is updated by the // base class call. LayoutBox::setSelectionState(state); if (!inlineBoxWrapper()) return; // We only include the space below the baseline in our layer's cached paint // invalidation rect if the image is selected. Since the selection state has // changed update the rect. if (hasLayer()) { LayoutRect rect = localVisualRect(); PaintLayer::mapRectToPaintInvalidationBacking( *this, containerForPaintInvalidation(), rect); setPreviousVisualRect(rect); } if (canUpdateSelectionOnRootLineBoxes()) inlineBoxWrapper()->root().setHasSelectedChildren(state != SelectionNone); }