diff --git a/gfx/tests/coverage/nsCoverage.cpp b/gfx/tests/coverage/nsCoverage.cpp index d8ec80f3b83..47b515dbbde 100644 --- a/gfx/tests/coverage/nsCoverage.cpp +++ b/gfx/tests/coverage/nsCoverage.cpp @@ -281,25 +281,27 @@ nsEventStatus HandleEvent(nsGUIEvent *aEvent) (ke->isControl?"Pressed":"Released"), (ke->isAlt?"Pressed":"Released")); printf("%s\n", str); + nsIntRect clientRect; + gWindow->GetClientBounds(clientRect); switch(ke->keyCode) { case 'U': gOffsetY -= 9; - gWindow->Invalidate(PR_FALSE); + gWindow->Invalidate(clientRect, PR_FALSE); break; case 'D': gOffsetY += 10; - gWindow->Invalidate(PR_FALSE); + gWindow->Invalidate(clientRect, PR_FALSE); break; case 'R': gOffsetX += 9; - gWindow->Invalidate(PR_FALSE); + gWindow->Invalidate(clientRect, PR_FALSE); break; case 'L': gOffsetX -= 10; - gWindow->Invalidate(PR_FALSE); + gWindow->Invalidate(clientRect, PR_FALSE); break; } } diff --git a/widget/public/nsIWidget.h b/widget/public/nsIWidget.h index 9eb594a99e9..8b4cd3bab48 100644 --- a/widget/public/nsIWidget.h +++ b/widget/public/nsIWidget.h @@ -664,15 +664,6 @@ class nsIWidget : public nsISupports { */ NS_IMETHOD MakeFullScreen(PRBool aFullScreen) = 0; - /** - * Invalidate the widget and repaint it. - * - * @param aIsSynchronous PR_TRUE then repaint synchronously. If PR_FALSE repaint later. - * @see #Update() - */ - - NS_IMETHOD Invalidate(PRBool aIsSynchronous) = 0; - /** * Invalidate a specified rect for a widget and repaints it. * diff --git a/widget/src/beos/nsWindow.cpp b/widget/src/beos/nsWindow.cpp index e28cedf7236..8a90e48c4b2 100644 --- a/widget/src/beos/nsWindow.cpp +++ b/widget/src/beos/nsWindow.cpp @@ -1417,40 +1417,6 @@ NS_METHOD nsWindow::SetCursor(nsCursor aCursor) return NS_OK; } -//------------------------------------------------------------------------- -// -// Invalidate this component visible area -// -//------------------------------------------------------------------------- -NS_METHOD nsWindow::Invalidate(PRBool aIsSynchronous) -{ - nsresult rv = NS_ERROR_FAILURE; - // Asynchronous painting is performed with via nsViewBeOS::Draw() call and its message queue. - // All update rects are collected in nsViewBeOS member "paintregion". - // Flushing of paintregion happens in nsViewBeOS::GetPaintRegion(), - // cleanup - in nsViewBeOS::Validate(), called in OnPaint(). - BRegion reg; - reg.MakeEmpty(); - if (mView && mView->LockLooper()) - { - if (PR_TRUE == aIsSynchronous) - { - mView->paintregion.Include(mView->Bounds()); - reg.Include(mView->Bounds()); - } - else - { - mView->Draw(mView->Bounds()); - rv = NS_OK; - } - mView->UnlockLooper(); - } - // Instant repaint. - if (PR_TRUE == aIsSynchronous) - rv = OnPaint(®); - return rv; -} - //------------------------------------------------------------------------- // // Invalidate this component visible area diff --git a/widget/src/beos/nsWindow.h b/widget/src/beos/nsWindow.h index 42223b81ee3..13b81769fa2 100644 --- a/widget/src/beos/nsWindow.h +++ b/widget/src/beos/nsWindow.h @@ -151,7 +151,6 @@ public: NS_IMETHOD GetScreenBounds(nsRect &aRect); NS_IMETHOD SetBackgroundColor(const nscolor &aColor); NS_IMETHOD SetCursor(nsCursor aCursor); - NS_IMETHOD Invalidate(PRBool aIsSynchronous); NS_IMETHOD Invalidate(const nsRect & aRect, PRBool aIsSynchronous); NS_IMETHOD InvalidateRegion(const nsIRegion *aRegion, PRBool aIsSynchronous); diff --git a/widget/src/cocoa/nsChildView.h b/widget/src/cocoa/nsChildView.h index 2781df2c6b6..2af67a0f859 100644 --- a/widget/src/cocoa/nsChildView.h +++ b/widget/src/cocoa/nsChildView.h @@ -338,7 +338,6 @@ public: NS_IMETHOD SetFocus(PRBool aRaise); NS_IMETHOD GetBounds(nsIntRect &aRect); - NS_IMETHOD Invalidate(PRBool aIsSynchronous); NS_IMETHOD Invalidate(const nsIntRect &aRect, PRBool aIsSynchronous); virtual void* GetNativeData(PRUint32 aDataType); diff --git a/widget/src/cocoa/nsChildView.mm b/widget/src/cocoa/nsChildView.mm index b4db8771b4e..65e264146ef 100644 --- a/widget/src/cocoa/nsChildView.mm +++ b/widget/src/cocoa/nsChildView.mm @@ -1593,31 +1593,6 @@ static void blinkRgn(RgnHandle rgn) #endif -// Invalidate this component's visible area -NS_IMETHODIMP nsChildView::Invalidate(PRBool aIsSynchronous) -{ - NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; - - if (!mView || !mVisible) - return NS_OK; - - if (aIsSynchronous) { - [mView display]; - } - else if ([NSView focusView]) { - // if a view is focussed (i.e. being drawn), then postpone the invalidate so that we - // don't lose it. - [mView setNeedsPendingDisplay]; - } - else { - [mView setNeedsDisplay:YES]; - } - - return NS_OK; - - NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; -} - // Invalidate this component's visible area NS_IMETHODIMP nsChildView::Invalidate(const nsIntRect &aRect, PRBool aIsSynchronous) { diff --git a/widget/src/cocoa/nsCocoaWindow.h b/widget/src/cocoa/nsCocoaWindow.h index 194efafb7db..23ab89f0b25 100644 --- a/widget/src/cocoa/nsCocoaWindow.h +++ b/widget/src/cocoa/nsCocoaWindow.h @@ -223,7 +223,6 @@ public: NS_IMETHOD SetTitle(const nsAString& aTitle); NS_IMETHOD Invalidate(const nsIntRect &aRect, PRBool aIsSynchronous); - NS_IMETHOD Invalidate(PRBool aIsSynchronous); NS_IMETHOD Update(); virtual nsresult ConfigureChildren(const nsTArray& aConfigurations); virtual void Scroll(const nsIntPoint& aDelta, diff --git a/widget/src/cocoa/nsCocoaWindow.mm b/widget/src/cocoa/nsCocoaWindow.mm index 3409bf32b44..ec47bfb9fcf 100644 --- a/widget/src/cocoa/nsCocoaWindow.mm +++ b/widget/src/cocoa/nsCocoaWindow.mm @@ -1145,14 +1145,6 @@ NS_IMETHODIMP nsCocoaWindow::Invalidate(const nsIntRect & aRect, PRBool aIsSynch return NS_OK; } -NS_IMETHODIMP nsCocoaWindow::Invalidate(PRBool aIsSynchronous) -{ - if (mPopupContentView) - return mPopupContentView->Invalidate(aIsSynchronous); - - return NS_OK; -} - NS_IMETHODIMP nsCocoaWindow::Update() { if (mPopupContentView) diff --git a/widget/src/gtk2/nsWindow.cpp b/widget/src/gtk2/nsWindow.cpp index 490255beccb..0bdecaa12ad 100644 --- a/widget/src/gtk2/nsWindow.cpp +++ b/widget/src/gtk2/nsWindow.cpp @@ -1676,28 +1676,6 @@ nsWindow::SetCursor(imgIContainer* aCursor, return rv; } -NS_IMETHODIMP -nsWindow::Invalidate(PRBool aIsSynchronous) -{ - if (!mGdkWindow || !CanBeSeen()) - return NS_OK; - - GdkRectangle rect; - rect.x = mBounds.x; - rect.y = mBounds.y; - rect.width = mBounds.width; - rect.height = mBounds.height; - - LOGDRAW(("Invalidate (all) [%p]: %d %d %d %d\n", (void *)this, - rect.x, rect.y, rect.width, rect.height)); - - gdk_window_invalidate_rect(mGdkWindow, &rect, FALSE); - if (aIsSynchronous) - gdk_window_process_updates(mGdkWindow, FALSE); - - return NS_OK; -} - NS_IMETHODIMP nsWindow::Invalidate(const nsIntRect &aRect, PRBool aIsSynchronous) diff --git a/widget/src/gtk2/nsWindow.h b/widget/src/gtk2/nsWindow.h index d15b313b1f9..6f8ef002e0b 100644 --- a/widget/src/gtk2/nsWindow.h +++ b/widget/src/gtk2/nsWindow.h @@ -181,7 +181,6 @@ public: NS_IMETHOD SetCursor(nsCursor aCursor); NS_IMETHOD SetCursor(imgIContainer* aCursor, PRUint32 aHotspotX, PRUint32 aHotspotY); - NS_IMETHOD Invalidate(PRBool aIsSynchronous); NS_IMETHOD Invalidate(const nsIntRect &aRect, PRBool aIsSynchronous); NS_IMETHOD Update(); diff --git a/widget/src/os2/nsWindow.cpp b/widget/src/os2/nsWindow.cpp index b530ec1efd1..04d773b29e4 100644 --- a/widget/src/os2/nsWindow.cpp +++ b/widget/src/os2/nsWindow.cpp @@ -1330,8 +1330,8 @@ NS_METHOD nsWindow::Resize(PRInt32 aX, if (!WinSetWindowPos(GetMainWindow(), 0, ptl.x, ptl.y, w, h, SWP_MOVE | SWP_SIZE)) { - if (aRepaint) { - Invalidate(PR_FALSE); + if (aRepaint && mWnd) { + WinInvalidateRect( mWnd, 0, FALSE); } } @@ -1860,26 +1860,6 @@ NS_IMETHODIMP nsWindow::HideWindowChrome(PRBool aShouldHide) return NS_OK; } -//------------------------------------------------------------------------- -// -// Invalidate this component visible area -// -//------------------------------------------------------------------------- -NS_METHOD nsWindow::Invalidate(PRBool aIsSynchronous) -{ - if (mWnd) - { - WinInvalidateRect( mWnd, 0, FALSE); -#if 0 - if( PR_TRUE == aIsSynchronous) { - Update(); - } -#endif - } - - return NS_OK; -} - //------------------------------------------------------------------------- // // Invalidate this component visible area @@ -2116,8 +2096,8 @@ nsWindow::Scroll(const nsIntPoint& aDelta, if (w->mBounds.Intersects(affectedRect)) { if (!ClipRegionContainedInRect(configuration.mClipRegion, affectedRect - (w->mBounds.TopLeft() - + aDelta))) { - w->Invalidate(PR_FALSE); + + aDelta)) && mWnd) { + WinInvalidateRect( mWnd, 0, FALSE); } // Send a WM_VRNDISABLED to the plugin child of this widget. diff --git a/widget/src/os2/nsWindow.h b/widget/src/os2/nsWindow.h index cb17154a87f..0769a2ebc94 100644 --- a/widget/src/os2/nsWindow.h +++ b/widget/src/os2/nsWindow.h @@ -165,7 +165,6 @@ class nsWindow : public nsBaseWidget NS_IMETHOD HideWindowChrome(PRBool aShouldHide); NS_IMETHOD SetTitle( const nsAString& aTitle); NS_IMETHOD SetIcon(const nsAString& aIconSpec); - NS_IMETHOD Invalidate( PRBool aIsSynchronous); NS_IMETHOD Invalidate( const nsIntRect & aRect, PRBool aIsSynchronous); NS_IMETHOD Update(); virtual nsresult ConfigureChildren(const nsTArray& aConfigurations); diff --git a/widget/src/photon/nsWidget.cpp b/widget/src/photon/nsWidget.cpp index cf38a7cff1a..d9784f25982 100644 --- a/widget/src/photon/nsWidget.cpp +++ b/widget/src/photon/nsWidget.cpp @@ -562,17 +562,6 @@ NS_METHOD nsWidget::SetCursor( nsCursor aCursor ) { } -NS_METHOD nsWidget::Invalidate( PRBool aIsSynchronous ) { - - // mWidget will be null during printing - if( !mWidget || !PtWidgetIsRealized( mWidget ) ) return NS_OK; - - PtWidget_t *aWidget = (PtWidget_t *)GetNativeData(NS_NATIVE_WIDGET); - PtDamageWidget( aWidget ); - if( aIsSynchronous ) PtFlush(); - return NS_OK; - } - NS_METHOD nsWidget::Invalidate( const nsRect & aRect, PRBool aIsSynchronous ) { if( !mWidget ) return NS_OK; // mWidget will be null during printing diff --git a/widget/src/photon/nsWidget.h b/widget/src/photon/nsWidget.h index b7253437cfe..71598c427c8 100644 --- a/widget/src/photon/nsWidget.h +++ b/widget/src/photon/nsWidget.h @@ -172,7 +172,6 @@ public: NS_IMETHOD CaptureMouse(PRBool aCapture) { return NS_ERROR_FAILURE; } - NS_IMETHOD Invalidate(PRBool aIsSynchronous); NS_IMETHOD Invalidate(const nsRect &aRect, PRBool aIsSynchronous); NS_IMETHOD InvalidateRegion(const nsIRegion *aRegion, PRBool aIsSynchronous); inline NS_IMETHOD Update(void) diff --git a/widget/src/qt/nsWindow.cpp b/widget/src/qt/nsWindow.cpp index 1421c58607a..f480d4dfbc1 100644 --- a/widget/src/qt/nsWindow.cpp +++ b/widget/src/qt/nsWindow.cpp @@ -634,22 +634,6 @@ nsWindow::SetCursor(imgIContainer* aCursor, return rv; } -NS_IMETHODIMP -nsWindow::Invalidate(PRBool aIsSynchronous) -{ - LOGDRAW(("Invalidate (all) [%p]: \n", (void *)this)); - - if (!mWidget) - return NS_OK; - - if (aIsSynchronous && !mWidget->paintingActive()) - mWidget->repaint(); - else - mWidget->update(); - - return NS_OK; -} - NS_IMETHODIMP nsWindow::Invalidate(const nsIntRect &aRect, PRBool aIsSynchronous) diff --git a/widget/src/qt/nsWindow.h b/widget/src/qt/nsWindow.h index 7aff34dadda..17fb13290c7 100644 --- a/widget/src/qt/nsWindow.h +++ b/widget/src/qt/nsWindow.h @@ -165,7 +165,6 @@ public: NS_IMETHOD GetHasTransparentBackground(PRBool& aTransparent); NS_IMETHOD HideWindowChrome(PRBool aShouldHide); NS_IMETHOD MakeFullScreen(PRBool aFullScreen); - NS_IMETHOD Invalidate(PRBool aIsSynchronous); NS_IMETHOD Invalidate(const nsIntRect &aRect, PRBool aIsSynchronous); NS_IMETHOD Update();