aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/render/gles2.h5
-rw-r--r--include/wlr/render.h3
-rw-r--r--include/wlr/render/interface.h19
3 files changed, 14 insertions, 13 deletions
diff --git a/include/render/gles2.h b/include/render/gles2.h
index 3006872c..57e162c0 100644
--- a/include/render/gles2.h
+++ b/include/render/gles2.h
@@ -26,8 +26,9 @@ struct wlr_renderer_state {
struct wlr_egl *egl;
};
-struct wlr_texture_state {
- struct wlr_texture *wlr_texture;
+struct wlr_gles2_texture {
+ struct wlr_texture wlr_texture;
+
struct wlr_egl *egl;
GLuint tex_id;
const struct pixel_format *pixel_format;
diff --git a/include/wlr/render.h b/include/wlr/render.h
index 5e9f889e..96b61ddf 100644
--- a/include/wlr/render.h
+++ b/include/wlr/render.h
@@ -54,11 +54,10 @@ bool wlr_renderer_buffer_is_drm(struct wlr_renderer *renderer,
void wlr_renderer_destroy(struct wlr_renderer *renderer);
struct wlr_texture_impl;
-struct wlr_texture_state;
struct wlr_texture {
struct wlr_texture_impl *impl;
- struct wlr_texture_state *state;
+
bool valid;
uint32_t format;
int width, height;
diff --git a/include/wlr/render/interface.h b/include/wlr/render/interface.h
index 69485e21..b6072bff 100644
--- a/include/wlr/render/interface.h
+++ b/include/wlr/render/interface.h
@@ -34,25 +34,26 @@ struct wlr_renderer *wlr_renderer_init(struct wlr_renderer_state *state,
struct wlr_renderer_impl *impl);
struct wlr_texture_impl {
- bool (*upload_pixels)(struct wlr_texture_state *state,
+ bool (*upload_pixels)(struct wlr_texture *texture,
enum wl_shm_format format, int stride, int width, int height,
const unsigned char *pixels);
- bool (*update_pixels)(struct wlr_texture_state *state,
+ bool (*update_pixels)(struct wlr_texture *texture,
enum wl_shm_format format, int stride, int x, int y,
int width, int height, const unsigned char *pixels);
- bool (*upload_shm)(struct wlr_texture_state *state, uint32_t format,
+ bool (*upload_shm)(struct wlr_texture *texture, uint32_t format,
struct wl_shm_buffer *shm);
- bool (*update_shm)(struct wlr_texture_state *surf, uint32_t format,
+ bool (*update_shm)(struct wlr_texture *texture, uint32_t format,
int x, int y, int width, int height, struct wl_shm_buffer *shm);
- bool (*upload_drm)(struct wlr_texture_state *state,
+ bool (*upload_drm)(struct wlr_texture *texture,
struct wl_resource *drm_buf);
- void (*get_matrix)(struct wlr_texture_state *state,
+ void (*get_matrix)(struct wlr_texture *state,
float (*matrix)[16], const float (*projection)[16], int x, int y);
- void (*bind)(struct wlr_texture_state *state);
- void (*destroy)(struct wlr_texture_state *state);
+ void (*bind)(struct wlr_texture *texture);
+ void (*destroy)(struct wlr_texture *texture);
};
-struct wlr_texture *wlr_texture_init();
+void wlr_texture_init(struct wlr_texture *texture,
+ struct wlr_texture_impl *impl);
void wlr_texture_bind(struct wlr_texture *texture);
#endif