From 01b72caa0e8932831db637b53534bdc7518c662c Mon Sep 17 00:00:00 2001 From: "tor%cs.brown.edu" Date: Tue, 27 Sep 2005 17:06:11 +0000 Subject: [PATCH] Bug 308239 - use markers in update region logic. r=scooter --- .../svg/base/src/nsSVGPathGeometryFrame.cpp | 31 ++++++++++++++++--- layout/svg/base/src/nsSVGPathGeometryFrame.h | 1 + 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/layout/svg/base/src/nsSVGPathGeometryFrame.cpp b/layout/svg/base/src/nsSVGPathGeometryFrame.cpp index d80eb7ad9e79..ac4052e4d874 100644 --- a/layout/svg/base/src/nsSVGPathGeometryFrame.cpp +++ b/layout/svg/base/src/nsSVGPathGeometryFrame.cpp @@ -67,8 +67,8 @@ // nsSVGPathGeometryFrame nsSVGPathGeometryFrame::nsSVGPathGeometryFrame() - : mUpdateFlags(0), mPropagateTransform(PR_TRUE), - mFillGradient(nsnull), mStrokeGradient(nsnull), mFilter(nsnull), + : mFilter(nsnull), mUpdateFlags(0), mPropagateTransform(PR_TRUE), + mFillGradient(nsnull), mStrokeGradient(nsnull), mFillPattern(nsnull), mStrokePattern(nsnull) { #ifdef DEBUG @@ -290,6 +290,10 @@ nsSVGPathGeometryFrame::PaintSVG(nsISVGRendererCanvas* canvas, GetMarkerFrames(&markerStart, &markerMid, &markerEnd); if (markerEnd || markerMid || markerStart) { + // need to set this up with the first draw + if (!mMarkerRegion) + mMarkerRegion = GetCoveredRegion(); + float strokeWidth; GetStrokeWidth(&strokeWidth); @@ -999,8 +1003,27 @@ void nsSVGPathGeometryFrame::UpdateGraphic(PRUint32 flags, if (filter_region) { outerSVGFrame->InvalidateRegion(filter_region, PR_TRUE); } else { - if (dirty_region) - outerSVGFrame->InvalidateRegion(dirty_region, PR_TRUE); + if (mMarkerRegion) { + outerSVGFrame->InvalidateRegion(mMarkerRegion, PR_TRUE); + mMarkerRegion = nsnull; + } + + nsISVGMarkable *markable; + CallQueryInterface(this, &markable); + + if (markable) { + nsSVGMarkerFrame *markerEnd, *markerMid, *markerStart; + GetMarkerFrames(&markerStart, &markerMid, &markerEnd); + + if (markerEnd || markerMid || markerStart) { + mMarkerRegion = GetCoveredRegion(); + if (mMarkerRegion) + outerSVGFrame->InvalidateRegion(mMarkerRegion, PR_TRUE); + } else { + if (dirty_region) + outerSVGFrame->InvalidateRegion(dirty_region, PR_TRUE); + } + } } } } diff --git a/layout/svg/base/src/nsSVGPathGeometryFrame.h b/layout/svg/base/src/nsSVGPathGeometryFrame.h index 0475bdf05d3c..cf7de9da6028 100644 --- a/layout/svg/base/src/nsSVGPathGeometryFrame.h +++ b/layout/svg/base/src/nsSVGPathGeometryFrame.h @@ -149,6 +149,7 @@ protected: nsISVGRendererPathGeometry *GetGeometry(); nsCOMPtr mFilterRegion; + nsCOMPtr mMarkerRegion; nsISVGFilterFrame *mFilter; private: