diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-24 10:10:11 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-24 20:40:42 +0000 |
commit | 8ccf559473f185bdb7640e438e131f17ddc1861c (patch) | |
tree | 3d7d01ea5b36aa733a1c76edc378c3b9654b50ba /vcl/unx/generic/gdi | |
parent | 3a58704459a8e60ecca337a247331ac55b7672d3 (diff) |
coverity#1255909 Uninitialized scalar field
Change-Id: I162199233c9d3feb03e7ab33b777174b2a03035a
Reviewed-on: https://gerrit.libreoffice.org/13104
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx/generic/gdi')
-rw-r--r-- | vcl/unx/generic/gdi/gdiimpl.cxx | 15 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/openglx11cairotextrender.cxx | 31 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salbmp.cxx | 8 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salgdi2.cxx | 9 |
4 files changed, 17 insertions, 46 deletions
diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx index 91c4db7b4221..46865d0481a7 100644 --- a/vcl/unx/generic/gdi/gdiimpl.cxx +++ b/vcl/unx/generic/gdi/gdiimpl.cxx @@ -667,19 +667,8 @@ void X11SalGraphicsImpl::copyArea ( long nDestX, long nDestY, long nSrcWidth, long nSrcHeight, sal_uInt16 ) { - SalTwoRect aPosAry; - - aPosAry.mnDestX = nDestX; - aPosAry.mnDestY = nDestY; - aPosAry.mnDestWidth = nSrcWidth; - aPosAry.mnDestHeight = nSrcHeight; - - aPosAry.mnSrcX = nSrcX; - aPosAry.mnSrcY = nSrcY; - aPosAry.mnSrcWidth = nSrcWidth; - aPosAry.mnSrcHeight = nSrcHeight; - - copyBits ( aPosAry, 0 ); + SalTwoRect aPosAry(nSrcX, nSrcY, nSrcWidth, nSrcHeight, nDestX, nDestY, nSrcWidth, nSrcHeight); + copyBits(aPosAry, 0); } void X11SalGraphicsImpl::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap ) diff --git a/vcl/unx/generic/gdi/openglx11cairotextrender.cxx b/vcl/unx/generic/gdi/openglx11cairotextrender.cxx index 38a7213cd815..f16fe966b4b7 100644 --- a/vcl/unx/generic/gdi/openglx11cairotextrender.cxx +++ b/vcl/unx/generic/gdi/openglx11cairotextrender.cxx @@ -31,32 +31,23 @@ cairo_surface_t* OpenGLX11CairoTextRender::getCairoSurface() void OpenGLX11CairoTextRender::drawSurface(cairo_t* cr) { + // XXX: lfrb: GLES 2.0 doesn't support GL_UNSIGNED_INT_8_8_8_8_REV + OpenGLSalGraphicsImpl *pImpl = dynamic_cast< OpenGLSalGraphicsImpl* >(mrParent.GetImpl()); + if(!pImpl) + return; + cairo_surface_t* pSurface = cairo_get_target(cr); int nWidth = cairo_image_surface_get_width( pSurface ); int nHeight = cairo_image_surface_get_height( pSurface ); cairo_surface_flush( pSurface ); unsigned char *pSrc = cairo_image_surface_get_data( pSurface ); - SalTwoRect aRect; - aRect.mnSrcX = 0; - aRect.mnSrcY = 0; - aRect.mnSrcWidth = nWidth; - aRect.mnSrcHeight = nHeight; - aRect.mnDestX = 0; - aRect.mnDestY = 0; - aRect.mnDestWidth = nWidth; - aRect.mnDestHeight = nHeight; - - // XXX: lfrb: GLES 2.0 doesn't support GL_UNSIGNED_INT_8_8_8_8_REV - OpenGLSalGraphicsImpl *pImpl = dynamic_cast< OpenGLSalGraphicsImpl* >(mrParent.GetImpl()); - if( pImpl ) - { - // Cairo surface data is ARGB with premultiplied alpha and is Y-inverted - OpenGLTexture aTexture( nWidth, nHeight, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, pSrc ); - pImpl->PreDraw(); - pImpl->DrawAlphaTexture( aTexture, aRect, true, true ); - pImpl->PostDraw(); - } + SalTwoRect aRect(0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight); + // Cairo surface data is ARGB with premultiplied alpha and is Y-inverted + OpenGLTexture aTexture( nWidth, nHeight, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, pSrc ); + pImpl->PreDraw(); + pImpl->DrawAlphaTexture( aTexture, aRect, true, true ); + pImpl->PostDraw(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx index a245dc9637b0..5d442f1a9f46 100644 --- a/vcl/unx/generic/gdi/salbmp.cxx +++ b/vcl/unx/generic/gdi/salbmp.cxx @@ -910,7 +910,8 @@ ImplSalDDB::ImplSalDDB( long nY, long nWidth, long nHeight -) : mnDepth( nDrawableDepth ) +) : maTwoRect(0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight) + , mnDepth( nDrawableDepth ) , mnXScreen( nXScreen ) { SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay(); @@ -934,14 +935,9 @@ ImplSalDDB::ImplSalDDB( ImplDraw( aDrawable, nDrawableDepth, maPixmap, mnDepth, nX, nY, nWidth, nHeight, 0, 0, aGC ); XFreeGC( pXDisp, aGC ); - - maTwoRect.mnSrcX = maTwoRect.mnSrcY = maTwoRect.mnDestX = maTwoRect.mnDestY = 0; - maTwoRect.mnSrcWidth = maTwoRect.mnDestWidth = nWidth; - maTwoRect.mnSrcHeight = maTwoRect.mnDestHeight = nHeight; } else { - maTwoRect.mnSrcX = maTwoRect.mnSrcY = maTwoRect.mnDestX = maTwoRect.mnDestY = 0; maTwoRect.mnSrcWidth = maTwoRect.mnDestWidth = 0; maTwoRect.mnSrcHeight = maTwoRect.mnDestHeight = 0; } diff --git a/vcl/unx/generic/gdi/salgdi2.cxx b/vcl/unx/generic/gdi/salgdi2.cxx index f1911b6e2fc5..e88a18ae1ca9 100644 --- a/vcl/unx/generic/gdi/salgdi2.cxx +++ b/vcl/unx/generic/gdi/salgdi2.cxx @@ -73,13 +73,8 @@ void X11SalGraphics::CopyScreenArea( Display* pDisplay, { X11SalBitmap aBM; aBM.ImplCreateFromDrawable( aSrc, nXScreenSrc, nSrcDepth, src_x, src_y, w, h ); - SalTwoRect aTwoRect; - aTwoRect.mnSrcX = aTwoRect.mnSrcY = 0; - aTwoRect.mnSrcWidth = aTwoRect.mnDestWidth = w; - aTwoRect.mnSrcHeight = aTwoRect.mnDestHeight = h; - aTwoRect.mnDestX = dest_x; - aTwoRect.mnDestY = dest_y; - aBM.ImplDraw( aDest, nXScreenDest, nDestDepth, aTwoRect,aDestGC ); + SalTwoRect aTwoRect(0, 0, w, h, dest_x, dest_y, w, h); + aBM.ImplDraw(aDest, nXScreenDest, nDestDepth, aTwoRect,aDestGC); } } |