summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>2012-03-27 17:36:38 +0300
committerKristian Høgsberg <krh@bitplanet.net>2012-03-27 16:36:53 -0400
commit9390ae3ed102a4b555efdee1c049c8c58b2282c6 (patch)
tree7bda9f65e3ecfd4dc8a3c8fc25da6462e160e5cf
parentfbf289481275959f6657ad555e4bbbe1679c63d0 (diff)
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)
-rw-r--r--src/compositor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compositor.c b/src/compositor.c
index 83ec3ed..be0e798 100644
--- a/src/compositor.c
+++ b/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;
}
}