Bug 253889: DeCOMtaminate nsIPresShell - IsPaintingSuppressed(). r=roc

--HG--
extra : rebase_source : 9ee8283e8bce33402893ae5316f89c9f699a1236
This commit is contained in:
Craig Topper 2010-03-31 08:43:49 -04:00
parent 8ef02ed2f5
commit afa4c872e5
7 changed files with 15 additions and 27 deletions

View File

@ -307,9 +307,7 @@ nsImageLoadingContent::OnStopDecode(imgIRequest* aRequest,
// to be suppressed for reasons other than the initial paint delay (for
// example - being in the bfcache), but we probably aren't loading images in
// those situations.
PRBool isSuppressed = PR_FALSE;
nsresult rv = shell->IsPaintingSuppressed(&isSuppressed);
if (NS_SUCCEEDED(rv) && isSuppressed)
if (shell->IsPaintingSuppressed())
doRequestDecode = PR_TRUE;
// If we're requesting a decode, do it

View File

@ -7223,9 +7223,7 @@ ApplyRenderingChangeToTree(nsPresContext* aPresContext,
nsChangeHint aChange)
{
nsIPresShell *shell = aPresContext->PresShell();
PRBool isPaintingSuppressed = PR_FALSE;
shell->IsPaintingSuppressed(&isPaintingSuppressed);
if (isPaintingSuppressed) {
if (shell->IsPaintingSuppressed()) {
// Don't allow synchronous rendering changes when painting is turned off.
aChange = NS_SubtractHint(aChange, nsChangeHint_RepaintFrame);
if (!aChange) {

View File

@ -1005,9 +1005,7 @@ void nsCaret::DrawCaret(PRBool aInvalidate)
nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(mPresShell);
NS_ENSURE_TRUE(presShell, /**/);
{
PRBool isPaintingSuppressed;
presShell->IsPaintingSuppressed(&isPaintingSuppressed);
if (isPaintingSuppressed)
if (presShell->IsPaintingSuppressed())
{
if (!mDrawn)
mPendingDraw = PR_TRUE;

View File

@ -82,9 +82,7 @@ nsDisplayListBuilder::nsDisplayListBuilder(nsIFrame* aReferenceFrame,
nsPresContext* pc = aReferenceFrame->PresContext();
nsIPresShell *shell = pc->PresShell();
PRBool suppressed;
shell->IsPaintingSuppressed(&suppressed);
mIsBackgroundOnly = suppressed;
mIsBackgroundOnly = shell->IsPaintingSuppressed();
if (pc->IsRenderingOnlySelection()) {
nsCOMPtr<nsISelectionController> selcon(do_QueryInterface(shell));
if (selcon) {

View File

@ -676,12 +676,12 @@ public:
* we don't allow the painting of any layer but the background, and we don't
* recur into our children.
*/
NS_IMETHOD IsPaintingSuppressed(PRBool* aResult)=0;
virtual NS_HIDDEN_(PRBool) IsPaintingSuppressed() const = 0;
/**
* Unsuppress painting.
*/
NS_IMETHOD UnsuppressPainting() = 0;
virtual NS_HIDDEN_(void) UnsuppressPainting() = 0;
/**
* Called to disable nsITheme support in a specific presshell.

View File

@ -741,8 +741,8 @@ public:
virtual NS_HIDDEN_(nsresult) CaptureHistoryState(nsILayoutHistoryState** aLayoutHistoryState, PRBool aLeavingPage);
NS_IMETHOD IsPaintingSuppressed(PRBool* aResult);
NS_IMETHOD UnsuppressPainting();
virtual NS_HIDDEN_(PRBool) IsPaintingSuppressed() const;
virtual NS_HIDDEN_(void) UnsuppressPainting();
virtual NS_HIDDEN_(void) DisableThemeSupport();
virtual PRBool IsThemeSupportEnabled();
@ -4393,11 +4393,10 @@ PresShell::CaptureHistoryState(nsILayoutHistoryState** aState, PRBool aLeavingPa
return NS_OK;
}
NS_IMETHODIMP
PresShell::IsPaintingSuppressed(PRBool* aResult)
PRBool
PresShell::IsPaintingSuppressed() const
{
*aResult = mPaintingSuppressed;
return NS_OK;
return mPaintingSuppressed;
}
void
@ -4434,7 +4433,7 @@ PresShell::UnsuppressAndInvalidate()
mViewManager->SynthesizeMouseMove(PR_FALSE);
}
NS_IMETHODIMP
void
PresShell::UnsuppressPainting()
{
if (mPaintSuppressionTimer) {
@ -4443,7 +4442,7 @@ PresShell::UnsuppressPainting()
}
if (mIsDocumentGone || !mPaintingSuppressed)
return NS_OK;
return;
// If we have reflows pending, just wait until we process
// the reflows and get all the frames where we want them
@ -4453,7 +4452,6 @@ PresShell::UnsuppressPainting()
mShouldUnsuppressPainting = PR_TRUE;
else
UnsuppressAndInvalidate();
return NS_OK;
}
void

View File

@ -3676,12 +3676,10 @@ nsIFrame::InvalidateWithFlags(const nsRect& aDamageRect, PRUint32 aFlags)
// painting is suppressed.
nsIPresShell *shell = PresContext()->GetPresShell();
if (shell) {
PRBool suppressed = PR_FALSE;
shell->IsPaintingSuppressed(&suppressed);
if (suppressed)
if (shell->IsPaintingSuppressed())
return;
}
InvalidateInternal(aDamageRect, 0, 0, nsnull, aFlags);
}