summaryrefslogtreecommitdiff
path: root/vcl/opengl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-09-11 12:25:35 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-09-16 14:16:36 +0200
commit0eb9f13d401eb473338c7da2e4cfd0e366996aee (patch)
tree4c6acd68523525d6af8d54b0a78b29b2673bb1c3 /vcl/opengl
parentbf2116353a89c402bf19b79d49eadf4454103423 (diff)
opengl: this doesn't really do anything as data is null anyway
Change-Id: Iacd75beecc14023173a9aa52a30298bbfe787d61
Diffstat (limited to 'vcl/opengl')
-rw-r--r--vcl/opengl/scale.cxx45
1 files changed, 4 insertions, 41 deletions
diff --git a/vcl/opengl/scale.cxx b/vcl/opengl/scale.cxx
index 1ddb6d46b966..5f5c37cab5e7 100644
--- a/vcl/opengl/scale.cxx
+++ b/vcl/opengl/scale.cxx
@@ -52,31 +52,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,
@@ -93,11 +68,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 );
@@ -176,14 +147,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 );
@@ -206,7 +173,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 );
@@ -267,11 +234,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 );