コード例 #1
0
/**
 * Walks over this layer, and all descendant layers.
 * If any of these are a ContainerLayer that reports invalidations to a PresShell,
 * then report that the entire bounds have changed.
 */
static void
NotifySubdocumentInvalidationRecursive(Layer* aLayer, NotifySubDocInvalidationFunc aCallback)
{
    aLayer->ClearInvalidRect();
    ContainerLayer* container = aLayer->AsContainerLayer();

    if (aLayer->GetMaskLayer()) {
        NotifySubdocumentInvalidationRecursive(aLayer->GetMaskLayer(), aCallback);
    }

    if (!container) {
        return;
    }

    for (Layer* child = container->GetFirstChild(); child; child = child->GetNextSibling()) {
        NotifySubdocumentInvalidationRecursive(child, aCallback);
    }

    aCallback(container, container->GetVisibleRegion());
}