14 #include <wayland-client.h>
15 #include "wayland-egl.h"
16 #include "wayland-egl-priv.h"
17 #include "wayland-drm-client-protocol.h"
21 wl_egl_window_resize(struct wl_egl_window
*egl_window
,
22 int width
, int height
,
25 egl_window
->width
= width
;
26 egl_window
->height
= height
;
31 WL_EGL_EXPORT
struct wl_egl_window
*
32 wl_egl_window_create(struct wl_surface
*surface
,
33 int width
, int height
,
34 struct wl_visual
*visual
)
36 struct wl_egl_window
*egl_window
;
38 egl_window
= malloc(sizeof *egl_window
);
42 egl_window
->surface
= surface
;
43 egl_window
->visual
= visual
;
44 wl_egl_window_resize(egl_window
, width
, height
, 0, 0);
45 egl_window
->attached_width
= 0;
46 egl_window
->attached_height
= 0;
52 wl_egl_window_destroy(struct wl_egl_window
*egl_window
)
58 wl_egl_window_get_attached_size(struct wl_egl_window
*egl_window
,
59 int *width
, int *height
)
62 *width
= egl_window
->attached_width
;
64 *height
= egl_window
->attached_height
;
67 WL_EGL_EXPORT
struct wl_egl_pixmap
*
68 wl_egl_pixmap_create(int width
, int height
,
69 struct wl_visual
*visual
, uint32_t flags
)
71 struct wl_egl_pixmap
*egl_pixmap
;
73 egl_pixmap
= malloc(sizeof *egl_pixmap
);
74 if (egl_pixmap
== NULL
)
77 egl_pixmap
->width
= width
;
78 egl_pixmap
->height
= height
;
79 egl_pixmap
->visual
= visual
;
81 egl_pixmap
->destroy
= NULL
;
87 wl_egl_pixmap_destroy(struct wl_egl_pixmap
*egl_pixmap
)
89 if (egl_pixmap
->destroy
)
90 egl_pixmap
->destroy(egl_pixmap
);
94 WL_EGL_EXPORT
struct wl_buffer
*
95 wl_egl_pixmap_create_buffer(struct wl_egl_pixmap
*egl_pixmap
)
97 return egl_pixmap
->buffer
;