[clutter] debug: Use cogl_primitive api for paint-volume visualization



commit 1741c805be7f403f2995b3037059879ba29d3d2a
Author: Robert Bragg <robert linux intel com>
Date:   Thu Jun 16 17:50:50 2011 +0100

    debug: Use cogl_primitive api for paint-volume visualization
    
    Instead of using the cogl_vertex_buffer API this uses the more concise
    cogl_primitive API instead. The aim is to get rid of the
    cogl_vertex_buffer API eventually so we should be trying out the
    replacement API wherever possible.

 clutter/clutter-actor.c |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index b9eb133..1d22739 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -2413,7 +2413,7 @@ _clutter_actor_draw_paint_volume_full (ClutterActor *self,
                                        const CoglColor *color)
 {
   static CoglMaterial *outline = NULL;
-  CoglHandle vbo;
+  CoglPrimitive *prim;
   ClutterVertex line_ends[12 * 2];
   int n_vertices;
 
@@ -2445,20 +2445,13 @@ _clutter_actor_draw_paint_volume_full (ClutterActor *self,
       line_ends[22] = pv->vertices[3]; line_ends[23] = pv->vertices[7];
     }
 
-  vbo = cogl_vertex_buffer_new (n_vertices);
-  cogl_vertex_buffer_add (vbo,
-                          "gl_Vertex",
-                          3, /* n_components */
-                          COGL_ATTRIBUTE_TYPE_FLOAT,
-                          FALSE, /* normalized */
-                          0, /* stride */
-                          line_ends);
+  prim = cogl_primitive_new_p3 (COGL_VERTICES_MODE_LINES, n_vertices,
+                                (CoglVertexP3 *)line_ends);
 
   cogl_material_set_color (outline, color);
   cogl_set_source (outline);
-  cogl_vertex_buffer_draw (vbo, COGL_VERTICES_MODE_LINES,
-                           0 , n_vertices);
-  cogl_object_unref (vbo);
+  cogl_primitive_draw (prim);
+  cogl_object_unref (prim);
 
   if (label)
     {



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