vcl/opengl/salbmp.cxx | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-)
New commits: commit 77841b211fe7e4bdb6511333236ba4b86fac908f Author: Michael Meeks <michael.me...@collabora.com> 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 <qui...@gmail.com> Tested-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx index 683ca5f..cacd157 100644 --- a/vcl/opengl/salbmp.cxx +++ b/vcl/opengl/salbmp.cxx @@ -598,7 +598,6 @@ bool OpenGLSalBitmap::calcChecksumGL(OpenGLTexture& rInputTexture, ChecksumType& { OUString FragShader("areaHashCRC64TFragmentShader"); - OpenGLZone aZone; rtl::Reference< OpenGLContext > xContext = OpenGLContext::getVCLContext(); static vcl::DeleteOnDeinit<OpenGLTexture> gCRCTableTexture( @@ -633,7 +632,6 @@ bool OpenGLSalBitmap::calcChecksumGL(OpenGLTexture& rInputTexture, ChecksumType& CHECK_GL_ERROR(); - // Second Pass nWidth = aFirstPassTexture.GetWidth(); @@ -677,25 +675,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 libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits