* overwrite it.*/
glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA_EXT,
0, 0, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, NULL);
+ es->pitch = wl_shm_buffer_get_stride(buffer) / 4;
glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA_EXT,
- buffer->width, buffer->height, 0,
+ es->pitch, buffer->height, 0,
GL_BGRA_EXT, GL_UNSIGNED_BYTE,
wl_shm_buffer_get_data(buffer));
es->visual = buffer->visual;
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, es->image);
es->visual = buffer->visual;
+ es->pitch = es->width;
}
}
{
struct wlsc_surface *es = (struct wlsc_surface *) surface;
+ es->pitch = es->width;
es->image = sprite->image;
if (sprite->image != EGL_NO_IMAGE_KHR) {
glBindTexture(GL_TEXTURE_2D, es->texture);
rectangles = pixman_region32_rectangles(&repaint, &n);
v = wl_array_add(&ec->vertices, n * 16 * sizeof *v);
p = wl_array_add(&ec->indices, n * 6 * sizeof *p);
- inv_width = 1.0 / es->width;
+ inv_width = 1.0 / es->pitch;
inv_height = 1.0 / es->height;
for (i = 0; i < n; i++, v += 16, p += 6) {
v[ 0] = rectangles[i].x1;
{
struct wl_list *surfaces_attached_to = buffer->user_data;
struct wlsc_surface *es;
+ GLsizei tex_width = wl_shm_buffer_get_stride(buffer) / 4;
wl_list_for_each(es, surfaces_attached_to, buffer_link) {
glBindTexture(GL_TEXTURE_2D, es->texture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA_EXT,
- buffer->width, buffer->height, 0,
+ tex_width, buffer->height, 0,
GL_BGRA_EXT, GL_UNSIGNED_BYTE,
wl_shm_buffer_get_data(buffer));
/* Hmm, should use glTexSubImage2D() here but GLES2 doesn't