mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 15:15:46 +00:00
ui/egl: fix framebuffer reads
Fix egl_fb_read() to use the (destination) surface size instead of the (source) framebuffer source for glReadPixels. Pass the DisplaySurface instead of the pixeldata pointer to egl_fb_read() to make this possible. With that in place framebuffer reads work fine even if the surface and framebuffer sizes don't match, so we can remove the guest-triggerable asserts in egl_scanout_flush(). Buglink: https://bugzilla.redhat.com//show_bug.cgi?id=1749659 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20190909073911.24787-1-kraxel@redhat.com
This commit is contained in:
@ -102,12 +102,12 @@ void egl_fb_blit(egl_fb *dst, egl_fb *src, bool flip)
|
||||
GL_COLOR_BUFFER_BIT, GL_LINEAR);
|
||||
}
|
||||
|
||||
void egl_fb_read(void *dst, egl_fb *src)
|
||||
void egl_fb_read(DisplaySurface *dst, egl_fb *src)
|
||||
{
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, src->framebuffer);
|
||||
glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
|
||||
glReadPixels(0, 0, src->width, src->height,
|
||||
GL_BGRA, GL_UNSIGNED_BYTE, dst);
|
||||
glReadPixels(0, 0, surface_width(dst), surface_height(dst),
|
||||
GL_BGRA, GL_UNSIGNED_BYTE, surface_data(dst));
|
||||
}
|
||||
|
||||
void egl_texture_blit(QemuGLShader *gls, egl_fb *dst, egl_fb *src, bool flip)
|
||||
|
Reference in New Issue
Block a user