From 8cee3c867095aacdec152842f01dc2fca1fc43aa Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 9 Jun 2010 14:42:18 +0100 Subject: [PATCH] cogl-atlas-texture: Flush the journal before starting blit not after _cogl_atlas_texture_blit_begin binds a texture to use as the destination and it expects it to stay bound until _cogl_atlas_texture_end_blit is called. However there was a call to _cogl_journal_flush directly after setting up the blit state which could cause the wrong texture to be bound. This just moves the flush to before the call to _cogl_atlas_texture_blit_begin. This was breaking test-cogl-sub-texture. --- clutter/cogl/cogl/cogl-atlas-texture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clutter/cogl/cogl/cogl-atlas-texture.c b/clutter/cogl/cogl/cogl-atlas-texture.c index 627026936..b15a85c86 100644 --- a/clutter/cogl/cogl/cogl-atlas-texture.c +++ b/clutter/cogl/cogl/cogl-atlas-texture.c @@ -670,8 +670,6 @@ _cogl_atlas_texture_migrate (unsigned int n_textures, unsigned int i; CoglAtlasTextureBlitData blit_data; - _cogl_atlas_texture_blit_begin (&blit_data, new_texture, old_texture); - /* We don't know if any materials may currently be referenced in the * journal that depend on the current underlying GL texture storage * so we flush the journal before migrating. @@ -681,6 +679,8 @@ _cogl_atlas_texture_migrate (unsigned int n_textures, */ _cogl_journal_flush (); + _cogl_atlas_texture_blit_begin (&blit_data, new_texture, old_texture); + for (i = 0; i < n_textures; i++) { /* Skip the texture that is being added because it doesn't contain