[mutter] cogl: Remove CoglVertexBuffer



commit 98c0fe934bde09be57d373b4395f27ff894aeca8
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Wed Nov 20 14:58:02 2019 +0100

    cogl: Remove CoglVertexBuffer
    
    It was deprecated, relied on deprecated API (implicit framebuffers,
    mateiarls etc), and was unused. Lets remove it.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/935

 cogl/cogl/cogl-primitives.h                        |    3 +-
 cogl/cogl/cogl.h                                   |    1 -
 cogl/cogl/deprecated/cogl-auto-texture.h           |    3 +-
 cogl/cogl/deprecated/cogl-vertex-buffer-private.h  |  165 --
 cogl/cogl/deprecated/cogl-vertex-buffer.c          | 1792 --------------------
 cogl/cogl/deprecated/cogl-vertex-buffer.h          |  425 -----
 cogl/cogl/driver/gl/cogl-pipeline-opengl.c         |    2 +-
 cogl/cogl/meson.build                              |    3 -
 cogl/tests/conform/meson.build                     |    2 -
 cogl/tests/conform/test-vertex-buffer-contiguous.c |  259 ---
 cogl/tests/conform/test-vertex-buffer-interleved.c |  164 --
 cogl/tests/conform/test-wrap-modes.c               |   46 -
 src/tests/clutter/interactive/meson.build          |    1 -
 .../clutter/interactive/test-cogl-point-sprites.c  |   17 -
 .../clutter/interactive/test-cogl-vertex-buffer.c  |  398 -----
 15 files changed, 3 insertions(+), 3278 deletions(-)
---
diff --git a/cogl/cogl/cogl-primitives.h b/cogl/cogl/cogl-primitives.h
index a24dc5990..60e0f4c68 100644
--- a/cogl/cogl/cogl-primitives.h
+++ b/cogl/cogl/cogl-primitives.h
@@ -40,8 +40,7 @@ G_BEGIN_DECLS
  * @short_description: Functions that draw various primitive 3D shapes
  *
  * The primitives API provides utilities for drawing some
- * common 3D shapes in a more convenient way than the CoglVertexBuffer
- * API provides.
+ * common 3D shapes.
  */
 
 /**
diff --git a/cogl/cogl/cogl.h b/cogl/cogl/cogl.h
index c9c5ffcbf..29601cc58 100644
--- a/cogl/cogl/cogl.h
+++ b/cogl/cogl/cogl.h
@@ -88,7 +88,6 @@
 #include <cogl/deprecated/cogl-auto-texture.h>
 #include <cogl/deprecated/cogl-shader.h>
 #include <cogl/deprecated/cogl-material-compat.h>
-#include <cogl/deprecated/cogl-vertex-buffer.h>
 
 #ifdef COGL_ENABLE_MUTTER_API
 #include <cogl/cogl-mutter.h>
diff --git a/cogl/cogl/deprecated/cogl-auto-texture.h b/cogl/cogl/deprecated/cogl-auto-texture.h
index b184ee364..df2b1da29 100644
--- a/cogl/cogl/deprecated/cogl-auto-texture.h
+++ b/cogl/cogl/deprecated/cogl-auto-texture.h
@@ -160,8 +160,7 @@ cogl_texture_new_from_bitmap (CoglBitmap *bitmap,
  * data is actually allocated.
  *
  * Sub textures have undefined behaviour texture coordinates outside
- * of the range [0,1] are used. They also do not work with
- * CoglVertexBuffers.
+ * of the range [0,1] are used.
  *
  * The sub texture will keep a reference to the full texture so you do
  * not need to keep one separately if you only want to use the sub
diff --git a/cogl/cogl/driver/gl/cogl-pipeline-opengl.c b/cogl/cogl/driver/gl/cogl-pipeline-opengl.c
index 89696b966..ebdb0981c 100644
--- a/cogl/cogl/driver/gl/cogl-pipeline-opengl.c
+++ b/cogl/cogl/driver/gl/cogl-pipeline-opengl.c
@@ -985,7 +985,7 @@ fragend_add_layer_cb (CoglPipelineLayer *layer,
  *
  *    Currently for textured rectangles we manually calculate the texture
  *    coords for each slice based on the users given coords, but this solution
- *    isn't ideal, and can't be used with CoglVertexBuffers.
+ *    isn't ideal.
  */
 void
 _cogl_pipeline_flush_gl_state (CoglContext *ctx,
diff --git a/cogl/cogl/meson.build b/cogl/cogl/meson.build
index f6f8c0163..f9d5c5ef4 100644
--- a/cogl/cogl/meson.build
+++ b/cogl/cogl/meson.build
@@ -65,7 +65,6 @@ built_headers += [cogl_gl_header_h]
 
 cogl_deprecated_headers = [
   'deprecated/cogl-material-compat.h',
-  'deprecated/cogl-vertex-buffer.h',
   'deprecated/cogl-shader.h',
   'deprecated/cogl-clutter.h',
   'deprecated/cogl-type-casts.h',
@@ -352,8 +351,6 @@ cogl_sources = [
   'cogl-closure-list.c',
   'cogl-fence.c',
   'cogl-fence-private.h',
-  'deprecated/cogl-vertex-buffer-private.h',
-  'deprecated/cogl-vertex-buffer.c',
   'deprecated/cogl-material-compat.c',
   'deprecated/cogl-program.c',
   'deprecated/cogl-program-private.h',
diff --git a/cogl/tests/conform/meson.build b/cogl/tests/conform/meson.build
index b36467593..2a7917aaa 100644
--- a/cogl/tests/conform/meson.build
+++ b/cogl/tests/conform/meson.build
@@ -54,8 +54,6 @@ cogl_test_conformance_sources = [
 #  "test-readpixels.c",
 #  "test-texture-mipmaps.c",
 #  "test-texture-pixmap-x11.c",",
-#  "test-vertex-buffer-contiguous.c",
-#  "test-vertex-buffer-interleved.c",
 #]
 
 cogl_test_conformance_includes = [
diff --git a/cogl/tests/conform/test-wrap-modes.c b/cogl/tests/conform/test-wrap-modes.c
index 92a609ec3..1c524f295 100644
--- a/cogl/tests/conform/test-wrap-modes.c
+++ b/cogl/tests/conform/test-wrap-modes.c
@@ -139,43 +139,6 @@ draw_tests_polygon (TestState *state)
     }
 }
 
-static void
-draw_tests_vbo (TestState *state)
-{
-  CoglHandle vbo;
-  int i;
-
-  vbo = cogl_vertex_buffer_new (4);
-  cogl_vertex_buffer_add (vbo, "gl_Vertex", 3,
-                          COGL_ATTRIBUTE_TYPE_FLOAT, FALSE,
-                          sizeof (vertices[0]),
-                          &vertices[0].x);
-  cogl_vertex_buffer_add (vbo, "gl_MultiTexCoord0", 2,
-                          COGL_ATTRIBUTE_TYPE_FLOAT, FALSE,
-                          sizeof (vertices[0]),
-                          &vertices[0].tx);
-  cogl_vertex_buffer_submit (vbo);
-
-  for (i = 0; i < G_N_ELEMENTS (wrap_modes); i += 2)
-    {
-      CoglPipelineWrapMode wrap_mode_s, wrap_mode_t;
-      CoglPipeline *pipeline;
-
-      wrap_mode_s = wrap_modes[i];
-      wrap_mode_t = wrap_modes[i + 1];
-      pipeline = create_pipeline (state, wrap_mode_s, wrap_mode_t);
-      cogl_set_source (pipeline);
-      cogl_object_unref (pipeline);
-      cogl_push_matrix ();
-      cogl_translate (TEX_SIZE * i, 0.0f, 0.0f);
-      /* Render the pipeline at four times the size of the texture */
-      cogl_vertex_buffer_draw (vbo, COGL_VERTICES_MODE_TRIANGLE_FAN, 0, 4);
-      cogl_pop_matrix ();
-    }
-
-  cogl_object_unref (vbo);
-}
-
 static void
 validate_set (TestState *state, int offset)
 {
@@ -232,7 +195,6 @@ validate_result (TestState *state)
   validate_set (state, 1); /* atlased rectangle */
 #endif
   validate_set (state, 2); /* cogl_polygon */
-  validate_set (state, 3); /* vertex buffer */
 }
 
 static void
@@ -260,14 +222,6 @@ paint (TestState *state)
   cogl_pop_matrix ();
   cogl_object_unref (state->texture);
 
-  /* Draw the tests using a vertex buffer */
-  state->texture = create_texture (TEST_UTILS_TEXTURE_NO_ATLAS);
-  cogl_push_matrix ();
-  cogl_translate (0.0f, TEX_SIZE * 6.0f, 0.0f);
-  draw_tests_vbo (state);
-  cogl_pop_matrix ();
-  cogl_object_unref (state->texture);
-
   validate_result (state);
 }
 
diff --git a/src/tests/clutter/interactive/meson.build b/src/tests/clutter/interactive/meson.build
index 7a12d8ae2..12274768e 100644
--- a/src/tests/clutter/interactive/meson.build
+++ b/src/tests/clutter/interactive/meson.build
@@ -36,7 +36,6 @@ clutter_tests_interactive_test_sources = [
   'test-text-field.c',
   'test-cairo-clock.c',
   'test-cairo-flowers.c',
-  'test-cogl-vertex-buffer.c',
   'test-stage-sizing.c',
   'test-scrolling.c',
   'test-swipe-action.c',
diff --git a/src/tests/clutter/interactive/test-cogl-point-sprites.c 
b/src/tests/clutter/interactive/test-cogl-point-sprites.c
index 453d6fffe..30b2567bc 100644
--- a/src/tests/clutter/interactive/test-cogl-point-sprites.c
+++ b/src/tests/clutter/interactive/test-cogl-point-sprites.c
@@ -102,7 +102,6 @@ paint_cb (ClutterActor        *stage,
   CoglMatrix old_matrix, new_matrix;
   int i;
   float diff_time;
-  CoglHandle vbo;
 
   cogl_get_projection_matrix (&old_matrix);
   /* Use an orthogonal projection from -1 -> 1 in both axes */
@@ -197,22 +196,6 @@ paint_cb (ClutterActor        *stage,
       g_timer_reset (data->last_spark_time);
     }
 
-  vbo = cogl_vertex_buffer_new (N_SPARKS);
-  cogl_vertex_buffer_add (vbo, "gl_Vertex", 2,
-                          COGL_ATTRIBUTE_TYPE_FLOAT, FALSE,
-                          sizeof (Spark),
-                          &data->sparks[0].x);
-  cogl_vertex_buffer_add (vbo, "gl_Color", 4,
-                          COGL_ATTRIBUTE_TYPE_UNSIGNED_BYTE, TRUE,
-                          sizeof (Spark),
-                          &data->sparks[0].color.red);
-  cogl_vertex_buffer_submit (vbo);
-
-  cogl_set_source (data->material);
-  cogl_vertex_buffer_draw (vbo, COGL_VERTICES_MODE_POINTS, 0, N_SPARKS);
-
-  cogl_object_unref (vbo);
-
   cogl_set_projection_matrix (&old_matrix);
   cogl_pop_matrix ();
 }


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