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/openglx11cairotextrender.cxx | |
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/openglx11cairotextrender.cxx')
-rw-r--r-- | vcl/unx/generic/gdi/openglx11cairotextrender.cxx | 31 |
1 files changed, 11 insertions, 20 deletions
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: */ |