profile/ivi/clutter.git
15 years ago[docs] Various gtk-doc fixes for COGL
Emmanuele Bassi [Wed, 10 Jun 2009 11:50:45 +0000 (12:50 +0100)]
[docs] Various gtk-doc fixes for COGL

Try to keep the gtk-doc errors down to a minimum.

15 years ago[docs] Various gtk-docs fixes
Emmanuele Bassi [Tue, 9 Jun 2009 13:47:36 +0000 (14:47 +0100)]
[docs] Various gtk-docs fixes

15 years ago[stage] Rename fullscreen methods
Emmanuele Bassi [Tue, 9 Jun 2009 13:05:03 +0000 (14:05 +0100)]
[stage] Rename fullscreen methods

The clutter_stage_fullscreen() and clutter_stage_unfullscreen() are
a GDK-ism. The underlying implementation is already using an accessor
with a boolean parameter.

This should take the amount of collisions between properties, methods
and signals to zero.

15 years ago[stage] Rename :fullscreen to :fullscreen-set
Emmanuele Bassi [Tue, 9 Jun 2009 12:48:03 +0000 (13:48 +0100)]
[stage] Rename :fullscreen to :fullscreen-set

The :fullscreen property is very much confusing as it is implemented.
It can be written to a value, but the whole process might fail. If we
set:

  g_object_set (stage, "fullscreen", TRUE, NULL);

and the fullscreen process fails or it is not implemented, the value
will be reset to FALSE (if we're lucky) or left TRUE (most of the
times).

The writability is just a shorthand for invoking clutter_stage_fullscreen()
or clutter_stage_unfullscreen() depending on a boolean value without
using an if.

The :fullscreen property also greatly confuses high level languages,
since the same symbol is used:

  - for a method name (Clutter.Stage.fullscreen())
  - for a property name (Clutter.Stage.fullscreen)
  - for a signal (Clutter.Stage::fullscreen)

For these reasons, the :fullscreen should be renamed to :fullscreen-set
and be read-only. Implementations of the Stage should only emit the
StageState event to change from normal to fullscreen, and the Stage
will automatically update the value of the property and emit a notify
signal for it.

15 years ago[build] Update the experimental features checks
Emmanuele Bassi [Tue, 9 Jun 2009 11:43:57 +0000 (12:43 +0100)]
[build] Update the experimental features checks

Instead of blacklisting experimental features at the end we can
explicitly mark backends and image backends near their checks and
provide a summary at the end.

15 years ago[json] Update the internal JSON-GLib copy
Emmanuele Bassi [Tue, 9 Jun 2009 11:42:19 +0000 (12:42 +0100)]
[json] Update the internal JSON-GLib copy

There have been changes in JSON-GLib upstream to clean up the
data structures, and facilitate introspection.

We still not use the updated JsonParser with the (private) JsonScanner
code, since it's a fork of GLib's GScanner.

15 years ago[introspection] Add --c-include to g-ir-scanner
Emmanuele Bassi [Tue, 9 Jun 2009 11:40:06 +0000 (12:40 +0100)]
[introspection] Add --c-include to g-ir-scanner

Since Clutter has a single-include header policy we need to put
the header to be included inside the GIR file.

15 years ago[build] Add as-compiler-flag.m4 to the dist
Emmanuele Bassi [Tue, 9 Jun 2009 11:39:28 +0000 (12:39 +0100)]
[build] Add as-compiler-flag.m4 to the dist

15 years ago[CoglTexture] Initialise tex->first_pixels to NULL in all constructors
Neil Roberts [Tue, 9 Jun 2009 10:13:11 +0000 (11:13 +0100)]
[CoglTexture] Initialise tex->first_pixels to NULL in all constructors

Otherwise if there is an error before the slices are created it will
try to free the first_pixels array and crash.

It now also checks whether first_pixels has been created before using
it to update the mipmaps. This should only happen for
cogl_texture_new_from_foreign and doesn't matter if the FBO extension
is available. It would be better in this case to fetch the first pixel
using glGetTexImage as Owen mentioned in the last commit.

15 years agoFix unitialized first_pixels for foreign textures
Owen W. Taylor [Mon, 8 Jun 2009 20:45:43 +0000 (16:45 -0400)]
Fix unitialized first_pixels for foreign textures

tex->first_pixels was never set for foreign textures, leading
to a crash when the texture object is freed.

As a quick fix, simply set to NULL. A more complete fix would
require remembering if we had ever seen the first pixel uploaded,
and if not, doing a glReadPixel to get it before triggering the
mipmap update.

http://bugzilla.openedhand.com/show_bug.cgi?id=1645

Signed-off-by: Neil Roberts <neil@linux.intel.com>
15 years agoOn bad blend strings, print the error if not returning it
Owen W. Taylor [Mon, 8 Jun 2009 13:26:57 +0000 (09:26 -0400)]
On bad blend strings, print the error if not returning it

It's very common that there's no reasonable fallback to do if the
blend or combine string you set isn't supported. So, rather than
requiring everybody to pass in a GError purely to catch syntax erorrs,
automatically g_warning() if a parse error is encountered and @error
is NULL.

http://bugzilla.openedhand.com/show_bug.cgi?id=1642

Signed-off-by: Robert Bragg <robert@linux.intel.com>
15 years agoFix for new potential memory leak in ClutterGLXTexturePixmap.
Garry Bodsworth [Mon, 8 Jun 2009 10:56:59 +0000 (11:56 +0100)]
Fix for new potential memory leak in ClutterGLXTexturePixmap.

This fixes a new instance of glXDestroyGLXPixmap which should be
glXDestroyPixmap.

Signed-off-by: Robert Bragg <robert@linux.intel.com>
15 years agoProperly adjust msecs_delta when clamping elapsed time
Owen W. Taylor [Mon, 8 Jun 2009 11:57:41 +0000 (07:57 -0400)]
Properly adjust msecs_delta when clamping elapsed time

When we complete a timeline, we clamp the elapsed_time variable
to the range of the timeline. We need to adjust msecs_delta so that
when we check for hit markers we have the correct interval.

http://bugzilla.openedhand.com/show_bug.cgi?id=1641

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years ago[animation] Keep a reference during notify::alpha
Emmanuele Bassi [Mon, 8 Jun 2009 13:42:22 +0000 (14:42 +0100)]
[animation] Keep a reference during notify::alpha

The Animation should be referenced during the notification of the
alpha value, since the callback is invoked depending on the Alpha
and it won't vivify the Animation instance for us.

Fixes bug:

  http://bugzilla.openedhand.com/show_bug.cgi?id=1537

15 years agointrospection-friendly ClutterEvent accessors
Emmanuele Bassi [Sat, 6 Jun 2009 14:27:37 +0000 (15:27 +0100)]
introspection-friendly ClutterEvent accessors

ClutterEvent is not really gobject-introspection friendly because
of the whole discriminated union thing. In particular, if you get
a ClutterEvent in a signal handler, you probably can't access the
event-type-specific fields, and you probably can't call methods
like clutter_key_event_symbol() either, because you can't cast the
ClutterEvent to a ClutterKeyEvent.

The cleanest solution is to turn every accessor into ClutterEvent
methods, accepting a ClutterEvent* and internally checking the event
type.

Fixes bug:

  http://bugzilla.openedhand.com/show_bug.cgi?id=1585

15 years ago[glx-texture-pixmap] Unref a cogl texture handle.
Garry Bodsworth [Mon, 8 Jun 2009 07:46:33 +0000 (08:46 +0100)]
[glx-texture-pixmap] Unref a cogl texture handle.

According to clutter_texture_set_cogl_texture you should unref the handle as
the texture takes its own.

Signed-off-by: Robert Bragg <robert@linux.intel.com>
15 years agoFix memory leak in ClutterGLXTexturePixmap.
Garry Bodsworth [Mon, 8 Jun 2009 07:38:50 +0000 (08:38 +0100)]
Fix memory leak in ClutterGLXTexturePixmap.

The OpenGL spec states that if you create a pixmap using glXCreatePixmap you
should use glXDestroyPixmap to destroy it.

Signed-off-by: Robert Bragg <robert@linux.intel.com>
15 years agoStraighten out 'realize' handling for ClutterGLXTexturePixmap
Owen W. Taylor [Sat, 6 Jun 2009 16:07:42 +0000 (12:07 -0400)]
Straighten out 'realize' handling for ClutterGLXTexturePixmap

Setting the pixmap for an unrealized ClutterGLXTexturePixmap should
not cause it to be realized, and certainly shouldn't cause the the
REALIZED flag to be set without using clutter_actor_realize().

This patch uses the simple approach that;

 - pixmap changes on an unrealized ClutterGLXTexturePixmap
   are ignored
 - when the ClutterGLXTexturePixmap is realized, we then create
   the GLXPixmap and the corresponding texture.

The call to clutter_glx_texture_pixmap_update_area() is moved
from create_cogl_texture() to
clutter_glx_texture_pixmap_create_glx_pixmap() since
create_cogl_texture() is only called from one place, and updating
the area is really something we do *after* creating the texture,
not part of creating the texture.

clutter_glx_texture_pixmap_create_glx_pixmap() is reorganized a
bit to avoid debug-logging confusingly if it's called before a pixmap
has been set, and for readability.

http://bugzilla.openedhand.com/show_bug.cgi?id=1635

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years agoRemove unnecessary setting of CLUTTER_ACTOR_REALIZED flag
Owen W. Taylor [Sat, 6 Jun 2009 13:55:00 +0000 (09:55 -0400)]
Remove unnecessary setting of CLUTTER_ACTOR_REALIZED flag

An implementaton of realize() never needs to set the
CLUTTER_ACTOR_REALIZED flag, though it can unset the flag if
things fail unexpectedly. (Previously, stage backend implementations
had to do this since clutter_actor_realize() wasn't used; this
is no longer the case.)

http://bugzilla.openedhand.com/show_bug.cgi?id=1634

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years agoBe more tolerant about natural_width < min_width
Owen W. Taylor [Sat, 6 Jun 2009 15:37:18 +0000 (11:37 -0400)]
Be more tolerant about natural_width < min_width

Due to the accumulation of floating point errors, natural_width
and min_width can diverge significantly even if the math for
computing them is correct. So just clamp natural_width to
min_width instead of warning about it.

http://bugzilla.openedhand.com/show_bug.cgi?id=1632

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years agoUse double temporaries when computing group size
Owen W. Taylor [Sat, 6 Jun 2009 15:28:02 +0000 (11:28 -0400)]
Use double temporaries when computing group size

If we use float temporaries when computing the bounds of
a group, then, depending on what variables are kept in registers
and what stored on the stack, the accumulated difference between
natural_width and min_width can be more than FLOAT_EPSILON.

Using double temporaries will eliminate the difference in most
cases, or, very rarely, reduce it to a last-bit error.

http://bugzilla.openedhand.com/show_bug.cgi?id=1632

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years agoHandle a clone of an actor with an unmapped parent
Owen W. Taylor [Sat, 6 Jun 2009 15:56:08 +0000 (11:56 -0400)]
Handle a clone of an actor with an unmapped parent

If we are cloning an source actor with an unmapped parent, then when
we temporarily map the source actor:

 - We need to skip the check that a mapped actor has a mapped
   parent.
 - We need to realize the actor's parents before mapping it,
   or we'll get an assertion failure in clutter_actor_update_map_state()
   because an actor with an unmapped parent is !may_be_realized.

http://bugzilla.openedhand.com/show_bug.cgi?id=1633

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years ago[tests] Clarify the numbers
Emmanuele Bassi [Mon, 8 Jun 2009 09:59:22 +0000 (10:59 +0100)]
[tests] Clarify the numbers

15 years ago[tests] The ::focus-in signal was renamed ::key-focus-in
Emmanuele Bassi [Mon, 8 Jun 2009 09:58:20 +0000 (10:58 +0100)]
[tests] The ::focus-in signal was renamed ::key-focus-in

The test-events interactive test is still using the old name.

15 years ago[build] Add AS_COMPILER_FLAGS
Emmanuele Bassi [Mon, 8 Jun 2009 01:22:26 +0000 (02:22 +0100)]
[build] Add AS_COMPILER_FLAGS

Use the AS_COMPILER_FLAGS to check whether the maintainer compiler flags
we use are supported; this should fail gracefully and only use the ones
that the compiler actually understands.

Fixes bug:

  http://bugzilla.openedhand.com/show_bug.cgi?id=1639

15 years ago[x11] Do not forcibly set the stage size on fullscreen
Emmanuele Bassi [Mon, 8 Jun 2009 01:04:27 +0000 (02:04 +0100)]
[x11] Do not forcibly set the stage size on fullscreen

Setting the stage size using clutter_actor_set_size() is almost always
wrong: the X11 stage implementation should save the size and queue a
relayout -- like it does when receiving a ConfigureNotify. The same
should happen when setting it to be full screen.

15 years ago[build] Search for Cogl GIR in the right place
Owen W. Taylor [Mon, 8 Jun 2009 00:51:02 +0000 (01:51 +0100)]
[build] Search for Cogl GIR in the right place

Since we build the Cogl GIR inside /clutter/cogl we should be looking
there when building the Clutter GIR. Otherwise g-ir-scanner will look
inside the gir directory -- and if you never built Clutter before it
will error out.

Fixes bug:

  http://bugzilla.openedhand.com/show_bug.cgi?id=1638

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years ago[test-blend-strings] Fix a silly off by one that meant the test couldn't fail
Robert Bragg [Sat, 6 Jun 2009 20:33:31 +0000 (21:33 +0100)]
[test-blend-strings] Fix a silly off by one that meant the test couldn't fail

The test was quiting after the 2nd frame but it should be the third frame because
the test doesn't actually check results until the third frame due to the workaround
for drivers with broken glReadPixels.

(When first written the test would have been verified with the
clutter_main_quit() commented out which gives visual feedback of what the
test does, so the off by one would have snuck in just before uncommenting
and pushing.)

15 years ago[texture] Fix error reporting on ::load-finished
Emmanuele Bassi [Sat, 6 Jun 2009 14:57:29 +0000 (15:57 +0100)]
[texture] Fix error reporting on ::load-finished

The load-finished signal has a GError* argument which is meant to
signify whether the loading was successful. However many of the
places in ClutterTexture that emit this signal directly pass their
'error' variable which is a GError** and will be NULL or not
completely independently of whether there was an error. If the
argument was dereferenced it would probably crash.

The test-texture-async interactive test case should also verify
that the ::load-finished signal is correctly emitted.

Fixes bug:

  http://bugzilla.openedhand.com/show_bug.cgi?id=1622

15 years ago[units] Always recompute pixels
Emmanuele Bassi [Sat, 6 Jun 2009 13:39:21 +0000 (14:39 +0100)]
[units] Always recompute pixels

When asking for the pixels value we should always recompute it.

The "pixel_set" guard can be left in place for future use.

15 years ago[build] Remove -Werror for the maintainer cflags
Emmanuele Bassi [Sat, 6 Jun 2009 13:38:10 +0000 (14:38 +0100)]
[build] Remove -Werror for the maintainer cflags

Now that we have Shave in place and don't risk losing warnings
we can avoid -Werror in the anal-retentive maintainer compiler
flags.

15 years agoFixes for some compiler warnings
Emmanuele Bassi [Sat, 6 Jun 2009 13:37:41 +0000 (14:37 +0100)]
Fixes for some compiler warnings

15 years ago[actor] get_transformed_position(): initialize Z value
Owen W. Taylor [Fri, 5 Jun 2009 21:53:57 +0000 (17:53 -0400)]
[actor] get_transformed_position(): initialize Z value

Initialize the Z value in the point we pass to
clutter_actor_apply_transform_to_point().

http://bugzilla.openedhand.com/show_bug.cgi?id=1630

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years agoFix stopping a timeline
Owen W. Taylor [Fri, 5 Jun 2009 20:52:18 +0000 (16:52 -0400)]
Fix stopping a timeline

Correctly apply De Morgan's laws to the short-circuit test in
clutter_timeline_pause(); it was short-circuiting always and
never actually pausing.

http://bugzilla.openedhand.com/show_bug.cgi?id=1629

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years agoFix the leak of the GList of layers in CoglMaterial
Johan Bilien [Wed, 3 Jun 2009 21:08:17 +0000 (22:08 +0100)]
Fix the leak of the GList of layers in CoglMaterial

http://bugzilla.openedhand.com/show_bug.cgi?id=1624

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years agoBroken fixed:: arguments
Bastian Winkler [Wed, 3 Jun 2009 12:36:18 +0000 (14:36 +0200)]
Broken fixed:: arguments

The commit 2c95b378 prevents clutter_animation_setup_property from being
called with fixed:: property names. This patch adds a additional
parameter "is_fixed" to clutter_animation_setup_property instead of
searching for "fixed::" in property_name.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years ago[build] Check for libXext
Emmanuele Bassi [Sat, 6 Jun 2009 11:34:00 +0000 (12:34 +0100)]
[build] Check for libXext

It seems GNU Gold (the new linker) either behaves as if with
--no-undefined by default, or has some issue preventing it from not
doing that when instructed to (I'm not sure if this actually
happens). In any case, clutter uses the Xshm extensions, but does not
link to libXext, which makes gold unhappy.

Based on a patch by: Xan Lopez <xan@gnome.org>

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years ago[CoglPangoDisplayList] Don't store the base color in the display list
Neil Roberts [Fri, 5 Jun 2009 17:00:22 +0000 (18:00 +0100)]
[CoglPangoDisplayList] Don't store the base color in the display list

It should be possible render a single PangoLayout with different
colors without recalculating the layout. This was not working because
the color used at the first edit was being stored in the display
list. This broke changing the opacity on a ClutterText.

Now each node in the display list has a 'color override' flag which
marks whether it should use the base color or not. The base color is
now passed in from _cogl_pango_display_list_render_texture. The alpha
value is always taken from the base color.

15 years ago[repaint] Run the repaint functions in clutter_redraw()
Emmanuele Bassi [Fri, 5 Jun 2009 16:55:24 +0000 (17:55 +0100)]
[repaint] Run the repaint functions in clutter_redraw()

The clutter_redraw() function is used by libraries embedding
Clutter inside another toolkit, instead of queueing a redraw
on the embedded stage. This means that clutter_redraw() should
perform the same sequence of actions done by the redraw idle
callback.

15 years ago[docs] Update README
Emmanuele Bassi [Fri, 5 Jun 2009 16:54:21 +0000 (17:54 +0100)]
[docs] Update README

* Remove mentions of Subversion

* Update the configure command line switches

15 years ago[cogl] cogl_material_set_layer does nothing if resetting the same texture
Robert Bragg [Sat, 4 Apr 2009 18:21:22 +0000 (19:21 +0100)]
[cogl] cogl_material_set_layer does nothing if resetting the same texture

This avoids dirtying the layer, and should avoid some uneeded state changes

15 years ago[test-conformance] we were calling clutter_init with un-initialized arguments
Robert Bragg [Fri, 22 May 2009 15:59:14 +0000 (16:59 +0100)]
[test-conformance] we were calling clutter_init with un-initialized arguments

This ensure we initialize shared_state->arg{c,v}_addr before calling
clutter_init

15 years ago[build] Fix compiler warnings
Emmanuele Bassi [Fri, 5 Jun 2009 15:46:12 +0000 (16:46 +0100)]
[build] Fix compiler warnings

Silence GCC

15 years agoFix a compiler warning
Emmanuele Bassi [Fri, 5 Jun 2009 14:18:43 +0000 (15:18 +0100)]
Fix a compiler warning

15 years ago[ClutterActor] Fix check for zero opacity when being painted from a clone
Neil Roberts [Fri, 5 Jun 2009 15:25:39 +0000 (16:25 +0100)]
[ClutterActor] Fix check for zero opacity when being painted from a clone

Clutter short-circuits painting when an actor's opacity is
zero. However if the actor is being painted from a ClutterClone then
it will be painted using the clone's opacity instead so the test was
broken.

15 years ago[build] Add all dependencies for pkg-config
Emmanuele Bassi [Fri, 5 Jun 2009 11:46:37 +0000 (12:46 +0100)]
[build] Add all dependencies for pkg-config

A merge conflict gone bad: the IMAGE_PC_FILES variable was not appended
to the CLUTTER_REQUIRES one, thus leading to Clutter depending on
GdkPixbuf but never actually checking for it.

15 years agoMerge branch '1.0-integration'
Emmanuele Bassi [Fri, 5 Jun 2009 11:41:42 +0000 (12:41 +0100)]
Merge branch '1.0-integration'

* 1.0-integration: (138 commits)
  [x11] Disable XInput by default
  [xinput] Invert the XI extension version check
  [cogl-primitives] Fix an unused variable warning when building GLES
  [clutter-stage-egl] Pass -1,-1 to clutter_stage_x11_fix_window_size
  Update the GLES backend to have the layer filters in the material
  [gles/cogl-shader] Add a missing semicolon
  [cogl] Move the texture filters to be a property of the material layer
  [text] Fix Pango unit to pixels conversion
  [actor] Force unrealization on destroy only for non-toplevels
  [x11] Rework map/unmap and resizing
  [xinput] Check for the XInput entry points
  [units] Validate units against the ParamSpec
  [actor] Add the ::allocation-changed signal
  [actor] Use flags to control allocations
  [units] Rework Units into logical distance value
  Remove a stray g_value_get_int()
  Remove usage of Units and macros
  [cogl-material] Allow setting a layer with an invalid texture handle
  [timeline] Remove the concept of frames from timelines
  [gles/cogl-shader] Fix parameter spec for cogl_shader_get_info_log
  ...

Conflicts:
configure.ac

15 years ago[x11] Disable XInput by default
Emmanuele Bassi [Fri, 5 Jun 2009 11:26:29 +0000 (12:26 +0100)]
[x11] Disable XInput by default

The XInput support in Clutter is still using XI 1.x. This will never
work correctly, and we are all waiting for XInput 2 anyway. The changes
internally should be minimal, so we can leave everything in place, but
it's better to disable XInput support by default -- at least for the
time being.

15 years agoMerge branch 'timeline-no-fps' into 1.0-integration
Neil Roberts [Fri, 5 Jun 2009 11:20:41 +0000 (12:20 +0100)]
Merge branch 'timeline-no-fps' into 1.0-integration

15 years ago[xinput] Invert the XI extension version check
Emmanuele Bassi [Fri, 5 Jun 2009 11:06:09 +0000 (12:06 +0100)]
[xinput] Invert the XI extension version check

Since having XQueryInputVersion means also having XGetExtensionVersion
we need to check the former first to avoid the deprecation warning.

15 years ago[cogl-primitives] Fix an unused variable warning when building GLES
Neil Roberts [Thu, 4 Jun 2009 21:20:18 +0000 (22:20 +0100)]
[cogl-primitives] Fix an unused variable warning when building GLES

The 'tex' variable is only used if #ifdef'd GL code so it was throwing
an error under GLES. The variable is now moved into a block inside the
#ifdef.

15 years ago[clutter-stage-egl] Pass -1,-1 to clutter_stage_x11_fix_window_size
Neil Roberts [Thu, 4 Jun 2009 21:15:41 +0000 (22:15 +0100)]
[clutter-stage-egl] Pass -1,-1 to clutter_stage_x11_fix_window_size

This reflects the changes made to e4ff24bc for the egl stage.

15 years agoUpdate the GLES backend to have the layer filters in the material
Neil Roberts [Thu, 4 Jun 2009 21:12:33 +0000 (22:12 +0100)]
Update the GLES backend to have the layer filters in the material

This reflects the changes made in 54d8aadf1d86 for the GLES backend.

15 years ago[gles/cogl-shader] Add a missing semicolon
Neil Roberts [Thu, 4 Jun 2009 21:10:33 +0000 (22:10 +0100)]
[gles/cogl-shader] Add a missing semicolon

cogl_shader_get_info_log was missing a semicolon which broke the build
on GLES 2.

15 years ago[cogl] Move the texture filters to be a property of the material layer
Neil Roberts [Thu, 4 Jun 2009 15:04:57 +0000 (16:04 +0100)]
[cogl] Move the texture filters to be a property of the material layer

The texture filters are now a property of the material layer rather
than the texture object. Whenever a texture is painted with a material
it sets the filters on all of the GL textures in the Cogl texture. The
filter is cached so that it won't be changed unnecessarily.

The automatic mipmap generation has changed so that the mipmaps are
only generated when the texture is painted instead of every time the
data changes. Changing the texture sets a flag to mark that the
mipmaps are dirty. This works better if the FBO extension is available
because we can use glGenerateMipmap. If the extension is not available
it will temporarily enable automatic mipmap generation and reupload
the first pixel of each slice. This requires tracking the data for the
first pixel.

The COGL_TEXTURE_AUTO_MIPMAP flag has been replaced with
COGL_TEXTURE_NO_AUTO_MIPMAP so that it will default to
auto-mipmapping. The mipmap generation is now effectively free if you
are not using a mipmap filter mode so you would only want to disable
it if you had some special reason to generate your own mipmaps.

ClutterTexture no longer has to store its own copy of the filter
mode. Instead it stores it in the material and the property is
directly set and read from that. This fixes problems with the filters
getting out of sync when a cogl handle is set on the texture
directly. It also avoids the mess of having to rerealize the texture
if the filter quality changes to HIGH because Cogl will take of
generating the mipmaps if needed.

15 years ago[text] Fix Pango unit to pixels conversion
Emmanuele Bassi [Thu, 4 Jun 2009 16:28:35 +0000 (17:28 +0100)]
[text] Fix Pango unit to pixels conversion

When going from Pango units to pixels we need to divide by 1024,
and not multiply by 1024.

15 years ago[actor] Force unrealization on destroy only for non-toplevels
Emmanuele Bassi [Thu, 4 Jun 2009 15:50:19 +0000 (16:50 +0100)]
[actor] Force unrealization on destroy only for non-toplevels

We cannot force unrealization on toplevels ourselves, so we need
to check inside clutter_actor_destroy() if we want to avoid a
warning.

15 years ago[x11] Rework map/unmap and resizing
Emmanuele Bassi [Thu, 4 Jun 2009 15:27:21 +0000 (16:27 +0100)]
[x11] Rework map/unmap and resizing

The mapping and unmapping of the X11 stage implementation is
a bit bong. It's asynchronous, for starters, when it really
can avoid it by tracking the state internally.

The ordering of the map/unmap sequence is also broken with
respect to the resizing.

By tracking the state internally into StageX11 we can safely
remove the MapNotify and UnmapNotify X event handling.

In theory, we should use _NET_WM_STATE a lot more, and reuse
the X11 state flags for fullscreening as well.

15 years ago[xinput] Check for the XInput entry points
Emmanuele Bassi [Thu, 4 Jun 2009 12:41:32 +0000 (13:41 +0100)]
[xinput] Check for the XInput entry points

Apparently, the XInput extension is using the same pkg-config
file ('xi') for both the 1.x and the 2.x API, so we need to
check for both the 1.x XGetExtensionVersion and the 2.x
XQueryInputVersion.

15 years ago[units] Validate units against the ParamSpec
Emmanuele Bassi [Thu, 4 Jun 2009 11:15:15 +0000 (12:15 +0100)]
[units] Validate units against the ParamSpec

When declaring a property using ClutterParamSpecUnits we pass a
default type to limit the type of units we accept as valid values
for the property.

This means that we need to add the unit type check as part of the
validation process.

15 years ago[actor] Add the ::allocation-changed signal
Emmanuele Bassi [Thu, 4 Jun 2009 11:00:58 +0000 (12:00 +0100)]
[actor] Add the ::allocation-changed signal

Sometimes it is useful to be able to track changes in the allocation
flags, like the absolute origin, inside children of a container.

Using the notify::allocation signal is not enough, in these cases, so
we need a specific signal that gives us both the allocation box and the
allocation flags.

15 years ago[actor] Use flags to control allocations
Emmanuele Bassi [Wed, 3 Jun 2009 13:02:06 +0000 (14:02 +0100)]
[actor] Use flags to control allocations

Instead of passing a boolean value, the ::allocate virtual function
should use a bitmask and flags. This gives us room for expansion
without breaking API/ABI, and allows to encode more information to
the allocation process instead of just changes of absolute origin.

15 years ago[units] Rework Units into logical distance value
Emmanuele Bassi [Wed, 3 Jun 2009 10:12:09 +0000 (11:12 +0100)]
[units] Rework Units into logical distance value

Units as they have been implemented since Clutter 0.4 have always been
misdefined as "logical distance unit", while they were just pixels with
fractionary bits.

Units should be reworked to be opaque structures to hold a value and
its unit type, that can be then converted into pixels when Clutter needs
to paint or compute size requisitions and perform allocations.

The previous API should be completely removed to avoid collisions, and
a new type:

        ClutterUnits

should be added; the ability to install GObject properties using
ClutterUnits should be maintained.

15 years agoRemove a stray g_value_get_int()
Emmanuele Bassi [Wed, 3 Jun 2009 09:09:56 +0000 (10:09 +0100)]
Remove a stray g_value_get_int()

Now that all properties are float, using g_value_get_int() to
retrieve the value of the :anchor-x property is going to print
out a warning.

15 years agoRemove usage of Units and macros
Emmanuele Bassi [Tue, 2 Jun 2009 17:44:30 +0000 (18:44 +0100)]
Remove usage of Units and macros

The ClutterUnit and relative macros should not be used when dealing
with pixels -- which is to say, all the time when inside Clutter.

15 years ago[cogl-material] Allow setting a layer with an invalid texture handle
Neil Roberts [Wed, 3 Jun 2009 14:22:42 +0000 (15:22 +0100)]
[cogl-material] Allow setting a layer with an invalid texture handle

It was previously possible to create a material layer with no texture
by setting some property on it such as the matrix. However it was not
possible to get back to that state without removing the layer and
recreating it. It is useful to be able to remove the texture to free
resources without forgetting the state of the layer so we can put a
different texture in later.

15 years ago[timeline] Remove the concept of frames from timelines
Neil Roberts [Thu, 4 Jun 2009 12:05:12 +0000 (13:05 +0100)]
[timeline] Remove the concept of frames from timelines

Timelines no longer work in terms of a frame rate and a number of
frames but instead just have a duration in milliseconds. This better
matches the working of the master clock where if any timelines are
running it will redraw as fast as possible rather than limiting to the
lowest rated timeline.

Most applications will just create animations and expect them to
finish in a certain amount of time without caring about how many
frames are drawn. If a frame is going to be drawn it might as well
update all of the animations to some fraction of the total animation
rather than rounding to the nearest whole frame.

The 'frame_num' parameter of the new-frame signal is now 'msecs' which
is a number of milliseconds progressed along the
timeline. Applications should use clutter_timeline_get_progress
instead of the frame number.

Markers can now only be attached at a time value. The position is
stored in milliseconds rather than at a frame number.

test-timeline-smoothness and test-timeline-dup-frames have been
removed because they no longer make sense.

15 years ago[gles/cogl-shader] Fix parameter spec for cogl_shader_get_info_log
Neil Roberts [Thu, 4 Jun 2009 11:04:47 +0000 (12:04 +0100)]
[gles/cogl-shader] Fix parameter spec for cogl_shader_get_info_log

The stub version of cogl_shader_get_info_log needed to be updated to
match the changes to the function signature in 61deeafa.

15 years ago[clutter-stage-win32] Call clutter_actor_map instead of setting the flags
Neil Roberts [Thu, 4 Jun 2009 10:59:17 +0000 (11:59 +0100)]
[clutter-stage-win32] Call clutter_actor_map instead of setting the flags

The clutter_actor_map and unmap functions need to be called to
properly update the mapped state. This matches the changes to the X11
stage in 125bded8.

15 years ago[clutter-event-win32] Fix the argument types to clutter_actor_get_size
Neil Roberts [Thu, 4 Jun 2009 10:50:52 +0000 (11:50 +0100)]
[clutter-event-win32] Fix the argument types to clutter_actor_get_size

clutter_actor_get_size now takes float pointers so it was issuing a
warning.

15 years agoLoad glBlendEquation and glBlendColor using cogl_get_proc_address
Neil Roberts [Thu, 4 Jun 2009 10:50:06 +0000 (11:50 +0100)]
Load glBlendEquation and glBlendColor using cogl_get_proc_address

These are defined since OpenGL 1.2 and since Windows doesn't export
any functions defined after 1.1 we need to load them dynamically.

15 years agoRename 'near' and 'far' variables to 'z_near' and 'z_far'
Neil Roberts [Thu, 4 Jun 2009 10:48:51 +0000 (11:48 +0100)]
Rename 'near' and 'far' variables to 'z_near' and 'z_far'

The Windows headers define near and far to be empty so it breaks the
build.

15 years ago[configure] Require pango 1.20 instead of 1.18
Neil Roberts [Thu, 4 Jun 2009 10:03:34 +0000 (11:03 +0100)]
[configure] Require pango 1.20 instead of 1.18

Clutter now calls pango_layout_set_height which is only available
since Pango 1.20.

15 years ago[actor] Unrealize on destroy
Emmanuele Bassi [Wed, 3 Jun 2009 11:59:16 +0000 (12:59 +0100)]
[actor] Unrealize on destroy

If the application code calls for destruction of an actor we need
to make sure that the actor is unrealized before running the dispose
sequence; otherwise, we might trigger an assertion failure on composite
actors.

15 years agoRevert commit 762873e7
Emmanuele Bassi [Wed, 3 Jun 2009 13:03:25 +0000 (14:03 +0100)]
Revert commit 762873e7

The commit 762873e79e501c949f3ef55cbac20276b6f6ed4e is completely
and utterly wrong and I should have never pushed it.

Serves me well for trying to work on three different branches and
on three different things.

15 years ago[master clock] Avoid excessive redraws
Emmanuele Bassi [Wed, 3 Jun 2009 11:02:56 +0000 (12:02 +0100)]
[master clock] Avoid excessive redraws

Currently, the clock source spins a redraw every time there is at
least a timeline running. If the timelines were not advanced in
the previous frame, though, because their interval is larger than
the vblanking interval then this will lead to excessive redraws of
the scenegraph even if nothing has changed.

To avoid this a simple guard should be set by the MasterClock::advance
method in case no timeline was effectively advanced, and checked
before dispatching the stage redraws.

15 years ago[cogl-texture] Don't take ownership of the data in cogl_texture_new_from_bitmap
Neil Roberts [Tue, 2 Jun 2009 17:01:18 +0000 (18:01 +0100)]
[cogl-texture] Don't take ownership of the data in cogl_texture_new_from_bitmap

When creating a Cogl texture from a Cogl bitmap it would steal the
data by setting the bitmap_owner flag and clearing the data pointer
from the bitmap. The data would be freed by the time the
new_from_bitmap is finished. There is no reason to do this because the
data will be freed when the Cogl bitmap is unref'd and it is confusing
not to be able to reuse the bitmap for creating multiple textures.

15 years ago[tests] Add ClutterColor conformance tests
Emmanuele Bassi [Mon, 1 Jun 2009 17:43:47 +0000 (18:43 +0100)]
[tests] Add ClutterColor conformance tests

Add a conformance test unit for the to_string() and from_string()
methods.

15 years ago[color] Add support for the "#rgba" color format
Robert Staudinger [Mon, 1 Jun 2009 16:54:46 +0000 (18:54 +0200)]
[color] Add support for the "#rgba" color format

clutter_color_from_string() only supported the "#rrggbbaa" format with
alpha channel, this patch adds support for "#rgba".

Colors in "#rrggbb" format were parsed manually, this is now left to
the pango color parsing fallback, since that's handling it just fine.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years ago[docs] Rework the API reference version generation
Emmanuele Bassi [Mon, 1 Jun 2009 16:35:41 +0000 (17:35 +0100)]
[docs] Rework the API reference version generation

Clutter copies the gtk-doc from the usual gtk+ template, and
has a version.xml.in containing only:

  @VERSION@

Without a newline at the end. Unfortunately, it appears that
autoconf has started adding a newline to the generated version.xml
which then is used as the payload for the "version" XML entity.

Instead of using a secondary file we can make configure generate
the whole clutter-docs.xml and cogl-docs.xml files from a template;
this way we also get the ability to substitute more autoconf variables
into the documentation -- if needs be.

15 years ago[cogl-shader] Make get_info_log() slightly nicer
Emmanuele Bassi [Mon, 1 Jun 2009 15:31:32 +0000 (16:31 +0100)]
[cogl-shader] Make get_info_log() slightly nicer

The cogl_shader_get_info_log() function is very inconvenient for
language bindings and for regular use, as it requires a static
buffer to be filled -- basically just providing a wrapper around
glGetInfoLogARB().

Since COGL aims to be a more convenient API than raw GL we should
just make cogl_shader_get_info_log() return an allocated string
with the GLSL compiler log.

15 years agoUse GL_QUADS for flushing a quad batch
Neil Roberts [Mon, 1 Jun 2009 16:10:22 +0000 (17:10 +0100)]
Use GL_QUADS for flushing a quad batch

Instead of using GL_TRIANGLES and uploading the indices every time, it
now uses GL_QUADS instead on OpenGL. Under GLES it still uses indices
but it uses the new cogl_vertex_buffer_indices_get_for_quads function
to avoid uploading the vertices every time.

This requires the _cogl_vertex_buffer_indices_pointer_from_handle
function to be exposed privately to the rest of Cogl.

The static_indices array has been removed from the Cogl context.

15 years ago[introspection] Remove Cogl symbols from Clutter GIR
Emmanuele Bassi [Mon, 1 Jun 2009 14:51:59 +0000 (15:51 +0100)]
[introspection] Remove Cogl symbols from Clutter GIR

The GIR file for Clutter still contains symbols from COGL, even
though we provide a Cogl GIR as well. The Clutter GIR should
depend on the Cogl GIR instead.

15 years agobuild: don't double install clutter-version.h
Marc-André Lureau [Sat, 30 May 2009 20:58:03 +0000 (23:58 +0300)]
build: don't double install clutter-version.h

Automake 1.11 installs several files in one command, and it fails if
the same file is installed two times.

See NEWS for details:
http://lists.gnu.org/archive/html/automake/2009-05/msg00093.html

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years ago[git ignore] Add report XML output file
Emmanuele Bassi [Mon, 1 Jun 2009 11:51:23 +0000 (12:51 +0100)]
[git ignore] Add report XML output file

15 years agoUniformly use floats in Actor properties
Emmanuele Bassi [Sun, 31 May 2009 14:15:46 +0000 (15:15 +0100)]
Uniformly use floats in Actor properties

All the underlying implementation and the public entry points have
been switched to floats; the only missing bits are the Actor properties
that deal with positioning and sizing.

This usually means a major pain when dealing with GValues and varargs
functions. While GValue will warn you when dealing with the wrong
conversions, varags will simply die an horrible (and hard to debug)
death via segfault. Nothing much to do here, except warn people in the
release notes and hope for the best.

15 years ago[texture] Increase verbosity of error messages
Emmanuele Bassi [Sun, 31 May 2009 14:07:58 +0000 (15:07 +0100)]
[texture] Increase verbosity of error messages

The GError messages in set_from_rgb_data() and set_from_yuv_data()
are a little bit too thin on details.

15 years ago[docs] Remove misleading text
Emmanuele Bassi [Sun, 31 May 2009 14:06:16 +0000 (15:06 +0100)]
[docs] Remove misleading text

The documentation for ClutterTexture's set_from_rgb_data() and
set_from_yuv_data() says:

  Note: This function is likely to change in future versions.

This is not true, since they'll remain for the whole 1.x API cycle.

15 years ago[pango-display-list] Use the CoglAttributeType macros instead of GL_FLOAT
Neil Roberts [Fri, 29 May 2009 10:52:21 +0000 (11:52 +0100)]
[pango-display-list] Use the CoglAttributeType macros instead of GL_FLOAT

Cogl now has an enum for the VBO attribute type so we should use that
instead of the GL enums.

15 years ago[pango-display-list] Use indexed vertices on GLES
Neil Roberts [Fri, 29 May 2009 10:38:03 +0000 (11:38 +0100)]
[pango-display-list] Use indexed vertices on GLES

Now that CoglVertexBuffers support indices we can use them with GLES
to avoid duplicating vertices. Regular GL still uses GL_QUADS because
it is shown to still have a performance benefit over indices with the
Intel drivers.

15 years ago[cogl-vertex-buffer] Add cogl_vertex_buffer_indices_get_for_quads
Neil Roberts [Thu, 28 May 2009 12:47:18 +0000 (13:47 +0100)]
[cogl-vertex-buffer] Add cogl_vertex_buffer_indices_get_for_quads

This function can be used as an efficient way of drawing groups of
quads without using GL_QUADS. It generates a VBO containing the
indices needed to render using pairs of GL_TRIANGLES. The VBO is
globally cached so that it only needs to be uploaded whenever more
indices are requested than ever before.

15 years ago[actor] Add allocate_available_size()
Emmanuele Bassi [Fri, 29 May 2009 16:53:19 +0000 (17:53 +0100)]
[actor] Add allocate_available_size()

The allocate_available_size() method is a convenience method in
the same spirit as allocate_preferred_size(). While the latter
will allocate the preferred size of an actor regardless of the
available size provided by the actor's parent -- and thus it's
suitable for simple fixed layout managers like ClutterGroup -- the
former will take into account the available size provided by the
parent and never allocate more than that; it is, thus, suitable
for simple fluid layout managers.

15 years ago[build] Remove cogl-enum-types.h on distclean
Emmanuele Bassi [Fri, 29 May 2009 16:50:58 +0000 (17:50 +0100)]
[build] Remove cogl-enum-types.h on distclean

The cogl-enum-types.h file is created by glib-mkenums under
/clutter/cogl/common, and then copied in /clutter/cogl in order
to make the inclusion of that file work inside cogl.h.

Since we're copying it in a different location, the Makefile
for that location has to clean up the copy.

15 years ago[build] Fix dist issues
Emmanuele Bassi [Fri, 29 May 2009 16:10:27 +0000 (17:10 +0100)]
[build] Fix dist issues

* cogl-deprecated.h is not being installed

* cogl-enum-types.c.in is not part of the dist

15 years agoFreeze notifiers around property setters
Jonas Bonn [Thu, 28 May 2009 07:47:45 +0000 (09:47 +0200)]
Freeze notifiers around property setters

Notifications should be fired off from both the internal timeline and
the wrapping animation here, so notifiers should be frozen around these
property setters.

Signed-off-by: Jonas Bonn <jonas@southpole.se>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years ago[animation] Final cleanups to new Animation model
Jonas Bonn [Thu, 28 May 2009 07:40:09 +0000 (09:40 +0200)]
[animation] Final cleanups to new Animation model

Just a couple of final cleanups after the reimplementation of the
Animation model.

i)  _set_mode does not need to set the timeline on the alpha
ii) freeze notifications around the setting of a new alpha

Signed-off-by: Jonas Bonn <jonas@southpole.se>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years ago[master clock] Use StageManager::peek_stages()
Emmanuele Bassi [Fri, 29 May 2009 13:52:49 +0000 (14:52 +0100)]
[master clock] Use StageManager::peek_stages()

Use the new StageManager::peek_stages() method to avoid a copy
of the stages list.

15 years ago[stage manager] Add peek_stages()
Emmanuele Bassi [Fri, 29 May 2009 13:45:53 +0000 (14:45 +0100)]
[stage manager] Add peek_stages()

We need an method for StageManager that returns a const pointer
to the internal list, to avoid the copy.

15 years ago[master clock] Handle Timeline::started signal correctly
Emmanuele Bassi [Fri, 29 May 2009 13:25:19 +0000 (14:25 +0100)]
[master clock] Handle Timeline::started signal correctly

The "started" signal is sent first after the timeline has been set to the
'running' state. For this reason, checking if the clock has any running
timelines running will always return true in the "started" signal handler:
the timeline that sent the signal is running.

What needs to be checked in the signal handler is if there are any
timelines running other than the one that emitted the ::started signal,
which we know is running anyway.

This prevents frames from being lost at the beginning of an animation when
a timeline is started after a quiescent period.

Fixes bug:

  http://bugzilla.openedhand.com/show_bug.cgi?id=1617

Signed-off-by: Jonas Bonn <jonas@southpole.se>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years ago[build] Copy cogl-enum-types.h under the guard
Emmanuele Bassi [Fri, 29 May 2009 13:27:55 +0000 (14:27 +0100)]
[build] Copy cogl-enum-types.h under the guard

We avoid rebuilding cogl-enum-types.h and cogl-enum-types.c by
using a "guard" -- a stamp file that will block Makefile. Since
we need cogl-enum-types.h into /clutter/cogl as well for the
cogl.h include to work, if we copy the cogl-enum-types.h
unconditionally it will cause a rebuild of the whole COGL; which
will cause a full rebuild.

To solve this, we can copy the header file when generating it
under the stamp file.