diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-26 12:27:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-27 11:42:27 +0200 |
commit | bd28564be85ee51dc08cb2591840e1cb00263e28 (patch) | |
tree | 192a63ee3898075f7fe60738f65ec72421cb441c /vcl/opengl | |
parent | svx: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9) (diff) | |
download | core-bd28564be85ee51dc08cb2591840e1cb00263e28.tar.gz core-bd28564be85ee51dc08cb2591840e1cb00263e28.zip |
loplugin:returnconstant in vcl
Change-Id: I597ef6d75d1c21cdc15a91bf7f549bc14c851506
Reviewed-on: https://gerrit.libreoffice.org/58086
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/opengl')
-rw-r--r-- | vcl/opengl/gdiimpl.cxx | 9 | ||||
-rw-r--r-- | vcl/opengl/program.cxx | 4 | ||||
-rw-r--r-- | vcl/opengl/salbmp.cxx | 4 | ||||
-rw-r--r-- | vcl/opengl/x11/gdiimpl.cxx | 13 |
4 files changed, 9 insertions, 21 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index bad495bdb1b6..d7965883d2d7 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -132,11 +132,9 @@ bool OpenGLSalGraphicsImpl::AcquireContext( bool bForceCreate ) return mpContext.is(); } -bool OpenGLSalGraphicsImpl::ReleaseContext() +void OpenGLSalGraphicsImpl::ReleaseContext() { mpContext.clear(); - - return true; } void OpenGLSalGraphicsImpl::Init() @@ -1738,10 +1736,7 @@ std::shared_ptr<SalBitmap> OpenGLSalGraphicsImpl::getBitmap( long nX, long nY, l " " << nWidth << "x" << nHeight ); //TODO really needed? PreDraw(); - if( !pBitmap->Create( maOffscreenTex, nX, nY, nWidth, nHeight ) ) - { - pBitmap = nullptr; - } + pBitmap->Create( maOffscreenTex, nX, nY, nWidth, nHeight ); PostDraw(); return pBitmap; } diff --git a/vcl/opengl/program.cxx b/vcl/opengl/program.cxx index 09a8a0d98d0b..5f677f1a5655 100644 --- a/vcl/opengl/program.cxx +++ b/vcl/opengl/program.cxx @@ -67,7 +67,7 @@ void OpenGLProgram::Use() Reuse(); } -bool OpenGLProgram::Clean() +void OpenGLProgram::Clean() { // unbind all textures for (OpenGLTexture& rTexture : maTextures) @@ -89,8 +89,6 @@ bool OpenGLProgram::Clean() } mnEnabledAttribs = 0; } - - return true; } bool OpenGLProgram::EnableVertexAttrib(GLuint& rAttrib, const OString& rName) diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx index 33fc720ef497..20d0ac1fadd3 100644 --- a/vcl/opengl/salbmp.cxx +++ b/vcl/opengl/salbmp.cxx @@ -115,7 +115,7 @@ OpenGLSalBitmap::~OpenGLSalBitmap() VCL_GL_INFO( "~OpenGLSalBitmap" ); } -bool OpenGLSalBitmap::Create( const OpenGLTexture& rTex, long nX, long nY, long nWidth, long nHeight ) +void OpenGLSalBitmap::Create( const OpenGLTexture& rTex, long nX, long nY, long nWidth, long nHeight ) { DBG_TESTSOLARMUTEX(); static const BitmapPalette aEmptyPalette; @@ -155,8 +155,6 @@ bool OpenGLSalBitmap::Create( const OpenGLTexture& rTex, long nX, long nY, long assert(mnWidth == maTexture.GetWidth() && mnHeight == maTexture.GetHeight()); - - return true; } bool OpenGLSalBitmap::Create( const Size& rSize, sal_uInt16 nBits, const BitmapPalette& rBitmapPalette ) diff --git a/vcl/opengl/x11/gdiimpl.cxx b/vcl/opengl/x11/gdiimpl.cxx index 2e8fffe7c0f6..5104d6302973 100644 --- a/vcl/opengl/x11/gdiimpl.cxx +++ b/vcl/opengl/x11/gdiimpl.cxx @@ -697,7 +697,7 @@ namespace } } -bool X11OpenGLSalGraphicsImpl::RenderPixmap(X11Pixmap const * pPixmap, X11Pixmap const * pMask, int nX, int nY, TextureCombo& rCombo) +void X11OpenGLSalGraphicsImpl::RenderPixmap(X11Pixmap const * pPixmap, X11Pixmap const * pMask, int nX, int nY, TextureCombo& rCombo) { const int aAttribs[] = { @@ -764,8 +764,6 @@ bool X11OpenGLSalGraphicsImpl::RenderPixmap(X11Pixmap const * pPixmap, X11Pixmap PostDraw(); CHECK_GL_ERROR(); - - return true; } bool X11OpenGLSalGraphicsImpl::RenderPixmapToScreen( X11Pixmap* pPixmap, X11Pixmap* pMask, int nX, int nY ) @@ -773,7 +771,8 @@ bool X11OpenGLSalGraphicsImpl::RenderPixmapToScreen( X11Pixmap* pPixmap, X11Pixm SAL_INFO( "vcl.opengl", "RenderPixmapToScreen (" << nX << " " << nY << ")" ); TextureCombo aCombo; - return RenderPixmap(pPixmap, pMask, nX, nY, aCombo); + RenderPixmap(pPixmap, pMask, nX, nY, aCombo); + return true; } bool X11OpenGLSalGraphicsImpl::TryRenderCachedNativeControl(ControlCacheKey& rControlCacheKey, int nX, int nY) @@ -811,9 +810,7 @@ bool X11OpenGLSalGraphicsImpl::RenderAndCacheNativeControl(X11Pixmap* pPixmap, X ControlCacheKey& aControlCacheKey) { std::unique_ptr<TextureCombo> pCombo(new TextureCombo); - bool bResult = RenderPixmap(pPixmap, pMask, nX, nY, *pCombo); - if (!bResult) - return false; + RenderPixmap(pPixmap, pMask, nX, nY, *pCombo); if (!aControlCacheKey.canCacheControl()) return true; @@ -822,7 +819,7 @@ bool X11OpenGLSalGraphicsImpl::RenderAndCacheNativeControl(X11Pixmap* pPixmap, X if (gTextureCache.get()) gTextureCache.get()->insert(std::move(pair)); - return bResult; + return true; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |