wl_list_remove(&animation->animation.link);
wl_list_remove(&animation->listener.link);
wl_list_remove(&animation->transform.link);
- animation->surface->geometry.dirty = 1;
+ weston_surface_geometry_dirty(animation->surface);
if (animation->done)
animation->done(animation, animation->data);
free(animation);
if (animation->frame)
animation->frame(animation);
- animation->surface->geometry.dirty = 1;
+ weston_surface_geometry_dirty(animation->surface);
weston_compositor_schedule_repaint(animation->surface->compositor);
}
&surface->transform.position.link);
weston_matrix_init(&surface->transform.position.matrix);
pixman_region32_init(&surface->transform.boundingbox);
- surface->geometry.dirty = 1;
+ surface->transform.dirty = 1;
surface->pending.buffer_destroy_listener.notify =
surface_handle_pending_buffer_destroy;
WL_EXPORT void
weston_surface_update_transform(struct weston_surface *surface)
{
- if (!surface->geometry.dirty)
+ if (!surface->transform.dirty)
return;
- surface->geometry.dirty = 0;
+ surface->transform.dirty = 0;
weston_surface_damage_below(surface);
}
WL_EXPORT void
+weston_surface_geometry_dirty(struct weston_surface *surface)
+{
+ surface->transform.dirty = 1;
+}
+
+WL_EXPORT void
weston_surface_to_global_fixed(struct weston_surface *surface,
wl_fixed_t sx, wl_fixed_t sy,
wl_fixed_t *x, wl_fixed_t *y)
surface->geometry.y = y;
surface->geometry.width = width;
surface->geometry.height = height;
- surface->geometry.dirty = 1;
+ weston_surface_geometry_dirty(surface);
}
WL_EXPORT void
{
surface->geometry.x = x;
surface->geometry.y = y;
- surface->geometry.dirty = 1;
+ weston_surface_geometry_dirty(surface);
}
WL_EXPORT int
if (!pixman_region32_equal(&opaque, &surface->opaque)) {
pixman_region32_copy(&surface->opaque, &opaque);
- surface->geometry.dirty = 1;
+ weston_surface_geometry_dirty(surface);
}
pixman_region32_fini(&opaque);
* To add a transformation to a surface, create a struct weston_transform, and
* add it to the list surface->geometry.transformation_list. Whenever you
* change the list, anything under surface->geometry, or anything in the
- * weston_transforms linked into the list, you must set
- * surface->geometry.dirty = 1.
+ * weston_transforms linked into the list, you must call
+ * weston_surface_geometry_dirty().
*
* The order in the list defines the order of transformations. Let the list
* contain the transformation matrices M1, ..., Mn as head to tail. The
struct weston_compositor *compositor;
pixman_region32_t clip;
pixman_region32_t damage;
- pixman_region32_t opaque;
+ pixman_region32_t opaque; /* part of geometry, see below */
pixman_region32_t input;
struct wl_list link;
struct wl_list layer_link;
- float alpha;
+ float alpha; /* part of geometry, see below */
struct weston_plane *plane;
void *renderer_state;
/* Surface geometry state, mutable.
- * If you change anything, set dirty = 1.
+ * If you change anything, call weston_surface_geometry_dirty().
* That includes the transformations referenced from the list.
*/
struct {
/* struct weston_transform */
struct wl_list transformation_list;
-
- int dirty;
} geometry;
/* State derived from geometry state, read-only.
* This is updated by weston_surface_update_transform().
*/
struct {
+ int dirty;
+
pixman_region32_t boundingbox;
pixman_region32_t opaque;
weston_surface_update_transform(struct weston_surface *surface);
void
+weston_surface_geometry_dirty(struct weston_surface *surface);
+
+void
weston_surface_to_global_fixed(struct weston_surface *surface,
wl_fixed_t sx, wl_fixed_t sy,
wl_fixed_t *x, wl_fixed_t *y);
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
wl_list_remove(&shsurf->workspace_transform.link);
wl_list_init(&shsurf->workspace_transform.link);
}
- shsurf->surface->geometry.dirty = 1;
+ weston_surface_geometry_dirty(surface);
}
}
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;
if (surface->alpha < step)
surface->alpha = step;
- surface->geometry.dirty = 1;
+ weston_surface_geometry_dirty(surface);
weston_surface_damage(surface);
}
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 =
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);
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) {
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:
next = surface;
prev = surface;
surface->alpha = 0.25;
- surface->geometry.dirty = 1;
+ weston_surface_geometry_dirty(surface);
weston_surface_damage(surface);
break;
default:
if (is_black_surface(surface, NULL)) {
surface->alpha = 0.25;
- surface->geometry.dirty = 1;
+ weston_surface_geometry_dirty(surface);
weston_surface_damage(surface);
}
}
x - 1, y - 1,
window->width + 2,
window->height + 2);
- window->surface->geometry.dirty = 1;
+ weston_surface_geometry_dirty(window->surface);
}
if (window->surface && !window->fullscreen) {
pixman_region32_fini(&window->surface->pending.opaque);
pixman_region32_init_rect(&window->surface->pending.opaque, 0, 0,
width, height);
- window->surface->geometry.dirty = 1;
+ weston_surface_geometry_dirty(window->surface);
}
return;
}
wl_list_insert(&test->layer.surface_list,
&surface->layer_link);
- surface->geometry.x = test_surface->x;
- surface->geometry.y = test_surface->y;
- surface->geometry.width = width;
- surface->geometry.height = height;
- surface->geometry.dirty = 1;
+ weston_surface_configure(surface, test_surface->x, test_surface->y,
+ width, height);
if (!weston_surface_is_mapped(surface))
weston_surface_update_transform(surface);