[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara caolanm at redhat.com
Tue Jul 7 04:39:37 PDT 2015


 vcl/unx/gtk/window/gtksalframe.cxx |   21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

New commits:
commit 10a3db37377a68ec7529bbfbf876c852d58b7ae4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jul 7 12:36:38 2015 +0100

    gtk3: handle 32bit icons, silences ugly warnings as bonus
    
    Change-Id: I015c89740631dfcbe62cab62f75b4a44d2b3b35a

diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 3efc911..9a33d77 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -1630,7 +1630,7 @@ bitmapToPixbuf( SalBitmap *pSalBitmap, SalBitmap *pSalAlpha )
 
     BitmapBuffer *pBitmap = pSalBitmap->AcquireBuffer( BITMAP_READ_ACCESS );
     g_return_val_if_fail( pBitmap != NULL, NULL );
-    g_return_val_if_fail( pBitmap->mnBitCount == 24, NULL );
+    g_return_val_if_fail( pBitmap->mnBitCount == 24 || pBitmap->mnBitCount == 32, NULL );
 
     BitmapBuffer *pAlpha = pSalAlpha->AcquireBuffer( BITMAP_READ_ACCESS );
     g_return_val_if_fail( pAlpha != NULL, NULL );
@@ -1650,19 +1650,20 @@ bitmapToPixbuf( SalBitmap *pSalBitmap, SalBitmap *pSalAlpha )
 
         for( nX = 0; nX < pBitmap->mnWidth; nX++ )
         {
-            if( pBitmap->mnFormat == BMP_FORMAT_24BIT_TC_BGR )
+            BitmapColor aColor;
+            if (pBitmap->mnBitCount == 24)
             {
-                pDestData[2] = *pData++;
-                pDestData[1] = *pData++;
-                pDestData[0] = *pData++;
+                pBitmap->maColorMask.GetColorFor24Bit(aColor, pData);
+                pData+=3;
             }
-            else // BMP_FORMAT_24BIT_TC_RGB
+            else
             {
-                pDestData[0] = *pData++;
-                pDestData[1] = *pData++;
-                pDestData[2] = *pData++;
+                pBitmap->maColorMask.GetColorFor32Bit(aColor, pData);
+                pData+=4;
             }
-            pDestData += 3;
+            *pDestData++ = aColor.GetRed();
+            *pDestData++ = aColor.GetGreen();
+            *pDestData++ = aColor.GetBlue();
             *pDestData++ = 255 - *pAlphaData++;
         }
     }


More information about the Libreoffice-commits mailing list