From 0cd94f0cf0dd104cee9837dc2961536a078d089e Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Mon, 26 Jun 2017 17:34:15 +1200 Subject: Added software cursor fallback --- render/gles2/surface.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'render/gles2/surface.c') diff --git a/render/gles2/surface.c b/render/gles2/surface.c index 278b3dc3..c9be6ac2 100644 --- a/render/gles2/surface.c +++ b/render/gles2/surface.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -10,15 +11,17 @@ #include "render/gles2.h" static bool gles2_surface_attach_pixels(struct wlr_surface_state *surface, - uint32_t format, int width, int height, const unsigned char *pixels) { + uint32_t format, int stride, int width, int height, const unsigned char *pixels) { assert(surface); surface->wlr_surface->width = width; surface->wlr_surface->height = height; surface->wlr_surface->format = format; GL_CALL(glGenTextures(1, &surface->tex_id)); GL_CALL(glBindTexture(GL_TEXTURE_2D, surface->tex_id)); + GL_CALL(glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, stride)); GL_CALL(glTexImage2D(GL_TEXTURE_2D, 0, format, width, height, 0, format, GL_UNSIGNED_BYTE, pixels)); + GL_CALL(glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, 0)); surface->wlr_surface->valid = true; return true; } -- cgit v1.2.3