From 05c7e5a97c0c059ed2f1fd20f55beae22eaf83c1 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Thu, 5 Feb 2009 19:48:00 +0000 Subject: [PATCH] [cogl-texture] Fix offset to next quad when flushing the log 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 | 4 ++-- clutter/cogl/gles/cogl-texture.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/clutter/cogl/gl/cogl-texture.c b/clutter/cogl/gl/cogl-texture.c index b5866532d..7f266913e 100644 --- a/clutter/cogl/gl/cogl-texture.c +++ b/clutter/cogl/gl/cogl-texture.c @@ -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 && diff --git a/clutter/cogl/gles/cogl-texture.c b/clutter/cogl/gles/cogl-texture.c index 3bb622aa6..f0bfba43d 100644 --- a/clutter/cogl/gles/cogl-texture.c +++ b/clutter/cogl/gles/cogl-texture.c @@ -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 &&