diff options
author | emersion <contact@emersion.fr> | 2018-03-24 18:30:28 -0400 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-03-24 23:48:32 -0400 |
commit | c63d94483b1e52817ca01ca82a867a78ebd39fa6 (patch) | |
tree | 46ec0a24a43aeff6513ca7a8a8ec25eb0c70e8e7 /examples/rotation.c | |
parent | 80d3561d325335e92b196f7cb5797eea9d71d17d (diff) |
Redesign wlr_texture
- Textures are now immutable (apart from those created from raw
pixels), no more invalid textures
- Move all wl_drm stuff in wlr_renderer
- Most of wlr_texture fields are now private
- Remove some duplicated DMA-BUF code in the DRM backend
- Add more assertions
- Stride is now always given as bytes rather than pixels
- Drop wl_shm functions
Fun fact: this patch has been written 10,000 meters up in the air.
Diffstat (limited to 'examples/rotation.c')
-rw-r--r-- | examples/rotation.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/rotation.c b/examples/rotation.c index cbff09a1..dfafeeca 100644 --- a/examples/rotation.c +++ b/examples/rotation.c @@ -142,13 +142,13 @@ int main(int argc, char *argv[]) { wlr_log(L_ERROR, "Could not start compositor, OOM"); exit(EXIT_FAILURE); } - state.cat_texture = wlr_render_texture_create(state.renderer); + state.cat_texture = wlr_texture_from_pixels(state.renderer, + WL_SHM_FORMAT_ABGR8888, cat_tex.width * 4, cat_tex.width, cat_tex.height, + cat_tex.pixel_data); if (!state.cat_texture) { wlr_log(L_ERROR, "Could not start compositor, OOM"); exit(EXIT_FAILURE); } - wlr_texture_upload_pixels(state.cat_texture, WL_SHM_FORMAT_ABGR8888, - cat_tex.width, cat_tex.width, cat_tex.height, cat_tex.pixel_data); if (!wlr_backend_start(compositor.backend)) { wlr_log(L_ERROR, "Failed to start backend"); |