InvalidationReason RenderLayerModelObject::invalidatePaintIfNeeded(const PaintInvalidationState& paintInvalidationState, const RenderLayerModelObject& newPaintInvalidationContainer)
{
    const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect();
    const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositionFromPaintInvalidationContainer();
    setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInvalidationContainer, &paintInvalidationState));
    setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromPaintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidationState));

    // If we are set to do a full paint invalidation that means the RenderView will 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()->doingFullPaintInvalidation())
        return InvalidationNone;

    return RenderObject::invalidatePaintIfNeeded(newPaintInvalidationContainer, oldPaintInvalidationRect, oldPositionFromPaintInvalidationContainer, paintInvalidationState);
}
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);
}