aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/backend/wayland.h1
-rw-r--r--include/render/gles2.h45
-rw-r--r--include/wlr/render/egl.h5
-rw-r--r--include/wlr/render/interface.h13
-rw-r--r--include/wlr/render/wlr_renderer.h2
-rw-r--r--include/wlr/render/wlr_texture.h2
-rw-r--r--include/wlr/types/wlr_xdg_shell.h5
-rw-r--r--include/wlr/types/wlr_xdg_shell_v6.h5
8 files changed, 33 insertions, 45 deletions
diff --git a/include/backend/wayland.h b/include/backend/wayland.h
index b68208af..00b6ae89 100644
--- a/include/backend/wayland.h
+++ b/include/backend/wayland.h
@@ -71,6 +71,7 @@ struct wlr_wl_pointer {
struct wlr_pointer wlr_pointer;
enum wlr_axis_source axis_source;
struct wlr_wl_backend_output *current_output;
+ struct wl_listener output_destroy_listener;
};
void wlr_wl_registry_poll(struct wlr_wl_backend *backend);
diff --git a/include/render/gles2.h b/include/render/gles2.h
index 0a4fb49f..43a8d648 100644
--- a/include/render/gles2.h
+++ b/include/render/gles2.h
@@ -17,17 +17,25 @@
extern PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES;
-struct pixel_format {
+struct gles2_pixel_format {
uint32_t wl_format;
GLint gl_format, gl_type;
int depth, bpp;
- GLuint *shader;
+ bool has_alpha;
};
struct wlr_gles2_renderer {
struct wlr_renderer wlr_renderer;
struct wlr_egl *egl;
+
+ struct {
+ GLuint quad;
+ GLuint ellipse;
+ GLuint tex_rgba;
+ GLuint tex_rgbx;
+ GLuint tex_ext;
+ } shaders;
};
struct wlr_gles2_texture {
@@ -35,37 +43,20 @@ struct wlr_gles2_texture {
struct wlr_egl *egl;
GLuint tex_id;
- const struct pixel_format *pixel_format;
+ const struct gles2_pixel_format *pixel_format;
EGLImageKHR image;
GLenum target;
};
-struct shaders {
- bool initialized;
- GLuint rgba, rgbx;
- GLuint quad;
- GLuint ellipse;
- GLuint external;
-};
-
-extern struct shaders shaders;
-
-const struct pixel_format *gl_format_for_wl_format(enum wl_shm_format fmt);
+const struct gles2_pixel_format *gles2_format_from_wl(enum wl_shm_format fmt);
+const enum wl_shm_format *gles2_formats(size_t *len);
struct wlr_texture *gles2_texture_create();
+struct wlr_gles2_texture *gles2_get_texture(struct wlr_texture *wlr_texture);
-extern const GLchar quad_vertex_src[];
-extern const GLchar quad_fragment_src[];
-extern const GLchar ellipse_fragment_src[];
-extern const GLchar vertex_src[];
-extern const GLchar fragment_src_rgba[];
-extern const GLchar fragment_src_rgbx[];
-extern const GLchar fragment_src_external[];
-
-bool _gles2_flush_errors(const char *file, int line);
-#define gles2_flush_errors(...) \
- _gles2_flush_errors(wlr_strip_path(__FILE__), __LINE__)
-
-#define GL_CALL(func) func; gles2_flush_errors()
+void gles2_push_marker(const char *file, const char *func);
+void gles2_pop_marker(void);
+#define GLES2_DEBUG_PUSH gles2_push_marker(wlr_strip_path(__FILE__), __func__)
+#define GLES2_DEBUG_POP gles2_pop_marker()
#endif
diff --git a/include/wlr/render/egl.h b/include/wlr/render/egl.h
index f05a9837..aa429e8e 100644
--- a/include/wlr/render/egl.h
+++ b/include/wlr/render/egl.h
@@ -94,11 +94,6 @@ int wlr_egl_get_dmabuf_modifiers(struct wlr_egl *egl, int format,
*/
bool wlr_egl_destroy_image(struct wlr_egl *egl, EGLImageKHR image);
-/**
- * Returns a string for the last error ocurred with egl.
- */
-const char *egl_error(void);
-
bool wlr_egl_make_current(struct wlr_egl *egl, EGLSurface surface,
int *buffer_age);
diff --git a/include/wlr/render/interface.h b/include/wlr/render/interface.h
index f0307230..7f25c0ff 100644
--- a/include/wlr/render/interface.h
+++ b/include/wlr/render/interface.h
@@ -14,11 +14,12 @@
struct wlr_renderer_impl;
struct wlr_renderer {
- struct wlr_renderer_impl *impl;
+ const struct wlr_renderer_impl *impl;
};
struct wlr_renderer_impl {
- void (*begin)(struct wlr_renderer *renderer, struct wlr_output *output);
+ void (*begin)(struct wlr_renderer *renderer, uint32_t width,
+ uint32_t height);
void (*end)(struct wlr_renderer *renderer);
void (*clear)(struct wlr_renderer *renderer, const float color[static 4]);
void (*scissor)(struct wlr_renderer *renderer, struct wlr_box *box);
@@ -44,7 +45,7 @@ struct wlr_renderer_impl {
};
void wlr_renderer_init(struct wlr_renderer *renderer,
- struct wlr_renderer_impl *impl);
+ const struct wlr_renderer_impl *impl);
struct wlr_texture_impl {
bool (*upload_pixels)(struct wlr_texture *texture,
@@ -65,14 +66,12 @@ struct wlr_texture_impl {
struct wl_resource *dmabuf_resource);
void (*get_buffer_size)(struct wlr_texture *texture,
struct wl_resource *resource, int *width, int *height);
- void (*bind)(struct wlr_texture *texture);
void (*destroy)(struct wlr_texture *texture);
};
void wlr_texture_init(struct wlr_texture *texture,
- struct wlr_texture_impl *impl);
-void wlr_texture_bind(struct wlr_texture *texture);
+ const struct wlr_texture_impl *impl);
void wlr_texture_get_buffer_size(struct wlr_texture *texture,
- struct wl_resource *resource, int *width, int *height);
+ struct wl_resource *resource, int *width, int *height);
#endif
diff --git a/include/wlr/render/wlr_renderer.h b/include/wlr/render/wlr_renderer.h
index d5f3cf70..6f0d2ecc 100644
--- a/include/wlr/render/wlr_renderer.h
+++ b/include/wlr/render/wlr_renderer.h
@@ -12,7 +12,7 @@ struct wlr_output;
struct wlr_renderer;
-void wlr_renderer_begin(struct wlr_renderer *r, struct wlr_output *output);
+void wlr_renderer_begin(struct wlr_renderer *r, int width, int height);
void wlr_renderer_end(struct wlr_renderer *r);
void wlr_renderer_clear(struct wlr_renderer *r, const float color[static 4]);
/**
diff --git a/include/wlr/render/wlr_texture.h b/include/wlr/render/wlr_texture.h
index 49aa93d7..095097e6 100644
--- a/include/wlr/render/wlr_texture.h
+++ b/include/wlr/render/wlr_texture.h
@@ -9,7 +9,7 @@
struct wlr_texture_impl;
struct wlr_texture {
- struct wlr_texture_impl *impl;
+ const struct wlr_texture_impl *impl;
bool valid;
uint32_t format;
diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h
index ad0a626f..410663f7 100644
--- a/include/wlr/types/wlr_xdg_shell.h
+++ b/include/wlr/types/wlr_xdg_shell.h
@@ -53,6 +53,7 @@ struct wlr_xdg_popup_grab {
struct wlr_seat *seat;
struct wl_list popups;
struct wl_list link; // wlr_xdg_shell::popup_grabs
+ struct wl_listener seat_destroy;
};
enum wlr_xdg_surface_role {
@@ -203,9 +204,9 @@ uint32_t wlr_xdg_toplevel_set_resizing(struct wlr_xdg_surface *surface,
bool resizing);
/**
- * Request that this toplevel surface closes.
+ * Request that this xdg surface closes.
*/
-void wlr_xdg_toplevel_send_close(struct wlr_xdg_surface *surface);
+void wlr_xdg_surface_send_close(struct wlr_xdg_surface *surface);
/**
* Compute the popup position in surface-local coordinates.
diff --git a/include/wlr/types/wlr_xdg_shell_v6.h b/include/wlr/types/wlr_xdg_shell_v6.h
index d8503d28..3bfb97a4 100644
--- a/include/wlr/types/wlr_xdg_shell_v6.h
+++ b/include/wlr/types/wlr_xdg_shell_v6.h
@@ -53,6 +53,7 @@ struct wlr_xdg_popup_grab_v6 {
struct wlr_seat *seat;
struct wl_list popups;
struct wl_list link; // wlr_xdg_shell_v6::popup_grabs
+ struct wl_listener seat_destroy;
};
enum wlr_xdg_surface_v6_role {
@@ -203,9 +204,9 @@ uint32_t wlr_xdg_toplevel_v6_set_resizing(struct wlr_xdg_surface_v6 *surface,
bool resizing);
/**
- * Request that this toplevel surface closes.
+ * Request that this xdg surface closes.
*/
-void wlr_xdg_toplevel_v6_send_close(struct wlr_xdg_surface_v6 *surface);
+void wlr_xdg_surface_v6_send_close(struct wlr_xdg_surface_v6 *surface);
/**
* Compute the popup position in surface-local coordinates.