This adds a new public function to queue a rerun of an effect. If
nothing else queues a redraw then when the effect's actor is painted
the effect will be run without the CLUTTER_EFFECT_RUN_ACTOR_DIRTY
flag. This allows parametrised offscreen effects to report that they
need to redraw the image without having to redraw the underlying
actor. This will be used to implement the 'transparency' effect of
ClutterActor.
If multiple redraws are queued with different effects then redrawing
is started from the one that occurs last in the list of effects.
Internally the function is a wrapper around the new function
_clutter_actor_queue_redraw_full. This is intended to be the sole
point of code for queuing redraws on an actor. It has parameters for
the clip and the effect. The other two existing functions to queue a
redraw (one with a clip and one without) now wrap around this function
by passing a NULL effect.
This implements a variation of frustum culling whereby we convert screen
space clip rectangles into eye space mini-frustums so that we don't have
to repeatedly transform actor paint-volumes all the way into screen
coordinates to perform culling, we just have to apply the modelview
transform and then determine each points distance from the planes that
make up the clip frustum.
By avoiding the projective transform, perspective divide and viewport
scale for each point culled this makes culling much cheaper.
This is needed if an effect wants to temporarily override the paint
opacity. It needs to be able to restore the old opacity override in
the post_paint handler otherwise it would replace the effect of the
opacity override from any outer effects.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2541
The 'in_clone_paint' parameter of the private function
_clutter_actor_set_in_clone_paint() shadowed the private function
in_clone_paint(). Rename this parameter to 'is_in_clone_paint' to remove
a compiler warning.
Replace the opacity_parent with an opacity_override variable, to allow
direct overriding of the paint opacity and simplify this mechanism
somewhat.
This also required a new private flag, in_clone_paint, to maintain the
functionality of the public function clutter_actor_is_in_clone_paint()
This makes it possible to choose the traversal order; either depth first
or breadth first and when visiting actors in a depth first order there
is now a callback called before children are traversed and one called
after. Some tasks such as unrealizing actors need to explicitly control
the traversal order to maintain the invariable that all children of an
actor are unrealized before we actually mark the parent as unrealized.
The callbacks are now passed the relative depth in the graph of the
actor being visited and instead of only being able to return a boolean
to bail out of further traversal it can now do one of: continue,
skip_children or break. To implement something like unrealize it's
desirable to skip children that you find have already been unrealized.
The last_paint_box for an actor represents its "normal" position - we
shouldn't update it or use it to cull drawing if we are painting
a clone of the actor. Tracking whether we are painting a clone is
done by adding _clutter_actor_push/pop_clone_paint() and a global
"clone paint level".
http://bugzilla.clutter-project.org/show_bug.cgi?id=2396
For internal usage, writing:
clutter_actor_get_name (actor) != NULL
? clutter_actor_get_name (actor)
: G_OBJECT_TYPE_NAME (actor)
is overly verbose and does two type checks. A simple, internal method
for getting the same result without type checks would be much more
appreciated.