summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-12-16 17:19:31 +0000
committerMichael Meeks <michael.meeks@collabora.com>2015-12-16 17:55:26 +0000
commit70bfd5d747ad24fcd70eab93fb5e27faafdd35fe (patch)
treeaa3aaef3920895254f5b3bcb0e30281114b6f55e
parent72f0067258fd7738217abd43452abe282e05c11b (diff)
tdf#96546 - Bitmap getTexture calls can crash too - enter GL zone earlier.
Change-Id: Idd095e0a3b5e5226eaf1db90bfb0a838bc51de19 Reviewed-on: https://gerrit.libreoffice.org/20741 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
-rw-r--r--vcl/opengl/gdiimpl.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index fe5c475258a4..860cdbc63bb1 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -1651,6 +1651,8 @@ void OpenGLSalGraphicsImpl::drawBitmap( const SalTwoRect& rPosAry, const SalBitm
// check that carefully only in the debug mode
assert(dynamic_cast<const OpenGLSalBitmap*>(&rSalBitmap));
+ OpenGLZone aZone;
+
const OpenGLSalBitmap& rBitmap = static_cast<const OpenGLSalBitmap&>(rSalBitmap);
OpenGLTexture& rTexture = rBitmap.GetTexture();
@@ -1668,6 +1670,8 @@ void OpenGLSalGraphicsImpl::drawBitmap(
assert(dynamic_cast<const OpenGLSalBitmap*>(&rSalBitmap));
assert(dynamic_cast<const OpenGLSalBitmap*>(&rMaskBitmap));
+ OpenGLZone aZone;
+
const OpenGLSalBitmap& rBitmap = static_cast<const OpenGLSalBitmap&>(rSalBitmap);
const OpenGLSalBitmap& rMask = static_cast<const OpenGLSalBitmap&>(rMaskBitmap);
OpenGLTexture& rTexture( rBitmap.GetTexture() );
@@ -1685,6 +1689,9 @@ void OpenGLSalGraphicsImpl::drawMask(
SalColor nMaskColor )
{
assert(dynamic_cast<const OpenGLSalBitmap*>(&rSalBitmap));
+
+ OpenGLZone aZone;
+
const OpenGLSalBitmap& rBitmap = static_cast<const OpenGLSalBitmap&>(rSalBitmap);
OpenGLTexture& rTexture( rBitmap.GetTexture() );
@@ -1696,6 +1703,8 @@ void OpenGLSalGraphicsImpl::drawMask(
SalBitmap* OpenGLSalGraphicsImpl::getBitmap( long nX, long nY, long nWidth, long nHeight )
{
+ OpenGLZone aZone;
+
OpenGLSalBitmap* pBitmap = new OpenGLSalBitmap;
VCL_GL_INFO( "::getBitmap " << nX << "," << nY <<
" " << nWidth << "x" << nHeight );
@@ -1788,6 +1797,8 @@ bool OpenGLSalGraphicsImpl::blendBitmap(
{
assert(dynamic_cast<const OpenGLSalBitmap*>(&rSalBitmap));
+ OpenGLZone aZone;
+
const OpenGLSalBitmap& rBitmap = static_cast<const OpenGLSalBitmap&>(rSalBitmap);
OpenGLTexture& rTexture( rBitmap.GetTexture() );
@@ -1814,6 +1825,8 @@ bool OpenGLSalGraphicsImpl::blendAlphaBitmap(
assert(dynamic_cast<const OpenGLSalBitmap*>(&rSalMaskBitmap));
assert(dynamic_cast<const OpenGLSalBitmap*>(&rSalAlphaBitmap));
+ OpenGLZone aZone;
+
const OpenGLSalBitmap& rSrcBitmap = static_cast<const OpenGLSalBitmap&>(rSalSrcBitmap);
const OpenGLSalBitmap& rMaskBitmap = static_cast<const OpenGLSalBitmap&>(rSalMaskBitmap);
const OpenGLSalBitmap& rAlphaBitmap = static_cast<const OpenGLSalBitmap&>(rSalAlphaBitmap);
@@ -1848,6 +1861,8 @@ bool OpenGLSalGraphicsImpl::drawAlphaBitmap(
assert(dynamic_cast<const OpenGLSalBitmap*>(&rSalBitmap));
assert(dynamic_cast<const OpenGLSalBitmap*>(&rAlphaBitmap));
+ OpenGLZone aZone;
+
const OpenGLSalBitmap& rBitmap = static_cast<const OpenGLSalBitmap&>(rSalBitmap);
const OpenGLSalBitmap& rAlpha = static_cast<const OpenGLSalBitmap&>(rAlphaBitmap);
OpenGLTexture& rTexture( rBitmap.GetTexture() );
@@ -1871,6 +1886,8 @@ bool OpenGLSalGraphicsImpl::drawTransformedBitmap(
assert(dynamic_cast<const OpenGLSalBitmap*>(&rSrcBitmap));
assert(dynamic_cast<const OpenGLSalBitmap*>(pAlphaBitmap));
+ OpenGLZone aZone;
+
const OpenGLSalBitmap& rBitmap = static_cast<const OpenGLSalBitmap&>(rSrcBitmap);
const OpenGLSalBitmap* pMaskBitmap = static_cast<const OpenGLSalBitmap*>(pAlphaBitmap);
OpenGLTexture& rTexture( rBitmap.GetTexture() );