vcl/inc/opengl/salbmp.hxx | 2 -- vcl/opengl/scale.cxx | 45 ++++----------------------------------------- 2 files changed, 4 insertions(+), 43 deletions(-)
New commits: commit f98252c515c02f2b30b21d086e081ba2c0fd4971 Author: Tomaž Vajngerl <[email protected]> Date: Fri Sep 11 12:25:35 2015 +0200 opengl: this doesn't really do anything as data is null anyway Change-Id: Iacd75beecc14023173a9aa52a30298bbfe787d61 (cherry picked from commit 0eb9f13d401eb473338c7da2e4cfd0e366996aee) Reviewed-on: https://gerrit.libreoffice.org/18623 Reviewed-by: Michael Meeks <[email protected]> Tested-by: Michael Meeks <[email protected]> diff --git a/vcl/inc/opengl/salbmp.hxx b/vcl/inc/opengl/salbmp.hxx index 3dd31a2..99a819a 100644 --- a/vcl/inc/opengl/salbmp.hxx +++ b/vcl/inc/opengl/salbmp.hxx @@ -109,8 +109,6 @@ private: bool ImplScaleConvolution( const double& rScaleX, const double& rScaleY, const Kernel& aKernel ); bool ImplScaleArea( double rScaleX, double rScaleY ); - bool getFormatAndType(GLenum& nFormat, GLenum& nType); - public: bool ImplScale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ); diff --git a/vcl/opengl/scale.cxx b/vcl/opengl/scale.cxx index 6ddd299..48b92db 100644 --- a/vcl/opengl/scale.cxx +++ b/vcl/opengl/scale.cxx @@ -44,31 +44,6 @@ public: void GetSize( Size& rSize ) const SAL_OVERRIDE; }; -bool OpenGLSalBitmap::getFormatAndType(GLenum& nFormat, GLenum& nType) -{ - switch(mnBits) - { - case 8: - nFormat = GL_LUMINANCE; - nType = GL_UNSIGNED_BYTE; - break; - case 16: - nFormat = GL_RGB; - nType = GL_UNSIGNED_SHORT_5_6_5; - break; - case 24: - nFormat = GL_RGB; - nType = GL_UNSIGNED_BYTE; - break; - case 32: - default: - nFormat = GL_RGBA; - nType = GL_UNSIGNED_BYTE; - break; - } - return true; -} - bool OpenGLSalBitmap::ImplScaleFilter( const double& rScaleX, const double& rScaleY, @@ -85,11 +60,7 @@ bool OpenGLSalBitmap::ImplScaleFilter( if( !pProgram ) return false; - GLenum nFormat; - GLenum nType; - getFormatAndType(nFormat, nType); - - OpenGLTexture aNewTex = OpenGLTexture(nNewWidth, nNewHeight, nFormat, nType, nullptr); + OpenGLTexture aNewTex(nNewWidth, nNewHeight); pFramebuffer = mpContext->AcquireFramebuffer( aNewTex ); pProgram->SetTexture( "sampler", maTexture ); @@ -168,14 +139,10 @@ bool OpenGLSalBitmap::ImplScaleConvolution( if( pProgram == 0 ) return false; - GLenum nFormat; - GLenum nType; - getFormatAndType(nFormat, nType); - // horizontal scaling in scratch texture if( mnWidth != nNewWidth ) { - OpenGLTexture aScratchTex = OpenGLTexture(nNewWidth, mnHeight, nFormat, nType, nullptr); + OpenGLTexture aScratchTex(nNewWidth, nNewHeight); pFramebuffer = mpContext->AcquireFramebuffer( aScratchTex ); @@ -198,7 +165,7 @@ bool OpenGLSalBitmap::ImplScaleConvolution( // vertical scaling in final texture if( mnHeight != nNewHeight ) { - OpenGLTexture aScratchTex = OpenGLTexture(nNewWidth, nNewHeight, nFormat, nType, nullptr); + OpenGLTexture aScratchTex(nNewWidth, nNewHeight); pFramebuffer = mpContext->AcquireFramebuffer( aScratchTex ); @@ -259,11 +226,7 @@ bool OpenGLSalBitmap::ImplScaleArea( double rScaleX, double rScaleY ) if( pProgram == 0 ) return false; - GLenum nFormat; - GLenum nType; - getFormatAndType(nFormat, nType); - - OpenGLTexture aScratchTex = OpenGLTexture(nNewWidth, nNewHeight, nFormat, nType, nullptr); + OpenGLTexture aScratchTex(nNewWidth, nNewHeight); OpenGLFramebuffer* pFramebuffer = mpContext->AcquireFramebuffer( aScratchTex );
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
