aboutsummaryrefslogtreecommitdiff
path: root/render/gles2
diff options
context:
space:
mode:
authorFilip Sandborg <filipsandborg@gmail.com>2019-08-31 22:00:52 +0200
committerSimon Ser <contact@emersion.fr>2019-08-31 23:00:52 +0300
commit734c64a6cc005f2c20df48af8079538a8c4cbd39 (patch)
tree2fa4347d906ebe5815c72e90962987bd80a50375 /render/gles2
parenta20bb38763877410a80a0c02ddfbfaa906c288fd (diff)
render/gles2: fix calculation for partial gles2 pixel read (#1809)
Diffstat (limited to 'render/gles2')
-rw-r--r--render/gles2/renderer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c
index 6a4903ef..d339b0ac 100644
--- a/render/gles2/renderer.c
+++ b/render/gles2/renderer.c
@@ -317,8 +317,8 @@ static bool gles2_read_pixels(struct wlr_renderer *wlr_renderer,
} else {
// Unfortunately GLES2 doesn't support GL_PACK_*, so we have to read
// the lines out row by row
- for (size_t i = src_y; i < src_y + height; ++i) {
- glReadPixels(src_x, src_y + height - i - 1, width, 1, fmt->gl_format,
+ for (size_t i = 0; i < height; ++i) {
+ 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);
}
if (flags != NULL) {