[mutter] cogl: Inline cogl_use_program into its one caller



commit c1bdaba5acfd84e8a2b716c90ae2fc157f53ca5e
Author: Adam Jackson <ajax redhat com>
Date:   Tue Jan 21 16:00:43 2020 -0500

    cogl: Inline cogl_use_program into its one caller
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/1015

 cogl/cogl/cogl-pipeline-private.h                |  3 ---
 cogl/cogl/driver/gl/cogl-pipeline-opengl.c       | 19 -------------------
 cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c | 13 ++++++++++++-
 3 files changed, 12 insertions(+), 23 deletions(-)
---
diff --git a/cogl/cogl/cogl-pipeline-private.h b/cogl/cogl/cogl-pipeline-private.h
index 554179316..27d6a2512 100644
--- a/cogl/cogl/cogl-pipeline-private.h
+++ b/cogl/cogl/cogl-pipeline-private.h
@@ -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);
 
diff --git a/cogl/cogl/driver/gl/cogl-pipeline-opengl.c b/cogl/cogl/driver/gl/cogl-pipeline-opengl.c
index e96d9703b..44a968a2c 100644
--- a/cogl/cogl/driver/gl/cogl-pipeline-opengl.c
+++ b/cogl/cogl/driver/gl/cogl-pipeline-opengl.c
@@ -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
diff --git a/cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c 
b/cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c
index 641d719f8..3a049a70b 100644
--- a/cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c
+++ b/cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c
@@ -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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]