From e2fcb62990c7f72c9ffcff5b39b2794352eaa610 Mon Sep 17 00:00:00 2001
From: Robert Bragg <robert@linux.intel.com>
Date: Tue, 12 Jan 2010 11:02:09 +0000
Subject: [PATCH] journal: Fixes logging of multiple sets of texture
 coordinates

If a user supplied multiple groups of texture coordinates with
cogl_rectangle_with_multitexture_coords() then we would repeatedly log only
the first group in the journal.  This fixes that bug and adds a conformance
test to verify the fix.

Thanks to Gord Allott for reporting this bug.
---
 cogl/cogl-journal.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cogl/cogl-journal.c b/cogl/cogl-journal.c
index fbb419a90..601d53d9a 100644
--- a/cogl/cogl-journal.c
+++ b/cogl/cogl-journal.c
@@ -740,13 +740,13 @@ _cogl_journal_log_quad (float         x_1,
                                    next_vert +  POS_STRIDE +
                                    COLOR_STRIDE + TEX_STRIDE * i);
 
-      t[0] = tex_coords[0]; t[1] = tex_coords[1];
+      t[0] = tex_coords[i * 4 + 0]; t[1] = tex_coords[i * 4 + 1];
       t += stride;
-      t[0] = tex_coords[0]; t[1] = tex_coords[3];
+      t[0] = tex_coords[i * 4 + 0]; t[1] = tex_coords[i * 4 + 3];
       t += stride;
-      t[0] = tex_coords[2]; t[1] = tex_coords[3];
+      t[0] = tex_coords[i * 4 + 2]; t[1] = tex_coords[i * 4 + 3];
       t += stride;
-      t[0] = tex_coords[2]; t[1] = tex_coords[1];
+      t[0] = tex_coords[i * 4 + 2]; t[1] = tex_coords[i * 4 + 1];
     }
 
   if (G_UNLIKELY (cogl_debug_flags & COGL_DEBUG_JOURNAL))