[cogl-texture] Fix offset to next quad when flushing the log
authorNeil Roberts <neil@linux.intel.com>
Thu, 5 Feb 2009 19:48:00 +0000 (19:48 +0000)
committerNeil Roberts <neil@linux.intel.com>
Thu, 5 Feb 2009 20:29:25 +0000 (20:29 +0000)
When the quad log contains multiple textures (such as when a sliced
texture is drawn) it dispatches the log with multiple calls to
flush_quad_batch and walks a pointer along the list of vertices.
However this pointer was being incremented by only one vertex so the
next quad would be drawn with three of the vertices from the last
quad.

clutter/cogl/gl/cogl-texture.c
clutter/cogl/gles/cogl-texture.c

index b586653..7f26691 100644 (file)
@@ -2145,9 +2145,9 @@ _cogl_journal_flush (void)
       CoglJournalEntry *current_entry = prev_entry + 1;
       gsize             stride;
 
-      /* Progress the vertex pointer */
+      /* Progress the vertex pointer to the next quad */
       stride = 2 + current_entry->n_layers * 2;
-      current_vertex_pointer += stride;
+      current_vertex_pointer += stride * 4;
 
       /* batch rectangles using the same textures */
       if (current_entry->material == prev_entry->material &&
index 3bb622a..f0bfba4 100644 (file)
@@ -2258,9 +2258,9 @@ _cogl_journal_flush (void)
       CoglJournalEntry *current_entry = prev_entry + 1;
       gsize             stride;
 
-      /* Progress the vertex pointer */
+      /* Progress the vertex pointer to the next quad */
       stride = 2 + current_entry->n_layers * 2;
-      current_vertex_pointer += stride;
+      current_vertex_pointer += stride * 4;
 
       /* batch rectangles using the same textures */
       if (current_entry->material == prev_entry->material &&