profile/ivi/clutter.git
13 years agobuild: Only generate bzip2 tarballs
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.

13 years agobuild: Dist every backend file
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.

13 years agocontainer: Do not emit a signal in the class handler
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.

13 years agointrospection: Skip Script.connect_signals_full()
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.

13 years agocontainer: Fix the marshaller for ::child-notify
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.

13 years agobuild: Automate the release process
Emmanuele Bassi [Sun, 3 Oct 2010 13:53:14 +0000 (14:53 +0100)]
build: Automate the release process

13 years agodocs: Update the coding style
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.

13 years agoUpdate zh_CN translation.
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>
13 years agocontainer: Add child_notify() wrapper
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.

13 years agocontainer: Implement ::child-notify
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.

13 years agobuild: Add more metadata to the introspection files
Emmanuele Bassi [Thu, 30 Sep 2010 11:43:10 +0000 (12:43 +0100)]
build: Add more metadata to the introspection files

13 years agocookbook: Remove unused variable from the animator example
Emmanuele Bassi [Thu, 30 Sep 2010 11:32:08 +0000 (12:32 +0100)]
cookbook: Remove unused variable from the animator example

13 years agobuild: Make Cally.gir depend on Cogl.gir
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.

13 years agoMerge remote branch 'elliot/events-buttons'
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

13 years agointrospection: Update to changed variables for header file names
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>
13 years agoactor: sync entry has_clip member to clip state
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>
13 years agoactor: don't ignore clip for clipped redraws
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

13 years agotest-pixmap: add timeout to draw arcs on pixmap
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.

13 years agox11-tfp: Implement get_paint_volume virtual
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

13 years agomaterial: tweak dot file debug code
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.

13 years agocookbook: Add recipe about handling button events
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.

13 years agowin32: Fix the CLUTTER_* keysym macros
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.

13 years agocookbook: Example of using button press and release events
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.

13 years agocookbook: Example of ClutterClickAction
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.

13 years agocookbook: Example of simple handling of 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.

13 years agoWrap g_object_class_install_properties()
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.

13 years agostage: Add more checks on the stage window retrieval
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.

13 years agobuild: Use platform detection to add -no-undefined
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.

13 years agomodules: Use the stable branch of json-glib
Emmanuele Bassi [Wed, 29 Sep 2010 15:46:06 +0000 (16:46 +0100)]
modules: Use the stable branch of json-glib

13 years agocogl-texture-2d-sliced: Don't create the slice textures twice
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.

13 years agoBump up dependency of json-glib to 0.12.0
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.

13 years agoRemove the internal copy of JSON-GLib
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.

13 years agoMerge branch 'wip/non-recursive'
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

13 years agomodules: Fix up mesa module
Emmanuele Bassi [Wed, 29 Sep 2010 14:44:51 +0000 (15:44 +0100)]
modules: Fix up mesa module

13 years agomodules: Add mesa and wayland to the moduleset
Emmanuele Bassi [Wed, 29 Sep 2010 14:23:53 +0000 (15:23 +0100)]
modules: Add mesa and wayland to the moduleset

13 years agoactor: don't dirty pick buffer in _real_queue_redraw
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.

13 years agoactor: Adds private _clutter_actor_traverse API
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.

13 years agoactor: Adds private _clutter_actor_get_n_children
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)

13 years agoactor: explicitly track children in clutter-actor.c
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.

13 years agodebug: fix blue outlines for paint-volumes debug opt
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.

13 years agoclone: Implement get_paint_volume virtual
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.

13 years agoRevert "actor: don't immediately queue redraw when queuing relayout"
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.

13 years agoactor: defer queue-redraw signaling
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.

13 years agopaint_volume: add private api to change reference actor
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.

13 years agopaint_volume: Adds _clutter_paint_volume_set_from_volume
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.

13 years agoactor: don't queue_redraw actors not descended from stage
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.

13 years agopaint-volume: Add convenience function for using an allocation
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.

13 years agotext: Update get_paint_volume() implementation
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.

13 years agoMove default paint volume computation into a function
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.

13 years agopaint_volume: assert non-NULL pv in _volume_copy
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.

13 years agopaint_volume: Splits out clutter_paint_volume code
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.

13 years agoactor: make default get_paint_volume more conservative
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.

13 years agoactor: don't always check needs_allocation for clipped redraw
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.

13 years agoactor: new actors should start with an empty paint box
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.

13 years agoactor: when culling/clipped redraws disable ignore paint box
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.

13 years agostage: only update viewport when allocation changes
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.

13 years agoglx: queue full redraws for the first 2 frames
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.

13 years agox11: minimize nasty artefacts when resizing windows
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.

13 years agox11: Queue clipped redraws for Expose events
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.

13 years agocogl: removes unused _cogl_setup_viewport
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.

13 years agostage: Sometimes really force a full redraw
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.

13 years agoactor: don't immediately queue redraw when queuing relayout
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.

13 years agoUse paint volumes to do automatic culling
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.

13 years agoactor: Use paint volumes to always queue clipped redraws
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.

13 years agoactor: make _transform_and_project_box static
Robert Bragg [Tue, 7 Sep 2010 20:43:50 +0000 (21:43 +0100)]
actor: make _transform_and_project_box static

This makes _clutter_actor_transform_and_project_box a static function
and removes the prototype from clutter-private.h since it is no longer
used outside clutter-actor.c

13 years agoactor: _real_queue_relayout shouldn't queue redraw
Robert Bragg [Tue, 7 Sep 2010 20:47:01 +0000 (21:47 +0100)]
actor: _real_queue_relayout shouldn't queue redraw

The base implementation for the actor queue_relayout method was queuing
an implicit redraw, but there shouldn't be anything implied from the
mere process of queuing a redraw that should force us to queue a redraw.
If actors are moved as a part of relayouting later then they will queue
a redraw.  Also clutter_actor_queue_relayout() still also explicitly
queues a redraw so I think this may have been doubly redundant.

13 years agoactor: re-allocation implies need to redraw
Robert Bragg [Tue, 7 Sep 2010 20:56:33 +0000 (21:56 +0100)]
actor: re-allocation implies need to redraw

If clutter_actor_allocate finds it necessary to update an actors
allocation then it now also queue a redraw of that actor. Currently we
queue redraws for actors very early on when queuing a relayout instead
of waiting to determine the final outcome of relayouting to determine if
a redraw is really required. With this in place we can move away from
preemptive queuing of redraws.

13 years agoactor: separate the queue redraw code
Robert Bragg [Tue, 7 Sep 2010 19:29:01 +0000 (20:29 +0100)]
actor: separate the queue redraw code

clutter_actor_queue_relayout currently queues a relayout and a redraw,
but the plan is to change it to only queue a relayout and honour the
documentation by assuming that the process of relayouting will
result queuing redraws for any actors whos allocation changes.

This doesn't make that change it just adds an internal
_clutter_actor_queue_only_relayout function which
clutter_actor_queue_relayout now uses as well as calling
clutter_actor_queue_redraw.

13 years agostage: make it possible to queue a relayout only
Robert Bragg [Tue, 7 Sep 2010 19:08:00 +0000 (20:08 +0100)]
stage: make it possible to queue a relayout only

This adds a private ->relayout_pending boolean similar in spirit to
redraw_pending. This will allow us to queue a relayout without
implicitly queueing a redraw; instead we can depend on the actions
of a relayout to queue any necessary redraw.

13 years agotexture: Forward queue redraw/relayout for fbos
Robert Bragg [Tue, 7 Sep 2010 18:40:28 +0000 (19:40 +0100)]
texture: Forward queue redraw/relayout for fbos

When clutter_texture_new_from_actor is use we need to track when the
source actor queues a redraw or a relayout so we can also queue a redraw
or relayout for the texture actor.

13 years agoQueue clipped redraws work in terms of paint volumes
Robert Bragg [Tue, 7 Sep 2010 18:31:27 +0000 (19:31 +0100)]
Queue clipped redraws work in terms of paint volumes

There is an internal _clutter_actor_queue_redraw_with_clip API that gets
used for texture-from-pixmap to minimize what we redraw in response to
Damage events. It was previously working in terms of a ClutterActorBox
but it has now been changed so an actor can queue a redraw of volume
instead.

The plan is that clutter_actor_queue_redraw will start to transparently
use _clutter_actor_queue_redraw_with_clip when it can determine a paint
volume for the actor.

13 years agoblur-effect: fix paint volume padding
Robert Bragg [Tue, 7 Sep 2010 18:07:19 +0000 (19:07 +0100)]
blur-effect: fix paint volume padding

For the blur effect we use a BLUR_PADDING constant to pad out the volume
of the source actor on the x and y axis. Previously we were offsetting
the origin negatively using BLUR_PADDING and then adding BLUR_PADDING
to the width and height, but we should have been adding 2*BLUR_PADDING
instead.

13 years agodebug: CLUTTER_DEBUG_REDRAWS: disable clipped redraws
Robert Bragg [Tue, 7 Sep 2010 22:07:52 +0000 (23:07 +0100)]
debug: CLUTTER_DEBUG_REDRAWS: disable clipped redraws

This ensures that clipped redraws are disabled when using
CLUTTER_PAINT=redraws. This may seem unintuitive given that this option
is for debugging clipped redraws, but we can't draw an outline outside
the clip region and anything we draw inside the clip region is liable to
leave a trailing mess on the screen since it won't be cleared up by
later clipped redraws.

13 years agopaint volumes: CLUTTER_PAINT=paint-volumes debug option
Robert Bragg [Tue, 7 Sep 2010 17:50:29 +0000 (18:50 +0100)]
paint volumes: CLUTTER_PAINT=paint-volumes debug option

This adds a debug option to visualize the paint volumes of all actors.
When CLUTTER_PAINT=paint-volumes is exported in the environment before
running a Clutter application then all actors will have their bounding
volume drawn in green with a label corresponding to the actors type.

13 years agopaint volumes: another pass at the design
Robert Bragg [Tue, 7 Sep 2010 17:04:19 +0000 (18:04 +0100)]
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.

13 years agoactor-box: Adds clutter_actor_box_union utility
Robert Bragg [Thu, 19 Aug 2010 14:38:15 +0000 (15:38 +0100)]
actor-box: Adds clutter_actor_box_union utility

When using ClutterActorBoxs for representing clip regions it can be
convenient to be able to union multiple boxes together.

13 years agotexture: size fbos using clutter_actor_get_paint_box
Robert Bragg [Thu, 19 Aug 2010 14:26:19 +0000 (15:26 +0100)]
texture: size fbos using clutter_actor_get_paint_box

Previously we used the transformed allocation but that doesn't take
into account actors with depth which may be projected outside the
area covered by the transformed allocation.

13 years agodocs: Add PaintVolume to the API reference
Emmanuele Bassi [Thu, 19 Aug 2010 14:27:51 +0000 (15:27 +0100)]
docs: Add PaintVolume to the API reference

And document the various related functions.

13 years agoblur-effect: Add padding to account for the blur
Emmanuele Bassi [Thu, 19 Aug 2010 13:06:52 +0000 (14:06 +0100)]
blur-effect: Add padding to account for the blur

The blur effect will sample pixels on the edges of the offscreen buffer,
so we want to add a padding to avoid clamping the blur.

We do this by creating a larger target texture, and updating the paint
volume of the actor during paint to take that padding into account.

13 years agooffscreen-effect: Use the paint box to size the FBO
Emmanuele Bassi [Thu, 19 Aug 2010 13:05:45 +0000 (14:05 +0100)]
offscreen-effect: Use the paint box to size the FBO

We should be using the real, on-screen, transformed size of the actor to
size and position the offscreen buffer we use to paint the actor for an
effect.

13 years agoeffect: Allow any effect to override the paint volume
Emmanuele Bassi [Mon, 16 Aug 2010 16:02:15 +0000 (17:02 +0100)]
effect: Allow any effect to override the paint volume

An Effect implementation might override the paint volume of the actor to
which it is applied to. The get_paint_volume() virtual function should
be added to the Effect class vtable so that any effect can get the
current paint volume and update it.

The clutter_actor_get_paint_volume() function becomes context aware, and
does the right thing if called from within a ClutterEffect pre_paint()
or post_paint() implementation, by allowing all effects in the chain up
to the caller to modify the paint volume.

13 years agoactor: Allow querying the paint volume
Emmanuele Bassi [Mon, 16 Aug 2010 14:53:28 +0000 (15:53 +0100)]
actor: Allow querying the paint volume

An actor has an implicit "paint volume", that is the volume in 3D space
occupied when painting itself.

The paint volume is defined as a cuboid with the origin placed at the
top-left corner of the actor; the size of the cuboid is given by three
vectors: width, height and depth.

ClutterActor provides API to convert the paint volume into a 2D box in
screen coordinates, to compute the on-screen area that an actor will
occupy when painted.

Actors can override the default implementation of the get_paint_volume()
virtual function to provide a different volume.

13 years agobuild: Start moving to a non-recursive layout
Emmanuele Bassi [Mon, 13 Sep 2010 10:30:30 +0000 (11:30 +0100)]
build: Start moving to a non-recursive layout

        *** WARNING: THIS COMMIT CHANGES THE BUILD ***

Do not recurse into the backend directories to build private, internal
libraries.

We only recurse from clutter/ into the cogl sub-directory; from there,
we don't recurse any further. All the backend-specific code in Cogl and
Clutter is compiled conditionally depending on the macros defined by the
configure script.

We still recurse from the top-level directory into doc, clutter and
tests, because gtk-doc and tests do not deal nicely with non-recursive
layouts.

This change makes Clutter compile slightly faster, and cleans up the
build system, especially when dealing with introspection data.

Ideally, we also want to make Cogl part of the top-level build, so that
we can finally drop the sed trick to change the shared library from the
GIR before compiling it.

Currently disabled:

  ‣ OSX backend
  ‣ Fruity backend

Currently enabled but untested:

  ‣ EGL backend
  ‣ Windows backend

13 years agocally: Do not use deprecated functions
Emmanuele Bassi [Wed, 29 Sep 2010 13:10:38 +0000 (14:10 +0100)]
cally: Do not use deprecated functions

The function g_strcasecmp() has been deprecated since GLib 2.2.

13 years agoanimator: Code style fixes
Emmanuele Bassi [Wed, 29 Sep 2010 10:44:46 +0000 (11:44 +0100)]
animator: Code style fixes

13 years agoClutterAnimator doesn't ref timeline properly
Stephen Kennedy [Wed, 29 Sep 2010 09:56:48 +0000 (10:56 +0100)]
ClutterAnimator doesn't ref timeline properly

ClutterAnimator currently has a number of bugs related to its
referencing of its internal timeline.

1) The default timeline created in _init is not unreffed (it appears the
programmer has wrongly thought ClutterTimeline has a floating reference
based on the use of g_object_ref_sink in _set_timeline)

2) The timeline and slave_timeline vars are unreffed in finalize instead
of dispose

3) The signal handlers set up in _set_timeline are not disconnected when
the animator is disposed

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
13 years agoAdd a conformance test for clutter_actor_contains
Neil Roberts [Mon, 27 Sep 2010 21:17:12 +0000 (22:17 +0100)]
Add a conformance test for clutter_actor_contains

This adds a conformance test for clutter_actor_contains to assert that
it gets the expected results for the given tree of actors.

13 years agoSimplify the loop for clutter_actor_contains
Neil Roberts [Mon, 27 Sep 2010 16:51:01 +0000 (17:51 +0100)]
Simplify the loop for clutter_actor_contains

This reorganizes the loop for clutter_actor_contains so that it is a
for loop rather than a while loop. Although this is mostly just
nitpicking, I think this change could make the loop slightly faster if
not optimized because it doesn't perform the self == descendant check
twice and it is clearer.

13 years agoDocument what happens when self==descendant in clutter_actor_contains
Neil Roberts [Mon, 27 Sep 2010 16:47:38 +0000 (17:47 +0100)]
Document what happens when self==descendant in clutter_actor_contains

The documentation for clutter_actor_contains didn't specify what
happens when self==descendant. A strict reading of it might lead you
to think that it would return FALSE because in that case the
descendant isn't an immediate child or a deeper descendant. The code
actually would return TRUE. I think this is more useful so this patch
fixes the docs rather than the code.

13 years agoPost-branch version bump to 1.5.1
Emmanuele Bassi [Mon, 27 Sep 2010 15:46:26 +0000 (16:46 +0100)]
Post-branch version bump to 1.5.1

13 years agodoap: Remove mallum from the maintainers list
Emmanuele Bassi [Sun, 26 Sep 2010 17:48:04 +0000 (18:48 +0100)]
doap: Remove mallum from the maintainers list

13 years agoactor: Dispose all constrains
Emmanuele Bassi [Sun, 26 Sep 2010 15:52:58 +0000 (16:52 +0100)]
actor: Dispose all constrains

We are leaking the ClutterMetaGroup with all the constraints when
disposing an Actor.

13 years agojson: Allow NULL as a value for strings, arrays and objects
Emmanuele Bassi [Sat, 25 Sep 2010 19:23:41 +0000 (20:23 +0100)]
json: Allow NULL as a value for strings, arrays and objects

We should not warn when asking for a string, array or object if the
contents were 'null'.

Patch from JSON-GLib.

13 years agotest-clutter-units: Force a known resolution to avoid fuzzyness
Emmanuele Bassi [Fri, 24 Sep 2010 15:21:06 +0000 (16:21 +0100)]
test-clutter-units: Force a known resolution to avoid fuzzyness

Instead of taking the current resolution, whatever it may be, use a
known DPI. This should alleviate fuzzyness and create consistent
results.

13 years agoPost-release version bump to 1.4.1
Emmanuele Bassi [Fri, 24 Sep 2010 14:25:15 +0000 (15:25 +0100)]
Post-release version bump to 1.4.1

13 years agoRelease 1.4.0 (stable)
Emmanuele Bassi [Fri, 24 Sep 2010 14:07:17 +0000 (15:07 +0100)]
Release 1.4.0 (stable)

13 years agocookbook: Reduce complexity of sample ClutterAnimator code for recipe
Elliot Smith [Fri, 24 Sep 2010 13:48:53 +0000 (14:48 +0100)]
cookbook: Reduce complexity of sample ClutterAnimator code for recipe

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
13 years agoanimator: fix removal of all keys
Øyvind Kolås [Fri, 24 Sep 2010 12:28:08 +0000 (13:28 +0100)]
animator: fix removal of all keys

When removing all keys in a ClutterAnimator, the hash table with
object/property name pairs went out of sync. This change makes
the animator always clear this hash table upon key-removal; and
refreshing it if the animator's timeline is running.

Fixes bug #2335

13 years agomaterial: Don't prune ancestry if it owns some layers
Robert Bragg [Thu, 23 Sep 2010 21:18:42 +0000 (22:18 +0100)]
material: Don't prune ancestry if it owns some layers

Each time a material property changes we look to see if any of its
ancestry has become redundant and if so we prune that redundant
ancestry.

There was a problem with the logic that handles this though because we
weren't considering that a material which is a layer state authority may
still defer to ancestors to define the state of individual layers.

For example a material that derives from a parent with 5 layers can
become a STATE_LAYERS authority by simply changing it's ->n_layers count
to 4 and in that case it can still defer to its ancestors to define the
state of those 4 layers.

This patch checks first if a material is a layer state authority and if
so only tries to prune its ancestry if it also *owns* all the individual
layers it depends on. (I.e. if g_list_length
(material->layer_differences) != material->n_layers then it's not safe
to try pruning its ancestry!)

http://bugzilla-attachments.gnome.org/attachment.cgi?id=170907

13 years agocogl-framebuffer.c: GL_DEPTH_STENCIL not supported in gles
Jammy Zhou [Tue, 21 Sep 2010 03:37:52 +0000 (11:37 +0800)]
cogl-framebuffer.c: GL_DEPTH_STENCIL not supported in gles

There is GL_INVALID_ENUM error for GL_DEPTH_STENCIL when call
glRenderbufferStorage() with OpenGL ES backend. So enable this
only for OpenGL backend.

Signed-off-by: Robert Bragg <robert@linux.intel.com>