profile/ivi/clutter.git
13 years agobuild: Fix typo in the docs URI variable name
Emmanuele Bassi [Thu, 7 Apr 2011 14:07:43 +0000 (15:07 +0100)]
build: Fix typo in the docs URI variable name

13 years agoUpdated Spanish translation
Daniel Mustieles [Wed, 6 Apr 2011 17:49:41 +0000 (19:49 +0200)]
Updated Spanish translation

13 years agocogl-pango-glyph-cache: Fix the flags passed to cogl_atlas_new
Neil Roberts [Wed, 6 Apr 2011 14:24:33 +0000 (15:24 +0100)]
cogl-pango-glyph-cache: Fix the flags passed to cogl_atlas_new

In 047227fb cogl_atlas_new was changed so that it can take a flags
parameter to specify whether to clear the new atlases and whether to
copy images to the new atlas after reorganisation. This was done so
that the atlas code could be shared with the glyph cache. At some
point during the development of this patch the flag was just a single
boolean instead and this is accidentally how it is used from the glyph
cache. The glyph cache therefore passes 'TRUE' as the set of flags
which means it will only get the 'clear' flag and not the
'disable-migration' flag. When the glyph cache gets full it will
therefore try to copy the texture to the new atlas as well as
redrawing them with cairo. This causes problems because the glyph
cache needs to work in situations where there is no FBO support.

13 years ago[l10n] Updated German translation
Christian Kirbach [Tue, 5 Apr 2011 19:17:03 +0000 (21:17 +0200)]
[l10n] Updated German translation

13 years agocogl-pipeline: Be careful not to take ownership of root layer
Neil Roberts [Tue, 5 Apr 2011 16:30:29 +0000 (17:30 +0100)]
cogl-pipeline: Be careful not to take ownership of root layer

In _cogl_pipeline_prune_empty_layer_difference if the layer's parent
has no owner then it just takes ownership of it. However this could
theoretically end up taking ownership of the root layer because
according to the comment above in the same function that should never
have an owner. This patch just adds an extra check to ensure that the
unowned layer has a parent.

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

13 years agopipeline: reclaim ownership if reverting to layer ancestor
Robert Bragg [Tue, 5 Apr 2011 16:01:24 +0000 (17:01 +0100)]
pipeline: reclaim ownership if reverting to layer ancestor

In _cogl_pipeline_prune_empty_layer_difference if we are reverting to
the immediate parent of an empty/redundant layer then it is not enough
to simply add a reference to the pipeline's ->layer_differences list
without also updating parent_layer->owner to point back to its new
owner.

This oversight was leading us to break the invariable that all layers
referenced in layer_differences have an owner and was also causing us to
break another invariable whereby after calling
_cogl_pipeline_layer_pre_change_notify the returned layer must always be
owned by the given 'required_owner'.

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

13 years agobuild: Cosmetic fixes for release targets
Emmanuele Bassi [Tue, 5 Apr 2011 10:24:03 +0000 (11:24 +0100)]
build: Cosmetic fixes for release targets

• Use $(SED) and $(GREP) consistently
• Do not point to the template README.in
• Eliminate the '===' separator in the NEWS extractor
• List all download URIs for the tarballs

13 years agobuild: Fix remote docs URI in the release-message
Emmanuele Bassi [Mon, 4 Apr 2011 22:16:46 +0000 (23:16 +0100)]
build: Fix remote docs URI in the release-message

13 years agobuild: Generate the release announcement
Emmanuele Bassi [Mon, 4 Apr 2011 21:34:10 +0000 (22:34 +0100)]
build: Generate the release announcement

Update the release-message target to generate the full release
announcement out of the standard blurb and the NEWS file. We use
a pretty evil sed incantation, courtesy of Neil Roberts.

13 years agobuild: Look for sed
Emmanuele Bassi [Mon, 4 Apr 2011 21:33:31 +0000 (22:33 +0100)]
build: Look for sed

Use AC_PROG_SED to find sed in a portable way.

13 years agodoap: Update the project information
Emmanuele Bassi [Mon, 4 Apr 2011 14:33:24 +0000 (15:33 +0100)]
doap: Update the project information

Update the location for repository and bugzilla, and redistribute the
blame^Wmaintainership.

13 years agobuild: Fix typo in Makefile.am.release
Emmanuele Bassi [Mon, 4 Apr 2011 14:11:20 +0000 (15:11 +0100)]
build: Fix typo in Makefile.am.release

13 years agooffscreen: Plug a leak in an error path
Emmanuele Bassi [Mon, 4 Apr 2011 13:42:36 +0000 (14:42 +0100)]
offscreen: Plug a leak in an error path

When creating a CoglOffscreen we take a reference on the texture handle,
but in case of error we never release it.

We should take that reference only on success.

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

13 years agoosx: Do not unrealize on hide
Emmanuele Bassi [Sat, 2 Apr 2011 21:36:38 +0000 (22:36 +0100)]
osx: Do not unrealize on hide

Calling unrealize on ClutterStage::hide will cause an assertion
failure and other badness when we destroy the stage.

13 years agoglx: throttle clipped redraws
Robert Bragg [Fri, 1 Apr 2011 17:36:56 +0000 (18:36 +0100)]
glx: throttle clipped redraws

When we come to presenting the result of a clipped redraw to the front
buffer with a blit we need to ensure that all the rendering is done,
otherwise redraw operations that are slower than the framerate can queue
up in the pipeline during a heavy animation, causing a larger and larger
backlog of rendering visible as lag to the user.

Note: Since calling glFinish() and sycnrhonizing the CPU with the GPU is
far from ideal, we hope that this is only a short term solution.

One idea is to using sync objects to track render completion so we can
throttle the backlog (ideally with an additional extension that lets us
get notifications in our mainloop instead of having to busy wait for the
completion.)

Another option is to support clipped redraws by reusing the contents of
old back buffers such that we can flip instead of using a blit and then
we can use GLX_INTEL_swap_events to throttle. For this though we would
still probably want an additional extension so we can report the limited
region of the window damage to X/compositors.

Thanks to Owen Taylor and Alexander Larsson for reporting the problem.

13 years agoUpdated Slovenian translation
Andrej Žnidaršič [Fri, 1 Apr 2011 16:57:01 +0000 (18:57 +0200)]
Updated Slovenian translation

13 years agoUpdated Slovenian translation
Andrej Žnidaršič [Fri, 1 Apr 2011 16:50:58 +0000 (18:50 +0200)]
Updated Slovenian translation

13 years agoRemoves the addition of the .exe extension to unit-test scripts, on win32.
Samuel Degrande [Fri, 25 Mar 2011 11:49:44 +0000 (12:49 +0100)]
Removes the addition of the .exe extension to unit-test scripts, on win32.

On win32, test scripts are created with a .exe extension.
Under mingw, a .exe script is launched in 16 bit compatibility mode (through
ntvdm), and so it just does not run.

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

13 years agobuild: Update the release rules
Emmanuele Bassi [Fri, 1 Apr 2011 15:31:49 +0000 (16:31 +0100)]
build: Update the release rules

13 years agoalign-constraint: Fix typo in the vertical align
Emmanuele Bassi [Fri, 1 Apr 2011 14:36:22 +0000 (15:36 +0100)]
align-constraint: Fix typo in the vertical align

We're clamping the x1 coordinate to the nearest pixel, instead of doing
so for the y1 coordinate.

13 years agopaint-volume: Zero-sized actors don't have paint volume
Emmanuele Bassi [Fri, 1 Apr 2011 10:43:34 +0000 (11:43 +0100)]
paint-volume: Zero-sized actors don't have paint volume

If an actor has an allocated dimension equal to 0 then it has no paint
volume.

13 years agotexture: Add some safeguards for paint volumes of empty textures
Emmanuele Bassi [Fri, 1 Apr 2011 10:42:41 +0000 (11:42 +0100)]
texture: Add some safeguards for paint volumes of empty textures

If the Texture has no material, and the image size is 0x0 then the actor
doesn't have any paint volume.

13 years agopo: Update the PO files
Emmanuele Bassi [Thu, 31 Mar 2011 16:12:13 +0000 (17:12 +0100)]
po: Update the PO files

13 years agopo: Track Clutter's POT file in Git
Emmanuele Bassi [Thu, 31 Mar 2011 16:07:08 +0000 (17:07 +0100)]
po: Track Clutter's POT file in Git

If no POT file is found, gettext will automatically create it; this, in
turn, will cause msgmerge to be run, and that will cause the PO files to
be touched and changed at the very first call for `make`.

Having the PO files with unstaged changes will ultimately lead to merge
issues will pulling from the remote repository between releases - unless
`git checkout -f` is called prior to `git pull -r`.

I think intltool only has some rule to avoid that from happening unless
on dist, but I have no intention of dragging intltool into the build of
a library that barely has localized messages.

13 years agoAdded Slovenian translation
Matej Urbančič [Wed, 30 Mar 2011 16:36:42 +0000 (18:36 +0200)]
Added Slovenian translation

13 years agoImported translations from Transifex.net
Piotr Drąg [Tue, 29 Mar 2011 15:40:50 +0000 (17:40 +0200)]
Imported translations from Transifex.net

13 years agoUpdated Polish translation
Piotr Drąg [Tue, 29 Mar 2011 15:25:11 +0000 (17:25 +0200)]
Updated Polish translation

13 years agoUpdated POTFILES.in and removed clutter-1.0.pot
Piotr Drąg [Tue, 29 Mar 2011 13:11:30 +0000 (15:11 +0200)]
Updated POTFILES.in and removed clutter-1.0.pot

13 years agomoduleset: Some modules have been moved to gnome.org
Emmanuele Bassi [Mon, 28 Mar 2011 17:36:33 +0000 (18:36 +0100)]
moduleset: Some modules have been moved to gnome.org

So we need to update the moduleset.

13 years agobuild: Fix previous commit
Emmanuele Bassi [Thu, 24 Mar 2011 14:13:59 +0000 (14:13 +0000)]
build: Fix previous commit

The previous commit broke the backend-specific required pkg-config
packages.

13 years agobuild: Remove bash-isms
Emmanuele Bassi [Tue, 22 Mar 2011 17:18:07 +0000 (17:18 +0000)]
build: Remove bash-isms

13 years agobuild: Use AC_CANONICAL_HOST
Emmanuele Bassi [Tue, 22 Mar 2011 17:10:49 +0000 (17:10 +0000)]
build: Use AC_CANONICAL_HOST

Since we're checking the value of the $host variable, it's a good idea
to use the canonicalization support in autoconf.

13 years agodoap: Fix the categories
Emmanuele Bassi [Tue, 22 Mar 2011 14:46:35 +0000 (14:46 +0000)]
doap: Fix the categories

13 years agodrag-action: Fix a compiler warning
Emmanuele Bassi [Mon, 21 Mar 2011 12:41:40 +0000 (12:41 +0000)]
drag-action: Fix a compiler warning

Use arguments of the right signedness when passing pointers.

13 years agoMerge remote-tracking branch 'elliot/cookbook-effects-basic'
Emmanuele Bassi [Mon, 21 Mar 2011 12:34:41 +0000 (12:34 +0000)]
Merge remote-tracking branch 'elliot/cookbook-effects-basic'

* elliot/cookbook-effects-basic:
  docs: Remove checks for whether an effect is disabled
  docs: Add recipe about implementing a ClutterEffect
  docs: Add example of setting background color with ClutterEffect
  docs: Add example of a border added through ClutterEffect

13 years agoclutter-clone: Make clutter_clone_get_paint_volume static
Neil Roberts [Fri, 18 Mar 2011 14:09:57 +0000 (14:09 +0000)]
clutter-clone: Make clutter_clone_get_paint_volume static

clutter_clone_get_paint_volume was being exported from the shared
library because the function wasn't declared static. This function
shouldn't be exposed because it should be accessed through
clutter_actor_get_paint_volume.

13 years agodocs: Remove checks for whether an effect is disabled
Elliot Smith [Thu, 17 Mar 2011 15:45:57 +0000 (15:45 +0000)]
docs: Remove checks for whether an effect is disabled

pre_paint() and post_paint() implementations don't need
to check whether an effect is disabled: Clutter will
not apply an effect unless it is enabled.

So remove code which checks whether the effect is
enabled or disabled from the example applications and the
documentation.

13 years agodocs: Add recipe about implementing a ClutterEffect
Elliot Smith [Wed, 16 Mar 2011 17:44:44 +0000 (17:44 +0000)]
docs: Add recipe about implementing a ClutterEffect

Add a recipe showing how to implement two simple
effects, based on ClutterEffect: an always gray background,
and a border with configurable width and color.

Also explains the necessity to queue a redraw on
the associated actor if the effect's properties change,
and shows how to implement that.

The example gives the GObject code for both effects,
as well as an example application showing how to use them.
The example also demonstrates how to disable/enable an effect,
making the border round an actor togglable.

13 years agodocs: Add example of setting background color with ClutterEffect
Elliot Smith [Tue, 8 Mar 2011 14:54:00 +0000 (14:54 +0000)]
docs: Add example of setting background color with ClutterEffect

Add example of a simple background color effect applied via
pre_paint() implementation in a ClutterEffect subclass.

This is a simple effect with an incomplete GObject
implementation (no properties, setters or getters)
to make it as easy to follow as possible.

13 years agodocs: Add example of a border added through ClutterEffect
Elliot Smith [Tue, 8 Mar 2011 11:19:13 +0000 (11:19 +0000)]
docs: Add example of a border added through ClutterEffect

Add a basic example showing how to implement a ClutterEffect
post_paint() function to overlay a highlight border over a
rectangular actor.

13 years agoclutter-offscreen-effect: Paint with 'nearest' texture filter mode
Neil Roberts [Tue, 15 Mar 2011 16:20:34 +0000 (16:20 +0000)]
clutter-offscreen-effect: Paint with 'nearest' texture filter mode

The texture containing the image for the redirected actor will always
be painted at a 1:1 texel:pixel ratio so there's no need to use linear
filtering. This should also counteract some of the effects of rounding
errors when calculating the geometry for the quad.

13 years agodocs: Update RELEASING
Emmanuele Bassi [Mon, 14 Mar 2011 16:02:13 +0000 (16:02 +0000)]
docs: Update RELEASING

13 years agomingw-fetch-dependencies.sh: Add a wrapper for pkg-config
Neil Roberts [Wed, 16 Mar 2011 12:27:22 +0000 (12:27 +0000)]
mingw-fetch-dependencies.sh: Add a wrapper for pkg-config

On a Fedora system (and maybe others) there is a wrapper script called
i686-pc-mingw32-pkg-config. This script unsets the PKG_CONFIG_PATH
variable and then sets the PKG_CONFIG_LIBDIR variable so that it won't
pick up the native system .pc files. This breaks cross compiling in
mingw-fetch-dependencies.sh because it ends up removing its attempts
to set a local search path.

To fix this, the mingw-fetch-dependencies script now generates its own
wrapper script which instead sets PKG_CONFIG_LIBDIR to the local
clutter-cross prefix and then runs the original pkg-config program
from the search path. This should have the same benefit of preventing
it from finding native system .pc files on systems that don't provide
a cross pkg-config. The cross compiling for json-glib and the
recommend args to pass to configure when building clutter are updated
to set the PKG_CONFIG varible to point to this wrapper script.

13 years agowin32: remove env.sh generated by mingw-fetch-dependencies.sh
Robert Bragg [Tue, 15 Mar 2011 23:28:27 +0000 (23:28 +0000)]
win32: remove env.sh generated by mingw-fetch-dependencies.sh

Since there is very little now left in the env.sh file generated by
mingw-fetch-dependencies.sh it can be removed. What remained (The
CFLAGS="-mms-bitfields" and PKG_CONFIG_PATH=$ROOT_DIR/lib/pkgconfig) can
simply be passed explicitly when calling ./configure.

13 years agowin32: remove deprecated -mno-cygwin options from env.sh
Robert Bragg [Tue, 15 Mar 2011 22:47:20 +0000 (22:47 +0000)]
win32: remove deprecated -mno-cygwin options from env.sh

This removes the use of -mno-cygwin from our generated env.sh for cross
compiling with mingw.

I don't know that anyone is building clutter under cygwin, and our
BuildingClutterOnWindows wiki page only describes building with msys not
cygwin so I think its fair to assume that this build configuration is
untested and thus not supported by us currently. Since the -mno-cygwin
option is deprecated it could well be that there is a better
cross-compilation solution available for cygwin these days if you want
to build programs that don't depend on cygwin libraries.

13 years agowin32: Strip unneeded flags from env.sh
Robert Bragg [Tue, 15 Mar 2011 22:37:04 +0000 (22:37 +0000)]
win32: Strip unneeded flags from env.sh

This remove CXXFLAGS since we don't have any c++ code in Clutter and
also removes the redundant -L$ROOT_DIR/lib from LDFLAGS and
-I$ROOT_DIR/include from CPPFLAGS and CFLAGS. (These should get added by
pkg-config)

13 years agowin32: Add blurb at end of mingw helper script
Robert Bragg [Tue, 15 Mar 2011 22:19:08 +0000 (22:19 +0000)]
win32: Add blurb at end of mingw helper script

This adds some blurb at the end the mingw-fetch-dependencies.sh script
that gives an example of how to go on and build clutter after fetching
all dependencies.

13 years agowin32: support building json-glib in mingw script
Robert Bragg [Tue, 15 Mar 2011 21:58:15 +0000 (21:58 +0000)]
win32: support building json-glib in mingw script

Since Tor does not currently provide win32 binaries for json-glib we
need to cross compile it before we can build clutter. This extends
mingw-fetch-dependencies.sh so it can fetch, unpack and cross-compile
json-glib into the same prefix as the binary dependencies.

13 years agowin32: don't set CC,CPP,AR,NM,LD etc in mingw env.sh
Robert Bragg [Tue, 15 Mar 2011 20:17:21 +0000 (20:17 +0000)]
win32: don't set CC,CPP,AR,NM,LD etc in mingw env.sh

It shouldn't be necessary to explicitly override CC,CPP,AR,NM,LD etc in
the env.sh helper script that mingw-fetch-dependencies.sh generates.
Clutter's ./configure script should figure all of those out for us.

13 years agowin32: remove automatic build option from mingw script
Robert Bragg [Tue, 15 Mar 2011 20:04:15 +0000 (20:04 +0000)]
win32: remove automatic build option from mingw script

This removes the "Do you want to checkout and build Clutter?" option
from the mingw-cross-compile.sh script and renames the script
mingw-fetch-dependencies.sh

As it stands the mingw-cross-compile.sh script isn't enough to fetch all
the dependencies for building clutter, since Tor doesn't provide binaries
for json-glib so the option to checkout and build clutter can't work.

Also it doesn't seem ideal to clone a fresh clutter repo instead of
being able to compile the source of the current repo.

13 years agowin32: mkdir -p win32 needed for out of tree builds
Robert Bragg [Tue, 15 Mar 2011 19:37:26 +0000 (19:37 +0000)]
win32: mkdir -p win32 needed for out of tree builds

if cross compiling clutter using mingw using an out of tree build
directory then a pre-requisite for creating the resources.o file
containing the transparent cursor is for the win32 directory itself to
be created at $(top_builddir)/clutter/win32.

13 years agocogl: Use GHookList instead of CoglCallbackList
Neil Roberts [Mon, 14 Mar 2011 17:58:31 +0000 (17:58 +0000)]
cogl: Use GHookList instead of CoglCallbackList

glib already has a data type to manage a list of callbacks called a
GHookList so we might as well use it instead of maintaining Cogl's own
type. The glib version may be slightly more efficient because it
avoids using a GList and instead encodes the prev and next pointers
directly in the GHook structure. It also has more features than
CoglCallbackList.

13 years agoclutter.doap: Add my gnome userid
Emmanuele Bassi [Mon, 14 Mar 2011 14:17:14 +0000 (14:17 +0000)]
clutter.doap: Add my gnome userid

Not strictly needed, since we're not hosted on GNOME, but it can still
be useful when extracting meta-data from the DOAP file.

13 years agoAUTHORS: Note that the file is unmaintained
Emmanuele Bassi [Mon, 14 Mar 2011 14:16:16 +0000 (14:16 +0000)]
AUTHORS: Note that the file is unmaintained

The list of authors can be extracted from the Git log; the AUTHORS file
is maintained for mere historical reasons.

13 years agoREADME.md: fix a dumb typo
Emmanuele Bassi [Mon, 14 Mar 2011 14:00:12 +0000 (14:00 +0000)]
README.md: fix a dumb typo

13 years agoAdd MarkDown version of the README
Emmanuele Bassi [Mon, 14 Mar 2011 13:57:26 +0000 (13:57 +0000)]
Add MarkDown version of the README

13 years agostage: handle ACCEPT_FOCUS in set_/get_property
Øyvind Kolås [Fri, 11 Mar 2011 17:09:59 +0000 (17:09 +0000)]
stage: handle ACCEPT_FOCUS in set_/get_property

13 years agoculling: Don't cull actors not being painted on the stage
Robert Bragg [Thu, 10 Mar 2011 18:51:51 +0000 (18:51 +0000)]
culling: Don't cull actors not being painted on the stage

Previously we were applying the culling optimization to any actor
painted without considering that we may be painting to an offscreen
framebuffer where the stage clip isn't applicable.

For now we simply expose a getter for the current draw framebuffer
and we can assume that a return value of NULL corresponds to the
stage.

Note: This will need to be updated as stages start to be backed by real
CoglFramebuffer objects and so we won't get NULL in those cases.

13 years agodebug: Add more CLIPPING debug notes
Robert Bragg [Thu, 10 Mar 2011 18:50:23 +0000 (18:50 +0000)]
debug: Add more CLIPPING debug notes

To give quick visibility to the things going on relating to clipping and
culling this adds some more CLIPPING debug notes to clutter-actor.c and
clutter-stage.c

13 years agoculling: check volume->is_empty before ->is_complete
Robert Bragg [Thu, 10 Mar 2011 13:42:11 +0000 (13:42 +0000)]
culling: check volume->is_empty before ->is_complete

As documented in cogl-pipeline-private.h, there is a precedence to the
ClutterPaintVolume bitfields that should be considered whenever we
implement code that manipulates PaintVolumes...

Firstly if ->is_empty == TRUE then the values for ->is_complete and
->is_2d are undefined, so we should typically check ->is_empty as the
first priority.

This fixes a bug in _clutter_paint_volume_cull() whereby we were
checking pv->is_complete before checking pv->is_empty which was
resulting in assertions for actors with no size.

13 years agocogl-clip-state: Adapt to experimental cogl2 API.
Jasper St. Pierre [Wed, 2 Mar 2011 17:45:25 +0000 (12:45 -0500)]
cogl-clip-state: Adapt to experimental cogl2 API.

The current clip state implementation couldn't be used in
conjunction with the CoglPath experimental API.

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

Signed-off-by: Neil Roberts <neil@linux.intel.com>
13 years agocogl-path: Optimise paths that are just a rectangle
Neil Roberts [Wed, 9 Mar 2011 17:46:23 +0000 (17:46 +0000)]
cogl-path: Optimise paths that are just a rectangle

Drawing and clipping to paths is generally quite expensive because the
geometry has to be tessellated into triangles in a single VBO which
breaks up the journal batching. If we can detect when the path
contains just a single rectangle then we can instead divert to calling
cogl_rectangle which will take advantage of the journal, or by pushing
a rectangle clip which usually ends up just using the scissor.

This patch adds a boolean to each path to mark when it is a
rectangle. It gets cleared whenever a node is added or gets set to
TRUE whenever cogl2_path_rectangle is called. This doesn't try to
catch cases where a rectangle is composed by cogl_path_line_to and
cogl_path_move_to commands.

13 years agodrag-action: Allow using settings for the drag threshold
Emmanuele Bassi [Mon, 28 Feb 2011 17:47:50 +0000 (17:47 +0000)]
drag-action: Allow using settings for the drag threshold

ClutterDragAction should be able to use the newly added ClutterSettings
property exposing the system's drag threshold.

Currently, the x-drag-threshold and the y-drag-threshold properties (and
relative accessors) use an unsigned integer for their values; we should
be able to safely expand the range to include -1 as the minimum value,
and use this new value to tell the ClutterDragAction that it should query
the ClutterSettings object for the drag threshold.

The storage of the properties has been changed, albeit in a compatible
way, as GObject installs a uint ↔ int transformation function for GValue
automatically.

The setter for the drag thresholds has been changes to use a signed
integer, but the getter has been updated to always Do The Right Thing™:
it never returns -1 but, instead, will return the valid drag threshold,
either from the value set or from the Settings singleton.

This change is ABI compatible.

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

13 years agox11: Map Net/DndDragThreshold to ClutterSettings
Emmanuele Bassi [Mon, 28 Feb 2011 16:08:23 +0000 (16:08 +0000)]
x11: Map Net/DndDragThreshold to ClutterSettings

Simple mapping between XSETTINGS key and ClutterSettings property.

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

13 years agosettings: Add dnd-drag-threshold property
Emmanuele Bassi [Mon, 28 Feb 2011 16:46:27 +0000 (16:46 +0000)]
settings: Add dnd-drag-threshold property

The newly added ClutterSettings:dnd-drag-threshold stores the
threshold, in pixels, that should be passed by the cursor to
start a drag operation.

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

13 years agosettings: Clean up property installation code
Emmanuele Bassi [Mon, 28 Feb 2011 16:40:07 +0000 (16:40 +0000)]
settings: Clean up property installation code

Use g_object_class_install_properties().

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

13 years agodocs: Add an ClutterState definition section
Emmanuele Bassi [Wed, 9 Mar 2011 12:05:34 +0000 (12:05 +0000)]
docs: Add an ClutterState definition section

ClutterState is missing some documentation on how to define transitions
using ClutterScript definitions; it is also missing some example code
for both the C API and the ClutterScript syntax.

13 years agobox: Implement the correct paint volume
Emmanuele Bassi [Tue, 8 Mar 2011 19:23:34 +0000 (19:23 +0000)]
box: Implement the correct paint volume

The allocation of the ClutterBox is not enough to be used as the paint
volume, because children might decide to paint outside that area.

Instead, we should use the allocation if the Box has a background color
and then do what Group does, and union all the paint volumes of the
children.

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

13 years agocogl-shader-boilerplate: Specify default precision earlier
Neil Roberts [Tue, 8 Mar 2011 12:53:41 +0000 (12:53 +0000)]
cogl-shader-boilerplate: Specify default precision earlier

In 9ff04e8a99 the builtin uniforms were moved to the common shader
boilerplate. However the common boilerplate is positioned before the
default precision specifier on GLES2 so it would fail to compile
because the uniforms end up with no precision in the fragment
shader. This patch just moves the precision specifier to above the
common boilerplate.

13 years agoevent: Return the CrossingEvent.device field
Emmanuele Bassi [Tue, 8 Mar 2011 10:05:57 +0000 (10:05 +0000)]
event: Return the CrossingEvent.device field

The CLUTTER_ENTER and CLUTTER_LEAVE event types were mistakenly ignored
by clutter_event_get_device(), when returning the device from a
non-allocated ClutterEvent.

13 years agowin32/event: Set the core pointer directly
Emmanuele Bassi [Tue, 8 Mar 2011 10:01:53 +0000 (10:01 +0000)]
win32/event: Set the core pointer directly

Since we have a ClutterInputDevice pointer already we can just set it
instead of using event->crossing.device.

13 years agoevent: Set the CrossingEvent device field
Emmanuele Bassi [Tue, 8 Mar 2011 10:01:06 +0000 (10:01 +0000)]
event: Set the CrossingEvent device field

The CLUTTER_ENTER and CLUTTER_LEAVE should also have their device field
set when calling clutter_event_set_device().

13 years agoclutter-actor: Fix test for avoiding calculating the paint volume
Neil Roberts [Mon, 7 Mar 2011 15:35:05 +0000 (15:35 +0000)]
clutter-actor: Fix test for avoiding calculating the paint volume

There's an optimisation in clutter-actor.c to avoid calculating the
last known paint volume whenever culling and clipped redraws are both
disabled. However there was a small thinko in the logic so that it
would also avoid calculating the paint volume whenever only one of the
debug flags is enabled. This fixes it to explicitly check that the two
flags are not both enabled before skipping the paint volume
calculation.

13 years agoutil: optimize _clutter_util_fully_transform_vertices
Robert Bragg [Tue, 8 Feb 2011 10:37:15 +0000 (10:37 +0000)]
util: optimize _clutter_util_fully_transform_vertices

Instead of unconditionally combining the modelview and projection
matrices and then iterating each of the vertices to call
cogl_matrix_transform_point for each one in turn we now only combine the
matrices if there are more than 4 vertices (with less than 4 vertices
its less work to transform them separately) and we use the new
cogl_vertex_{transform,project}_points APIs which can hopefully
vectorize the transformations.

Finally the perspective divide and viewport scale is done in a separate
loop at the end and we don't do the spurious perspective divide and
viewport scale for the z component.

13 years agoactor: Cache per-actor transforms
Robert Bragg [Fri, 4 Feb 2011 09:17:16 +0000 (09:17 +0000)]
actor: Cache per-actor transforms

Previously each time we needed to retrieve the model transform for a
given actor we would call the apply_transform vfunc which would build up
a transformation matrix based on the actor's current anchor point, its
scale, its allocation and rotation. The apply_transform implementation
would repeatedly call API like cogl_matrix_rotate, cogl_matrix_translate
and cogl_matrix_scale.

All this micro matrix manipulation APIs were starting to show up in the
profiles of dynamic applications so this adds priv->transform matrix
cache which maintains the combined result of the actors scale, rotation
and anchor point etc. Whenever something like the rotation changes then
then the matrix is marked as dirty, but so long as the matrix isn't
dirty then the apply_transform vfunc now just calls cogl_matrix_multiply
with the cached transform matrix.

13 years agoOptimize culling by doing culling in eye-coordinates
Robert Bragg [Tue, 1 Feb 2011 18:32:08 +0000 (18:32 +0000)]
Optimize culling by doing culling in eye-coordinates

This implements a variation of frustum culling whereby we convert screen
space clip rectangles into eye space mini-frustums so that we don't have
to repeatedly transform actor paint-volumes all the way into screen
coordinates to perform culling, we just have to apply the modelview
transform and then determine each points distance from the planes that
make up the clip frustum.

By avoiding the projective transform, perspective divide and viewport
scale for each point culled this makes culling much cheaper.

13 years agostage: simplify apply_transform
Robert Bragg [Tue, 8 Feb 2011 14:46:31 +0000 (14:46 +0000)]
stage: simplify apply_transform

This simplifies the implementation of the ClutterStage apply_transform
vfunc by using the new cogl_matrix_view_2d_in_perspective utility API
which can setup up a view transform for a given perspective so that a
cross section of the view frustum at an arbitrary depth can be mapped
directly to 2D stage coordinates with (0,0) at the top left.

13 years agomatrix: adds 2d view transform conveniences
Robert Bragg [Tue, 8 Feb 2011 15:21:41 +0000 (15:21 +0000)]
matrix: adds 2d view transform conveniences

This adds two new experimental functions to cogl-matrix.c:
cogl_matrix_view_2d_in_perspective and cogl_matrix_view_2d_in_frustum
which can be used to setup a view transform that maps a 2D coordinate
system (0,0) top left and (width,height) bottom right to the current
viewport.

Toolkits such as Clutter that want to mix 2D and 3D drawing can use
these APIs to position a 2D coordinate system at an arbitrary depth
inside a 3D perspective projected viewing frustum.

13 years agostage: don't call glGetIntegerv in clutter_stage_read_pixels
Robert Bragg [Tue, 1 Feb 2011 18:15:50 +0000 (18:15 +0000)]
stage: don't call glGetIntegerv in clutter_stage_read_pixels

Firstly Clutter shouldn't be using OpenGL directly so this needed
changing but also conceptually it doesn't make sense for
clutter_stage_read_pixels to validate the requested area to read against
the viewport it would make more sense to compare against the window
size. Finally checking that the width of the area is less than the
viewport or window width without considering the x isn't enough to know
if the area extends outside the windows bounds. (same for the height)

This patch removes the validation of the read area from
clutter_stage_read_pixels and instead we now simply rely on the
semantics of cogl_read_pixels for reading areas outside the window
bounds.

13 years agoviewport: consistently use floats for viewports
Robert Bragg [Tue, 1 Feb 2011 16:51:58 +0000 (16:51 +0000)]
viewport: consistently use floats for viewports

OpenGL < 4.0 only supports integer based viewports and internally we
have a mixture of code using floats and integers for viewports. This
patch switches all viewports throughout clutter and cogl to be
represented using floats considering that in the future we may want to
take advantage of floating point viewports with modern hardware/drivers.

13 years agoutil: tune point_in_poly test for polys in screen coords
Robert Bragg [Thu, 3 Mar 2011 23:19:30 +0000 (23:19 +0000)]
util: tune point_in_poly test for polys in screen coords

This makes a change to the original point_in_poly algorithm from:
http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html

The aim was to tune the test so that tests against screen aligned
rectangles are more resilient to some in-precision in how we transformed
that rectangle into screen coordinates. In particular gnome-shell was
finding that for some stage sizes then row 0 of the stage would become a
dead zone when going through the software picking fast-path and this was
because the y position of screen aligned rectangles could end up as
something like 0.00024 and the way the algorithm works it doesn't have
any epsilon/fuz factor to consider that in-precision.

We've avoided introducing an epsilon factor to the comparisons since we
feel there's a risk of changing some semantics in ways that might not be
desirable. One of those is that if you transform two polygons which
share an edge and test a point close to that edge then this algorithm
will currently give a positive result for only one polygon.

Another concern is the way this algorithm resolves the corner case where
the horizontal ray being cast to count edge crossings may cross directly
through a vertex. The solution is based on the "idea of Simulation of
Simplicity" and "pretends to shift the ray infinitesimally down so that
it either clearly intersects, or clearly doesn't touch". I'm not
familiar with the idea myself so I expect a misplaced epsilon is likely
to break that aspect of the algorithm.

The simple solution this patch applies is to pixel align the polygon
vertices which should eradicate most noise due to in-precision.

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

13 years agoglx: Use g_set_error_literal() where appropriate
Emmanuele Bassi [Fri, 4 Mar 2011 23:58:12 +0000 (23:58 +0000)]
glx: Use g_set_error_literal() where appropriate

13 years agoOn error, return FALSE in the post_parse hook
Emmanuele Bassi [Fri, 4 Mar 2011 23:56:12 +0000 (23:56 +0000)]
On error, return FALSE in the post_parse hook

Anything that is not CLUTTER_INIT_SUCCESS is to be considered an error.

This fixes the Clutter initialization sequence to actually error out
on pre-conditions and backend initialization failures.

13 years agoClean up argument parsing GError handling
Emmanuele Bassi [Fri, 4 Mar 2011 23:55:02 +0000 (23:55 +0000)]
Clean up argument parsing GError handling

Pass a GError in, so that clutter_init() can effectively print out a
critical warning on initialization failure, like it used to do in the
olden days.

13 years agox11: Use g_set_error_literal()
Emmanuele Bassi [Fri, 4 Mar 2011 23:53:45 +0000 (23:53 +0000)]
x11: Use g_set_error_literal()

The g_set_error() function takes a format string.

13 years agoclutter-offscreen-effect: Use 0,0 as the offset if no actor box
Neil Roberts [Fri, 4 Mar 2011 17:04:02 +0000 (17:04 +0000)]
clutter-offscreen-effect: Use 0,0 as the offset if no actor box

clutter_offscreen_effect_pre_paint was using the unitialized value of
the ‘box’ variable whenever the actor doesn't have a paint
volume. This patch makes it just set the offset to 0,0 instead.

13 years agoclutter-offscreen-effect: Preserve the old opacity override
Neil Roberts [Thu, 3 Mar 2011 16:46:26 +0000 (16:46 +0000)]
clutter-offscreen-effect: Preserve the old opacity override

When removing the opacity override in the post_paint implementation,
ClutterOffscreenEffect would always set the override back to -1. This
ends up cancelling out the effect of any overrides from outer effects
which means that if any actor has multiple effects attached then it
would apply the opacity multiple times.

To fix this, the effect now preserves the old value of the opacity
override and restores that instead of setting -1.

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

13 years agoclutter-actor: Add an internal _clutter_actor_get_opacity_override
Neil Roberts [Tue, 1 Mar 2011 19:52:43 +0000 (19:52 +0000)]
clutter-actor: Add an internal _clutter_actor_get_opacity_override

This is needed if an effect wants to temporarily override the paint
opacity. It needs to be able to restore the old opacity override in
the post_paint handler otherwise it would replace the effect of the
opacity override from any outer effects.

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

13 years agoRemove private helper #define's
Jasper St. Pierre [Thu, 3 Mar 2011 11:35:46 +0000 (06:35 -0500)]
Remove private helper #define's

Finish off the second half of 09a830d294.

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

13 years agobox: set default paint volume to allocation
Dioselin [Tue, 1 Mar 2011 22:05:11 +0000 (14:05 -0800)]
box: set default paint volume to allocation

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

13 years agoeffect: Queue a redraw on :enabled changes
Emmanuele Bassi [Tue, 1 Mar 2011 18:36:55 +0000 (18:36 +0000)]
effect: Queue a redraw on :enabled changes

ClutterEffect should queue a redraw if the :enabled property of its
parent class ClutterActorMeta changes.

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

13 years agoconstraint: Queue a relayout on :enabled changes
Emmanuele Bassi [Tue, 1 Mar 2011 18:36:08 +0000 (18:36 +0000)]
constraint: Queue a relayout on :enabled changes

ClutterConstraint should queue a relayout if the :enabled property of
its parent class ClutterActorMeta changes.

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

13 years agooffscreen-effect: Add public accessor for target size
Emmanuele Bassi [Mon, 28 Feb 2011 14:31:59 +0000 (14:31 +0000)]
offscreen-effect: Add public accessor for target size

The OffscreenEffect class needs to expose a way for sub-classes to
track the size of FBO it creates, in case it has to do some geometry
deformations like the DeformEffect sub-classes.

Let's move the private symbol we used internally in 1.6 to fix
DeformEffect to the list of public symbols of OffscreenEffect.

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

13 years agoMove the keysym ↔ Unicode table to .rodata
Emmanuele Bassi [Mon, 28 Feb 2011 14:02:00 +0000 (14:02 +0000)]
Move the keysym ↔ Unicode table to .rodata

The table we use for converting between keysyms and Unicode should be
static and constified, so that it can live in the .rodata section of
the ELF shared object, and be shared among processes.

This change moves the table to a source file, instead of an header; the
change also requires the clutter_keysym_to_unicode() function to be
moved from clutter-event.c into this new source file. The declaration is
still in clutter-event.h, so we don't need to do anything special.

13 years agobuild: Show CFLAGS in the configure summary
Emmanuele Bassi [Mon, 28 Feb 2011 12:49:48 +0000 (12:49 +0000)]
build: Show CFLAGS in the configure summary

Don't show just the maintainer flags, but the whole shebang.

13 years agoevent: Add setters for ClutterEvent members
Emmanuele Bassi [Tue, 22 Feb 2011 17:12:34 +0000 (17:12 +0000)]
event: Add setters for ClutterEvent members

Creating a synthetic event requires direct access to the ClutterEvent
union members; this access does not map in bindings to high-level
languages, especially run-time bindings using GObject-Introspection.
It's also midly annoying from C, as it unnecessarily exposes the guts of
ClutterEvent - something we might want to fix in the future.

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

13 years agotests: Check return value of clutter_init_with_args instead of error
Neil Roberts [Tue, 22 Feb 2011 12:53:15 +0000 (12:53 +0000)]
tests: Check return value of clutter_init_with_args instead of error

Some of the tests were ignoring the return value of
clutter_init_with_args and instead they would recognise an error by
seeing whether the GError parameter was set. This patch changes it to
check the return value so that it won't give a warning now that
G_GNUC_WARN_UNUSED_RESULT is on that function.

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

13 years agoAdd G_GNUC_WARN_UNUSED_RESULT to clutter_init and init_with_args
Neil Roberts [Tue, 22 Feb 2011 12:38:19 +0000 (12:38 +0000)]
Add G_GNUC_WARN_UNUSED_RESULT to clutter_init and init_with_args

Many people expect clutter_init to work the same way as gtk_init which
exits the program on init failure. clutter_init however returns a
status code on failure which applications need to handle because if
the init fails then any further Clutter calls are likely to crash. In
Clutter 2.0 we may want to change this to be more like GTK+.

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

13 years agodoc: fix clutter_init() usage in examples
nobled [Tue, 22 Feb 2011 00:44:55 +0000 (00:44 +0000)]
doc: fix clutter_init() usage in examples

Make sure users get the idea that clutter_init()
has a return value that needs to be checked.

These were fixed via sed magic:

sed -i -s -e "s/clutter_init (.*)/\
if (& != CLUTTER_INIT_SUCCESS)\n    return 1/"\
 doc/*/*/*.{c,xml} doc/*/*.xml

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

13 years agotests: abort if clutter_init fails
nobled [Tue, 22 Feb 2011 00:19:35 +0000 (00:19 +0000)]
tests: abort if clutter_init fails

This fixes segfaults when something goes wrong during
init, but the test keeps going anyway.

Except for test-easing and test-picking, these were fixed by
sed magic:

sed -i -s -e "s/clutter_init \?(&argc, &argv)/\
if (clutter_init (\&argc, \&argv) != CLUTTER_INIT_SUCCESS)\n\
    return 1/" tests/*/*.c

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