mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 09:30:45 -05:00
[cogl_read_pixels] call cogl_flush() before changing glPixelStore state
We were previously calling cogl_flush() after setting up the glPixelStore state for calling glReadPixels, but flushing the journal could itself change the glPixelStore state.
This commit is contained in:
parent
d1de286109
commit
f59180d073
@ -820,6 +820,10 @@ cogl_read_pixels (int x,
|
|||||||
if (!cogl_is_offscreen (draw_buffer))
|
if (!cogl_is_offscreen (draw_buffer))
|
||||||
y = draw_buffer_height - y - height;
|
y = draw_buffer_height - y - height;
|
||||||
|
|
||||||
|
/* make sure any batched primitives get emitted to the GL driver before
|
||||||
|
* issuing our read pixels... */
|
||||||
|
cogl_flush ();
|
||||||
|
|
||||||
/* Setup the pixel store parameters that may have been changed by
|
/* Setup the pixel store parameters that may have been changed by
|
||||||
Cogl */
|
Cogl */
|
||||||
glPixelStorei (GL_PACK_ALIGNMENT, 4);
|
glPixelStorei (GL_PACK_ALIGNMENT, 4);
|
||||||
@ -829,10 +833,6 @@ cogl_read_pixels (int x,
|
|||||||
glPixelStorei (GL_PACK_SKIP_ROWS, 0);
|
glPixelStorei (GL_PACK_SKIP_ROWS, 0);
|
||||||
#endif /* HAVE_COGL_GL */
|
#endif /* HAVE_COGL_GL */
|
||||||
|
|
||||||
/* make sure any batched primitives get emitted to the GL driver before
|
|
||||||
* issuing our read pixels... */
|
|
||||||
cogl_flush ();
|
|
||||||
|
|
||||||
glReadPixels (x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
|
glReadPixels (x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
|
||||||
|
|
||||||
/* NB: All offscreen rendering is done upside down so there is no need
|
/* NB: All offscreen rendering is done upside down so there is no need
|
||||||
|
Loading…
Reference in New Issue
Block a user