diff options
Diffstat (limited to 'vcl/win/source/gdi')
-rw-r--r-- | vcl/win/source/gdi/salgdi2.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/vcl/win/source/gdi/salgdi2.cxx b/vcl/win/source/gdi/salgdi2.cxx index 6f0e5d4a1eb9..6433921835fd 100644 --- a/vcl/win/source/gdi/salgdi2.cxx +++ b/vcl/win/source/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/bmpacc.hxx" @@ -36,7 +37,6 @@ #include "salgdiimpl.hxx" #include "opengl/win/gdiimpl.hxx" - bool WinSalGraphics::supportsOperation( OutDevSupportType eType ) const { static bool bAllowForTest(true); @@ -76,9 +76,15 @@ namespace void convertToWinSalBitmap(SalBitmap& rSalBitmap, WinSalBitmap& rWinSalBitmap) { - BitmapBuffer* pRead = rSalBitmap.AcquireBuffer(BITMAP_READ_ACCESS); + BitmapPalette aBitmapPalette; + OpenGLSalBitmap* pGLSalBitmap = dynamic_cast<OpenGLSalBitmap*>(&rSalBitmap); + if (pGLSalBitmap != nullptr) + { + aBitmapPalette = pGLSalBitmap->GetBitmapPalette(); + } - rWinSalBitmap.Create(rSalBitmap.GetSize(), rSalBitmap.GetBitCount(), BitmapPalette()); + BitmapBuffer* pRead = rSalBitmap.AcquireBuffer(BITMAP_READ_ACCESS); + rWinSalBitmap.Create(rSalBitmap.GetSize(), rSalBitmap.GetBitCount(), aBitmapPalette); BitmapBuffer* pWrite = rWinSalBitmap.AcquireBuffer(BITMAP_WRITE_ACCESS); sal_uInt8* pSource(pRead->mpBits); |