b=792305 don't update mask bits outside the mask r=roc
authorKarl Tomlinson <karlt+@karlt.net>
Mon, 24 Sep 2012 11:17:31 +1200
changeset 107885 5a9ee59a8c3b888916b389c358bc4ad594234e5a
parent 107884 f92968ac30fae4c58a6147e4a95c5f492c44f723
child 107886 1c2e9acb91a35ef55a65fb3bebd7922ea5b79ffc
push id23522
push userryanvm@gmail.com
push dateTue, 25 Sep 2012 00:47:14 +0000
treeherdermozilla-central@654489f4be25 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs792305
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
b=792305 don't update mask bits outside the mask r=roc
widget/gtk2/nsWindow.cpp
--- a/widget/gtk2/nsWindow.cpp
+++ b/widget/gtk2/nsWindow.cpp
@@ -4344,28 +4344,27 @@ nsWindow::UpdateTranslucentWindowAlphaIn
         mTransparencyBitmap = new gchar[size];
         memset(mTransparencyBitmap, 255, size);
         mTransparencyBitmapWidth = mBounds.width;
         mTransparencyBitmapHeight = mBounds.height;
     } else {
         ResizeTransparencyBitmap();
     }
 
-    NS_ASSERTION(aRect.x >= 0 && aRect.y >= 0
-            && aRect.XMost() <= mBounds.width && aRect.YMost() <= mBounds.height,
-            "Rect is out of window bounds");
+    nsIntRect rect;
+    rect.IntersectRect(aRect, nsIntRect(0, 0, mBounds.width, mBounds.height));
 
     if (!ChangedMaskBits(mTransparencyBitmap, mBounds.width, mBounds.height,
-                         aRect, aAlphas, aStride))
+                         rect, aAlphas, aStride))
         // skip the expensive stuff if the mask bits haven't changed; hopefully
         // this is the common case
         return NS_OK;
 
     UpdateMaskBits(mTransparencyBitmap, mBounds.width, mBounds.height,
-                   aRect, aAlphas, aStride);
+                   rect, aAlphas, aStride);
 
     if (!mNeedsShow) {
         ApplyTransparencyBitmap();
     }
     return NS_OK;
 }
 
 void