cogl: Inline cogl_use_program into its one caller

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1015
This commit is contained in:
Adam Jackson 2020-01-21 16:00:43 -05:00 committed by Georges Basile Stavracas Neto
parent 640ad4718e
commit c1bdaba5ac
3 changed files with 12 additions and 23 deletions

View File

@ -561,9 +561,6 @@ typedef struct _CoglPipelineFlushOptions
CoglTexture *layer0_override_texture;
} CoglPipelineFlushOptions;
void
cogl_use_program (GLuint gl_program);
unsigned int
_cogl_get_n_args_for_combine_func (CoglPipelineCombineFunc func);

View File

@ -233,25 +233,6 @@ _cogl_pipeline_texture_storage_change_notify (CoglTexture *texture)
}
}
void
cogl_use_program (GLuint gl_program)
{
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
if (ctx->current_gl_program != gl_program)
{
_cogl_gl_util_clear_gl_errors (ctx);
ctx->glUseProgram (gl_program);
if (_cogl_gl_util_get_error (ctx) == GL_NO_ERROR)
ctx->current_gl_program = gl_program;
else
{
GE( ctx, glUseProgram (0) );
ctx->current_gl_program = 0;
}
}
}
#if defined(HAVE_COGL_GLES2) || defined(HAVE_COGL_GL)
static gboolean

View File

@ -752,7 +752,18 @@ _cogl_pipeline_progend_glsl_end (CoglPipeline *pipeline,
gl_program = program_state->program;
cogl_use_program (gl_program);
if (ctx->current_gl_program != gl_program)
{
_cogl_gl_util_clear_gl_errors (ctx);
ctx->glUseProgram (gl_program);
if (_cogl_gl_util_get_error (ctx) == GL_NO_ERROR)
ctx->current_gl_program = gl_program;
else
{
GE( ctx, glUseProgram (0) );
ctx->current_gl_program = 0;
}
}
state.unit = 0;
state.gl_program = gl_program;