PopState() now returns PR_TRUE if there is an empty clip region after the pop.

This commit is contained in:
michaelp 1998-06-16 16:49:29 +00:00
parent cc0628b4d0
commit 26ea1cc215
5 changed files with 22 additions and 10 deletions

View File

@ -210,9 +210,8 @@ void nsRenderingContextUnix :: PushState(void)
}
void nsRenderingContextUnix :: PopState(void)
PRBool nsRenderingContextUnix :: PopState(void)
{
PRUint32 cnt = mStateCache->Count();
GraphicsState * state;
@ -229,7 +228,8 @@ void nsRenderingContextUnix :: PopState(void)
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)
@ -486,8 +486,9 @@ void nsRenderingContextUnix :: DestroyDrawingSurface(nsDrawingSurface aDS)
// XXX - Could this be a GC? If so, store the type of surface in nsDrawingSurfaceUnix
::XFreePixmap(surface->display, surface->drawable);
// if (mRenderingSurface == surface)
// mRenderingSurface = nsnull;
//XXX greg, this seems bad. MMP
if (mRenderingSurface == surface)
mRenderingSurface = nsnull;
delete aDS;
}

View File

@ -66,7 +66,7 @@ public:
virtual nsresult SelectOffScreenDrawingSurface(nsDrawingSurface aSurface);
virtual void PushState(void);
virtual void PopState(void);
virtual PRBool PopState(void);
virtual PRBool IsVisibleRect(const nsRect& aRect);

View File

@ -104,8 +104,10 @@ public:
/**
* 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

View File

@ -354,8 +354,10 @@ void nsRenderingContextWin :: PushState(void)
mTMatrix = &mStates->mMatrix;
}
void nsRenderingContextWin :: PopState(void)
PRBool nsRenderingContextWin :: PopState(void)
{
PRBool retval = PR_FALSE;
if (nsnull == mStates)
{
NS_ASSERTION(!(nsnull == mStates), "state underflow");
@ -385,7 +387,12 @@ void nsRenderingContextWin :: PopState(void)
pstate = pstate->mNext;
if (nsnull != pstate)
::SelectClipRgn(mDC, pstate->mClipRegion);
{
int cliptype = ::SelectClipRgn(mDC, pstate->mClipRegion);
if (cliptype == NULLREGION)
retval = PR_TRUE;
}
}
oldstate->mFlags &= ~FLAGS_ALL;
@ -396,6 +403,8 @@ void nsRenderingContextWin :: PopState(void)
else
mTMatrix = nsnull;
}
return retval;
}
PRBool nsRenderingContextWin :: IsVisibleRect(const nsRect& aRect)

View File

@ -61,7 +61,7 @@ public:
virtual nsresult SelectOffScreenDrawingSurface(nsDrawingSurface aSurface);
virtual void PushState(void);
virtual void PopState(void);
virtual PRBool PopState(void);
virtual PRBool IsVisibleRect(const nsRect& aRect);