b=795812 shape out translucent windows where alpha < 1/2 r=roc
authorKarl Tomlinson <karlt+@karlt.net>
Wed, 03 Oct 2012 11:35:28 +1300
changeset 109096 7f2eac1712ef
parent 109095 139ec19e88be
child 109097 6552072432a2
push id15846
push userktomlinson@mozilla.com
push dateWed, 03 Oct 2012 18:37:00 +0000
treeherdermozilla-inbound@b2fd5b6ca0d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs795812
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=795812 shape out translucent windows where alpha < 1/2 r=roc
widget/gtk2/nsWindow.cpp
--- a/widget/gtk2/nsWindow.cpp
+++ b/widget/gtk2/nsWindow.cpp
@@ -4224,17 +4224,17 @@ ChangedMaskBits(gchar* aMaskBits, int32_
         const nsIntRect& aRect, uint8_t* aAlphas, int32_t aStride)
 {
     int32_t x, y, xMax = aRect.XMost(), yMax = aRect.YMost();
     int32_t maskBytesPerRow = GetBitmapStride(aMaskWidth);
     for (y = aRect.y; y < yMax; y++) {
         gchar* maskBytes = aMaskBits + y*maskBytesPerRow;
         uint8_t* alphas = aAlphas;
         for (x = aRect.x; x < xMax; x++) {
-            bool newBit = *alphas > 0;
+            bool newBit = *alphas > 0x7f;
             alphas++;
 
             gchar maskByte = maskBytes[x >> 3];
             bool maskBit = (maskByte & (1 << (x & 7))) != 0;
 
             if (maskBit != newBit) {
                 return true;
             }
@@ -4250,17 +4250,17 @@ void UpdateMaskBits(gchar* aMaskBits, in
         const nsIntRect& aRect, uint8_t* aAlphas, int32_t aStride)
 {
     int32_t x, y, xMax = aRect.XMost(), yMax = aRect.YMost();
     int32_t maskBytesPerRow = GetBitmapStride(aMaskWidth);
     for (y = aRect.y; y < yMax; y++) {
         gchar* maskBytes = aMaskBits + y*maskBytesPerRow;
         uint8_t* alphas = aAlphas;
         for (x = aRect.x; x < xMax; x++) {
-            bool newBit = *alphas > 0;
+            bool newBit = *alphas > 0x7f;
             alphas++;
 
             gchar mask = 1 << (x & 7);
             gchar maskByte = maskBytes[x >> 3];
             // Note: '-newBit' turns 0 into 00...00 and 1 into 11...11
             maskBytes[x >> 3] = (maskByte & ~mask) | (-newBit & mask);
         }
         aAlphas += aStride;