mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-15 06:59:49 -05:00
Move buffer creation and buffer details into drm.c and shm.c
This commit is contained in:
parent
e4762a6ac1
commit
8525a50362
7 changed files with 118 additions and 91 deletions
|
|
@ -278,9 +278,7 @@ wayland_compositor_create_output(struct wayland_compositor *c,
|
|||
static struct wl_buffer *
|
||||
create_invisible_pointer(struct wayland_compositor *c)
|
||||
{
|
||||
struct wlsc_drm_buffer *wlsc_buffer;
|
||||
struct wl_buffer *buffer;
|
||||
int name, stride;
|
||||
struct wl_visual *visual;
|
||||
GLuint texture;
|
||||
const int width = 1, height = 1;
|
||||
|
|
@ -294,18 +292,8 @@ create_invisible_pointer(struct wayland_compositor *c)
|
|||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
|
||||
visual = wl_display_get_premultiplied_argb_visual(c->parent.display);
|
||||
wlsc_buffer = wlsc_drm_buffer_create(&c->base, width, height, visual);
|
||||
buffer = c->base.create_buffer(&c->base, width, height, visual, data);
|
||||
|
||||
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, wlsc_buffer->image);
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, data);
|
||||
|
||||
eglExportDRMImageMESA(c->base.display, wlsc_buffer->image,
|
||||
&name, NULL, &stride);
|
||||
|
||||
buffer = wl_drm_create_buffer(c->parent.drm, name,
|
||||
width, height,
|
||||
stride, visual);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue