[Libreoffice-commits] core.git: vcl/inc vcl/win

Marco Cecchetti marco.cecchetti at collabora.com
Mon Mar 21 09:46:07 UTC 2016


 vcl/inc/opengl/salbmp.hxx |    1 +
 vcl/win/gdi/salgdi2.cxx   |   10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit f5a53794e188c8ee49173749578a6b81b52a82f4
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date:   Sun Mar 20 20:37:31 2016 +0100

    tdf#98324 - PNG prints as black block with OpenGL - fixed
    
    Now the correct color palette is used.
    
    Change-Id: If26c7cb149d1d6c24ae78137ff54669b3091fdb2
    Reviewed-on: https://gerrit.libreoffice.org/23378
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/vcl/inc/opengl/salbmp.hxx b/vcl/inc/opengl/salbmp.hxx
index 4eb0b01..5a9270e 100644
--- a/vcl/inc/opengl/salbmp.hxx
+++ b/vcl/inc/opengl/salbmp.hxx
@@ -85,6 +85,7 @@ public:
     bool            Create( const OpenGLTexture& rTex, long nX, long nY, long nWidth, long nHeight );
     OpenGLTexture&  GetTexture() const;
     static rtl::Reference<OpenGLContext> GetBitmapContext();
+    const BitmapPalette& GetBitmapPalette() const { return maPalette; }
 
 private:
 
diff --git a/vcl/win/gdi/salgdi2.cxx b/vcl/win/gdi/salgdi2.cxx
index 1500ae8..f8b8fe7 100644
--- a/vcl/win/gdi/salgdi2.cxx
+++ b/vcl/win/gdi/salgdi2.cxx
@@ -29,6 +29,7 @@
 #include <win/salids.hrc>
 #include <win/salgdi.h>
 #include <win/salframe.h>
+#include <opengl/salbmp.hxx>
 
 #include <vcl/salbtype.hxx>
 #include <vcl/bitmapaccess.hxx>
@@ -73,9 +74,16 @@ namespace
 
 void convertToWinSalBitmap(SalBitmap& rSalBitmap, WinSalBitmap& rWinSalBitmap)
 {
+         BitmapPalette aBitmapPalette;
+         OpenGLSalBitmap* pGLSalBitmap = dynamic_cast<OpenGLSalBitmap*>(&rSalBitmap);
+         if (pGLSalBitmap != nullptr)
+         {
+             aBitmapPalette = pGLSalBitmap->GetBitmapPalette();
+         }
+
         BitmapBuffer* pRead = rSalBitmap.AcquireBuffer(BITMAP_READ_ACCESS);
 
-        rWinSalBitmap.Create(rSalBitmap.GetSize(), rSalBitmap.GetBitCount(), BitmapPalette());
+        rWinSalBitmap.Create(rSalBitmap.GetSize(), rSalBitmap.GetBitCount(), aBitmapPalette);
         BitmapBuffer* pWrite = rWinSalBitmap.AcquireBuffer(BITMAP_WRITE_ACCESS);
 
         sal_uInt8* pSource(pRead->mpBits);


More information about the Libreoffice-commits mailing list