Commit 5b752721 authored by Jonathan Watt's avatar Jonathan Watt
Browse files

Bug 488314 part 2 - Kill vestiges of SetMatrixPropagation. r=longsonr.

--HG--
extra : rebase_source : ab532ae0ee733e6c759856640d755869bc231f73
parent 75d9cb15
......@@ -105,11 +105,6 @@ public:
NS_IMETHOD NotifyRedrawSuspended()=0;
NS_IMETHOD NotifyRedrawUnsuspended()=0;
// Set whether we should stop multiplying matrices when building up
// the current transformation matrix at this frame.
NS_IMETHOD SetMatrixPropagation(PRBool aPropagate)=0;
virtual PRBool GetMatrixPropagation()=0;
/**
* Get this frame's contribution to the rect returned by a GetBBox() call
* that occurred either on this element, or on one of its ancestors.
......
......@@ -93,7 +93,7 @@ nsSVGContainerFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow)
{
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_PROPAGATE_TRANSFORM);
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
nsresult rv = nsSVGContainerFrameBase::Init(aContent, aParent, aPrevInFlow);
return rv;
}
......@@ -103,7 +103,6 @@ nsSVGDisplayContainerFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow)
{
AddStateBits(NS_STATE_SVG_PROPAGATE_TRANSFORM);
if (!(GetStateBits() & NS_STATE_IS_OUTER_SVG)) {
AddStateBits(aParent->GetStateBits() &
(NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_CLIPPATH_CHILD));
......@@ -283,20 +282,3 @@ nsSVGDisplayContainerFrame::GetBBoxContribution(const gfxMatrix &aToBBoxUserspac
return bboxUnion;
}
NS_IMETHODIMP
nsSVGDisplayContainerFrame::SetMatrixPropagation(PRBool aPropagate)
{
if (aPropagate) {
AddStateBits(NS_STATE_SVG_PROPAGATE_TRANSFORM);
} else {
RemoveStateBits(NS_STATE_SVG_PROPAGATE_TRANSFORM);
}
return NS_OK;
}
PRBool
nsSVGDisplayContainerFrame::GetMatrixPropagation()
{
return (GetStateBits() & NS_STATE_SVG_PROPAGATE_TRANSFORM) != 0;
}
......@@ -112,8 +112,6 @@ public:
virtual void NotifySVGChanged(PRUint32 aFlags);
NS_IMETHOD NotifyRedrawSuspended();
NS_IMETHOD NotifyRedrawUnsuspended();
NS_IMETHOD SetMatrixPropagation(PRBool aPropagate);
virtual PRBool GetMatrixPropagation();
virtual gfxRect GetBBoxContribution(const gfxMatrix &aToBBoxUserspace);
NS_IMETHOD_(PRBool) IsDisplayContainer() { return PR_TRUE; }
NS_IMETHOD_(PRBool) HasValidCoveredRect() { return PR_FALSE; }
......
......@@ -91,9 +91,8 @@ nsSVGForeignObjectFrame::Init(nsIContent* aContent,
#endif
nsresult rv = nsSVGForeignObjectFrameBase::Init(aContent, aParent, aPrevInFlow);
AddStateBits(NS_STATE_SVG_PROPAGATE_TRANSFORM |
(aParent->GetStateBits() &
(NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_CLIPPATH_CHILD)));
AddStateBits(aParent->GetStateBits() &
(NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_CLIPPATH_CHILD));
if (NS_SUCCEEDED(rv)) {
nsSVGUtils::GetOuterSVGFrame(this)->RegisterForeignObject(this);
}
......@@ -432,23 +431,6 @@ nsSVGForeignObjectFrame::NotifyRedrawUnsuspended()
return NS_OK;
}
NS_IMETHODIMP
nsSVGForeignObjectFrame::SetMatrixPropagation(PRBool aPropagate)
{
if (aPropagate) {
AddStateBits(NS_STATE_SVG_PROPAGATE_TRANSFORM);
} else {
RemoveStateBits(NS_STATE_SVG_PROPAGATE_TRANSFORM);
}
return NS_OK;
}
PRBool
nsSVGForeignObjectFrame::GetMatrixPropagation()
{
return (GetStateBits() & NS_STATE_SVG_PROPAGATE_TRANSFORM) != 0;
}
gfxRect
nsSVGForeignObjectFrame::GetBBoxContribution(const gfxMatrix &aToBBoxUserspace)
{
......
......@@ -128,8 +128,6 @@ public:
virtual void NotifySVGChanged(PRUint32 aFlags);
NS_IMETHOD NotifyRedrawSuspended();
NS_IMETHOD NotifyRedrawUnsuspended();
NS_IMETHOD SetMatrixPropagation(PRBool aPropagate);
virtual PRBool GetMatrixPropagation();
virtual gfxRect GetBBoxContribution(const gfxMatrix &aToBBoxUserspace);
NS_IMETHOD_(PRBool) IsDisplayContainer() { return PR_TRUE; }
NS_IMETHOD_(PRBool) HasValidCoveredRect() { return PR_TRUE; }
......
......@@ -52,9 +52,8 @@ nsSVGGeometryFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow)
{
AddStateBits((aParent->GetStateBits() &
(NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_CLIPPATH_CHILD)) |
NS_STATE_SVG_PROPAGATE_TRANSFORM);
AddStateBits(aParent->GetStateBits() &
(NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_CLIPPATH_CHILD));
nsresult rv = nsSVGGeometryFrameBase::Init(aContent, aParent, aPrevInFlow);
return rv;
}
......
......@@ -491,11 +491,11 @@ nsSVGGlyphFrame::UpdateCoveredRegion()
return NS_OK;
}
SetMatrixPropagation(PR_FALSE);
mPropagateTransform = PR_FALSE;
CharacterIterator iter(this, PR_TRUE);
iter.SetInitialMatrix(tmpCtx);
AddBoundingBoxesToPath(&iter, tmpCtx);
SetMatrixPropagation(PR_TRUE);
mPropagateTransform = PR_TRUE;
tmpCtx->IdentityMatrix();
// Be careful when replacing the following logic to get the fill and stroke
......@@ -1479,7 +1479,7 @@ nsSVGGlyphFrame::NotifyGlyphMetricsChange()
PRBool
nsSVGGlyphFrame::GetGlobalTransform(gfxMatrix *aMatrix)
{
if (!GetMatrixPropagation()) {
if (!mPropagateTransform) {
aMatrix->Reset();
return PR_TRUE;
}
......@@ -1635,23 +1635,6 @@ nsSVGGlyphFrame::EnsureTextRun(float *aDrawScale, float *aMetricsScale,
return PR_TRUE;
}
NS_IMETHODIMP
nsSVGGlyphFrame::SetMatrixPropagation(PRBool aPropagate)
{
if (aPropagate) {
AddStateBits(NS_STATE_SVG_PROPAGATE_TRANSFORM);
} else {
RemoveStateBits(NS_STATE_SVG_PROPAGATE_TRANSFORM);
}
return NS_OK;
}
PRBool
nsSVGGlyphFrame::GetMatrixPropagation()
{
return (GetStateBits() & NS_STATE_SVG_PROPAGATE_TRANSFORM) != 0;
}
//----------------------------------------------------------------------
// helper class
......
......@@ -66,7 +66,8 @@ protected:
: nsSVGGlyphFrameBase(aContext),
mTextRun(nsnull),
mStartIndex(0),
mWhitespaceHandling(COMPRESS_WHITESPACE)
mWhitespaceHandling(COMPRESS_WHITESPACE),
mPropagateTransform(PR_TRUE)
{}
~nsSVGGlyphFrame()
{
......@@ -126,8 +127,6 @@ public:
virtual void NotifySVGChanged(PRUint32 aFlags);
NS_IMETHOD NotifyRedrawSuspended();
NS_IMETHOD NotifyRedrawUnsuspended();
NS_IMETHOD SetMatrixPropagation(PRBool aPropagate);
virtual PRBool GetMatrixPropagation();
NS_IMETHOD_(PRBool) IsDisplayContainer() { return PR_FALSE; }
NS_IMETHOD_(PRBool) HasValidCoveredRect() { return PR_TRUE; }
......@@ -229,6 +228,7 @@ protected:
// The start index into the position and rotation data
PRUint32 mStartIndex;
PRUint8 mWhitespaceHandling;
PRPackedBool mPropagateTransform;
};
#endif
......@@ -335,23 +335,6 @@ nsSVGPathGeometryFrame::NotifyRedrawUnsuspended()
return NS_OK;
}
NS_IMETHODIMP
nsSVGPathGeometryFrame::SetMatrixPropagation(PRBool aPropagate)
{
if (aPropagate) {
AddStateBits(NS_STATE_SVG_PROPAGATE_TRANSFORM);
} else {
RemoveStateBits(NS_STATE_SVG_PROPAGATE_TRANSFORM);
}
return NS_OK;
}
PRBool
nsSVGPathGeometryFrame::GetMatrixPropagation()
{
return (GetStateBits() & NS_STATE_SVG_PROPAGATE_TRANSFORM) != 0;
}
gfxRect
nsSVGPathGeometryFrame::GetBBoxContribution(const gfxMatrix &aToBBoxUserspace)
{
......
......@@ -100,8 +100,6 @@ protected:
virtual void NotifySVGChanged(PRUint32 aFlags);
NS_IMETHOD NotifyRedrawSuspended();
NS_IMETHOD NotifyRedrawUnsuspended();
NS_IMETHOD SetMatrixPropagation(PRBool aPropagate);
virtual PRBool GetMatrixPropagation();
virtual gfxRect GetBBoxContribution(const gfxMatrix &aToBBoxUserspace);
NS_IMETHOD_(PRBool) IsDisplayContainer() { return PR_FALSE; }
NS_IMETHOD_(PRBool) HasValidCoveredRect() { return PR_TRUE; }
......
......@@ -98,10 +98,8 @@ class Element;
/* are we the child of a non-display container? */
#define NS_STATE_SVG_NONDISPLAY_CHILD NS_FRAME_STATE_BIT(22)
#define NS_STATE_SVG_PROPAGATE_TRANSFORM NS_FRAME_STATE_BIT(23)
// If this bit is set, we are a <clipPath> element or descendant.
#define NS_STATE_SVG_CLIPPATH_CHILD NS_FRAME_STATE_BIT(24)
#define NS_STATE_SVG_CLIPPATH_CHILD NS_FRAME_STATE_BIT(23)
/**
* Byte offsets of channels in a native packed gfxColor or cairo image surface.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment