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 109102 7f2eac1712ef
parent 109101 139ec19e88be
child 109103 6552072432a2
push id23609
push userryanvm@gmail.com
push dateThu, 04 Oct 2012 01:43:15 +0000
treeherdermozilla-central@ae646840907e [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;