b=792305 don't update mask bits outside the mask r=roc a=akeybl
authorKarl Tomlinson <karlt+@karlt.net>
Fri, 19 Oct 2012 12:58:24 +1300
changeset 82032 53363548ad9bd6bea6096a674116c3f710308db8
parent 82031 a0ae1918be120a0903ac9a95a9a7fce648c532a5
child 82033 2b91826d58cbd4fa135c7900a328ea63e447a5ee
push id300
push userktomlinson@mozilla.com
push dateFri, 19 Oct 2012 00:00:41 +0000
reviewersroc, akeybl
bugs792305
milestone10.0.10esrpre
b=792305 don't update mask bits outside the mask r=roc a=akeybl
widget/src/gtk2/nsWindow.cpp
--- a/widget/src/gtk2/nsWindow.cpp
+++ b/widget/src/gtk2/nsWindow.cpp
@@ -4952,28 +4952,27 @@ nsWindow::UpdateTranslucentWindowAlphaIn
         mTransparencyBitmap = new gchar[size];
         if (mTransparencyBitmap == nsnull)
             return NS_ERROR_FAILURE;
         memset(mTransparencyBitmap, 255, size);
         mTransparencyBitmapWidth = mBounds.width;
         mTransparencyBitmapHeight = mBounds.height;
     }
 
-    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