1
0
Fork 0
Commit graph

15 commits

Author SHA1 Message Date
Robert Bragg
b66c22ac1c actor: documents _get/apply_relative_transform_matrix
Although this patch doesn't make them public, it documents the
_clutter_actor_get/apply_relative_transform_matrix functions so they
could easily be made public if desired. I think these API could be
useful to have publicly, and I originally documented them because I
thought they would be needed in the MX toolkit.
2011-06-17 18:38:29 +01:00
Emmanuele Bassi
2b81d90dd7 Eliminate G_CONST_RETURN
The G_CONST_RETURN define in GLib is, and has always been, a bit fuzzy.

We always used it to conform to the platform, at least for public-facing
API.

At first I assumed it has something to do with brain-damaged compilers
or with weird platforms where const was not really supported; sadly,
it's something much, much worse: it's a define that can be toggled at
compile-time to remove const from the signature of public API. This is a
truly terrifying feature that I assume was added in the past century,
and whose inception clearly had something to do with massive doses of
absynthe and opium — because any other explanation would make the
existence of such a feature even worse than assuming drugs had anything
to do with it.

Anyway, and pleasing the gods, this dubious feature is being
removed/deprecated in GLib; see bug:

  https://bugzilla.gnome.org/show_bug.cgi?id=644611

Before deprecation, though, we should just remove its usage from the
whole API. We should especially remove its usage from Cally's internals,
since there it never made sense in the first place.
2011-06-07 16:06:24 +01:00
Neil Roberts
00b733a85a clutter-effect: Add clutter_effect_queue_rerun
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.
2011-05-13 01:46:32 +01:00
Emmanuele Bassi
f6e6c803d9 Deprecate actor id
The actor's id, which is currently used to generate the pick color,
should not be part of the public API: it's an internal detail of the
pick implementation, and having it exposed is like punching a hole
through the abstraction.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2633

https://bugzilla.gnome.org/show_bug.cgi?id=647876
2011-05-06 17:47:41 +01:00
Robert Bragg
19b8622983 Optimize culling by doing culling in eye-coordinates
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.
2011-03-07 13:26:20 +00:00
Neil Roberts
3fab04805e clutter-actor: Add an internal _clutter_actor_get_opacity_override
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
2011-03-03 16:54:51 +00:00
Chris Lord
b152a97ea5 actor: Rename in_clone_paint parameter to avoid variable shadowing
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.
2011-02-11 16:27:46 +00:00
Chris Lord
b2ea7d1352 actor: Replace private opacity_parent with opacity_override
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()
2011-02-11 16:17:57 +00:00
Emmanuele Bassi
49a43a0772 Remove unnecessary duplicate name for private enumerations 2010-12-10 16:03:10 +00:00
Emmanuele Bassi
f5b51a2428 docs: Documentation fixes 2010-12-09 15:06:12 +00:00
Robert Bragg
4bda674732 actor: make _clutter_actor_traverse more flexible
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.
2010-11-24 16:51:59 +00:00
Owen W. Taylor
8e6fac38fa Don't update or use last_paint_box when painting inside a clone
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
2010-11-23 12:50:29 +00:00
Emmanuele Bassi
0523d6db08 actor: Add a get_debug_name() private Actor method
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.
2010-11-15 16:00:48 +00:00
Emmanuele Bassi
cf46c8197e Add copyright notices 2010-10-21 13:13:00 +01:00
Emmanuele Bassi
46c597a1f6 Clean up clutter-private.h/6
Move all Actor private API to a separate file.
2010-10-21 12:22:17 +01:00