3 #include <wayland-client.h>
4 #include "wayland-egl.h"
5 #include "wayland-egl-priv.h"
8 wl_egl_window_resize(struct wl_egl_window
*egl_window
,
12 egl_window
->width
= width
;
13 egl_window
->height
= height
;
18 WL_EGL_EXPORT
struct wl_egl_window
*
19 wl_egl_window_create(struct wl_surface
*surface
,
20 int width
, int height
)
22 struct wl_egl_window
*egl_window
;
24 egl_window
= malloc(sizeof *egl_window
);
28 egl_window
->surface
= surface
;
29 wl_egl_window_resize(egl_window
, width
, height
, 0, 0);
30 egl_window
->attached_width
= 0;
31 egl_window
->attached_height
= 0;
37 wl_egl_window_destroy(struct wl_egl_window
*egl_window
)
43 wl_egl_window_get_attached_size(struct wl_egl_window
*egl_window
,
44 int *width
, int *height
)
47 *width
= egl_window
->attached_width
;
49 *height
= egl_window
->attached_height
;
52 WL_EGL_EXPORT
struct wl_egl_pixmap
*
53 wl_egl_pixmap_create(int width
, int height
, uint32_t flags
)
55 struct wl_egl_pixmap
*egl_pixmap
;
57 egl_pixmap
= malloc(sizeof *egl_pixmap
);
58 if (egl_pixmap
== NULL
)
61 egl_pixmap
->width
= width
;
62 egl_pixmap
->height
= height
;
64 egl_pixmap
->destroy
= NULL
;
65 egl_pixmap
->buffer
= NULL
;
66 egl_pixmap
->driver_private
= NULL
;
72 wl_egl_pixmap_destroy(struct wl_egl_pixmap
*egl_pixmap
)
74 if (egl_pixmap
->destroy
)
75 egl_pixmap
->destroy(egl_pixmap
);
79 WL_EGL_EXPORT
struct wl_buffer
*
80 wl_egl_pixmap_create_buffer(struct wl_egl_pixmap
*egl_pixmap
)
82 return egl_pixmap
->buffer
;