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.
This commit is contained in:
Neil Roberts 2010-06-09 14:42:18 +01:00 committed by Robert Bragg
parent 413e631f48
commit 8cee3c8670

View File

@ -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