compositor: make es->pitch consistent between shm and drm surfaces

For shm buffers, es->pitch is set using the stride of the buffer. If
the shell happened to set the surface width to something different than
the buffer width, the contents of the surface would be cropped on the
width during redraw. However, for non-shm surfaces, es->pitch was set to
the surface width. That caused the contents of the buffer to be scaled
on the width when the buffer was wider than the surface.

This makes the behavior on both cases the same: crop on the width and
scale on the height. (which is weird but consistent)
Ander Conselvan de Oliveira 13 years ago committed by Kristian Høgsberg
parent fbf2894812
commit 9390ae3ed1
  1. 2
      src/compositor.c

@ -700,7 +700,7 @@ weston_buffer_attach(struct wl_buffer *buffer, struct wl_surface *surface)
ec->image_target_texture_2d(GL_TEXTURE_2D, es->image);
es->pitch = es->geometry.width;
es->pitch = buffer->width;
}
}

Loading…
Cancel
Save