summaryrefslogtreecommitdiff
path: root/cogl-pango
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2011-10-25 22:34:59 +0100
committerRobert Bragg <robert@linux.intel.com>2011-11-01 12:03:03 +0000
commit8cf76ee36b46b8601a15ac223cb27e75f85f70d4 (patch)
tree26d014413a08993c5db993e97c121a579fba3c79 /cogl-pango
parenta8fbde4710baa3b8b17ac16b4ffaef1ac472b71e (diff)
primitive: Add n_indices arg to _set_indices function
When associating indices with a CoglPrimitive you are now forced to specify the number of indices that should be read when drawing. It's easy to forget to call cogl_primitive_set_n_vertices() after associating indices with a primitive (and anyway you can see that someone could be led to believe Cogl can determine that implicitly somewhow) so this should avoid a lot of mistakes with using the API. We'd expect that setting indices and updating the n_vertices property would go hand in hand 99% of the time anyway so this change should be more convenient as well as less error prone. This patch adds some documentation for cogl_primitive_set_indices and cogl_primitive_get/set_n_vertices. It also tries to clarify how the CoglPrimitive:n_vertices property is updated and what that property means in relation to other functions too. https://bugzilla.gnome.org/show_bug.cgi?id=661019 Reviewed-by: Neil Roberts <neil@linux.intel.com>
Diffstat (limited to 'cogl-pango')
-rw-r--r--cogl-pango/cogl-pango-display-list.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/cogl-pango/cogl-pango-display-list.c b/cogl-pango/cogl-pango-display-list.c
index a6320d87..9cc0166f 100644
--- a/cogl-pango/cogl-pango-display-list.c
+++ b/cogl-pango/cogl-pango-display-list.c
@@ -353,9 +353,8 @@ emit_vertex_buffer_geometry (CoglPangoDisplayListNode *node)
CoglIndices *indices =
cogl_get_rectangle_indices (node->d.texture.rectangles->len);
- cogl_primitive_set_indices (prim, indices);
- cogl_primitive_set_n_vertices (prim,
- node->d.texture.rectangles->len * 6);
+ cogl_primitive_set_indices (prim, indices,
+ node->d.texture.rectangles->len * 6);
}
node->d.texture.primitive = prim;