libweston: assert when transforming for views with dirty transforms

If the view transform is dirty it might be incorrect. Also, we normally
set up the view transform matrix properly regardless of whether the
transform is enabled or not - but if we've never run
weston_view_update_transform() it will be all zeros.

This is a step towards removing view->transform.enabled checks and just
using the transform matrix in all cases.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2022-11-08 16:23:46 -06:00
parent d611ab24fd
commit 2dc8680d71

View File

@ -649,6 +649,8 @@ WL_EXPORT void
weston_view_to_global_float(struct weston_view *view, weston_view_to_global_float(struct weston_view *view,
float sx, float sy, float *x, float *y) float sx, float sy, float *x, float *y)
{ {
assert(!view->transform.dirty);
if (view->transform.enabled) { if (view->transform.enabled) {
struct weston_vector v = { { sx, sy, 0.0f, 1.0f } }; struct weston_vector v = { { sx, sy, 0.0f, 1.0f } };
@ -1465,6 +1467,8 @@ WL_EXPORT void
weston_view_from_global_float(struct weston_view *view, weston_view_from_global_float(struct weston_view *view,
float x, float y, float *vx, float *vy) float x, float y, float *vx, float *vy)
{ {
assert(!view->transform.dirty);
if (view->transform.enabled) { if (view->transform.enabled) {
struct weston_vector v = { { x, y, 0.0f, 1.0f } }; struct weston_vector v = { { x, y, 0.0f, 1.0f } };