paint volumes: another pass at the design
authorRobert Bragg <robert@linux.intel.com>
Tue, 7 Sep 2010 17:04:19 +0000 (18:04 +0100)
committerRobert Bragg <robert@linux.intel.com>
Wed, 29 Sep 2010 14:12:57 +0000 (15:12 +0100)
commit3540d222e1ebba80bbe6cdfe32e97af052304d77
tree59c0cc66263d513a3552ecaf05cf93bafdb88d3c
parent48a24a2e08d5978e538e31c8480fa3d7b9b0b291
paint volumes: another pass at the design

This is a fairly extensive second pass at exposing paint volumes for
actors.

The API has changed to allow clutter_actor_get_paint_volume to fail
since there are times - such as when an actor isn't a descendent of the
stage - when the volume can't be determined. Another example is when
something has connected to the "paint" signal of the actor and we simply
have no way of knowing what might be drawn in that handler.

The API has also be changed to return a const ClutterPaintVolume pointer
(transfer none) so we can avoid having to dynamically allocate the
volumes in the most common/performance critical code paths. Profiling was
showing the slice allocation of volumes taking about 1% of an apps time,
for some fairly basic tests. Most volumes can now simply be allocated on
the stack; for clutter_actor_get_paint_volume we return a pointer to
&priv->paint_volume and if we need a more dynamic allocation there is
now a _clutter_stage_paint_volume_stack_allocate() mechanism which lets
us allocate data which expires at the start of the next frame.

The API has been extended to make it easier to implement
get_paint_volume for containers by using
clutter_actor_get_transformed_paint_volume and
clutter_paint_volume_union. The first allows you to query the paint
volume of a child but transformed into parent actor coordinates. The
second lets you combine volumes together so you can union all the
volumes for a container's children and report that as the container's
own volume.

The representation of paint volumes has been updated to consider that
2D actors are the most common.

The effect apis, clutter-texture and clutter-group have been update
accordingly.
17 files changed:
clutter/clutter-actor.c
clutter/clutter-actor.h
clutter/clutter-blur-effect.c
clutter/clutter-effect.c
clutter/clutter-effect.h
clutter/clutter-group.c
clutter/clutter-main.c
clutter/clutter-offscreen-effect.c
clutter/clutter-private.h
clutter/clutter-stage.c
clutter/clutter-texture.c
clutter/clutter-types.h
clutter/egl/clutter-stage-egl.c
clutter/fruity/clutter-backend-fruity.c
clutter/glx/clutter-stage-glx.c
clutter/osx/clutter-stage-osx.c
clutter/win32/clutter-backend-win32.c