[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/unx

Caolán McNamara caolanm at redhat.com
Tue Jul 7 07:01:54 PDT 2015


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

New commits:
commit d2a1c2eda3f894b9451c677c64644c0054234bd1
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
    (cherry picked from commit 10a3db37377a68ec7529bbfbf876c852d58b7ae4)
    Reviewed-on: https://gerrit.libreoffice.org/16814
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index c225426..3bee994 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -1631,7 +1631,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 );
@@ -1651,19 +1651,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