compositor: introduce weston_surface_geometry_dirty()
Instead of directly setting the dirty flag on weston_surface geometry,
use a function for that.
This allows us to hook into geometry dirtying in a following patch.
Also add comments to weston_surface fields, whose modification causes
transform state to become outdated.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
diff --git a/src/shell.c b/src/shell.c
index 5a09bb6..26f0d60 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -610,7 +610,7 @@
weston_matrix_init(&shsurf->workspace_transform.matrix);
weston_matrix_translate(&shsurf->workspace_transform.matrix,
0.0, d, 0.0);
- surface->geometry.dirty = 1;
+ weston_surface_geometry_dirty(surface);
}
static void
@@ -686,7 +686,7 @@
wl_list_remove(&shsurf->workspace_transform.link);
wl_list_init(&shsurf->workspace_transform.link);
}
- shsurf->surface->geometry.dirty = 1;
+ weston_surface_geometry_dirty(surface);
}
}
@@ -1530,7 +1530,7 @@
if (!wl_list_empty(&shsurf->rotation.transform.link)) {
wl_list_remove(&shsurf->rotation.transform.link);
wl_list_init(&shsurf->rotation.transform.link);
- shsurf->surface->geometry.dirty = 1;
+ weston_surface_geometry_dirty(shsurf->surface);
shsurf->saved_rotation_valid = true;
}
break;
@@ -2480,7 +2480,7 @@
if (surface->alpha < step)
surface->alpha = step;
- surface->geometry.dirty = 1;
+ weston_surface_geometry_dirty(surface);
weston_surface_damage(surface);
}
@@ -2574,7 +2574,7 @@
r = sqrtf(dx * dx + dy * dy);
wl_list_remove(&shsurf->rotation.transform.link);
- shsurf->surface->geometry.dirty = 1;
+ weston_surface_geometry_dirty(shsurf->surface);
if (r > 20.0f) {
struct weston_matrix *matrix =
@@ -2939,7 +2939,7 @@
ws = surface->surface;
wl_list_insert(&shell->input_panel_layer.surface_list,
&ws->layer_link);
- ws->geometry.dirty = 1;
+ weston_surface_geometry_dirty(ws);
weston_surface_update_transform(ws);
weston_surface_damage(ws);
weston_slide_run(ws, ws->geometry.height, 0, NULL, NULL);
@@ -3056,7 +3056,7 @@
surface->geometry.width = width;
surface->geometry.height = height;
- surface->geometry.dirty = 1;
+ weston_surface_geometry_dirty(surface);
/* initial positioning, see also configure() */
switch (surface_type) {
@@ -3150,11 +3150,7 @@
if (shsurf)
surface_type = shsurf->type;
- surface->geometry.x = x;
- surface->geometry.y = y;
- surface->geometry.width = width;
- surface->geometry.height = height;
- surface->geometry.dirty = 1;
+ weston_surface_configure(surface, x, y, width, height);
switch (surface_type) {
case SHELL_SURFACE_FULLSCREEN:
@@ -3586,7 +3582,7 @@
next = surface;
prev = surface;
surface->alpha = 0.25;
- surface->geometry.dirty = 1;
+ weston_surface_geometry_dirty(surface);
weston_surface_damage(surface);
break;
default:
@@ -3595,7 +3591,7 @@
if (is_black_surface(surface, NULL)) {
surface->alpha = 0.25;
- surface->geometry.dirty = 1;
+ weston_surface_geometry_dirty(surface);
weston_surface_damage(surface);
}
}