[Libreoffice-commits] core.git: vcl/opengl vcl/win
Tomaž Vajngerl
tomaz.vajngerl at collabora.com
Sat Dec 12 14:02:16 PST 2015
vcl/opengl/gdiimpl.cxx | 16 ++++++++++++++++
vcl/win/gdi/gdiimpl.cxx | 15 +++++++++++++++
2 files changed, 31 insertions(+)
New commits:
commit 1321ae8ceba1801cd75322d6cf51ab53bac86b2a
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sat Dec 12 18:00:21 2015 +0100
check in dbg if we use correct SalBitmap instance that we expect
Change-Id: If1f176291304d2ef401bfb65c73ebf6635f0e756
Reviewed-on: https://gerrit.libreoffice.org/20668
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
Tested-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 0b6dc76..5054a6f 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -1665,6 +1665,9 @@ void OpenGLSalGraphicsImpl::drawBitmap(
const SalBitmap& rSalBitmap,
const SalBitmap& rMaskBitmap )
{
+ assert(dynamic_cast<const OpenGLSalBitmap*>(&rSalBitmap));
+ assert(dynamic_cast<const OpenGLSalBitmap*>(&rMaskBitmap));
+
const OpenGLSalBitmap& rBitmap = static_cast<const OpenGLSalBitmap&>(rSalBitmap);
const OpenGLSalBitmap& rMask = static_cast<const OpenGLSalBitmap&>(rMaskBitmap);
OpenGLTexture& rTexture( rBitmap.GetTexture() );
@@ -1681,6 +1684,7 @@ void OpenGLSalGraphicsImpl::drawMask(
const SalBitmap& rSalBitmap,
SalColor nMaskColor )
{
+ assert(dynamic_cast<const OpenGLSalBitmap*>(&rSalBitmap));
const OpenGLSalBitmap& rBitmap = static_cast<const OpenGLSalBitmap&>(rSalBitmap);
OpenGLTexture& rTexture( rBitmap.GetTexture() );
@@ -1782,6 +1786,8 @@ bool OpenGLSalGraphicsImpl::blendBitmap(
const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap )
{
+ assert(dynamic_cast<const OpenGLSalBitmap*>(&rSalBitmap));
+
const OpenGLSalBitmap& rBitmap = static_cast<const OpenGLSalBitmap&>(rSalBitmap);
OpenGLTexture& rTexture( rBitmap.GetTexture() );
@@ -1804,6 +1810,10 @@ bool OpenGLSalGraphicsImpl::blendAlphaBitmap(
const SalBitmap& rSalMaskBitmap,
const SalBitmap& rSalAlphaBitmap )
{
+ assert(dynamic_cast<const OpenGLSalBitmap*>(&rSalSrcBitmap));
+ assert(dynamic_cast<const OpenGLSalBitmap*>(&rSalMaskBitmap));
+ assert(dynamic_cast<const OpenGLSalBitmap*>(&rSalAlphaBitmap));
+
const OpenGLSalBitmap& rSrcBitmap = static_cast<const OpenGLSalBitmap&>(rSalSrcBitmap);
const OpenGLSalBitmap& rMaskBitmap = static_cast<const OpenGLSalBitmap&>(rSalMaskBitmap);
const OpenGLSalBitmap& rAlphaBitmap = static_cast<const OpenGLSalBitmap&>(rSalAlphaBitmap);
@@ -1835,6 +1845,9 @@ bool OpenGLSalGraphicsImpl::drawAlphaBitmap(
const SalBitmap& rSalBitmap,
const SalBitmap& rAlphaBitmap )
{
+ assert(dynamic_cast<const OpenGLSalBitmap*>(&rSalBitmap));
+ assert(dynamic_cast<const OpenGLSalBitmap*>(&rAlphaBitmap));
+
const OpenGLSalBitmap& rBitmap = static_cast<const OpenGLSalBitmap&>(rSalBitmap);
const OpenGLSalBitmap& rAlpha = static_cast<const OpenGLSalBitmap&>(rAlphaBitmap);
OpenGLTexture& rTexture( rBitmap.GetTexture() );
@@ -1855,6 +1868,9 @@ bool OpenGLSalGraphicsImpl::drawTransformedBitmap(
const SalBitmap& rSrcBitmap,
const SalBitmap* pAlphaBitmap)
{
+ assert(dynamic_cast<const OpenGLSalBitmap*>(&rSrcBitmap));
+ assert(dynamic_cast<const OpenGLSalBitmap*>(pAlphaBitmap));
+
const OpenGLSalBitmap& rBitmap = static_cast<const OpenGLSalBitmap&>(rSrcBitmap);
const OpenGLSalBitmap* pMaskBitmap = static_cast<const OpenGLSalBitmap*>(pAlphaBitmap);
OpenGLTexture& rTexture( rBitmap.GetTexture() );
diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx
index 89093bb..8af9909 100644
--- a/vcl/win/gdi/gdiimpl.cxx
+++ b/vcl/win/gdi/gdiimpl.cxx
@@ -707,6 +707,8 @@ void WinSalGraphicsImpl::drawBitmap(const SalTwoRect& rPosAry, const SalBitmap&
}
// fall back old stuff
+ assert(dynamic_cast<const WinSalBitmap*>(&rSalBitmap));
+
ImplDrawBitmap(mrParent.getHDC(), rPosAry, static_cast<const WinSalBitmap&>(rSalBitmap),
mrParent.isPrinter(),
mbXORMode ? SRCINVERT : SRCCOPY );
@@ -725,6 +727,9 @@ void WinSalGraphicsImpl::drawBitmap( const SalTwoRect& rPosAry,
return;
}
+ assert(dynamic_cast<const WinSalBitmap*>(&rSSalBitmap));
+ assert(dynamic_cast<const WinSalBitmap*>(&rSTransparentBitmap));
+
const WinSalBitmap& rSalBitmap = static_cast<const WinSalBitmap&>(rSSalBitmap);
const WinSalBitmap& rTransparentBitmap = static_cast<const WinSalBitmap&>(rSTransparentBitmap);
@@ -827,6 +832,8 @@ void WinSalGraphicsImpl::drawMask( const SalTwoRect& rPosAry,
{
DBG_ASSERT( !mrParent.isPrinter(), "No transparency print possible!" );
+ assert(dynamic_cast<const WinSalBitmap*>(&rSSalBitmap));
+
const WinSalBitmap& rSalBitmap = static_cast<const WinSalBitmap&>(rSSalBitmap);
SalTwoRect aPosAry = rPosAry;
@@ -2214,6 +2221,8 @@ bool WinSalGraphicsImpl::tryDrawBitmapGdiPlus(const SalTwoRect& rTR, const SalBi
{
if(rTR.mnSrcWidth && rTR.mnSrcHeight && rTR.mnDestWidth && rTR.mnDestHeight)
{
+ assert(dynamic_cast<const WinSalBitmap*>(&rSrcBitmap));
+
const WinSalBitmap& rSalBitmap = static_cast< const WinSalBitmap& >(rSrcBitmap);
GdiPlusBmpPtr aARGB(rSalBitmap.ImplGetGdiPlusBitmap());
@@ -2263,6 +2272,9 @@ bool WinSalGraphicsImpl::drawAlphaBitmap(
{
if(rTR.mnSrcWidth && rTR.mnSrcHeight && rTR.mnDestWidth && rTR.mnDestHeight)
{
+ assert(dynamic_cast<const WinSalBitmap*>(&rSrcBitmap));
+ assert(dynamic_cast<const WinSalBitmap*>(&rAlphaBmp));
+
const WinSalBitmap& rSalBitmap = static_cast< const WinSalBitmap& >(rSrcBitmap);
const WinSalBitmap& rSalAlpha = static_cast< const WinSalBitmap& >(rAlphaBmp);
GdiPlusBmpPtr aARGB(rSalBitmap.ImplGetGdiPlusBitmap(&rSalAlpha));
@@ -2297,6 +2309,9 @@ bool WinSalGraphicsImpl::drawTransformedBitmap(
const SalBitmap& rSourceBitmap,
const SalBitmap* pAlphaBitmap)
{
+ assert(dynamic_cast<const WinSalBitmap*>(&rSourceBitmap));
+ assert(dynamic_cast<const WinSalBitmap*>(&pAlphaBitmap));
+
const WinSalBitmap& rSalBitmap = static_cast< const WinSalBitmap& >(rSourceBitmap);
const WinSalBitmap* pSalAlpha = static_cast< const WinSalBitmap* >(pAlphaBitmap);
GdiPlusBmpPtr aARGB(rSalBitmap.ImplGetGdiPlusBitmap(pSalAlpha));
More information about the Libreoffice-commits
mailing list