wlr_renderer: Switch texture rendering functions to take wlr_raster

Implements automatic texture uploading as both wlr_scene and cursor
handling both are simplified as a result.
This commit is contained in:
Alexander Orzechowski 2022-06-26 22:29:22 -04:00
parent 45ad3d47ad
commit 248a33a026
20 changed files with 142 additions and 166 deletions

View file

@ -14,6 +14,7 @@
#include <wlr/render/wlr_renderer.h>
#include <wlr/render/wlr_texture.h>
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_raster.h>
#include <wlr/render/dmabuf.h>
struct wlr_box;
@ -29,8 +30,8 @@ struct wlr_renderer_impl {
void (*scissor)(struct wlr_renderer *renderer, struct wlr_box *box);
bool (*raster_upload)(struct wlr_renderer *renderer,
struct wlr_raster *raster);
bool (*render_subtexture_with_matrix)(struct wlr_renderer *renderer,
struct wlr_texture *texture, const struct wlr_fbox *box,
bool (*render_subraster_with_matrix)(struct wlr_renderer *renderer,
struct wlr_raster *raster, const struct wlr_fbox *box,
const float matrix[static 9], float alpha);
void (*render_quad_with_matrix)(struct wlr_renderer *renderer,
const float color[static 4], const float matrix[static 9]);

View file

@ -57,21 +57,21 @@ void wlr_renderer_scissor(struct wlr_renderer *r, struct wlr_box *box);
bool wlr_renderer_raster_upload(struct wlr_renderer *r,
struct wlr_raster *raster);
/**
* Renders the requested texture.
* Renders the requested raster.
*/
bool wlr_render_texture(struct wlr_renderer *r, struct wlr_texture *texture,
bool wlr_render_raster(struct wlr_renderer *r, struct wlr_raster *raster,
const float projection[static 9], int x, int y, float alpha);
/**
* Renders the requested texture using the provided matrix.
* Renders the requested raster using the provided matrix.
*/
bool wlr_render_texture_with_matrix(struct wlr_renderer *r,
struct wlr_texture *texture, const float matrix[static 9], float alpha);
bool wlr_render_raster_with_matrix(struct wlr_renderer *r,
struct wlr_raster *raster, const float matrix[static 9], float alpha);
/**
* Renders the requested texture using the provided matrix, after cropping it
* Renders the requested raster using the provided matrix, after cropping it
* to the provided rectangle.
*/
bool wlr_render_subtexture_with_matrix(struct wlr_renderer *r,
struct wlr_texture *texture, const struct wlr_fbox *box,
bool wlr_render_subraster_with_matrix(struct wlr_renderer *r,
struct wlr_raster *raster, const struct wlr_fbox *box,
const float matrix[static 9], float alpha);
/**
* Renders a solid rectangle in the specified color.