diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-08-09 22:17:40 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-08-09 22:17:40 -0400 |
commit | 4de930542f1a3d7322e7a7c1d2dc43dc9b4a4129 (patch) | |
tree | 38482a217fbcb0c0527a80787725d5d77fb81e8e /include/wlr/render.h | |
parent | b109aecff98bfed9a7ae834947ac93cb14bfc8dc (diff) |
Implement partial texture uploads
Diffstat (limited to 'include/wlr/render.h')
-rw-r--r-- | include/wlr/render.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/include/wlr/render.h b/include/wlr/render.h index 3dcc482c..61169333 100644 --- a/include/wlr/render.h +++ b/include/wlr/render.h @@ -62,19 +62,35 @@ struct wlr_texture { }; /** - * Uploads a pixel buffer to this texture. The buffer may be discarded after - * calling this function. + * Copies pixels to this texture. The buffer is not accessed after this function + * returns. */ bool wlr_texture_upload_pixels(struct wlr_texture *surf, enum wl_shm_format format, int stride, int width, int height, const unsigned char *pixels); /** - * Uploads pixels from a wl_shm_buffer to this texture. The shm buffer may be - * invalidated after calling this function. + * Copies pixels to this texture. The buffer is not accessed after this function + * returns. Under some circumstances, this function may re-upload the entire + * buffer - therefore, the entire buffer must be valid. + */ +bool wlr_texture_update_pixels(struct wlr_texture *surf, + enum wl_shm_format format, int stride, int x, int y, + int width, int height, const unsigned char *pixels); +/** + * Copies pixels from a wl_shm_buffer into this texture. The buffer is not + * accessed after this function returns. */ bool wlr_texture_upload_shm(struct wlr_texture *surf, uint32_t format, struct wl_shm_buffer *shm); /** + * Copies a rectangle of pixels from a wl_shm_buffer onto the texture. The + * buffer is not accessed after this function returns. Under some circumstances, + * this function may re-upload the entire buffer - therefore, the entire buffer + * must be valid. + */ +bool wlr_texture_update_shm(struct wlr_texture *surf, uint32_t format, + int x, int y, int width, int height, struct wl_shm_buffer *shm); +/** * Prepares a matrix with the appropriate scale for the given texture and * multiplies it with the projection, producing a matrix that the shader can * muptlipy vertex coordinates with to get final screen coordinates. |