[cogl_read_pixels] ensure we flush the current draw buffer state before reading

Make sure we call _cogl_draw_buffer_flush_state() before glReadPixels() to
be sure we have bound the correct framebuffer.
This commit is contained in:
Robert Bragg 2009-11-02 01:10:02 +00:00
parent b47404c91d
commit ed431a3c65

View File

@ -806,6 +806,9 @@ cogl_read_pixels (int x,
temprow = g_alloca (rowstride * sizeof (guint8)); temprow = g_alloca (rowstride * sizeof (guint8));
draw_buffer = _cogl_get_draw_buffer (); draw_buffer = _cogl_get_draw_buffer ();
_cogl_draw_buffer_flush_state (draw_buffer, 0);
draw_buffer_height = _cogl_draw_buffer_get_height (draw_buffer); draw_buffer_height = _cogl_draw_buffer_get_height (draw_buffer);
/* The y co-ordinate should be given in OpenGL's coordinate system /* The y co-ordinate should be given in OpenGL's coordinate system