[mutter] cogl: Remove unused cogl_program_use and friends



commit 795491c80a07a7343566ed01ed04da198c20af6f
Author: Adam Jackson <ajax redhat com>
Date:   Tue Jan 21 14:28:10 2020 -0500

    cogl: Remove unused cogl_program_use and friends
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/1015

 cogl/cogl/cogl-context-private.h    |   2 -
 cogl/cogl/cogl-framebuffer.h        |   4 +-
 cogl/cogl/deprecated/cogl-program.c |  81 --------------------------
 cogl/cogl/deprecated/cogl-shader.h  | 111 ------------------------------------
 4 files changed, 2 insertions(+), 196 deletions(-)
---
diff --git a/cogl/cogl/cogl-context-private.h b/cogl/cogl/cogl-context-private.h
index 9694e8a8a..605fd02df 100644
--- a/cogl/cogl/cogl-context-private.h
+++ b/cogl/cogl/cogl-context-private.h
@@ -228,8 +228,6 @@ struct _CoglContext
   GLint             max_activateable_texture_units;
 
   /* Fragment processing programs */
-  CoglHandle              current_program;
-
   GLuint                  current_gl_program;
 
   gboolean current_gl_dither_enabled;
diff --git a/cogl/cogl/cogl-framebuffer.h b/cogl/cogl/cogl-framebuffer.h
index 63c8cc8fb..2046d459d 100644
--- a/cogl/cogl/cogl-framebuffer.h
+++ b/cogl/cogl/cogl-framebuffer.h
@@ -1065,8 +1065,8 @@ cogl_framebuffer_clear4f (CoglFramebuffer *framebuffer,
  * @pipeline.
  *
  * <note>This api doesn't support any of the legacy global state options such
- * as cogl_set_depth_test_enabled(), cogl_set_backface_culling_enabled() or
- * cogl_program_use()</note>
+ * as cogl_set_depth_test_enabled() or
+ * cogl_set_backface_culling_enabled().</note>
  *
  * Stability: unstable
  * Since: 1.10
diff --git a/cogl/cogl/deprecated/cogl-program.c b/cogl/cogl/deprecated/cogl-program.c
index 7033c9374..adf5543d2 100644
--- a/cogl/cogl/deprecated/cogl-program.c
+++ b/cogl/cogl/deprecated/cogl-program.c
@@ -119,20 +119,6 @@ cogl_program_link (CoglHandle handle)
      whenever the settings change */
 }
 
-void
-cogl_program_use (CoglHandle handle)
-{
-  _COGL_GET_CONTEXT (ctx, NO_RETVAL);
-
-  g_return_if_fail (handle == NULL || cogl_is_program (handle));
-
-  if (handle != NULL)
-    cogl_object_ref (handle);
-  if (ctx->current_program != NULL)
-    cogl_object_unref (ctx->current_program);
-  ctx->current_program = handle;
-}
-
 int
 cogl_program_get_uniform_location (CoglHandle handle,
                                    const char *uniform_name)
@@ -192,18 +178,6 @@ cogl_program_modify_uniform (CoglProgram *program,
   return uniform;
 }
 
-void
-cogl_program_uniform_1f (int uniform_no,
-                         float  value)
-{
-  CoglProgramUniform *uniform;
-
-  _COGL_GET_CONTEXT (ctx, NO_RETVAL);
-
-  uniform = cogl_program_modify_uniform (ctx->current_program, uniform_no);
-  _cogl_boxed_value_set_1f (&uniform->value, value);
-}
-
 void
 cogl_program_set_uniform_1f (CoglHandle handle,
                              int uniform_location,
@@ -215,18 +189,6 @@ cogl_program_set_uniform_1f (CoglHandle handle,
   _cogl_boxed_value_set_1f (&uniform->value, value);
 }
 
-void
-cogl_program_uniform_1i (int uniform_no,
-                         int value)
-{
-  CoglProgramUniform *uniform;
-
-  _COGL_GET_CONTEXT (ctx, NO_RETVAL);
-
-  uniform = cogl_program_modify_uniform (ctx->current_program, uniform_no);
-  _cogl_boxed_value_set_1i (&uniform->value, value);
-}
-
 void
 cogl_program_set_uniform_1i (CoglHandle handle,
                              int uniform_location,
@@ -238,20 +200,6 @@ cogl_program_set_uniform_1i (CoglHandle handle,
   _cogl_boxed_value_set_1i (&uniform->value, value);
 }
 
-void
-cogl_program_uniform_float (int uniform_no,
-                            int size,
-                            int count,
-                            const float *value)
-{
-  CoglProgramUniform *uniform;
-
-  _COGL_GET_CONTEXT (ctx, NO_RETVAL);
-
-  uniform = cogl_program_modify_uniform (ctx->current_program, uniform_no);
-  _cogl_boxed_value_set_float (&uniform->value, size, count, value);
-}
-
 void
 cogl_program_set_uniform_float (CoglHandle handle,
                                 int uniform_location,
@@ -265,20 +213,6 @@ cogl_program_set_uniform_float (CoglHandle handle,
   _cogl_boxed_value_set_float (&uniform->value, n_components, count, value);
 }
 
-void
-cogl_program_uniform_int (int uniform_no,
-                          int size,
-                          int count,
-                          const int *value)
-{
-  CoglProgramUniform *uniform;
-
-  _COGL_GET_CONTEXT (ctx, NO_RETVAL);
-
-  uniform = cogl_program_modify_uniform (ctx->current_program, uniform_no);
-  _cogl_boxed_value_set_int (&uniform->value, size, count, value);
-}
-
 void
 cogl_program_set_uniform_int (CoglHandle handle,
                               int uniform_location,
@@ -310,21 +244,6 @@ cogl_program_set_uniform_matrix (CoglHandle handle,
                                 value);
 }
 
-void
-cogl_program_uniform_matrix (int uniform_no,
-                             int size,
-                             int count,
-                             gboolean transpose,
-                             const float *value)
-{
-  CoglProgramUniform *uniform;
-
-  _COGL_GET_CONTEXT (ctx, NO_RETVAL);
-
-  uniform = cogl_program_modify_uniform (ctx->current_program, uniform_no);
-  _cogl_boxed_value_set_matrix (&uniform->value, size, count, transpose, value);
-}
-
 void
 _cogl_program_flush_uniforms (CoglProgram *program,
                               GLuint gl_program,
diff --git a/cogl/cogl/deprecated/cogl-shader.h b/cogl/cogl/deprecated/cogl-shader.h
index 65f8792d9..beb5ed38d 100644
--- a/cogl/cogl/deprecated/cogl-shader.h
+++ b/cogl/cogl/deprecated/cogl-shader.h
@@ -398,25 +398,6 @@ COGL_DEPRECATED_FOR (cogl_snippet_)
 void
 cogl_program_link (CoglHandle handle);
 
-/**
- * cogl_program_use:
- * @handle: a #CoglHandle for a shader program or %NULL.
- *
- * Activate a specific shader program replacing that part of the GL
- * rendering pipeline, if passed in %NULL the default
- * behavior of GL is reinstated.
- *
- * This function affects the global state of the current Cogl
- * context. It is much more efficient to attach the shader to a
- * specific material used for rendering instead by calling
- * cogl_material_set_user_program().
- *
- * Deprecated: 1.16: Use #CoglSnippet api
- */
-COGL_DEPRECATED_FOR (cogl_snippet_)
-void
-cogl_program_use (CoglHandle handle);
-
 /**
  * cogl_program_get_uniform_location:
  * @handle: a #CoglHandle for a shader program.
@@ -427,8 +408,6 @@ cogl_program_use (CoglHandle handle);
  * shader object and is possible to modify as an external parameter.
  *
  * Return value: the offset of a uniform in a specified program.
- *   This uniform can be set using cogl_program_uniform_1f() when the
- *   program is in use.
  * Deprecated: 1.16: Use #CoglSnippet api instead
  */
 COGL_DEPRECATED_FOR (cogl_snippet_)
@@ -551,96 +530,6 @@ cogl_program_set_uniform_matrix (CoglHandle program,
                                  gboolean transpose,
                                  const float *value);
 
-/**
- * cogl_program_uniform_1f:
- * @uniform_no: the uniform to set.
- * @value: the new value of the uniform.
- *
- * Changes the value of a floating point uniform in the currently
- * used (see cogl_program_use()) shader program.
- *
- * Deprecated: 1.16: Use #CoglSnippet api
- */
-COGL_DEPRECATED_FOR (cogl_snippet_)
-void
-cogl_program_uniform_1f (int   uniform_no,
-                         float value);
-
-/**
- * cogl_program_uniform_1i:
- * @uniform_no: the uniform to set.
- * @value: the new value of the uniform.
- *
- * Changes the value of an integer uniform in the currently
- * used (see cogl_program_use()) shader program.
- *
- * Deprecated: 1.16: Use #CoglSnippet api
- */
-COGL_DEPRECATED_FOR (cogl_snippet_)
-void
-cogl_program_uniform_1i (int uniform_no,
-                         int value);
-
-/**
- * cogl_program_uniform_float:
- * @uniform_no: the uniform to set.
- * @size: Size of float vector.
- * @count: Size of array of uniforms.
- * @value: (array length=count): the new value of the uniform.
- *
- * Changes the value of a float vector uniform, or uniform array in the
- * currently used (see cogl_program_use()) shader program.
- *
- * Deprecated: 1.16: Use #CoglSnippet api
- */
-COGL_DEPRECATED_FOR (cogl_snippet_)
-void
-cogl_program_uniform_float (int            uniform_no,
-                            int            size,
-                            int            count,
-                            const float   *value);
-
-/**
- * cogl_program_uniform_int:
- * @uniform_no: the uniform to set.
- * @size: Size of int vector.
- * @count: Size of array of uniforms.
- * @value: (array length=count): the new value of the uniform.
- *
- * Changes the value of a int vector uniform, or uniform array in the
- * currently used (see cogl_program_use()) shader program.
- *
- * Deprecated: 1.16: Use #CoglSnippet api
- */
-COGL_DEPRECATED_FOR (cogl_snippet_)
-void
-cogl_program_uniform_int (int        uniform_no,
-                          int        size,
-                          int        count,
-                          const int *value);
-
-/**
- * cogl_program_uniform_matrix:
- * @uniform_no: the uniform to set.
- * @size: Size of matrix.
- * @count: Size of array of uniforms.
- * @transpose: Whether to transpose the matrix when setting the uniform.
- * @value: (array length=count): the new value of the uniform.
- *
- * Changes the value of a matrix uniform, or uniform array in the
- * currently used (see cogl_program_use()) shader program. The @size
- * parameter is used to determine the square size of the matrix.
- *
- * Deprecated: 1.16: Use #CoglSnippet api
- */
-COGL_DEPRECATED_FOR (cogl_snippet_)
-void
-cogl_program_uniform_matrix (int          uniform_no,
-                             int          size,
-                             int          count,
-                             gboolean     transpose,
-                             const float *value);
-
 G_END_DECLS
 
 #endif /* __COGL_SHADER_H__ */


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