Kaydet (Commit) f7efd54b authored tarafından Jan Holesovsky's avatar Jan Holesovsky

opengl: Check for error at the end of every method that deals with OpenGL.

Otherwise we will get the report of an error much much later, most probably in
a totally unrelated part.

Change-Id: I33d3c6d01126f5766beb179eeaeb3276a9078226
üst 1254e56e
...@@ -96,12 +96,16 @@ void OpenGLSalGraphicsImpl::PreDraw() ...@@ -96,12 +96,16 @@ void OpenGLSalGraphicsImpl::PreDraw()
if( mbOffscreen ) if( mbOffscreen )
glBindFramebuffer( GL_FRAMEBUFFER, mnFramebufferId ); glBindFramebuffer( GL_FRAMEBUFFER, mnFramebufferId );
glViewport( 0, 0, GetWidth(), GetHeight() ); glViewport( 0, 0, GetWidth(), GetHeight() );
CHECK_GL_ERROR();
} }
void OpenGLSalGraphicsImpl::PostDraw() void OpenGLSalGraphicsImpl::PostDraw()
{ {
if( mbOffscreen ) if( mbOffscreen )
glBindFramebuffer( GL_FRAMEBUFFER, 0 ); glBindFramebuffer( GL_FRAMEBUFFER, 0 );
CHECK_GL_ERROR();
} }
void OpenGLSalGraphicsImpl::freeResources() void OpenGLSalGraphicsImpl::freeResources()
...@@ -143,6 +147,8 @@ void OpenGLSalGraphicsImpl::ResetClipRegion() ...@@ -143,6 +147,8 @@ void OpenGLSalGraphicsImpl::ResetClipRegion()
SAL_INFO( "vcl.opengl", "::ResetClipRegion" ); SAL_INFO( "vcl.opengl", "::ResetClipRegion" );
maContext.makeCurrent(); maContext.makeCurrent();
glDisable(GL_STENCIL_TEST); glDisable(GL_STENCIL_TEST);
CHECK_GL_ERROR();
} }
// get the depth of the device // get the depth of the device
...@@ -237,8 +243,9 @@ void OpenGLSalGraphicsImpl::SetOffscreen( bool bOffscreen ) ...@@ -237,8 +243,9 @@ void OpenGLSalGraphicsImpl::SetOffscreen( bool bOffscreen )
glBindFramebuffer( GL_FRAMEBUFFER, mnFramebufferId ); glBindFramebuffer( GL_FRAMEBUFFER, mnFramebufferId );
mpOffscreenTex.reset( new OpenGLTexture( GetWidth(), GetHeight() ) ); mpOffscreenTex.reset( new OpenGLTexture( GetWidth(), GetHeight() ) );
glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mpOffscreenTex->Id(), 0 ); glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mpOffscreenTex->Id(), 0 );
CHECK_GL_ERROR();
} }
CHECK_GL_ERROR();
} }
bool OpenGLSalGraphicsImpl::CreateSolidProgram( void ) bool OpenGLSalGraphicsImpl::CreateSolidProgram( void )
...@@ -251,6 +258,8 @@ bool OpenGLSalGraphicsImpl::CreateSolidProgram( void ) ...@@ -251,6 +258,8 @@ bool OpenGLSalGraphicsImpl::CreateSolidProgram( void )
SAL_INFO( "vcl.opengl", "Solid Program Created" ); SAL_INFO( "vcl.opengl", "Solid Program Created" );
glBindAttribLocation( mnSolidProgram, GL_ATTRIB_POS, "position" ); glBindAttribLocation( mnSolidProgram, GL_ATTRIB_POS, "position" );
mnColorUniform = glGetUniformLocation( mnSolidProgram, "color" ); mnColorUniform = glGetUniformLocation( mnSolidProgram, "color" );
CHECK_GL_ERROR();
return true; return true;
} }
...@@ -263,6 +272,8 @@ bool OpenGLSalGraphicsImpl::CreateTextureProgram( void ) ...@@ -263,6 +272,8 @@ bool OpenGLSalGraphicsImpl::CreateTextureProgram( void )
glBindAttribLocation( mnTextureProgram, GL_ATTRIB_POS, "position" ); glBindAttribLocation( mnTextureProgram, GL_ATTRIB_POS, "position" );
glBindAttribLocation( mnTextureProgram, GL_ATTRIB_TEX, "tex_coord_in" ); glBindAttribLocation( mnTextureProgram, GL_ATTRIB_TEX, "tex_coord_in" );
mnSamplerUniform = glGetUniformLocation( mnTextureProgram, "sampler" ); mnSamplerUniform = glGetUniformLocation( mnTextureProgram, "sampler" );
CHECK_GL_ERROR();
return true; return true;
} }
...@@ -276,6 +287,8 @@ bool OpenGLSalGraphicsImpl::CreateMaskedTextureProgram( void ) ...@@ -276,6 +287,8 @@ bool OpenGLSalGraphicsImpl::CreateMaskedTextureProgram( void )
glBindAttribLocation( mnTextureProgram, GL_ATTRIB_TEX, "tex_coord_in" ); glBindAttribLocation( mnTextureProgram, GL_ATTRIB_TEX, "tex_coord_in" );
mnMaskedSamplerUniform = glGetUniformLocation( mnMaskedTextureProgram, "sampler" ); mnMaskedSamplerUniform = glGetUniformLocation( mnMaskedTextureProgram, "sampler" );
mnMaskSamplerUniform = glGetUniformLocation( mnMaskedTextureProgram, "mask" ); mnMaskSamplerUniform = glGetUniformLocation( mnMaskedTextureProgram, "mask" );
CHECK_GL_ERROR();
return true; return true;
} }
...@@ -289,6 +302,8 @@ bool OpenGLSalGraphicsImpl::CreateMaskProgram( void ) ...@@ -289,6 +302,8 @@ bool OpenGLSalGraphicsImpl::CreateMaskProgram( void )
glBindAttribLocation( mnTextureProgram, GL_ATTRIB_TEX, "tex_coord_in" ); glBindAttribLocation( mnTextureProgram, GL_ATTRIB_TEX, "tex_coord_in" );
mnMaskUniform = glGetUniformLocation( mnMaskProgram, "sampler" ); mnMaskUniform = glGetUniformLocation( mnMaskProgram, "sampler" );
mnMaskColorUniform = glGetUniformLocation( mnMaskProgram, "mask" ); mnMaskColorUniform = glGetUniformLocation( mnMaskProgram, "mask" );
CHECK_GL_ERROR();
return true; return true;
} }
...@@ -302,6 +317,8 @@ bool OpenGLSalGraphicsImpl::CreateLinearGradientProgram( void ) ...@@ -302,6 +317,8 @@ bool OpenGLSalGraphicsImpl::CreateLinearGradientProgram( void )
glBindAttribLocation( mnTextureProgram, GL_ATTRIB_TEX, "tex_coord_in" ); glBindAttribLocation( mnTextureProgram, GL_ATTRIB_TEX, "tex_coord_in" );
mnLinearGradientStartColorUniform = glGetUniformLocation( mnLinearGradientProgram, "start_color" ); mnLinearGradientStartColorUniform = glGetUniformLocation( mnLinearGradientProgram, "start_color" );
mnLinearGradientEndColorUniform = glGetUniformLocation( mnLinearGradientProgram, "end_color" ); mnLinearGradientEndColorUniform = glGetUniformLocation( mnLinearGradientProgram, "end_color" );
CHECK_GL_ERROR();
return true; return true;
} }
...@@ -316,6 +333,8 @@ bool OpenGLSalGraphicsImpl::CreateRadialGradientProgram( void ) ...@@ -316,6 +333,8 @@ bool OpenGLSalGraphicsImpl::CreateRadialGradientProgram( void )
mnRadialGradientStartColorUniform = glGetUniformLocation( mnRadialGradientProgram, "start_color" ); mnRadialGradientStartColorUniform = glGetUniformLocation( mnRadialGradientProgram, "start_color" );
mnRadialGradientEndColorUniform = glGetUniformLocation( mnRadialGradientProgram, "end_color" ); mnRadialGradientEndColorUniform = glGetUniformLocation( mnRadialGradientProgram, "end_color" );
mnRadialGradientCenterUniform = glGetUniformLocation( mnRadialGradientProgram, "center" ); mnRadialGradientCenterUniform = glGetUniformLocation( mnRadialGradientProgram, "center" );
CHECK_GL_ERROR();
return true; return true;
} }
...@@ -336,6 +355,8 @@ void OpenGLSalGraphicsImpl::BeginSolid( SalColor nColor, sal_uInt8 nTransparency ...@@ -336,6 +355,8 @@ void OpenGLSalGraphicsImpl::BeginSolid( SalColor nColor, sal_uInt8 nTransparency
} }
glUseProgram( mnSolidProgram ); glUseProgram( mnSolidProgram );
glUniformColor( mnColorUniform, nColor, nTransparency ); glUniformColor( mnColorUniform, nColor, nTransparency );
CHECK_GL_ERROR();
} }
void OpenGLSalGraphicsImpl::BeginSolid( SalColor nColor, double fTransparency ) void OpenGLSalGraphicsImpl::BeginSolid( SalColor nColor, double fTransparency )
...@@ -353,6 +374,8 @@ void OpenGLSalGraphicsImpl::BeginSolid( SalColor nColor, double fTransparency ) ...@@ -353,6 +374,8 @@ void OpenGLSalGraphicsImpl::BeginSolid( SalColor nColor, double fTransparency )
} }
glUseProgram( mnSolidProgram ); glUseProgram( mnSolidProgram );
glUniformColorf( mnColorUniform, nColor, fTransparency ); glUniformColorf( mnColorUniform, nColor, fTransparency );
CHECK_GL_ERROR();
} }
void OpenGLSalGraphicsImpl::BeginSolid( SalColor nColor ) void OpenGLSalGraphicsImpl::BeginSolid( SalColor nColor )
...@@ -364,6 +387,8 @@ void OpenGLSalGraphicsImpl::EndSolid( void ) ...@@ -364,6 +387,8 @@ void OpenGLSalGraphicsImpl::EndSolid( void )
{ {
glUseProgram( 0 ); glUseProgram( 0 );
glDisable( GL_BLEND ); glDisable( GL_BLEND );
CHECK_GL_ERROR();
} }
void OpenGLSalGraphicsImpl::BeginInvert( void ) void OpenGLSalGraphicsImpl::BeginInvert( void )
...@@ -371,12 +396,16 @@ void OpenGLSalGraphicsImpl::BeginInvert( void ) ...@@ -371,12 +396,16 @@ void OpenGLSalGraphicsImpl::BeginInvert( void )
glEnable( GL_BLEND ); glEnable( GL_BLEND );
glBlendFunc( GL_ONE_MINUS_DST_COLOR, GL_ZERO ); glBlendFunc( GL_ONE_MINUS_DST_COLOR, GL_ZERO );
BeginSolid( MAKE_SALCOLOR( 255, 255, 255 ) ); BeginSolid( MAKE_SALCOLOR( 255, 255, 255 ) );
CHECK_GL_ERROR();
} }
void OpenGLSalGraphicsImpl::EndInvert( void ) void OpenGLSalGraphicsImpl::EndInvert( void )
{ {
EndSolid(); EndSolid();
glDisable( GL_BLEND ); glDisable( GL_BLEND );
CHECK_GL_ERROR();
} }
void OpenGLSalGraphicsImpl::DrawPoint( long nX, long nY ) void OpenGLSalGraphicsImpl::DrawPoint( long nX, long nY )
...@@ -390,6 +419,8 @@ void OpenGLSalGraphicsImpl::DrawPoint( long nX, long nY ) ...@@ -390,6 +419,8 @@ void OpenGLSalGraphicsImpl::DrawPoint( long nX, long nY )
glVertexAttribPointer( GL_ATTRIB_POS, 2, GL_FLOAT, GL_FALSE, 0, pPoint ); glVertexAttribPointer( GL_ATTRIB_POS, 2, GL_FLOAT, GL_FALSE, 0, pPoint );
glDrawArrays( GL_POINTS, 0, 1 ); glDrawArrays( GL_POINTS, 0, 1 );
glDisableVertexAttribArray( GL_ATTRIB_POS ); glDisableVertexAttribArray( GL_ATTRIB_POS );
CHECK_GL_ERROR();
} }
void OpenGLSalGraphicsImpl::DrawLine( long nX1, long nY1, long nX2, long nY2 ) void OpenGLSalGraphicsImpl::DrawLine( long nX1, long nY1, long nX2, long nY2 )
...@@ -405,6 +436,8 @@ void OpenGLSalGraphicsImpl::DrawLine( long nX1, long nY1, long nX2, long nY2 ) ...@@ -405,6 +436,8 @@ void OpenGLSalGraphicsImpl::DrawLine( long nX1, long nY1, long nX2, long nY2 )
glVertexAttribPointer( GL_ATTRIB_POS, 2, GL_FLOAT, GL_FALSE, 0, pPoints ); glVertexAttribPointer( GL_ATTRIB_POS, 2, GL_FLOAT, GL_FALSE, 0, pPoints );
glDrawArrays( GL_LINES, 0, 2 ); glDrawArrays( GL_LINES, 0, 2 );
glDisableVertexAttribArray( GL_ATTRIB_POS ); glDisableVertexAttribArray( GL_ATTRIB_POS );
CHECK_GL_ERROR();
} }
void OpenGLSalGraphicsImpl::DrawLines( sal_uInt32 nPoints, const SalPoint* pPtAry, bool bClose ) void OpenGLSalGraphicsImpl::DrawLines( sal_uInt32 nPoints, const SalPoint* pPtAry, bool bClose )
...@@ -425,6 +458,8 @@ void OpenGLSalGraphicsImpl::DrawLines( sal_uInt32 nPoints, const SalPoint* pPtAr ...@@ -425,6 +458,8 @@ void OpenGLSalGraphicsImpl::DrawLines( sal_uInt32 nPoints, const SalPoint* pPtAr
else else
glDrawArrays( GL_LINE_STRIP, 0, nPoints ); glDrawArrays( GL_LINE_STRIP, 0, nPoints );
glDisableVertexAttribArray( GL_ATTRIB_POS ); glDisableVertexAttribArray( GL_ATTRIB_POS );
CHECK_GL_ERROR();
} }
void OpenGLSalGraphicsImpl::DrawConvexPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) void OpenGLSalGraphicsImpl::DrawConvexPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry )
...@@ -442,6 +477,8 @@ void OpenGLSalGraphicsImpl::DrawConvexPolygon( sal_uInt32 nPoints, const SalPoin ...@@ -442,6 +477,8 @@ void OpenGLSalGraphicsImpl::DrawConvexPolygon( sal_uInt32 nPoints, const SalPoin
glVertexAttribPointer( GL_ATTRIB_POS, 2, GL_FLOAT, GL_FALSE, 0, &aVertices[0] ); glVertexAttribPointer( GL_ATTRIB_POS, 2, GL_FLOAT, GL_FALSE, 0, &aVertices[0] );
glDrawArrays( GL_TRIANGLE_FAN, 0, nPoints ); glDrawArrays( GL_TRIANGLE_FAN, 0, nPoints );
glDisableVertexAttribArray( GL_ATTRIB_POS ); glDisableVertexAttribArray( GL_ATTRIB_POS );
CHECK_GL_ERROR();
} }
void OpenGLSalGraphicsImpl::DrawConvexPolygon( const Polygon& rPolygon ) void OpenGLSalGraphicsImpl::DrawConvexPolygon( const Polygon& rPolygon )
...@@ -461,6 +498,8 @@ void OpenGLSalGraphicsImpl::DrawConvexPolygon( const Polygon& rPolygon ) ...@@ -461,6 +498,8 @@ void OpenGLSalGraphicsImpl::DrawConvexPolygon( const Polygon& rPolygon )
glVertexAttribPointer( GL_ATTRIB_POS, 2, GL_FLOAT, GL_FALSE, 0, &aVertices[0] ); glVertexAttribPointer( GL_ATTRIB_POS, 2, GL_FLOAT, GL_FALSE, 0, &aVertices[0] );
glDrawArrays( GL_TRIANGLE_FAN, 0, nPoints ); glDrawArrays( GL_TRIANGLE_FAN, 0, nPoints );
glDisableVertexAttribArray( GL_ATTRIB_POS ); glDisableVertexAttribArray( GL_ATTRIB_POS );
CHECK_GL_ERROR();
} }
void OpenGLSalGraphicsImpl::DrawRect( long nX, long nY, long nWidth, long nHeight ) void OpenGLSalGraphicsImpl::DrawRect( long nX, long nY, long nWidth, long nHeight )
...@@ -533,6 +572,8 @@ void OpenGLSalGraphicsImpl::DrawPolyPolygon( const basegfx::B2DPolyPolygon& rPol ...@@ -533,6 +572,8 @@ void OpenGLSalGraphicsImpl::DrawPolyPolygon( const basegfx::B2DPolyPolygon& rPol
glVertexAttribPointer( GL_ATTRIB_POS, 2, GL_FLOAT, GL_FALSE, 0, pVertices.data() ); glVertexAttribPointer( GL_ATTRIB_POS, 2, GL_FLOAT, GL_FALSE, 0, pVertices.data() );
glDrawArrays( GL_TRIANGLES, 0, pVertices.size() / 2 ); glDrawArrays( GL_TRIANGLES, 0, pVertices.size() / 2 );
glDisableVertexAttribArray( GL_ATTRIB_POS ); glDisableVertexAttribArray( GL_ATTRIB_POS );
CHECK_GL_ERROR();
} }
void OpenGLSalGraphicsImpl::DrawTextureRect( const Size& rSize, const SalTwoRect& rPosAry, bool bInverted ) void OpenGLSalGraphicsImpl::DrawTextureRect( const Size& rSize, const SalTwoRect& rPosAry, bool bInverted )
...@@ -559,6 +600,8 @@ void OpenGLSalGraphicsImpl::DrawTextureRect( const Size& rSize, const SalTwoRect ...@@ -559,6 +600,8 @@ void OpenGLSalGraphicsImpl::DrawTextureRect( const Size& rSize, const SalTwoRect
DrawRect( rPosAry.mnDestX, rPosAry.mnDestY, rPosAry.mnDestWidth, rPosAry.mnDestHeight ); DrawRect( rPosAry.mnDestX, rPosAry.mnDestY, rPosAry.mnDestWidth, rPosAry.mnDestHeight );
glDisableVertexAttribArray( GL_ATTRIB_TEX ); glDisableVertexAttribArray( GL_ATTRIB_TEX );
CHECK_GL_ERROR();
} }
void OpenGLSalGraphicsImpl::DrawTexture( GLuint nTexture, const Size& rSize, const SalTwoRect& pPosAry, bool bInverted ) void OpenGLSalGraphicsImpl::DrawTexture( GLuint nTexture, const Size& rSize, const SalTwoRect& pPosAry, bool bInverted )
...@@ -580,6 +623,8 @@ void OpenGLSalGraphicsImpl::DrawTexture( GLuint nTexture, const Size& rSize, con ...@@ -580,6 +623,8 @@ void OpenGLSalGraphicsImpl::DrawTexture( GLuint nTexture, const Size& rSize, con
glBindTexture( GL_TEXTURE_2D, 0 ); glBindTexture( GL_TEXTURE_2D, 0 );
glUseProgram( 0 ); glUseProgram( 0 );
CHECK_GL_ERROR();
} }
void OpenGLSalGraphicsImpl::DrawTextureWithMask( GLuint nTexture, GLuint nMask, const Size& rSize, const SalTwoRect& pPosAry ) void OpenGLSalGraphicsImpl::DrawTextureWithMask( GLuint nTexture, GLuint nMask, const Size& rSize, const SalTwoRect& pPosAry )
...@@ -608,6 +653,8 @@ void OpenGLSalGraphicsImpl::DrawTextureWithMask( GLuint nTexture, GLuint nMask, ...@@ -608,6 +653,8 @@ void OpenGLSalGraphicsImpl::DrawTextureWithMask( GLuint nTexture, GLuint nMask,
glActiveTexture( GL_TEXTURE0 ); glActiveTexture( GL_TEXTURE0 );
glBindTexture( GL_TEXTURE_2D, 0 ); glBindTexture( GL_TEXTURE_2D, 0 );
glUseProgram( 0 ); glUseProgram( 0 );
CHECK_GL_ERROR();
} }
void OpenGLSalGraphicsImpl::DrawMask( GLuint nMask, SalColor nMaskColor, const SalTwoRect& /*pPosAry*/ ) void OpenGLSalGraphicsImpl::DrawMask( GLuint nMask, SalColor nMaskColor, const SalTwoRect& /*pPosAry*/ )
...@@ -629,11 +676,12 @@ void OpenGLSalGraphicsImpl::DrawMask( GLuint nMask, SalColor nMaskColor, const S ...@@ -629,11 +676,12 @@ void OpenGLSalGraphicsImpl::DrawMask( GLuint nMask, SalColor nMaskColor, const S
glActiveTexture( GL_TEXTURE0 ); glActiveTexture( GL_TEXTURE0 );
glBindTexture( GL_TEXTURE_2D, 0 ); glBindTexture( GL_TEXTURE_2D, 0 );
glUseProgram( 0 ); glUseProgram( 0 );
CHECK_GL_ERROR();
} }
void OpenGLSalGraphicsImpl::DrawLinearGradient( const Gradient& rGradient, const Rectangle& rRect ) void OpenGLSalGraphicsImpl::DrawLinearGradient( const Gradient& rGradient, const Rectangle& rRect )
{ {
if( mnLinearGradientProgram == 0 ) if( mnLinearGradientProgram == 0 )
{ {
if( !CreateLinearGradientProgram() ) if( !CreateLinearGradientProgram() )
...@@ -667,6 +715,8 @@ void OpenGLSalGraphicsImpl::DrawLinearGradient( const Gradient& rGradient, const ...@@ -667,6 +715,8 @@ void OpenGLSalGraphicsImpl::DrawLinearGradient( const Gradient& rGradient, const
CHECK_GL_ERROR(); CHECK_GL_ERROR();
glUseProgram( 0 ); glUseProgram( 0 );
CHECK_GL_ERROR();
} }
void OpenGLSalGraphicsImpl::DrawRadialGradient( const Gradient& rGradient, const Rectangle& rRect ) void OpenGLSalGraphicsImpl::DrawRadialGradient( const Gradient& rGradient, const Rectangle& rRect )
...@@ -704,6 +754,8 @@ void OpenGLSalGraphicsImpl::DrawRadialGradient( const Gradient& rGradient, const ...@@ -704,6 +754,8 @@ void OpenGLSalGraphicsImpl::DrawRadialGradient( const Gradient& rGradient, const
glDisableVertexAttribArray( GL_ATTRIB_TEX ); glDisableVertexAttribArray( GL_ATTRIB_TEX );
glUseProgram( 0 ); glUseProgram( 0 );
CHECK_GL_ERROR();
} }
...@@ -1094,6 +1146,8 @@ SalColor OpenGLSalGraphicsImpl::getPixel( long nX, long nY ) ...@@ -1094,6 +1146,8 @@ SalColor OpenGLSalGraphicsImpl::getPixel( long nX, long nY )
PreDraw(); PreDraw();
glReadPixels( nX, nY, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, pixel); glReadPixels( nX, nY, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, pixel);
PostDraw(); PostDraw();
CHECK_GL_ERROR();
return MAKE_SALCOLOR( pixel[0], pixel[1], pixel[2] ); return MAKE_SALCOLOR( pixel[0], pixel[1], pixel[2] );
} }
...@@ -1201,6 +1255,8 @@ bool OpenGLSalGraphicsImpl::drawAlphaBitmap( ...@@ -1201,6 +1255,8 @@ bool OpenGLSalGraphicsImpl::drawAlphaBitmap(
DrawTexture( nTexture, rBitmap.GetSize(), rPosAry ); DrawTexture( nTexture, rBitmap.GetSize(), rPosAry );
glDisable( GL_BLEND ); glDisable( GL_BLEND );
PostDraw(); PostDraw();
CHECK_GL_ERROR();
return true; return true;
} }
......
...@@ -413,6 +413,8 @@ GLuint OpenGLSalBitmap::CreateTexture() ...@@ -413,6 +413,8 @@ GLuint OpenGLSalBitmap::CreateTexture()
} }
mbDirtyTexture = false; mbDirtyTexture = false;
CHECK_GL_ERROR();
return mpTexture->Id(); return mpTexture->Id();
} }
...@@ -444,6 +446,7 @@ bool OpenGLSalBitmap::ReadTexture() ...@@ -444,6 +446,7 @@ bool OpenGLSalBitmap::ReadTexture()
glDeleteRenderbuffers( 1, &nRenderbufferDepthId ); glDeleteRenderbuffers( 1, &nRenderbufferDepthId );
glDeleteRenderbuffers( 1, &nRenderbufferColorId ); glDeleteRenderbuffers( 1, &nRenderbufferColorId );
CHECK_GL_ERROR();
return true; return true;
} }
......
...@@ -57,6 +57,7 @@ GLuint OpenGLSalBitmap::ImplGetTextureProgram() ...@@ -57,6 +57,7 @@ GLuint OpenGLSalBitmap::ImplGetTextureProgram()
mnTexSamplerUniform = glGetUniformLocation( mnTexProgram, "sampler" ); mnTexSamplerUniform = glGetUniformLocation( mnTexProgram, "sampler" );
} }
CHECK_GL_ERROR();
return mnTexProgram; return mnTexProgram;
} }
...@@ -76,6 +77,7 @@ GLuint OpenGLSalBitmap::ImplGetConvolutionProgram() ...@@ -76,6 +77,7 @@ GLuint OpenGLSalBitmap::ImplGetConvolutionProgram()
mnConvOffsetsUniform = glGetUniformLocation( mnConvProgram, "offsets" ); mnConvOffsetsUniform = glGetUniformLocation( mnConvProgram, "offsets" );
} }
CHECK_GL_ERROR();
return mnConvProgram; return mnConvProgram;
} }
...@@ -110,6 +112,8 @@ bool OpenGLSalBitmap::ImplScaleFilter( GLenum nFilter ) ...@@ -110,6 +112,8 @@ bool OpenGLSalBitmap::ImplScaleFilter( GLenum nFilter )
glDeleteFramebuffers( 1, &nFramebufferId ); glDeleteFramebuffers( 1, &nFramebufferId );
mpTexture.reset( pNewTex ); mpTexture.reset( pNewTex );
CHECK_GL_ERROR();
return true; return true;
} }
...@@ -227,6 +231,7 @@ bool OpenGLSalBitmap::ImplScaleConvolution( ...@@ -227,6 +231,7 @@ bool OpenGLSalBitmap::ImplScaleConvolution(
mnWidth = nNewWidth; mnWidth = nNewWidth;
mnHeight = nNewHeight; mnHeight = nNewHeight;
CHECK_GL_ERROR();
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment