compositor: Fix rendering with shm transformed buffers
The implementation of buffer transformation didn't handle transformed
shm buffers properly. The partial texture upload was broken since the
damage is in surface coordinates that don't necessarily match the
buffer's coordinates. It also wouldn't handle the buffer stride
properly, resulting in incorrect rendering if it didn't match the
buffer's width.
The logic used for converting texture coordinates was generalized and
moved out of the renderer, since this conversion may be useful in other
places, such as the backends.
diff --git a/src/compositor.h b/src/compositor.h
index 48633d4..2547da1 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -506,6 +506,13 @@
int32_t
weston_surface_buffer_height(struct weston_surface *surface);
+WL_EXPORT void
+weston_surface_to_buffer_float(struct weston_surface *surface,
+ float x, float y, float *bx, float *by);
+pixman_box32_t
+weston_surface_to_buffer_rect(struct weston_surface *surface,
+ pixman_box32_t rect);
+
void
weston_spring_init(struct weston_spring *spring,
double k, double current, double target);