render/gles2: use format bpp when reading pixels

This commit is contained in:
emersion 2018-01-26 23:13:41 +01:00
parent 4fa90b0511
commit f34a1b75eb
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
2 changed files with 5 additions and 1 deletions

View file

@ -229,7 +229,7 @@ static bool wlr_gles2_read_pixels(struct wlr_renderer *renderer,
unsigned char *p = data + dst_y * stride;
for (size_t i = src_y; i < src_y + height; ++i) {
glReadPixels(src_x, src_y + height - i - 1, width, 1, fmt->gl_format,
fmt->gl_type, p + i * stride + dst_x * 4);
fmt->gl_type, p + i * stride + dst_x * fmt->bpp / 8);
}
return true;