gl-renderer: don't flip outputs for FBO rendering

The GL renderer uses the bottom left corner as origin. Therefore, the buffers
must be flipped when using ReadPixels to have a image in the correct orientation
for screenshots. If the rendered buffers are directly passed to a different
application without going through ReadPixels, the rendered buffer appears upside
down.

Flip the rendered image in the FBO to fix the orientation when directly using
the rendered buffer. Update read_pixels to not flip the image in these cases.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
This commit is contained in:
Michael Tretter 2024-07-15 14:25:32 +02:00
parent c2dbe17150
commit cc926a4567
1 changed files with 1 additions and 1 deletions

View File

@ -4079,7 +4079,7 @@ gl_renderer_output_create(struct weston_output *output,
return -1;
go->egl_surface = surface;
go->y_flip = -1.0f;
go->y_flip = surface == EGL_NO_SURFACE ? 1.0f : -1.0f;
if (gr->has_disjoint_timer_query)
gr->gen_queries(1, &go->render_query);