Emmanuele Bassi [Mon, 11 Oct 2010 12:52:09 +0000 (13:52 +0100)]
Whitespace alignment fixes
Emmanuele Bassi [Mon, 11 Oct 2010 12:51:12 +0000 (13:51 +0100)]
paint-volume: Add arguments checks
In some cases we access the arguments in public functions without, or
prior to checking the arguments.
Owen W. Taylor [Thu, 7 Oct 2010 20:00:47 +0000 (16:00 -0400)]
ClutterClone: Handle clone_source == NULL for get_paint_volume()
It's valid to have a ClutterClone without a clone source; in this
case the paint volume is empty.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2360
Emmanuele Bassi [Mon, 11 Oct 2010 12:32:26 +0000 (13:32 +0100)]
clone: Remove unnecessary G_UNLIKELY macros
A Clone:source property might be NULL, and we should not penalize
performance when we can just bail out early, because that would kind of
defeat the point.
Emmanuele Bassi [Mon, 11 Oct 2010 11:00:18 +0000 (12:00 +0100)]
docs: Update the README
Add a minimal building reference, and point to git-bz for filing
patches to Bugzilla.
Emmanuele Bassi [Sun, 10 Oct 2010 08:31:55 +0000 (09:31 +0100)]
osx: Compilation fixes
Replace deprecated symbols with the correct ones.
Emmanuele Bassi [Fri, 8 Oct 2010 12:29:49 +0000 (13:29 +0100)]
box-layout: Plug a memory leak
Similar to commit
4724be167f19fe58cb38179e6f3b34b6797ff639 for
TableLayout.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2358
Neil Roberts [Wed, 6 Oct 2010 15:01:03 +0000 (16:01 +0100)]
Plug a memory leak in clutter-table-layout
Whenever the allocation is changed on a child of a ClutterTableLayout
and animations are not in effect then it would store a copy of the
allocation in the child meta data. However it was not freeing the old
copy of the allocation so it would end up with a small leak.
Instead of just changing it to free the old value this patch makes it
store the allocation inline in the meta data struct because it seems
that the size of an actor box is already quite small compared to the
size of the meta data struct so it is probably not worth having a
separate allocation for it. To detect the case when there has not yet
been an allocation a separate boolean is used instead of storing NULL.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2358
Emmanuele Bassi [Thu, 7 Oct 2010 17:01:53 +0000 (18:01 +0100)]
autogen.sh: libtool 2.4 has been released
Damien Lespiau [Thu, 7 Oct 2010 11:17:33 +0000 (12:17 +0100)]
po: Update French localization
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Andika Triwidada [Tue, 5 Oct 2010 16:23:37 +0000 (17:23 +0100)]
po: Update Indonesian localization
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Damien Lespiau [Tue, 5 Oct 2010 16:22:56 +0000 (17:22 +0100)]
po: Add French localization
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Tue, 5 Oct 2010 13:30:01 +0000 (14:30 +0100)]
clutter.modules: Update Cairo and Pixman
Damien Lespiau [Tue, 5 Oct 2010 07:35:19 +0000 (08:35 +0100)]
texture: Fix the typos in the blurbs and make them not end with '.'
All the nifty things you discover when translating strings not exposed
to anyone. First the clutter-wide record of the number of typos in one
string. Second, ClutterTexture happened to have the only property blurbs
ending with a '.', remove them.
Damien Lespiau [Tue, 5 Oct 2010 07:25:06 +0000 (08:25 +0100)]
text: Rename the nick of the position property "Cursor Position"
the "position" property of ClutterText is really the position of the
cursor. Rename the nick accordingly not to confuse it with the position
of the actor itself and be consistent with all the other cursor-related
properties.
Damien Lespiau [Tue, 5 Oct 2010 07:03:19 +0000 (08:03 +0100)]
cogl: Use Cogl (not COGL) consistently
If I remember correctly, Robert wants to name Cogl, Cogl (not COGL) so
start by having a consistent naming in the code.
Damien Lespiau [Tue, 5 Oct 2010 06:44:49 +0000 (07:44 +0100)]
bin-layer: Fix the property blurbs
The descriptions for the 'y-align' and 'x-align' properties talk about a
layer and a layer manager. It seems that these properties are the
alignement factors relative to the BinLayout, so document them
accordingly.
Damien Lespiau [Mon, 4 Oct 2010 17:35:13 +0000 (18:35 +0100)]
box-layout: Fix missing spaces in the blurbs of vertical and homogeneous
Damien Lespiau [Mon, 4 Oct 2010 16:20:30 +0000 (17:20 +0100)]
deform-effect: Fix Horiontal/Horizontal typo
Emmanuele Bassi [Mon, 4 Oct 2010 14:47:53 +0000 (15:47 +0100)]
build: Fix the release-message target
Generate the SHA256 checksum file during release-upload and then copy it
to the build directory.
Andika Triwidada [Mon, 4 Oct 2010 14:43:54 +0000 (15:43 +0100)]
po: Add Indonesian localization
Piotr Drąg [Mon, 4 Oct 2010 14:43:16 +0000 (15:43 +0100)]
po: Update Polish localization
Emmanuele Bassi [Mon, 4 Oct 2010 14:20:44 +0000 (15:20 +0100)]
Post-release version bump to 1.5.3
Emmanuele Bassi [Mon, 4 Oct 2010 13:53:55 +0000 (14:53 +0100)]
Release Clutter 1.5.2 (snapshot)
Emmanuele Bassi [Mon, 4 Oct 2010 13:12:21 +0000 (14:12 +0100)]
cogl-x11: Trap glXDestroyPixmap()
There are ordering issues in the pixmap destruction with current and
past X11 server, Mesa and dri2. Under some circumstances, an X pixmap
might be destroyed with the GLX pixmap still referencing it, and thus
the X server will decide to destroy the GLX pixmap as well; then, when
Cogl tries to destroy the GLX pixmap, it gets BadDrawable errors.
Clutter 1.2 used to trap + sync all calls to glXDestroyPixmap(), but
then we assumed that the ordering issue had been solved. So, we're back
to square 1.
I left a Big Fat Comment™ right above the glXDestroyPixmap() call
referencing the bug and the reasoning behind the trap, so that we don't
go and remove it in the future without checking that the issue has been
in fact solved.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2324
Alejandro Piñeiro [Mon, 4 Oct 2010 00:17:40 +0000 (02:17 +0200)]
Fixing cally.pc.in and moving include headers to previous directory
After commit
8dd8fbdb some errors appear if you try work directly
against cally:
* cally.pc.in removed some elements. After install clutter, doing
pkg-config --cflags cally-1.0
fails due missing winsys
* cally headers were moved from clutter-1.0/cally to
clutter-1.0/clutter/cally. Applications using it (yes I know,
nobody is officially using it) would require to:
* Change their include.
* Add directly a dependency to cally, in order to use the cally.pc
file with the correct directory include.
Note: Take into account that accessibility support still works (ie:
clutter_get_accessibility_enabled). This bug only prevents
applications to work directly against cally (ie: create a CallyActor
subclass)
http://bugzilla.clutter-project.org/show_bug.cgi?id=2353
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Mon, 4 Oct 2010 10:30:32 +0000 (11:30 +0100)]
effect: Fix up the class ABI
Landing the paint-box branch accidentally added two slots to the
ClutterEffectClass vtable, plus the get_paint_volume() function
pointer. This is an ABI break from 1.4.
Emmanuele Bassi [Mon, 4 Oct 2010 10:27:16 +0000 (11:27 +0100)]
actor-box: Constify arguments for union
The input arguments for clutter_actor_box_union() should be constified,
since they will not be modified by the function.
Emmanuele Bassi [Mon, 4 Oct 2010 10:26:46 +0000 (11:26 +0100)]
docs: Fix the annotations of ActorClass
Emmanuele Bassi [Mon, 4 Oct 2010 09:52:36 +0000 (10:52 +0100)]
build: Add -xobjective-c to the fruity backend section
Like we do for the Quartz backend, we should turn on the -xobjective-c
compiler flag for the Fruity backend.
This does not mean that the backend actually works.
Emmanuele Bassi [Mon, 4 Oct 2010 09:44:00 +0000 (10:44 +0100)]
docs: Remove TODO
Clutter has long since moved all the RFE and roadmap tracking to
Bugzilla. The TODO is just a relic of an ancient past, where men
were real men, women were real women, and fuzzy little creatures
from Alpha Centauri were fuzzy little creatures from Alpha Centauri.
Emmanuele Bassi [Mon, 4 Oct 2010 08:09:13 +0000 (09:09 +0100)]
build: Remove redundant EXTRA_DISTs
The files for the backend that we conditionally compile are
automatically added to the dist process by automake.
Emmanuele Bassi [Mon, 4 Oct 2010 08:08:07 +0000 (09:08 +0100)]
docs: Add unused symbols to the Clutter API reference
Emmanuele Bassi [Mon, 4 Oct 2010 07:57:29 +0000 (08:57 +0100)]
build: Unconditionally add GLES2 shaders to EXTRA_DIST
Emmanuele Bassi [Sun, 3 Oct 2010 16:21:10 +0000 (17:21 +0100)]
build: Generate a stub announcement email when releasing
Emmanuele Bassi [Sun, 3 Oct 2010 15:37:41 +0000 (16:37 +0100)]
docs: Update the RELEASING checklist
Emmanuele Bassi [Sun, 3 Oct 2010 15:13:02 +0000 (16:13 +0100)]
build: Only generate bzip2 tarballs
Don't generate both bz2 and gz tarballs: we only use the former anyway,
and the latter just adds time for distcheck to complete.
The gz tarball will be generated by the remote installation scripts when
publishing the release.
Emmanuele Bassi [Sun, 3 Oct 2010 15:10:44 +0000 (16:10 +0100)]
build: Dist every backend file
All backend files should be present in the tarball generated by `make
dist`, to allow building Clutter on different platforms.
Emmanuele Bassi [Sun, 3 Oct 2010 14:28:14 +0000 (15:28 +0100)]
container: Do not emit a signal in the class handler
Yes, I am that stupid.
Emmanuele Bassi [Sun, 3 Oct 2010 14:16:41 +0000 (15:16 +0100)]
introspection: Skip Script.connect_signals_full()
It's meant to be used by language bindings, not by applications.
Emmanuele Bassi [Sun, 3 Oct 2010 14:12:01 +0000 (15:12 +0100)]
container: Fix the marshaller for ::child-notify
The marshaller was defined as OBJECT,OBJECT,PARAM but the signal
definition used only two arguments. Since the signal never worked
and we never got any report about it, nobody could be possibly
using the ::child-notify signal.
Emmanuele Bassi [Sun, 3 Oct 2010 13:53:14 +0000 (14:53 +0100)]
build: Automate the release process
Emmanuele Bassi [Sun, 3 Oct 2010 10:02:56 +0000 (11:02 +0100)]
docs: Update the coding style
Resynchronize with gtk+'s coding style document, since they switched to
ours.
Aron Xu [Thu, 30 Sep 2010 07:20:05 +0000 (15:20 +0800)]
Update zh_CN translation.
Signed-off-by: Aron Xu <aronxu@gnome.org>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Thu, 30 Sep 2010 13:58:23 +0000 (14:58 +0100)]
container: Add child_notify() wrapper
The child_notify() virtual function on ClutterContainer does not have a
wrapper for implementations to call.
Emmanuele Bassi [Thu, 30 Sep 2010 12:11:05 +0000 (13:11 +0100)]
container: Implement ::child-notify
Since we added child properties to the Container interface we made a
guarantee that the ::child-notify signal would be emitted whenever a
property was set using clutter_container_child_set*().
We were lying.
The child_notify virtual function was not implemented, and the signal
was never emitted.
We also used a G_LIKELY() macro while checking for non-NULL on a
function pointer that was by default set to NULL, thus making the
setting of child properties far less efficient than needed.
Emmanuele Bassi [Thu, 30 Sep 2010 11:43:10 +0000 (12:43 +0100)]
build: Add more metadata to the introspection files
Emmanuele Bassi [Thu, 30 Sep 2010 11:32:08 +0000 (12:32 +0100)]
cookbook: Remove unused variable from the animator example
Emmanuele Bassi [Thu, 30 Sep 2010 11:31:28 +0000 (12:31 +0100)]
build: Make Cally.gir depend on Cogl.gir
Since Cally's introspection data depends on it.
Emmanuele Bassi [Thu, 30 Sep 2010 11:24:32 +0000 (12:24 +0100)]
Merge remote branch 'elliot/events-buttons'
* elliot/events-buttons:
cookbook: Add recipe about handling button events
cookbook: Example of using button press and release events
cookbook: Example of ClutterClickAction
cookbook: Example of simple handling of button events
Colin Walters [Wed, 29 Sep 2010 17:18:03 +0000 (13:18 -0400)]
introspection: Update to changed variables for header file names
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Ray Strode [Wed, 29 Sep 2010 22:43:30 +0000 (18:43 -0400)]
actor: sync entry has_clip member to clip state
The clutter stage has a list of entries of actors waiting to be redrawn.
Each entry has a "clip" ClutterPaintVolume member which represents which
how much of the actor needs to get redrawn. It's possible for there to
be no clip associated with the entry. In this case, the clip member is
invalid, the has_clip member should be set to false.
This commit fixes a bug where the has_clip member was not being
initially, explicitly set to false for new entries, and not being
explicitly set to false in the event the clip associated with the entry
is freed.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2350
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Robert Bragg [Thu, 30 Sep 2010 10:18:23 +0000 (11:18 +0100)]
actor: don't ignore clip for clipped redraws
In all the changes made recently to how we handle redraws and adding
support for paint-volumes we stopped looking at explicit clip regions
passed to _clutter_actor_queue_redraw_with_clip.
In _clutter_actor_finish_queue_redraw we had started always trying to
clip the redraw to the paint-volume of the actor, but forgot to consider
that the user may have already determined the clip region for us!
Now we first check if the given clip != NUll and if so we don't need to
calculate the paint-volume of the actor.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2349
Robert Bragg [Thu, 30 Sep 2010 01:37:24 +0000 (02:37 +0100)]
test-pixmap: add timeout to draw arcs on pixmap
As a convenient test that clipped redraws are working correctly in
response to X pixmap damage this updates test-pixmap to have a repeating
1 second timeout that draws arcs on the pixmap.
Robert Bragg [Thu, 30 Sep 2010 01:00:24 +0000 (02:00 +0100)]
x11-tfp: Implement get_paint_volume virtual
One of the later changes made on the paint volume branch before merging
with master was to make paint volumes opt in only since we couldn't make
any safe assumptions about how custom actors may constrain their
painting. We added very conservative implementations for the existing
Clutter actors - including for ClutterTexture which
ClutterX11TexturePixmap is a sub-class of - but we were conservative to
the extent of explicitly checking the GType of the actor so we would
avoid making any assumptions about sub-classes. The upshot was that we
neglected to implement the get_paint_volume vfunc for
ClutterX11TexturePixmap.
This patch provides an implementation that simply reports the actor's
allocation as its paint volume. Also unlike for other core actors it
doesn't explicitly check the GType so we are assuming that all existing
sub-classes of ClutterX11TexturePixmap constrain their drawing to the
actor's transformed allocation. If anyone does want to draw outside the
allocation in future sub-classes, then they should also provide an
updated get_paint_volume implementation.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2349
Robert Bragg [Fri, 24 Sep 2010 00:01:33 +0000 (01:01 +0100)]
material: tweak dot file debug code
When using the debug function _cogl_debug_dump_materials_dot_file to
write a dot file representing the sparse graph of material state we now
only show a link between materials and layers when the material directly
owns that layer reference (i.e. just those referenced in
material->layer_differences) This makes it possible to see when
ancestors of a material are being deferred too for layer state.
For example when looking at the graph if you see that a material has an
n_layers of 3 but there is only a link to 2 layers, then you know you
need to look at it's ancestors to find the last layer.
Elliot Smith [Thu, 30 Sep 2010 10:12:14 +0000 (11:12 +0100)]
cookbook: Add recipe about handling button events
Recipe covers adding handlers for button-press-event and
button-release-event signals on actors, and how to
examine the content of a ClutterButtonEvent via API functions.
The discussion section explains about click count
(the criteria for how clicks get counted, including
distance and time settings); how button numbers are reported;
and how to use ClutterClickAction as an alternative
for press + release in certain scenarios.
Neil Roberts [Wed, 29 Sep 2010 16:04:25 +0000 (17:04 +0100)]
win32: Fix the CLUTTER_* keysym macros
In
4ee05f8e21d the namespace for the clutter keysym macros were
changed to CLUTTER_KEY_* but the win32 events backend was still
referring to the old names.
Elliot Smith [Tue, 28 Sep 2010 15:53:30 +0000 (16:53 +0100)]
cookbook: Example of using button press and release events
A longer example of using button press and release events
to draw rectangles with random colors.
Elliot Smith [Tue, 28 Sep 2010 15:37:26 +0000 (16:37 +0100)]
cookbook: Example of ClutterClickAction
Example of handling clicks on an actor; part of the recipe on
handling button events.
Elliot Smith [Mon, 27 Sep 2010 15:36:16 +0000 (16:36 +0100)]
cookbook: Example of simple handling of button events
Added an example showing how to examine the content
of a ClutterButtonEvent in a signal handler.
Emmanuele Bassi [Thu, 30 Sep 2010 09:29:00 +0000 (10:29 +0100)]
Wrap g_object_class_install_properties()
GObject ≥ 2.26.0 added a nice convenience call for installing properties
from an array of GParamSpec. Since we're already storing all GParamSpec
in an array in order to use them with g_object_notify_by_pspec(), this
turns out nicely for us.
Since we do not depend on GLib 2.26 (yet), we need to provide a simple
private wrapper that implements the fall back to the default
g_object_class_install_property() call.
ClutterDragAction has been converted as a proof of concept.
Emmanuele Bassi [Thu, 30 Sep 2010 09:27:10 +0000 (10:27 +0100)]
stage: Add more checks on the stage window retrieval
During destruction, the StageWindow implementation associated to a Stage
might be NULL. We need to add more checks for a) the IN_DESTRUCTION flag
being set and b) the StageWindow pointer being NULL. Otherwise, we will
get warnings during the destruction of the Stage.
Emmanuele Bassi [Wed, 29 Sep 2010 16:32:57 +0000 (17:32 +0100)]
build: Use platform detection to add -no-undefined
Instead of relying on the flavour passed to the configure script.
Emmanuele Bassi [Wed, 29 Sep 2010 15:46:06 +0000 (16:46 +0100)]
modules: Use the stable branch of json-glib
Neil Roberts [Wed, 29 Sep 2010 14:40:22 +0000 (15:40 +0100)]
cogl-texture-2d-sliced: Don't create the slice textures twice
Both of the cogl_texture_2d_sliced_new functions called the
slices_create function which creates the underlying GL
textures. However this was also called by init_base so the textures
would end up being created twice. This would make it leak the GL
textures and the arrays which point to them.
Emmanuele Bassi [Wed, 29 Sep 2010 15:05:55 +0000 (16:05 +0100)]
Bump up dependency of json-glib to 0.12.0
New stable release.
Emmanuele Bassi [Wed, 22 Sep 2010 11:56:33 +0000 (12:56 +0100)]
Remove the internal copy of JSON-GLib
The internal copy of JSON-GLib was meant to go away right after the 1.0
release, given that JSON-GLib was still young and relatively unknown.
Nowadays, many projects started depending on this little library, and
distributions ship it and keep it up to date.
Keeping a copy of JSON-GLib means keeping it up to date; unfortunately,
this would also imply updating the code not just for the API but for the
internal implementations.
Starting with the 1.2 release, Clutter preferably dependend on the
system copy; with the 1.4 release we stopped falling back automatically.
The 1.6 cycle finally removes the internal copy and requires a copy of
JSON-GLib installed on the target system in order to compile Clutter.
Emmanuele Bassi [Wed, 29 Sep 2010 14:55:58 +0000 (15:55 +0100)]
Merge branch 'wip/non-recursive'
* wip/non-recursive:
build: Start moving to a non-recursive layout
Emmanuele Bassi [Wed, 29 Sep 2010 14:44:51 +0000 (15:44 +0100)]
modules: Fix up mesa module
Emmanuele Bassi [Wed, 29 Sep 2010 14:23:53 +0000 (15:23 +0100)]
modules: Add mesa and wayland to the moduleset
Robert Bragg [Fri, 24 Sep 2010 01:24:36 +0000 (02:24 +0100)]
actor: don't dirty pick buffer in _real_queue_redraw
Since re-working how redraws are queued it is no longer necessary to
dirty the pick buffer in _clutter_actor_real_queue_redraw since this
should now reliably be handled in _clutter_stage_queue_actor_redraw.
Robert Bragg [Sun, 12 Sep 2010 23:33:23 +0000 (00:33 +0100)]
actor: Adds private _clutter_actor_traverse API
This adds two internal functions relating to explicit traversal of the
scenegraph:
_clutter_actor_foreach_child
_clutter_actor_traverse
_clutter_actor_foreach_child just iterates the immediate children of an
actor, and with a new ClutterForeachCallback type it allows the
callbacks to break iteration early.
_clutter_actor_traverse traverses the given actor and all of its
decendants. Again traversal can be stopped early if a callback returns
FALSE.
The first intended use for _clutter_actor_traverse is to maintain a
cache pointer to the stage for all actors. In this case we will need to
update the pointer for all descendants of an actor when an actor is
reparented in any way.
Robert Bragg [Sun, 12 Sep 2010 22:49:02 +0000 (23:49 +0100)]
actor: Adds private _clutter_actor_get_n_children
This adds a private getter to query the number of children an actor has.
One use planned for this API is to avoid calling get_paint_volume on
such actors. (It's not clear what the best semantics for
get_paint_volume are for actors with children, so we are considering
leaving the semantics undefined for the initial clutter 1.4 release)
Robert Bragg [Sun, 12 Sep 2010 22:31:39 +0000 (23:31 +0100)]
actor: explicitly track children in clutter-actor.c
We now explicitly track the list of children each actor has in a private
GList. This gives us a reliable way to know how many children an actor
has - even for composite actors that don't implement the container
interface. This also will allow us to directly traverse the scenegraph
in a more generalized fashion. Previously the scenegraph was
more-or-less represented implicitly according the implementation of
paint methods.
Robert Bragg [Sat, 11 Sep 2010 01:48:18 +0000 (02:48 +0100)]
debug: fix blue outlines for paint-volumes debug opt
When using the CLUTTER_PAINT=paint-volumes debug option we try and show
when a paint volume couldn't be determined by drawing a blue outline of
the allocation instead. There was a typo though and instead we were
drawing an outline the size of the stage instead of for the given actor.
This fixes that and removes a FIXME comment relating to the blue outline
that is now implemented.
Robert Bragg [Sat, 11 Sep 2010 01:39:23 +0000 (02:39 +0100)]
clone: Implement get_paint_volume virtual
To allow Clutter to queue clipped redraws when a clone actor changes we
need to be able to report a paint volume for clone actors. This patch
makes ClutterClones query the paint volume of their source actor and
masquerade it as their own volume.
Robert Bragg [Fri, 10 Sep 2010 01:18:16 +0000 (02:18 +0100)]
Revert "actor: don't immediately queue redraw when queuing relayout"
This reverts commit
ca44c6a7d8abe9f2c548bee817559ea8adaa7a80.
In reality there are probably lots of actors that depend on the exact
semantics as they are documented so this change isn't really acceptable.
For example when the font changes in ClutterText we only queue a
relayout, and since it's possible that the font will have the same size
and the actor won't get a new allocation it wouldn't otherwise queue a
redraw.
Since queue_redraw requests now get deferred until just before a paint
run it is actually no longer a problem to queue the redraw here.
Robert Bragg [Fri, 10 Sep 2010 00:33:02 +0000 (01:33 +0100)]
actor: defer queue-redraw signaling
Instead of immediately, recursively emitting the "queue-redraw" signal
when clutter_actor_queue_redraw is called we now defer this process
until all stage updates are complete. This allows us to aggregate
repeated _queue_redraw requests for the same actor avoiding redundant
paint volume transformations. By deferring we also increase the
likelihood that the actor will have a valid paint volume since it will
have an up to date allocation; this in turn means we will more often be
able to automatically queue clipped redraws which can have a big impact
on performance.
Here's an outline of the actor queue redraw mechanism:
The process starts in clutter_actor_queue_redraw or
_clutter_actor_queue_redraw_with_clip.
These functions queue an entry in a list associated with the stage which
is a list of actors that queued a redraw while updating the timelines,
performing layouting and processing other mainloop sources before the
next paint starts.
We aim to minimize the processing done at this point because there is a
good chance other events will happen while updating the scenegraph that
would invalidate any expensive work we might otherwise try to do here.
For example we don't try and resolve the screen space bounding box of an
actor at this stage so as to minimize how much of the screen redraw
because it's possible something else will happen which will force a full
redraw anyway.
When all updates are complete and we come to paint the stage (see
_clutter_stage_do_update) then we iterate this list and actually emit
the "queue-redraw" signals for each of the listed actors which will
bubble up to the stage for each actor and at that point we will
transform the actors paint volume into screen coordinates to determine
the clip region for what needs to be redrawn in the next paint.
Note: actors are allowed to queue a redraw in reseponse to a
queue-redraw signal so we repeat the processing of the list until it
remains empty. An example of when this happens is for Clone actors or
clutter_texture_new_from_actor actors which need to queue a redraw if
their source queues a redraw.
Robert Bragg [Thu, 9 Sep 2010 17:51:17 +0000 (18:51 +0100)]
paint_volume: add private api to change reference actor
For Clone actors we will need a way to report the volume of the source
actor as the volume of the clone actor. To make this work though we need
to be able to replace the reference to the source actor with a reference
to the clone actor instead. This adds a private
_clutter_paint_volume_set_reference_actor function to do that.
Robert Bragg [Thu, 9 Sep 2010 16:53:29 +0000 (17:53 +0100)]
paint_volume: Adds _clutter_paint_volume_set_from_volume
This adds a way to initialize a paint volume from another source paint
volume. This lets us for instance pass the contents of one paint volume
back through the out param of a get_paint_volume implementation.
Robert Bragg [Thu, 9 Sep 2010 13:30:38 +0000 (14:30 +0100)]
actor: don't queue_redraw actors not descended from stage
This makes clutter_actor_queue_redraw simply bail out early if the actor
isn't a descendant of a ClutterStage since the request isn't meaningful
and it avoids a crash when trying to queue a clipped redraw against the
stage to clear the actors old location.
Emmanuele Bassi [Thu, 9 Sep 2010 12:11:11 +0000 (13:11 +0100)]
paint-volume: Add convenience function for using an allocation
Classes overriding ClutterActor::get_paint_volume() that wish to use
their allocation as the paint volume should have an idiomatic way of
doing so.
Emmanuele Bassi [Thu, 9 Sep 2010 11:38:25 +0000 (12:38 +0100)]
text: Update get_paint_volume() implementation
In commit
9818eee4646e49e99beb5a43f1dafcbdcca41f94 I forgot to update
ClutterText as well as the other actors.
Emmanuele Bassi [Thu, 9 Sep 2010 11:30:29 +0000 (12:30 +0100)]
Move default paint volume computation into a function
This should reduce the amount of copy and paste for actor sub-classes
that use the default paint volume from the allocation.
Robert Bragg [Wed, 8 Sep 2010 20:01:37 +0000 (21:01 +0100)]
paint_volume: assert non-NULL pv in _volume_copy
Instead of carefully checking if the user passes NULL to
clutter_paint_volume_copy we now simply use g_return_val_if_fail.
Robert Bragg [Wed, 8 Sep 2010 19:39:15 +0000 (20:39 +0100)]
paint_volume: Splits out clutter_paint_volume code
This splits out all the clutter_paint_volume code from clutter-actor.c
into clutter-paint-volume.c. Since clutter-actor.c and
clutter-paint-volume.c both needed the functionality of
_fully_transform_vertices, this function has now been moved to
clutter-utils.c as _clutter_util_fully_transform_vertices.
Robert Bragg [Wed, 8 Sep 2010 18:47:11 +0000 (19:47 +0100)]
actor: make default get_paint_volume more conservative
There are too many examples where the default assumption that an actor
paints inside its allocation isn't true, so we now return FALSE in the
base implementation instead. This means that by default we are saying
"we don't know the paint volume of the actor", so developers need to
implement the get_paint_volume virtual to take advantage of culling and
clipped redraws with their actors.
This patch provides very conservative get_paint_volume implementations
for ClutterTexture, ClutterCairoTexture, ClutterRectangle and
ClutterText which all explicitly check the actor's object type to avoid
making any assumptions about subclasses.
Robert Bragg [Wed, 8 Sep 2010 17:20:54 +0000 (18:20 +0100)]
actor: don't always check needs_allocation for clipped redraw
We were always explicitly checking priv->needs_allocation in
_clutter_actor_queue_redraw_with_clip, but we only need to do that if
the CLUTTER_REDRAW_CLIPPED_TO_ALLOCATION flag is used.
Robert Bragg [Wed, 8 Sep 2010 17:17:27 +0000 (18:17 +0100)]
actor: new actors should start with an empty paint box
This initializes priv->last_paint_box with a degenerate box, so a newly
allocated actor added to the scenegraph and made visible only needs to
trigger a redraw of its initial position. If we don't have a valid
last_paint_box though we would instead trigger a full stage redraw.
Robert Bragg [Wed, 8 Sep 2010 17:14:04 +0000 (18:14 +0100)]
actor: when culling/clipped redraws disable ignore paint box
To make comparing the performance with culling/clipped redraws
enabled/disabled fairer we now avoid querying the paint box when they
are disabled, so that results should reflect how the cost of
transforming paint volumes into screen space etc gets offset against the
benefit of culling.
Robert Bragg [Wed, 8 Sep 2010 10:32:29 +0000 (11:32 +0100)]
stage: only update viewport when allocation changes
In clutter_stage_allocate at the end we were always querying the latest
allocation set and using the geometry to assert the viewport and then
kicking a full redraw. These only need to be done when the allocation
really changes, so we now read the previous allocation at the start of
the function and compare at the end. This was stopping clipped redraws
from being used in a lot of cases.
Robert Bragg [Wed, 8 Sep 2010 00:18:30 +0000 (01:18 +0100)]
glx: queue full redraws for the first 2 frames
To consider that we've see a number of drivers that can struggle to get
going and may produce a bad first frame we now force the first 2 frames
to be full redraws. This became a serious issue after we started using
clipped redraws more aggressively because we assumed that after the
first frame the full framebuffer was valid and we only redraw the
content that changes. With buggy drivers though, applications would be
left with junk covering a lot of the stage until some event triggered a
full redraw.
Robert Bragg [Wed, 8 Sep 2010 00:15:00 +0000 (01:15 +0100)]
x11: minimize nasty artefacts when resizing windows
This is a workaround for a race condition when resizing windows while
there are in-flight glXCopySubBuffer blits happening.
The problem stems from the fact that rectangles for the blits are
described relative to the bottom left of the window and because we can't
guarantee control over the X window gravity used when resizing so the
gravity is typically NorthWest not SouthWest.
This means if you grow a window vertically the server will make sure to
place the old contents of the window at the top-left/north-west of your
new larger window, but that may happen asynchronous to GLX preparing to
do a blit specified relative to the bottom-left/south-west of the window
(based on the old smaller window geometry).
When the GLX issued blit finally happens relative to the new bottom of
your window, the destination will have shifted relative to the top-left
where all the pixels you care about are so it will result in a nasty
artefact making resizing look very ugly!
We can't currently fix this completely, in-part because the window
manager tends to trample any gravity we might set. This workaround
instead simply disables blits for a while if we are notified of any
resizes happening so if the user is resizing a window via the window
manager then they may see an artefact for one frame but then we will
fallback to redrawing the full stage until the cooling off period is
over.
Robert Bragg [Wed, 8 Sep 2010 00:03:15 +0000 (01:03 +0100)]
x11: Queue clipped redraws for Expose events
Instead of triggering a full stage redraw for Expose events we use the
geometry of the exposed region given in the event to queue a clipped
redraw of the stage.
Robert Bragg [Tue, 7 Sep 2010 22:35:26 +0000 (23:35 +0100)]
cogl: removes unused _cogl_setup_viewport
Clutter has now taken responsibility for managing its viewport,
projection matrix and view transform as part of ClutterStage so
_cogl_setup_viewport is no longer used by anything, and since it's quite
an obscure API anyway it's we've taken the opportunity to remove the
function.
Robert Bragg [Tue, 7 Sep 2010 22:25:18 +0000 (23:25 +0100)]
stage: Sometimes really force a full redraw
Since clutter_actor_queue_redraw now automatically clips redraws
according to the paint volume of the actor we have to be careful to
ensure we really force a full redraw when the stage is allocated a new
size or the stage viewport changes.
Robert Bragg [Tue, 7 Sep 2010 22:09:06 +0000 (23:09 +0100)]
actor: don't immediately queue redraw when queuing relayout
We have bent the originally documented semantics a bit so now where we
say "Queueing a new layout automatically queues a redraw as well" it
might be clearer to say "Queuing a new layout implicitly queues a redraw
as well if anything in the layout changes".
This should be close enough to the original semantics to not cause any
problems.
Without this change then we we fail to take advantage of clipped redraws
in a lot of cases because queuing a redraw with priv->needs_allocation
== TRUE will automatically be promoted to a full stage redraw since it's
not possible to determine a valid paint-volume.
Also queuing a redraw here will end up registering a redundant clipped
redraw for the current location, doing quite a lot of redundant
transforms, and then later when re-allocated during layouting another
queue redraw would happen with the correct paint-volume.
Robert Bragg [Tue, 7 Sep 2010 21:21:28 +0000 (22:21 +0100)]
Use paint volumes to do automatic culling
This uses actor paint volumes to perform culling during
clutter_actor_paint.
When performing a clipped redraw (because only a few localized actors
changed) then as we traverse the scenegraph painting the actors we can
now ignore actors that don't intersect the clip region. Early testing
shows this can have a big performance benefit; e.g. 100% fps improvement
for test-state with culling enabled and we hope that there are even much
more compelling examples than that in the real world,
Most Clutter applications are 2Dish interfaces and have quite a lot of
actors that get continuously painted when anything is animated. The
dynamic actors are often localized to an area of user focus though so
with culling we can completely avoid painting any of the static actors
outside the current clip region.
Obviously the cost of culling has to be offset against the cost of
painting to determine if it's a win, but our (limited) testing suggests
it should be a win for most applications.
Note: we hope we will be able to also bring another performance bump
from culling with another iteration - hopefully in the 1.6 cycle - to
avoid doing the culling in screen space and instead do it in the stage's
model space. This will hopefully let us minimize the cost of
transforming the actor volumes for culling.
Robert Bragg [Tue, 7 Sep 2010 21:11:28 +0000 (22:11 +0100)]
actor: Use paint volumes to always queue clipped redraws
This makes clutter_actor_queue_redraw transparently use an actor's paint
volume to queue a clipped redraw.
We save the actors paint box each time it is painted so that when
clutter_actor_queue_redraw is called we can determine the old and new
location of the actor so we know the full bounds of what must be redrawn
to clear its old view and show the new.