mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-03 09:01:40 -05:00
render/gles2: fix calculation for partial gles2 pixel read (#1809)
This commit is contained in:
parent
a20bb38763
commit
734c64a6cc
1 changed files with 2 additions and 2 deletions
|
|
@ -317,8 +317,8 @@ static bool gles2_read_pixels(struct wlr_renderer *wlr_renderer,
|
||||||
} else {
|
} else {
|
||||||
// Unfortunately GLES2 doesn't support GL_PACK_*, so we have to read
|
// Unfortunately GLES2 doesn't support GL_PACK_*, so we have to read
|
||||||
// the lines out row by row
|
// the lines out row by row
|
||||||
for (size_t i = src_y; i < src_y + height; ++i) {
|
for (size_t i = 0; i < height; ++i) {
|
||||||
glReadPixels(src_x, src_y + height - i - 1, width, 1, fmt->gl_format,
|
glReadPixels(src_x, renderer->viewport_height - src_y - i - 1, width, 1, fmt->gl_format,
|
||||||
fmt->gl_type, p + i * stride + dst_x * fmt->bpp / 8);
|
fmt->gl_type, p + i * stride + dst_x * fmt->bpp / 8);
|
||||||
}
|
}
|
||||||
if (flags != NULL) {
|
if (flags != NULL) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue