profile/ivi/clutter.git
13 years agopo: Add French localization
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>
13 years agoclutter.modules: Update Cairo and Pixman
Emmanuele Bassi [Tue, 5 Oct 2010 13:30:01 +0000 (14:30 +0100)]
clutter.modules: Update Cairo and Pixman

13 years agotexture: Fix the typos in the blurbs and make them not end with '.'
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.

13 years agotext: Rename the nick of the position property "Cursor Position"
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.

13 years agocogl: Use Cogl (not COGL) consistently
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.

13 years agobin-layer: Fix the property blurbs
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.

13 years agobox-layout: Fix missing spaces in the blurbs of vertical and homogeneous
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

13 years agodeform-effect: Fix Horiontal/Horizontal typo
Damien Lespiau [Mon, 4 Oct 2010 16:20:30 +0000 (17:20 +0100)]
deform-effect: Fix Horiontal/Horizontal typo

13 years agobuild: Fix the release-message target
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.

13 years agopo: Add Indonesian localization
Andika Triwidada [Mon, 4 Oct 2010 14:43:54 +0000 (15:43 +0100)]
po: Add Indonesian localization

13 years agopo: Update Polish localization
Piotr Drąg [Mon, 4 Oct 2010 14:43:16 +0000 (15:43 +0100)]
po: Update Polish localization

13 years agoPost-release version bump to 1.5.3
Emmanuele Bassi [Mon, 4 Oct 2010 14:20:44 +0000 (15:20 +0100)]
Post-release version bump to 1.5.3

13 years agoRelease Clutter 1.5.2 (snapshot)
Emmanuele Bassi [Mon, 4 Oct 2010 13:53:55 +0000 (14:53 +0100)]
Release Clutter 1.5.2 (snapshot)

13 years agocogl-x11: Trap glXDestroyPixmap()
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

13 years agoFixing cally.pc.in and moving include headers to previous directory
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>
13 years agoeffect: Fix up the class ABI
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.

13 years agoactor-box: Constify arguments for union
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.

13 years agodocs: Fix the annotations of ActorClass
Emmanuele Bassi [Mon, 4 Oct 2010 10:26:46 +0000 (11:26 +0100)]
docs: Fix the annotations of ActorClass

13 years agobuild: Add -xobjective-c to the fruity backend section
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.

13 years agodocs: Remove TODO
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.

13 years agobuild: Remove redundant EXTRA_DISTs
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.

13 years agodocs: Add unused symbols to the Clutter API reference
Emmanuele Bassi [Mon, 4 Oct 2010 08:08:07 +0000 (09:08 +0100)]
docs: Add unused symbols to the Clutter API reference

13 years agobuild: Unconditionally add GLES2 shaders to EXTRA_DIST
Emmanuele Bassi [Mon, 4 Oct 2010 07:57:29 +0000 (08:57 +0100)]
build: Unconditionally add GLES2 shaders to EXTRA_DIST

13 years agobuild: Generate a stub announcement email when releasing
Emmanuele Bassi [Sun, 3 Oct 2010 16:21:10 +0000 (17:21 +0100)]
build: Generate a stub announcement email when releasing

13 years agodocs: Update the RELEASING checklist
Emmanuele Bassi [Sun, 3 Oct 2010 15:37:41 +0000 (16:37 +0100)]
docs: Update the RELEASING checklist

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.