diff options
Diffstat (limited to 'render')
-rw-r--r-- | render/gles2/pixel_format.c | 4 | ||||
-rw-r--r-- | render/gles2/renderer.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/render/gles2/pixel_format.c b/render/gles2/pixel_format.c index 9cc75923..a544077b 100644 --- a/render/gles2/pixel_format.c +++ b/render/gles2/pixel_format.c @@ -25,12 +25,16 @@ struct pixel_format formats[] = { }, { .wl_format = WL_SHM_FORMAT_XBGR8888, + .depth = 24, + .bpp = 32, .gl_format = GL_RGBA, .gl_type = GL_UNSIGNED_BYTE, .shader = &shaders.rgbx }, { .wl_format = WL_SHM_FORMAT_ABGR8888, + .depth = 32, + .bpp = 32, .gl_format = GL_RGBA, .gl_type = GL_UNSIGNED_BYTE, .shader = &shaders.rgba diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c index 6b1a9c59..cc06ad08 100644 --- a/render/gles2/renderer.c +++ b/render/gles2/renderer.c @@ -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; |