vcl/opengl/salbmp.cxx | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-)
New commits: commit 432328f19bea0aa14a2b09a701c5b3aaf1f93908 Author: Michael Meeks <[email protected]> Date: Tue Feb 9 17:08:08 2016 +0000 vcl: opengl - fix crashing / memory corrupting issues with updateChecksum. Switch to use GetTexture which is robust over a number of corner-cases. Also ensure that we have a valid VCL OpenGLContext. Change-Id: I79b2b8ee241da4ed79e93e30df005e8c32ffcf02 Reviewed-on: https://gerrit.libreoffice.org/22242 Reviewed-by: Tomaž Vajngerl <[email protected]> Tested-by: Tomaž Vajngerl <[email protected]> (cherry picked from commit 77841b211fe7e4bdb6511333236ba4b86fac908f) Reviewed-on: https://gerrit.libreoffice.org/22247 Tested-by: Jenkins <[email protected]> Reviewed-by: Michael Meeks <[email protected]> diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx index 7f0d66b..0896fd1 100644 --- a/vcl/opengl/salbmp.cxx +++ b/vcl/opengl/salbmp.cxx @@ -596,7 +596,6 @@ bool OpenGLSalBitmap::calcChecksumGL(OpenGLTexture& rInputTexture, ChecksumType& { OUString FragShader("areaHashCRC64TFragmentShader"); - OpenGLZone aZone; rtl::Reference< OpenGLContext > xContext = OpenGLContext::getVCLContext(); static vcl::DeleteOnDeinit<OpenGLTexture> gCRCTableTexture( @@ -631,7 +630,6 @@ bool OpenGLSalBitmap::calcChecksumGL(OpenGLTexture& rInputTexture, ChecksumType& CHECK_GL_ERROR(); - // Second Pass nWidth = aFirstPassTexture.GetWidth(); @@ -675,25 +673,19 @@ void OpenGLSalBitmap::updateChecksum() const if (mbChecksumValid) return; - OpenGLSalBitmap* pThis = const_cast<OpenGLSalBitmap*>(this); - - if (!mbDirtyTexture) + if( (mnWidth * mnHeight) < (1024*768) || mnWidth < 128 || mnHeight < 128 ) { - pThis->CreateTexture(); + SalBitmap::updateChecksum(); + return; } - OpenGLTexture& rInputTexture = pThis->maTexture; - int nWidth = rInputTexture.GetWidth(); - int nHeight = rInputTexture.GetHeight(); + OpenGLSalBitmap* pThis = const_cast<OpenGLSalBitmap*>(this); - if( (nWidth * nHeight) < (1024*768) || nWidth < 128 || nHeight < 128 ) - { + OpenGLVCLContextZone aContextZone; + OpenGLTexture& rInputTexture = GetTexture(); + pThis->mbChecksumValid = calcChecksumGL(rInputTexture, pThis->mnChecksum); + if (!pThis->mbChecksumValid) SalBitmap::updateChecksum(); - } - else - { - pThis->mbChecksumValid = calcChecksumGL(rInputTexture, pThis->mnChecksum); - } } rtl::Reference<OpenGLContext> OpenGLSalBitmap::GetBitmapContext()
_______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
