compositor: document weston_view_damage_below()
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Tue, 17 Feb 2015 11:10:01 +0000 (13:10 +0200)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 18 Feb 2015 07:49:44 +0000 (09:49 +0200)
Explains what weston_view::clip is.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compositor.c
src/compositor.h

index c2c975d..c40f3eb 100644 (file)
@@ -943,6 +943,22 @@ weston_view_move_to_plane(struct weston_view *view,
        weston_surface_damage(view->surface);
 }
 
+/** Inflict damage on the plane where the view is visible.
+ *
+ * \param view The view that causes the damage.
+ *
+ * If the view is currently on a plane (including the primary plane),
+ * take the view's boundingbox, subtract all the opaque views that cover it,
+ * and add the remaining region as damage to the plane. This corresponds
+ * to the damage inflicted to the plane if this view disappeared.
+ *
+ * A repaint is scheduled for this view.
+ *
+ * The region of all opaque views covering this view is stored in
+ * weston_view::clip and updated by view_accumulate_damage() during
+ * weston_output_repaint(). Specifically, that region matches the
+ * scenegraph as it was last painted.
+ */
 WL_EXPORT void
 weston_view_damage_below(struct weston_view *view)
 {
index 5c0ea74..47b6036 100644 (file)
@@ -761,7 +761,7 @@ struct weston_view {
        struct weston_plane *plane;
        struct weston_view *parent_view;
 
-       pixman_region32_t clip;
+       pixman_region32_t clip;          /* See weston_view_damage_below() */
        float alpha;                     /* part of geometry, see below */
 
        void *renderer_state;