mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 18:11:05 -05:00
[cogl_read_pixels] fixes for calculating the y offset when rendering offscreen
Since offscreen rendering is forced to be upside down we don't need to do any conversion of the users coordinates to go from Cogl window coordinates to OpenGL window coordinates.
This commit is contained in:
parent
426197f51d
commit
b47404c91d
@ -809,8 +809,13 @@ cogl_read_pixels (int x,
|
|||||||
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
|
||||||
so 0 is the bottom row */
|
* so 0 is the bottom row
|
||||||
y = draw_buffer_height - y - height;
|
*
|
||||||
|
* NB: all offscreen rendering is done upside down so no conversion
|
||||||
|
* is necissary in this case.
|
||||||
|
*/
|
||||||
|
if (!cogl_is_offscreen (draw_buffer))
|
||||||
|
y = draw_buffer_height - y - height;
|
||||||
|
|
||||||
/* Setup the pixel store parameters that may have been changed by
|
/* Setup the pixel store parameters that may have been changed by
|
||||||
Cogl */
|
Cogl */
|
||||||
|
Loading…
Reference in New Issue
Block a user