mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-06 13:29:45 -05:00
implement get_buffer_size for egl buffers
This commit is contained in:
parent
2bf2dbb2bd
commit
4f2b1cc930
1 changed files with 13 additions and 1 deletions
|
|
@ -222,7 +222,19 @@ static void gles2_texture_get_buffer_size(struct wlr_texture *texture, struct
|
||||||
wl_resource *resource, int *width, int *height) {
|
wl_resource *resource, int *width, int *height) {
|
||||||
struct wl_shm_buffer *buffer = wl_shm_buffer_get(resource);
|
struct wl_shm_buffer *buffer = wl_shm_buffer_get(resource);
|
||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
wlr_log(L_ERROR, "getting buffer size is only implemented for shm buffers");
|
struct wlr_gles2_texture *tex = (struct wlr_gles2_texture *)texture;
|
||||||
|
if (!glEGLImageTargetTexture2DOES) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!wlr_egl_query_buffer(tex->egl, resource, EGL_WIDTH,
|
||||||
|
(EGLint*)&width)) {
|
||||||
|
wlr_log(L_ERROR, "could not get size of the buffer "
|
||||||
|
"(no buffer found)");
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
wlr_egl_query_buffer(tex->egl, resource, EGL_HEIGHT,
|
||||||
|
(EGLint*)&height);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue