Fix crash with transparent windows caused by bug 418454 r=robarnold
authorVladimir Vukicevic <vladimir@pobox.com>
Wed, 01 Oct 2008 02:03:32 -0400
changeset 20045 8d8ef01ef749db8249f4a302c5659feb8aa6fe7e
parent 20044 9f8ea2a5f29023bab593b7324af0c3c7c64025e7
child 20046 f63a4b1a4397a757562a2c7d5af25f649cbca12d
push id2598
push userrobarnold@cmu.edu
push dateWed, 01 Oct 2008 06:04:49 +0000
treeherdermozilla-central@8d8ef01ef749 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrobarnold
bugs418454
milestone1.9.1b1pre
Fix crash with transparent windows caused by bug 418454 r=robarnold
widget/src/windows/nsWindow.cpp
--- a/widget/src/windows/nsWindow.cpp
+++ b/widget/src/windows/nsWindow.cpp
@@ -5860,16 +5860,18 @@ PRBool nsWindow::OnPaint(HDC aDC)
                            &event,
                            nsCAutoString("noname"),
                            (PRInt32) mWnd);
 #endif // NS_DEBUG
 
 #ifdef MOZ_XUL
       nsRefPtr<gfxASurface> targetSurface;
       if (eTransparencyTransparent == mTransparencyMode) {
+        if (mTransparentSurface == nsnull)
+          SetupTranslucentWindowMemoryBitmap(mTransparencyMode);
         targetSurface = mTransparentSurface;
       } else {
         targetSurface = new gfxWindowsSurface(hDC);
       }
 #else
       nsRefPtr<gfxASurface> targetSurface = new gfxWindowsSurface(hDC);
 #endif