From 8296e1d191e5f58977b6aafebf6da77129219ecb Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 24 Nov 2014 10:10:11 +0000 Subject: coverity#1255909 Uninitialized scalar field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I162199233c9d3feb03e7ab33b777174b2a03035a Reviewed-on: https://gerrit.libreoffice.org/13104 Tested-by: LibreOffice gerrit bot Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- vcl/opengl/gdiimpl.cxx | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'vcl/opengl/gdiimpl.cxx') diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index 3802a7e37312..a6b0f84ce19b 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -381,11 +381,9 @@ bool OpenGLSalGraphicsImpl::CheckOffscreenTexture() return true; } - SalTwoRect aPosAry; - aPosAry.mnSrcX = aPosAry.mnDestX = 0; - aPosAry.mnSrcY = aPosAry.mnDestY = 0; - aPosAry.mnSrcWidth = aPosAry.mnDestWidth = GetWidth(); - aPosAry.mnSrcHeight = aPosAry.mnDestHeight = GetHeight(); + GLfloat fWidth = GetWidth(); + GLfloat fHeight = GetHeight(); + SalTwoRect aPosAry(0, 0, fWidth, fHeight, 0,0, fWidth, fHeight); // TODO: improve performance: lfrb: User GL_ARB_copy_image? OpenGLTexture aNewTex = OpenGLTexture( GetWidth(), GetHeight() ); @@ -882,7 +880,6 @@ void OpenGLSalGraphicsImpl::DrawTransformedTexture( 0, (float) rTexture.GetHeight(), 0, 0, (float) rTexture.GetWidth(), 0, (float) rTexture.GetWidth(), (float) rTexture.GetHeight() }; GLfloat aTexCoord[8]; - SalTwoRect aPosAry; if( rMask ) { @@ -920,9 +917,9 @@ void OpenGLSalGraphicsImpl::DrawTransformedTexture( rTexture.SetFilter( GL_LINEAR ); CHECK_GL_ERROR(); - aPosAry.mnSrcX = aPosAry.mnSrcY = 0; - aPosAry.mnSrcWidth = rTexture.GetWidth(); - aPosAry.mnSrcHeight = rTexture.GetHeight(); + GLfloat fWidth = rTexture.GetWidth(); + GLfloat fHeight = rTexture.GetHeight(); + SalTwoRect aPosAry(0, 0, fWidth, fHeight, 0, 0, fWidth, fHeight); rTexture.GetCoord( aTexCoord, aPosAry ); glEnableVertexAttribArray( GL_ATTRIB_TEX ); glVertexAttribPointer( GL_ATTRIB_TEX, 2, GL_FLOAT, GL_FALSE, 0, aTexCoord ); @@ -1514,14 +1511,7 @@ void OpenGLSalGraphicsImpl::copyArea( { SAL_INFO( "vcl.opengl", "::copyArea " << nSrcX << "," << nSrcY << " >> " << nDestX << "," << nDestY << " (" << nSrcWidth << "," << nSrcHeight << ")" ); OpenGLTexture aTexture; - SalTwoRect aPosAry; - - aPosAry.mnSrcX = 0; - aPosAry.mnSrcY = 0; - aPosAry.mnDestX = nDestX; - aPosAry.mnDestY = nDestY; - aPosAry.mnSrcWidth = aPosAry.mnDestWidth = nSrcWidth; - aPosAry.mnSrcHeight = aPosAry.mnDestHeight = nSrcHeight; + SalTwoRect aPosAry(0, 0, nSrcWidth, nSrcHeight, nDestX, nDestY, nSrcWidth, nSrcHeight); PreDraw(); aTexture = OpenGLTexture( nSrcX, GetHeight() - nSrcY - nSrcHeight, nSrcWidth, nSrcHeight ); -- cgit v1.2.3