mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
PopState() now returns PR_TRUE if there is an empty clip region after the pop.
This commit is contained in:
parent
cc0628b4d0
commit
26ea1cc215
@ -210,9 +210,8 @@ void nsRenderingContextUnix :: PushState(void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsRenderingContextUnix :: PopState(void)
|
PRBool nsRenderingContextUnix :: PopState(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
PRUint32 cnt = mStateCache->Count();
|
PRUint32 cnt = mStateCache->Count();
|
||||||
GraphicsState * state;
|
GraphicsState * state;
|
||||||
|
|
||||||
@ -229,7 +228,8 @@ void nsRenderingContextUnix :: PopState(void)
|
|||||||
delete state;
|
delete state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//XXX need to return if clip region is empty after pop. see nsirendering....h MMP
|
||||||
|
return PR_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
PRBool nsRenderingContextUnix :: IsVisibleRect(const nsRect& aRect)
|
PRBool nsRenderingContextUnix :: IsVisibleRect(const nsRect& aRect)
|
||||||
@ -486,8 +486,9 @@ void nsRenderingContextUnix :: DestroyDrawingSurface(nsDrawingSurface aDS)
|
|||||||
// XXX - Could this be a GC? If so, store the type of surface in nsDrawingSurfaceUnix
|
// XXX - Could this be a GC? If so, store the type of surface in nsDrawingSurfaceUnix
|
||||||
::XFreePixmap(surface->display, surface->drawable);
|
::XFreePixmap(surface->display, surface->drawable);
|
||||||
|
|
||||||
// if (mRenderingSurface == surface)
|
//XXX greg, this seems bad. MMP
|
||||||
// mRenderingSurface = nsnull;
|
if (mRenderingSurface == surface)
|
||||||
|
mRenderingSurface = nsnull;
|
||||||
|
|
||||||
delete aDS;
|
delete aDS;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ public:
|
|||||||
virtual nsresult SelectOffScreenDrawingSurface(nsDrawingSurface aSurface);
|
virtual nsresult SelectOffScreenDrawingSurface(nsDrawingSurface aSurface);
|
||||||
|
|
||||||
virtual void PushState(void);
|
virtual void PushState(void);
|
||||||
virtual void PopState(void);
|
virtual PRBool PopState(void);
|
||||||
|
|
||||||
virtual PRBool IsVisibleRect(const nsRect& aRect);
|
virtual PRBool IsVisibleRect(const nsRect& aRect);
|
||||||
|
|
||||||
|
@ -104,8 +104,10 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get and and set RenderingContext to this graphical state
|
* Get and and set RenderingContext to this graphical state
|
||||||
|
* @return if PR_TRUE, indicates that the clipping region after
|
||||||
|
* popping state is empty, else PR_FALSE
|
||||||
*/
|
*/
|
||||||
virtual void PopState(void) = 0;
|
virtual PRBool PopState(void) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tells if a given rectangle is visible within the rendering context
|
* Tells if a given rectangle is visible within the rendering context
|
||||||
|
@ -354,8 +354,10 @@ void nsRenderingContextWin :: PushState(void)
|
|||||||
mTMatrix = &mStates->mMatrix;
|
mTMatrix = &mStates->mMatrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsRenderingContextWin :: PopState(void)
|
PRBool nsRenderingContextWin :: PopState(void)
|
||||||
{
|
{
|
||||||
|
PRBool retval = PR_FALSE;
|
||||||
|
|
||||||
if (nsnull == mStates)
|
if (nsnull == mStates)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(!(nsnull == mStates), "state underflow");
|
NS_ASSERTION(!(nsnull == mStates), "state underflow");
|
||||||
@ -385,7 +387,12 @@ void nsRenderingContextWin :: PopState(void)
|
|||||||
pstate = pstate->mNext;
|
pstate = pstate->mNext;
|
||||||
|
|
||||||
if (nsnull != pstate)
|
if (nsnull != pstate)
|
||||||
::SelectClipRgn(mDC, pstate->mClipRegion);
|
{
|
||||||
|
int cliptype = ::SelectClipRgn(mDC, pstate->mClipRegion);
|
||||||
|
|
||||||
|
if (cliptype == NULLREGION)
|
||||||
|
retval = PR_TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
oldstate->mFlags &= ~FLAGS_ALL;
|
oldstate->mFlags &= ~FLAGS_ALL;
|
||||||
@ -396,6 +403,8 @@ void nsRenderingContextWin :: PopState(void)
|
|||||||
else
|
else
|
||||||
mTMatrix = nsnull;
|
mTMatrix = nsnull;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
PRBool nsRenderingContextWin :: IsVisibleRect(const nsRect& aRect)
|
PRBool nsRenderingContextWin :: IsVisibleRect(const nsRect& aRect)
|
||||||
|
@ -61,7 +61,7 @@ public:
|
|||||||
virtual nsresult SelectOffScreenDrawingSurface(nsDrawingSurface aSurface);
|
virtual nsresult SelectOffScreenDrawingSurface(nsDrawingSurface aSurface);
|
||||||
|
|
||||||
virtual void PushState(void);
|
virtual void PushState(void);
|
||||||
virtual void PopState(void);
|
virtual PRBool PopState(void);
|
||||||
|
|
||||||
virtual PRBool IsVisibleRect(const nsRect& aRect);
|
virtual PRBool IsVisibleRect(const nsRect& aRect);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user