mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-03 09:01:40 -05:00
Further improvements to rendering subsystem
This commit is contained in:
parent
83f8864f0a
commit
cd6a40d816
17 changed files with 475 additions and 336 deletions
36
render/wlr_surface.c
Normal file
36
render/wlr_surface.c
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <wlr/render/interface.h>
|
||||
|
||||
struct wlr_surface *wlr_surface_init(struct wlr_surface_state *state,
|
||||
struct wlr_surface_impl *impl) {
|
||||
struct wlr_surface *s = calloc(sizeof(struct wlr_surface), 1);
|
||||
s->state = state;
|
||||
s->impl = impl;
|
||||
return s;
|
||||
}
|
||||
|
||||
void wlr_surface_destroy(struct wlr_surface *surface) {
|
||||
surface->impl->destroy(surface->state);
|
||||
free(surface);
|
||||
}
|
||||
|
||||
void wlr_surface_bind(struct wlr_surface *surface) {
|
||||
surface->impl->bind(surface->state);
|
||||
}
|
||||
|
||||
bool wlr_surface_attach_pixels(struct wlr_surface *surface, uint32_t format,
|
||||
int width, int height, const unsigned char *pixels) {
|
||||
return surface->impl->attach_pixels(surface->state,
|
||||
format, width, height, pixels);
|
||||
}
|
||||
|
||||
bool wlr_surface_attach_shm(struct wlr_surface *surface, uint32_t format,
|
||||
struct wl_shm_buffer *shm) {
|
||||
return surface->impl->attach_shm(surface->state, format, shm);
|
||||
}
|
||||
|
||||
void wlr_surface_get_matrix(struct wlr_surface *surface,
|
||||
float (*matrix)[16], const float (*projection)[16], int x, int y) {
|
||||
surface->impl->get_matrix(surface->state, matrix, projection, x, y);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue