summaryrefslogtreecommitdiff
path: root/src/surface.h
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2022-06-07 13:47:35 +0100
committerPhil Jones <philj56@gmail.com>2022-06-07 15:31:49 +0100
commit51bbf779ba2c9d5954e2c9470a8eae7c1ddd38a5 (patch)
treef2b52f0211f9052fefa64e23c6a0d81305391589 /src/surface.h
parent7562d7b539d8013376de2cff494231ba307f4ee1 (diff)
Switch from using (E)GL to wl_shm.
eglInitialize() is slow (~50-100ms), and uses a fair amount of memory (~100 MB). For such a small, simple program that just wants to launch as quickly as possible, wl_shm performs better.
Diffstat (limited to 'src/surface.h')
-rw-r--r--src/surface.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/surface.h b/src/surface.h
index b8b132f..8abd1e1 100644
--- a/src/surface.h
+++ b/src/surface.h
@@ -3,21 +3,28 @@
#include <stdbool.h>
#include <stdint.h>
-#include "egl.h"
-#include "gl.h"
+#include <wayland-client.h>
+#include "color.h"
+#include "image.h"
struct surface {
- struct egl egl;
- struct gl gl;
struct wl_surface *wl_surface;
+ struct wl_shm_pool *wl_shm_pool;
int32_t width;
int32_t height;
+ int32_t stride;
+ int index;
+ struct wl_buffer *buffers[2];
+
+ int shm_pool_size;
+ int shm_pool_fd;
+ uint8_t *shm_pool_data;
bool redraw;
};
void surface_initialise(
struct surface *surface,
- struct wl_display *wl_display,
+ struct wl_shm *wl_shm,
struct image *texture);
void surface_destroy(struct surface *surface);
void surface_draw(