Exemplo n.º 1
0
void
nsSVGForeignObjectFrame::FlushDirtyRegion(PRUint32 aFlags)
{
  NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
                    "Should not have been called");

  NS_ASSERTION(!mInReflow,
               "We shouldn't be flushing while we have a pending flush");

  if (mSameDocDirtyRegion.IsEmpty() && mSubDocDirtyRegion.IsEmpty()) {
    return;
  }

  nsSVGOuterSVGFrame *outerSVGFrame = nsSVGUtils::GetOuterSVGFrame(this);
  if (!outerSVGFrame) {
    NS_ERROR("null outerSVGFrame");
    return;
  }

  InvalidateDirtyRect(outerSVGFrame, mSameDocDirtyRegion.GetBounds(), aFlags);
  InvalidateDirtyRect(outerSVGFrame, mSubDocDirtyRegion.GetBounds(),
                      aFlags | INVALIDATE_CROSS_DOC);

  mSameDocDirtyRegion.SetEmpty();
  mSubDocDirtyRegion.SetEmpty();
}
Exemplo n.º 2
0
void
nsSVGForeignObjectFrame::InvalidateInternal(const nsRect& aDamageRect,
                                            nscoord aX, nscoord aY,
                                            nsIFrame* aForChild,
                                            PRUint32 aFlags)
{
  // This is called by our descendants when they change.

  if (GetStateBits() & NS_FRAME_IS_DIRTY) {
    // Our entire area has been (or will be) invalidated, so no point
    // keeping track of sub-areas that our descendants dirty.
    return;
  }

  if (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD) {
    nsSVGEffects::InvalidateRenderingObservers(this);
    return;
  }

  if (!mInReflow) {
    // We can't collect dirty areas, since we don't have a place to reliably
    // call FlushDirtyRegion before we paint, so we have to invalidate now.
    InvalidateDirtyRect(nsSVGUtils::GetOuterSVGFrame(this), aDamageRect + nsPoint(aX, aY), aFlags);
    return;
  }

  nsRegion* region = (aFlags & INVALIDATE_CROSS_DOC)
    ? &mSubDocDirtyRegion : &mSameDocDirtyRegion;
  region->Or(*region, aDamageRect + nsPoint(aX, aY));
}
Exemplo n.º 3
0
void
nsSVGForeignObjectFrame::FlushDirtyRegion(PRUint32 aFlags)
{
  if ((mSameDocDirtyRegion.IsEmpty() && mSubDocDirtyRegion.IsEmpty()) ||
      mInReflow)
    return;

  nsSVGOuterSVGFrame *outerSVGFrame = nsSVGUtils::GetOuterSVGFrame(this);
  if (!outerSVGFrame) {
    NS_ERROR("null outerSVGFrame");
    return;
  }

  if (outerSVGFrame->IsRedrawSuspended())
    return;

  InvalidateDirtyRect(outerSVGFrame, mSameDocDirtyRegion.GetBounds(), aFlags);
  InvalidateDirtyRect(outerSVGFrame, mSubDocDirtyRegion.GetBounds(),
                      aFlags | INVALIDATE_CROSS_DOC);

  mSameDocDirtyRegion.SetEmpty();
  mSubDocDirtyRegion.SetEmpty();
}