profile/ivi/clutter.git
15 years agoUndeprecate clutter_actor_set_scale_with_gravity
Neil Roberts [Wed, 28 Jan 2009 16:24:02 +0000 (16:24 +0000)]
Undeprecate clutter_actor_set_scale_with_gravity

The scale center has returned so this function is available again but
it was still deprecated so you couldn't use it.

15 years agoMerge branch 'scale-center'
Neil Roberts [Wed, 28 Jan 2009 09:08:19 +0000 (09:08 +0000)]
Merge branch 'scale-center'

Bug 1349 - Using the anchor point to set the scale center is messy

The branch adds an extra center point for scaling which can be used
for example to set a scale about the center without affecting the
position of the actor.

The scale center can be specified as a unit offset from the origin or
as a gravity. If specified as a gravity it will be stored as a
fraction of the actor's size so that the position will track when the
actor changes size.

The anchor point and rotation centers have been modified so they can
be set with a gravity in the same way. However, only the Z rotation
exposes a property to set using a gravity because the other two
require a Z coordinate which doesn't make sense to interpret as a
fraction of the actor's width or height.

Conflicts:

clutter/clutter-actor.c

15 years ago[clutter-actor] Use G_STMT_START/END instead of do { } while (0)
Neil Roberts [Wed, 28 Jan 2009 15:25:38 +0000 (15:25 +0000)]
[clutter-actor] Use G_STMT_START/END instead of do { } while (0)

In the TRANSFORM_ABOUT_ANCHOR_COORD macro it now uses G_STMT_START and
G_STMT_END instead of directly using do/while because it's more
readable.

15 years agoUpdate NEWS file
Emmanuele Bassi [Wed, 28 Jan 2009 14:36:45 +0000 (14:36 +0000)]
Update NEWS file

15 years agoUpdate the release notes for 1.0
Emmanuele Bassi [Wed, 28 Jan 2009 14:07:23 +0000 (14:07 +0000)]
Update the release notes for 1.0

Add items about the ClutterBehaviourBspline and ClutterEffect
API removals.

15 years ago[cogl-texture] Fix order of tex coords when compensating for waste
Neil Roberts [Wed, 28 Jan 2009 12:57:06 +0000 (12:57 +0000)]
[cogl-texture] Fix order of tex coords when compensating for waste

When drawing a texture with waste in _cogl_multitexture_unsliced_quad
it scales the texture coordinates so that the waste is not
included. However the formula was the wrong way around so it was
calculating as if the texture coordinates are ordered x1,x2,y1,y2 but
it is actually x1,y1,x2,y2.

15 years ago[text-backface-culling] Fix width/height parameters to cogl_rectangle
Neil Roberts [Wed, 28 Jan 2009 12:06:39 +0000 (12:06 +0000)]
[text-backface-culling] Fix width/height parameters to cogl_rectangle

During the upgrade to cogl material, test-backface-culling was
switched to use cogl_rectangle instead of cogl_texture_rectangle to
draw the textures. However, cogl_rectangle takes a width and height
instead of the the top-left and bottom-right vertices so the
rectangles were being drawn in the wrong place.

15 years ago[cogl-texture] Reset size of vertex log after drawing a polygon
Neil Roberts [Wed, 28 Jan 2009 12:00:01 +0000 (12:00 +0000)]
[cogl-texture] Reset size of vertex log after drawing a polygon

Otherwise trying to render a rectangle after a polygon doesn't work
because it expects the array to be empty when it starts logging
vertices.

15 years agoFix rectangles_with_multitexture_coords for sliced without tex coords
Neil Roberts [Wed, 28 Jan 2009 11:29:49 +0000 (11:29 +0000)]
Fix rectangles_with_multitexture_coords for sliced without tex coords

When the texture is sliced it drops back to a fallback function and
passes it the texture coordinates from the rectangle. However if no
tex coords are given it would crash. Now it passes the default
0.0->1.0 tex coords instead.

15 years agoFix _cogl_texture_unsliced_quad when no texture coordinates are given
Neil Roberts [Wed, 28 Jan 2009 11:09:47 +0000 (11:09 +0000)]
Fix _cogl_texture_unsliced_quad when no texture coordinates are given

If no texture coordinates are given then texture_unsliced_quad tries
to generate its own coordinates. However it also tries to read the
texture coordinates to check if they are in [0.0,1.0] range so it will
crash before it reaches that.

15 years agoReuse the layers list
Emmanuele Bassi [Wed, 28 Jan 2009 11:56:12 +0000 (11:56 +0000)]
Reuse the layers list

Instead of getting the layers list twice from the Material, we
can reuse the list when we need to retrieve the first layer.

15 years agoRemove gtk-doc annotation
Emmanuele Bassi [Wed, 28 Jan 2009 11:55:19 +0000 (11:55 +0000)]
Remove gtk-doc annotation

The _cogl_material_flush_layers_gl_state() function is static,
so it should not have a gtk-doc annotation.

15 years agoFix typo in the :clone getter method
Emmanuele Bassi [Tue, 27 Jan 2009 20:06:58 +0000 (20:06 +0000)]
Fix typo in the :clone getter method

The :clone property getter method, clutter_clone_get_source(), was
defined using the wrong name of clutter_clone_get_clone_source().

15 years agoUpdate the release notes for 1.0
Emmanuele Bassi [Tue, 27 Jan 2009 17:44:49 +0000 (17:44 +0000)]
Update the release notes for 1.0

Add entries for the removal of:

  - ClutterLabel
  - ClutterEntry
  - ClutterCloneTexture

15 years agoFix building GLES after _cogl_texture_handle_from_pointer got removed
Neil Roberts [Wed, 28 Jan 2009 10:52:55 +0000 (10:52 +0000)]
Fix building GLES after _cogl_texture_handle_from_pointer got removed

Commit a688b1db removed the function and replaced it with a direct
cast. This was also being used in the GL ES so the build broke.

15 years agoDirectly set backend font options in clutter_set_font_flags
Neil Roberts [Tue, 27 Jan 2009 16:55:25 +0000 (16:55 +0000)]
Directly set backend font options in clutter_set_font_flags

Instead of having a separate set of font options that override the
backend options when clutter_set_font_flags is called, it now just
directly sets the backend font options. So now the font flags are just
a convenience wrapper around the backend font options.

This also makes the ClutterText labels automatically update when the
font flags are changed because they will respond to the 'font-changed'
signal from the backend.

15 years agoListen for the font-changed signal on the backend in ClutterText
Neil Roberts [Tue, 27 Jan 2009 16:47:20 +0000 (16:47 +0000)]
Listen for the font-changed signal on the backend in ClutterText

Whenever a ClutterText is created it now connects to the font-changed
signal. When it is emitted the layout cache is dirtied and a relayout
is queued. That way changes to the font options or resolution will
cause an immediate update to the labels in the scene.

15 years ago[docs] Documentation fixes
Emmanuele Bassi [Tue, 27 Jan 2009 16:53:01 +0000 (16:53 +0000)]
[docs] Documentation fixes

Update the COGL API reference to avoid a lot of warnings coming
from gtk-doc.

15 years ago[docs] Update Clutter API reference symbols
Emmanuele Bassi [Tue, 27 Jan 2009 16:41:51 +0000 (16:41 +0000)]
[docs] Update Clutter API reference symbols

Add the new symbols from the ClutterClone and COGL material API
to the API reference.

15 years agoRemoved unused conditional
Emmanuele Bassi [Tue, 27 Jan 2009 16:40:51 +0000 (16:40 +0000)]
Removed unused conditional

USE_COGL_MATERIAL is a left-over from the development branch.

15 years agoMerge branch 'generic-actor-clone'
Emmanuele Bassi [Tue, 27 Jan 2009 16:12:30 +0000 (16:12 +0000)]
Merge branch 'generic-actor-clone'

* generic-actor-clone:
  Remove CloneTexture from the API
  [tests] Clean up the Clone interactive test
  Rename ActorClone to Clone/2
  Rename ActorClone to Clone/1
  Improves the unit test to verify more awkward scaling and some corresponding fixes
  Implements a generic ClutterActorClone that doesn't need fbos.

15 years agoFallout from cogl-material merge
Emmanuele Bassi [Tue, 27 Jan 2009 16:02:04 +0000 (16:02 +0000)]
Fallout from cogl-material merge

When enabling the maintainer CFLAGS the compiler got very angry
at the code that has been merged.

15 years agoAdds padding to CoglColor to future proof it a bit
Robert Bragg [Tue, 27 Jan 2009 11:01:23 +0000 (11:01 +0000)]
Adds padding to CoglColor to future proof it a bit

This adds enough padding to allow us to change to an internal float storage
for the color components if needs be in the future.

15 years agoSupport scaling on the z axis with cogl_scale
Robert Bragg [Mon, 26 Jan 2009 22:52:38 +0000 (22:52 +0000)]
Support scaling on the z axis with cogl_scale

This simply adds a z argument to cogl_scale and updates clutter-actor.c
to pass 1.0 for the z scale.

15 years agoMerge branch 'cogl-material'
Robert Bragg [Tue, 27 Jan 2009 15:19:34 +0000 (15:19 +0000)]
Merge branch 'cogl-material'

Conflicts:

clutter/cogl/gl/cogl-texture.c
clutter/cogl/gles/cogl-primitives.c

* cogl-material:
 clutter-{clone-,}texture weren't updating their material opacity.
 Updates GLES1 support for CoglMaterial
 Normalizes gl vs gles code in preperation for synching material changes
 Removes cogl_blend_func and cogl_alpha_func
 Fully integrates CoglMaterial throughout the rest of Cogl
 [cogl-material] Restore the GL_TEXTURE_ENV_MODE after material_rectangle
 [cogl-material] Make the user_tex_coords parameter of _rectangle const
 [test-cogl-material] Remove return value from material_rectangle_paint
 Add cogl-material.h and cogl-matrix.h to libclutterinclude_HEADERS
 [cogl-material] improvements for cogl_material_rectangle
 [cogl-material] Adds a cogl_material_set_color function
 [cogl-material] Some improvements for how we sync CoglMaterial state with OpenGL
 [cogl-material] Converts clutter-texture/clutter-clone-texture to the material API
 [doc] Hooks up cogl-material reference documentation
 Updates previous GLES multi-texturing code to use CoglMaterial
 Adds a CoglMaterial abstraction, which includes support for multi-texturing
 [doc] Hooks up cogl-matrix reference documentation
 Adds CoglMatrix utility code
 [tests] Adds an interactive unit test for multi-texturing
 [multi-texturing] This adds a new cogl_multi_texture API for GL,GLES1 + GLES2

15 years agoRemove CloneTexture from the API
Emmanuele Bassi [Tue, 27 Jan 2009 15:18:45 +0000 (15:18 +0000)]
Remove CloneTexture from the API

ClutterClone supercedes ClutterCloneTexture, since it can clone
every kind of actor -- including composite ones.

This is another "brain surgery with a shotgun" kind of commit: it
removes CloneTexture and updates every test case using CloneTexture
to ClutterClone. The API fallout is minimal, luckily for us.

15 years agoRemoves test-simple from tests/interactive/Makefile.am
Robert Bragg [Tue, 27 Jan 2009 15:17:16 +0000 (15:17 +0000)]
Removes test-simple from tests/interactive/Makefile.am

The addition was accidental

15 years agoReplace clutter_set_use_mipmapped_text with clutter_set_font_flags
Neil Roberts [Tue, 27 Jan 2009 14:25:50 +0000 (14:25 +0000)]
Replace clutter_set_use_mipmapped_text with clutter_set_font_flags

The hope is that this function makes it easier to extend the font
settings with more flags without having to add a function for every
setting.

A new flag for enabling hinting has been added. If set, this changes
the font options on the global PangoContext and any newly created
PangoContexts. The options are only set if the flag is changed from
the default so it won't override any detailed setting chosen by the
backend.

15 years ago[tests] Clean up the Clone interactive test
Emmanuele Bassi [Tue, 27 Jan 2009 14:36:12 +0000 (14:36 +0000)]
[tests] Clean up the Clone interactive test

Do not assume the default stage, and store more data inside the
"application" structure that gets passed around instead of relying
on macros.

15 years agoclutter-{clone-,}texture weren't updating their material opacity.
Robert Bragg [Mon, 26 Jan 2009 15:25:55 +0000 (15:25 +0000)]
clutter-{clone-,}texture weren't updating their material opacity.

cogl_set_source_color4ub was previously used to set a transparent
white source color according to the actors opacity, but since
cogl_set_source_color now always implies you want a solid fill we
we use cogl_material_set_color4ub to achieve the same result.

15 years agoUpdates GLES1 support for CoglMaterial
Robert Bragg [Mon, 26 Jan 2009 11:07:35 +0000 (11:07 +0000)]
Updates GLES1 support for CoglMaterial

This updates cogl/gles in line with the integration of CoglMaterial throughout
Cogl that has been done for cogl/gl.

Note: This is still buggy, but at least it builds again and test-actors works.
Some GLES2 specific changes were made, but these haven't been tested yet.

15 years agoNormalizes gl vs gles code in preperation for synching material changes
Robert Bragg [Sat, 24 Jan 2009 16:55:04 +0000 (16:55 +0000)]
Normalizes gl vs gles code in preperation for synching material changes

This changes all GLES code to use the OpenGL function names instead of
the cogl_wrap_* names. For GLES2 we now define the OpenGL name to point
to the wrapper, as opposed to defining the wrapper to point to the
OpenGL name for GLES1.

I've also done a quick pass through gl/cogl.c and gles/cogl.c to make
them more easily comparable. (most of the code is now identical)

15 years agoRemoves cogl_blend_func and cogl_alpha_func
Robert Bragg [Sat, 24 Jan 2009 15:09:43 +0000 (15:09 +0000)]
Removes cogl_blend_func and cogl_alpha_func

The GL blend function and alpha function are now controlled by the material
code, and even internally Cogl should now be using the material API when
it needs control of these.

15 years agoFully integrates CoglMaterial throughout the rest of Cogl
Robert Bragg [Fri, 23 Jan 2009 16:15:40 +0000 (16:15 +0000)]
Fully integrates CoglMaterial throughout the rest of Cogl

This glues CoglMaterial in as the fundamental way that Cogl describes how to
fill in geometry.

It adds cogl_set_source (), which is used to set the material which will be
used by all subsequent drawing functions

It adds cogl_set_source_texture as a convenience for setting up a default
material with a single texture layer, and cogl_set_source_color is now also
a convenience for setting up a material with a solid fill.

"drawing functions" include, cogl_rectangle, cogl_texture_rectangle,
cogl_texture_multiple_rectangles, cogl_texture_polygon (though the
cogl_texture_* funcs have been renamed; see below for details),
cogl_path_fill/stroke and cogl_vertex_buffer_draw*.

cogl_texture_rectangle, cogl_texture_multiple_rectangles and
cogl_texture_polygon no longer take a texture handle; instead the current
source material is referenced. The functions have also been renamed to:
cogl_rectangle_with_texture_coords, cogl_rectangles_with_texture_coords
and cogl_polygon respectivly.

Most code that previously did:
  cogl_texture_rectangle (tex_handle, x, y,...);
needs to be changed to now do:
  cogl_set_source_texture (tex_handle);
  cogl_rectangle_with_texture_coords (x, y,....);

In the less likely case where you were blending your source texture with a color
like:
  cogl_set_source_color4ub (r,g,b,a); /* where r,g,b,a isn't just white */
  cogl_texture_rectangle (tex_handle, x, y,...);
you will need your own material to do that:
  mat = cogl_material_new ();
  cogl_material_set_color4ub (r,g,b,a);
  cogl_material_set_layer (mat, 0, tex_handle));
  cogl_set_source_material (mat);

Code that uses the texture coordinates, 0, 0, 1, 1 don't need to use
cog_rectangle_with_texure_coords since these are the coordinates that
cogl_rectangle will use.

For cogl_texture_polygon; as well as dropping the texture handle, the
n_vertices and vertices arguments were transposed for consistency. So
code previously written as:
  cogl_texture_polygon (tex_handle, 3, verts, TRUE);
need to be written as:
  cogl_set_source_texture (tex_handle);
  cogl_polygon (verts, 3, TRUE);

All of the unit tests have been updated to now use the material API and
test-cogl-material has been renamed to test-cogl-multitexture since any
textured quad is now technically a test of CoglMaterial but this test
specifically creates a material with multiple texture layers.

Note: The GLES backend has not been updated yet; that will be done in a
following commit.

15 years agoRename ActorClone to Clone/2
Emmanuele Bassi [Mon, 26 Jan 2009 11:03:12 +0000 (11:03 +0000)]
Rename ActorClone to Clone/2

Step two: rename the object and its methods.

While we're at it, adhere more strictly to the coding style
practises; rename :clone-source to :source; add a setter method
for the :source property; take a reference on the source actor
to avoid it disappearing while we're still accessing it.

15 years ago[tests] Remove an unused variable
Emmanuele Bassi [Tue, 27 Jan 2009 13:22:47 +0000 (13:22 +0000)]
[tests] Remove an unused variable

This fixes a compiler warning.

15 years agoBug 1388 - Clarify signal emission for advance_to_marker()
Emmanuele Bassi [Tue, 27 Jan 2009 11:25:06 +0000 (11:25 +0000)]
Bug 1388 - Clarify signal emission for advance_to_marker()

Like clutter_timeline_advance(), calling advance_to_marker() will
not emit ::new-frame for the frame where the marker is set on; it
will also not emit ::marker-reached for the marker we are advancing
the timeline to.

15 years agoBug 1387 - Clarify new-frame signal emission with advance()
Emmanuele Bassi [Tue, 27 Jan 2009 11:18:09 +0000 (11:18 +0000)]
Bug 1387 - Clarify new-frame signal emission with advance()

When calling clutter_timeline_advance(), a timeline will not emit
the ::new-frame signal for the frame we are advancing to, as this
would break the invariants of the timeline behaviour.

The documentation should make this clear.

15 years ago[timeline] Check the fps property range in the ctor
Emmanuele Bassi [Tue, 27 Jan 2009 10:35:50 +0000 (10:35 +0000)]
[timeline] Check the fps property range in the ctor

The clutter_timeline_new() constructor is not checking the full
range of the passed :fps property. The ParamSpec of the property
and the setter method perform this check, so the ctor should as
well.

15 years ago[timeline] Move a complex condition into its own function
Emmanuele Bassi [Tue, 27 Jan 2009 10:33:44 +0000 (10:33 +0000)]
[timeline] Move a complex condition into its own function

The "is-timeline-complete" condition is pretty long, spanning
four lines and four logical sub-conditions. It is possible to
neatly move it into an is_complete() function and make the
code more readable.

15 years ago[timeline] Intern signal names
Emmanuele Bassi [Tue, 27 Jan 2009 10:32:15 +0000 (10:32 +0000)]
[timeline] Intern signal names

The signal names are static string and thus should be interned
so that Glib can do a simple pointer comparison whenever needed,
instead of a strcmp().

15 years ago[timeline] Whitespace fixes
Emmanuele Bassi [Tue, 27 Jan 2009 10:31:53 +0000 (10:31 +0000)]
[timeline] Whitespace fixes

15 years ago[timeline] Documentation and comment fixes
Emmanuele Bassi [Tue, 27 Jan 2009 10:27:33 +0000 (10:27 +0000)]
[timeline] Documentation and comment fixes

The long description of the ClutterTimeline class is very C
developer-oriented. Since many language bindings will refer to
the C API reference we should probably be more verbose and
language agnostic -- at least in the class description.

The methods documentation also requires a little pass to increase
the consistency of the terminology, the grammar and the syntax.

Finally, comments never killed anyone.

15 years ago[tests] Assert as soon as possible
Emmanuele Bassi [Fri, 23 Jan 2009 17:56:25 +0000 (17:56 +0000)]
[tests] Assert as soon as possible

In order to give a usable location of the errors in the test
suite, we need to assert() as soon as possible.

15 years ago[timeline] Create markers hash tables on demand
Emmanuele Bassi [Fri, 23 Jan 2009 17:17:36 +0000 (17:17 +0000)]
[timeline] Create markers hash tables on demand

Since not every timeline will have markers it's unfair to make
all of them crete two empty hash tables (with a preallocated
fixed size).

This commit moves the responsibility of creating the hash tables
to the marker API itself, and adds the relative checks.

15 years ago[timeline] Limit timelines to 1000 frames per second
Emmanuele Bassi [Fri, 23 Jan 2009 17:14:39 +0000 (17:14 +0000)]
[timeline] Limit timelines to 1000 frames per second

Since we are using milliseconds granularity to integrate timelines
with the GLib main loop, we cannot allow values of the :fps
property bigger than 1000. This means validating the fps value both
in the GParamSpec and the clutter_timeline_set_speed() accessor
function.

This should also fix floating point exceptions when trying to
perform "n_frames = milliseconds / (1000 / fps)".

See bug 1354:

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

15 years agoBug 1414 - avoid relayout of ClutterTexture if not syncing size
Havoc Pennington [Mon, 26 Jan 2009 16:24:17 +0000 (16:24 +0000)]
Bug 1414 - avoid relayout of ClutterTexture if not syncing size

If a ClutterTexture does not sync size, it should be possible to
change the texture size without causing a relayout.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years agoBug 1415 - short-circuit setting same clip again
Havoc Pennington [Mon, 26 Jan 2009 16:22:39 +0000 (16:22 +0000)]
Bug 1415 - short-circuit setting same clip again

There is some GL work and a repaint anytime the clip is set
or unset, so avoid that if it isn't really changed.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years agoSet the SYNC_MATRICES flag when a stage is first realized
Neil Roberts [Wed, 21 Jan 2009 12:47:29 +0000 (12:47 +0000)]
Set the SYNC_MATRICES flag when a stage is first realized

The stage will usually be painted before the first ConfigureNotify
arrives so we need to set the SYNC_MATRICES flag to ensure that the
viewport will be correct for that paint. Unfortunately this means that
the viewport will be set again once the ConfigureNotify is received
but compared to rendering an initial invalid scene I think it is the
lesser of two evils.

15 years agoRename ActorClone to Clone/1
Emmanuele Bassi [Mon, 26 Jan 2009 10:32:53 +0000 (10:32 +0000)]
Rename ActorClone to Clone/1

Step one of the ActorClone -> Clone renaming: rename the files.

15 years agoWhitespace fixes for BehaviourEllipse
Emmanuele Bassi [Fri, 23 Jan 2009 16:50:17 +0000 (16:50 +0000)]
Whitespace fixes for BehaviourEllipse

Simple fallout from the automated conversion scripts that
switched from ClutterFixed to float.

15 years agoBug 1395 - apply and get_nth_actor are inconsistent
Emmanuele Bassi [Fri, 23 Jan 2009 16:22:02 +0000 (16:22 +0000)]
Bug 1395 - apply and get_nth_actor are inconsistent

When calling clutter_behaviour_apply() the new actor is prepended
to the list of actors to which a behaviour is applied; this breaks
the rest of methods working on the actors list, e.g.:

  # adding actors
  apply(actor_0);
  apply(actor_1);
  apply(actor_2);

  # expected: [ actor_0, actor_1, actor_2 ]
  [ actor_2, actor_1, actor_0 ] = get_actors();

  # expected: actor_2
  actor_0 = get_nth_actor(2);

This commit fixes the inconsistency in the returned values.

15 years agoFix the Cogl primitives for the GLES backend
Neil Roberts [Sat, 24 Jan 2009 00:25:24 +0000 (00:25 +0000)]
Fix the Cogl primitives for the GLES backend

The Cogl primitives broke for GLES 1.1 and 2 after the cogl-float
branch merge.

CoglPathNode was still being declared as GLfixed for the GLES backend
but it was being filled with float values so they were all ending up
as numbers < 1.

glDrawArrays was being called with GL_FIXED so this has been changed
to GL_FLOAT.

The scanline rasterizer had a leftover hardcoded ClutterFixed constant
to add a small amount to the height of each line.

struct _CoglFloatVec2 has been removed because it is no longer used
anywhere.

15 years agoSimplify test-cogl-primitives
Neil Roberts [Fri, 23 Jan 2009 23:55:44 +0000 (23:55 +0000)]
Simplify test-cogl-primitives

This removes a lot of code from test-cogl-primitives to make it easier
to follow. The TestCoglBox custom actor has gone and instead a blank
ClutterGroup is created with a paint signal handler.

Instead of rendering constantly and updating when a GTimer elapses a
second, a ClutterTimeline is used with 1 fps and a new redraw is
queued every frame.

The custom main loop is replaced with a regular call to clutter_main.
This fixes the close button of the stage window so you can quit
without having to press Ctrl+C.

15 years ago[test-cogl-primitives] Remove trailing whitespace
Neil Roberts [Fri, 23 Jan 2009 23:41:26 +0000 (23:41 +0000)]
[test-cogl-primitives] Remove trailing whitespace

15 years ago[clutter-timeline] Remove the code for backwards timelines in get_progress
Neil Roberts [Fri, 23 Jan 2009 22:57:36 +0000 (22:57 +0000)]
[clutter-timeline] Remove the code for backwards timelines in get_progress

The special check to invert the progress when the timeline direction
is backwards is not necessary because the actual frame number will be
decreasing in that case. Inverting just makes it progress forwards
again.

This is more apparent since the float-alpha-value branch merge because
the clutter_linear function directly returns the value from
get_progress. For example in test-depth, the animations loop instead
of oscillating back and forth.

15 years agoFix gtk-doc reference since the anchor point changes
Neil Roberts [Fri, 23 Jan 2009 17:25:43 +0000 (17:25 +0000)]
Fix gtk-doc reference since the anchor point changes

The documentation has been updated to reflect the fact that the anchor
point will move when the actor changes size if it was specified using
a gravity value. The new functions for setting the scale center and z
rotation gravity are also documented.

15 years ago[test-anchors] Add tests for the rotation centers
Neil Roberts [Fri, 23 Jan 2009 15:57:20 +0000 (15:57 +0000)]
[test-anchors] Add tests for the rotation centers

The rotation centers are now tested in a similar way to the anchor
point and scale centers.

The notification handling code has been simplified a bit to handle the
increased amount of properties.

15 years agoConvert the rotation centers to be AnchorCoords
Neil Roberts [Fri, 23 Jan 2009 15:55:41 +0000 (15:55 +0000)]
Convert the rotation centers to be AnchorCoords

Currently only the Z axis rotation center can be set using a gravity
but the other rotations also store their center as an AnchorCoord for
consistency. Specifying the center as a gravity makes less sense for
the other axes because the actors have no size along the Z axis.

The rotation angles are now stored as gdoubles and the fixed point *x
entry points have been removed.

The Z rotation can now be set with a gravity center using the
following new function:

void clutter_actor_set_z_rotation_from_gravity (ClutterActor   *self,
                                                gdouble         angle,
                                                ClutterGravity  gravity);

15 years ago[test-anchors] Add tests for the scale center
Neil Roberts [Fri, 23 Jan 2009 11:12:54 +0000 (11:12 +0000)]
[test-anchors] Add tests for the scale center

A separate set of tests for the scale center have been added that work
in a similar way to the anchor point tests.

15 years agoAdd a scale center property to ClutterActor
Neil Roberts [Fri, 23 Jan 2009 11:11:24 +0000 (11:11 +0000)]
Add a scale center property to ClutterActor

This sets the center point from which the scaling will occur. This can
be used insetad of the anchor point to avoid moving the actor. Like
the anchor point, it can be specified as either a coordinate in units
or a gravity enum.

To set the center you can use two new variants of set_scale:

clutter_actor_set_scale_full (ClutterActor *self,
                              gdouble       scale_x,
                              gdouble       scale_y,
                              int           center_x,
                              int           center_y);

or

clutter_actor_set_scale_with_gravity (ClutterActor   *self,
                                      gdouble         scale_x,
                                      gdouble         scale_y,
                                      ClutterGravity  gravity);

The ClutterFixed variants of the set_scale functions have been removed
and the scale value is now always stored as a double.

15 years agoAdd a conformance test for the anchor point
Neil Roberts [Thu, 22 Jan 2009 13:14:02 +0000 (13:14 +0000)]
Add a conformance test for the anchor point

This verifies that the anchor point can be set from a gravity and then
it moves when the anchor point changes size.

15 years agoStore when the anchor point is set from a gravity
Neil Roberts [Thu, 22 Jan 2009 13:07:33 +0000 (13:07 +0000)]
Store when the anchor point is set from a gravity

This makes it so when the anchor point is set using a gravity enum
then the anchor point moves when the actor changes size. A new
property is added for the anchor point gravity. If the anchor point is
set from gravity then the position in units can also be retreived with
the regular API.

A new union type is used to store the anchor point with helper
accessor functions. The hope is these can be reused for the scale and
rotation center points.

15 years ago[test-text] Use g_setenv instead of setenv
Neil Roberts [Fri, 23 Jan 2009 18:20:46 +0000 (18:20 +0000)]
[test-text] Use g_setenv instead of setenv

setenv doesn't appear to be available on Windows so it fails to
compile.

15 years agoMerge commit 'origin/master' into cogl-material
Robert Bragg [Fri, 23 Jan 2009 15:23:49 +0000 (15:23 +0000)]
Merge commit 'origin/master' into cogl-material

Conflicts:

clutter/clutter-texture.c
clutter/cogl/cogl-texture.h
clutter/cogl/cogl.h.in
clutter/cogl/common/Makefile.am
clutter/cogl/gl/Makefile.am
clutter/cogl/gles/Makefile.am
clutter/cogl/gles/cogl-gles2-wrapper.c
clutter/cogl/gles/cogl-gles2-wrapper.h

15 years agoBug 1361 - Unused ClutterStage::get_resolution() methods
Emmanuele Bassi [Fri, 23 Jan 2009 15:16:21 +0000 (15:16 +0000)]
Bug 1361 - Unused ClutterStage::get_resolution() methods

The clutter_stage_get_resolution() and fixed-point API are just
shorthands for:

        clutter_backend_get_resolution (default_backend);

And as such do not fit at all in the ClutterStage class. The only
reason for their existence was the ClutterUnit conversion macros,
which have now been fixed to use the default backend through a
function call instead.

Thus, we can safely remove the stage entry points.

15 years agoClean up the test reports
Emmanuele Bassi [Fri, 23 Jan 2009 13:29:55 +0000 (13:29 +0000)]
Clean up the test reports

Since we override the clean-generic target in order to remove
the shell scripts we create for each conformance test unit, we
cannot use CLEANFILES to remove the test reports.

15 years agoSplit maintainer-flags from the compiler flags
Emmanuele Bassi [Fri, 23 Jan 2009 13:09:51 +0000 (13:09 +0000)]
Split maintainer-flags from the compiler flags

The maintainer compiler flags we use trigger warnings and errors
in the autogenerated code that gtk-doc creates to scan the header
and source files. Since we cannot control that, and we must run
a distcheck with both --enable-gtk-doc and --enable-maintainer-flags
turned on, we need to use less-strict compiler flags when inside
the doc/reference subdirectories.

The way to do this is to split the maintainer compiler flags into
their own Makefile variable, called MAINTAINER_CFLAGS. The we
can use $(MAINTAINER_CFLAGS) in the INCLUDES or _CFLAGS sections
of each part of the source directories we wish to check with the
anal retentiveness suited for maintainers.

15 years agoFix compiler warnings
Emmanuele Bassi [Fri, 23 Jan 2009 13:08:46 +0000 (13:08 +0000)]
Fix compiler warnings

The maintainer-flags option discovered the usual amount of
collisions and compiler warnings we have to fix in order to
get distcheck to pass.

15 years agoMerge branch 'float-alpha-value'
Emmanuele Bassi [Fri, 23 Jan 2009 12:10:50 +0000 (12:10 +0000)]
Merge branch 'float-alpha-value'

* float-alpha-value:
  [script] Parse easing modes by name
  [docs] Update the easing modes documentation
  [animation] Implement new easing functions
  [animation] Move the alpha value to floating point

15 years ago[actor] Add the ::pick signal to the Actor class
Emmanuele Bassi [Fri, 23 Jan 2009 11:34:13 +0000 (11:34 +0000)]
[actor] Add the ::pick signal to the Actor class

Since we allow overriding the paint() implementation through the
::paint signal to change the way an actor is being painted, we
should also allow overriding the pick() implementation using a
::pick signal.

15 years agoFix some failures from the fixed-to-float script in cogl-texture
Neil Roberts [Thu, 22 Jan 2009 17:42:26 +0000 (17:42 +0000)]
Fix some failures from the fixed-to-float script in cogl-texture

The script converted calls to COGL_FIXED_MUL(x,y) to (x*y). However
this fails for cases like this:

 COGL_FIXED_MUL(a + b, c)

which become

 (a + b * c)

The meaning of this is of course different because multiplication has
a higher precedence than addition.

This was causing breakages in cogl_texture_quad_sw when the vertex
coordinates are not in increasing order. This was the case in
test-backface-culling when NPOTs are not available.

15 years ago[gitignore] Update ignore file with the new tests
Emmanuele Bassi [Thu, 22 Jan 2009 16:55:51 +0000 (16:55 +0000)]
[gitignore] Update ignore file with the new tests

15 years ago[tests] Use the right value in cogl_texture_new*
Emmanuele Bassi [Thu, 22 Jan 2009 16:54:49 +0000 (16:54 +0000)]
[tests] Use the right value in cogl_texture_new*

The correct symbol for disabling the flags when creating a new
COGL texture is COGL_TEXTURE_NONE.

15 years agoImprove accuracy of clutter_sinx()
Emmanuele Bassi [Thu, 22 Jan 2009 15:59:23 +0000 (15:59 +0000)]
Improve accuracy of clutter_sinx()

Improve clutter_sinx() by replacing the low precision CFX_SIN_STEP
with a multiply/divide pair. This reduces the maximum error from
1.8e-04 to 2.4e-05.

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

Based on a patch by Owen W. Taylor <otaylor@fishsoup.net>

15 years agoUse the allocation to get the pick area
Emmanuele Bassi [Thu, 22 Jan 2009 15:55:43 +0000 (15:55 +0000)]
Use the allocation to get the pick area

Since a pick is really a paint operation, we can safely get
the allocation box, instead of using get_width() and get_height().

This should help cutting down the function calls. If we were
feeling adventurous, we could even use the allocation directly
from the private data structure.

Based on a patch by Gwenole Beauchesne <gbeauchesne@splitted-desktop.org>

15 years ago[gles] Fix computation of camera distance
Emmanuele Bassi [Thu, 22 Jan 2009 14:52:34 +0000 (14:52 +0000)]
[gles] Fix computation of camera distance

Port the fix in commit f409b58e to the GLES implementation of
COGL.

15 years agoFix computation of camera distance
Owen W. Taylor [Thu, 22 Jan 2009 14:17:16 +0000 (14:17 +0000)]
Fix computation of camera distance

Compute the value of the camera distance as exactly half the xx
component of the projection matrix. The heuristically derived
value for 60 degrees was off by about 0.016%, causing noticeable
blurring, and other field of view angles which didn't have the
heuristic adjustment off by much more.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years agoAvoid needlessly queue redraws for invisible actors
Emmanuele Bassi [Thu, 22 Jan 2009 13:58:50 +0000 (13:58 +0000)]
Avoid needlessly queue redraws for invisible actors

If an actor is not set as visible, or if it is in a section of
the scenegraph that it's set as not visible (e.g. one of the
parents is not visible) then we should not queue a redraw for
it.

Patch based on code from Michael Boccara <michael@graphtech.co.il>

15 years agoBug 1409 - Use G_SIGNAL_RUN_LAST with ::queue-redraw signal
Jason Tackaberry [Thu, 22 Jan 2009 13:38:32 +0000 (13:38 +0000)]
Bug 1409 - Use G_SIGNAL_RUN_LAST with ::queue-redraw signal

The intention behind ::queue-redraw is to be able to block the
default handler by attaching a callback and calling one of the
g_signal_stop_emission variants.

However this doesn't work, because ::queue-redraw has the
G_SIGNAL_RUN_FIRST flag instead of G_SIGNAL_RUN_LAST.

15 years agoFix typo in the flags update
Emmanuele Bassi [Thu, 22 Jan 2009 13:24:20 +0000 (13:24 +0000)]
Fix typo in the flags update

Epic en_GB keyboard FAIL.

15 years ago[units] Fix Units in GValue and ClutterParamSpecUnit
Emmanuele Bassi [Thu, 22 Jan 2009 12:11:25 +0000 (12:11 +0000)]
[units] Fix Units in GValue and ClutterParamSpecUnit

The GValue and GParamSpec integration of ClutterUnit was still
using the old, fixed-point based logic.

Storing ClutterUnits in a GValue should use floating point values,
and ClutterParamSpecUnit should follow suit.

15 years agoFix the format for a floating point value
Emmanuele Bassi [Thu, 22 Jan 2009 11:46:23 +0000 (11:46 +0000)]
Fix the format for a floating point value

The debug annotation was still expecting an integer after
we switched the angle to float.

15 years agoStore the units-per-em inside the Backend
Emmanuele Bassi [Thu, 22 Jan 2009 11:37:52 +0000 (11:37 +0000)]
Store the units-per-em inside the Backend

Instead of recomputing the number of units needed to fit in
an em each time clutter_units_em() is called, we can store this
value into the default Backend along with the resolution and
font name. The value should also be updated each time the
resolution and font are changed, to keep it up to date.

15 years ago[docs] Specify the coordinate space of ButtonEvent
Emmanuele Bassi [Wed, 21 Jan 2009 22:03:31 +0000 (22:03 +0000)]
[docs] Specify the coordinate space of ButtonEvent

The coordinates of each ButtonEvent are relative to the stage that
received the event, so we should document this in the structure
annotation.

It should also be mentioned that the coordinates can be transformed
into actor-relative coordinates by using transform_stage_point().

15 years agoAdd units-from-em conversion
Emmanuele Bassi [Wed, 21 Jan 2009 17:35:47 +0000 (17:35 +0000)]
Add units-from-em conversion

An em is a unit of measurement in typography, equal to the point
size of the current font.

It should be possible to convert a value expressed in em to
ClutterUnits by using the current font and the current DPI as
stored by the default backend.

15 years agoRemove the single-stage units converters
Emmanuele Bassi [Wed, 21 Jan 2009 17:10:36 +0000 (17:10 +0000)]
Remove the single-stage units converters

The stage-with/height-percentage converters had been broken by
the multiple-stages support of Clutter 0.8. They are also made
useless by the fact that Units are now floating point values.

The millimeters and typographic points converters also depended
on the default stage, but they can be reworked to use the default
DPI coming from the default Backend instead.

15 years ago[docs] Remove sources of warnings in API references
Emmanuele Bassi [Wed, 21 Jan 2009 16:41:18 +0000 (16:41 +0000)]
[docs] Remove sources of warnings in API references

15 years ago[docs] Add CoglTextureFlags to the API reference
Emmanuele Bassi [Wed, 21 Jan 2009 10:59:19 +0000 (10:59 +0000)]
[docs] Add CoglTextureFlags to the API reference

15 years ago[docs] Build COGL API reference first
Emmanuele Bassi [Wed, 21 Jan 2009 10:58:32 +0000 (10:58 +0000)]
[docs] Build COGL API reference first

Since the Clutter API reference needs some types from COGL's,
we should be building COGL's API reference first.

15 years ago[tests] Update the tests calling cogl_texture_new_*
Emmanuele Bassi [Sun, 18 Jan 2009 15:00:18 +0000 (15:00 +0000)]
[tests] Update the tests calling cogl_texture_new_*

The tests calling any of the cogl_texture_new_* family of functions
must be updated to the new constructor syntax.

15 years agoChange the COGL texture constructor to use flags
Emmanuele Bassi [Sun, 18 Jan 2009 14:51:19 +0000 (14:51 +0000)]
Change the COGL texture constructor to use flags

Boolean arguments for functions are pretty evil and usually
lead to combinatorial explosion of parameters in case multiple
settings are added.

In the case of the COGL texture constructors we have a boolean
argument for enabling the auto-mipmapping; it is conceivable that
we might want to add more settings for a COGL texture without
breaking API or ABI compatibility, so the boolean argument should
become a bitmask.

The internals have not been changed: instead of checking for
a non-zero value, we check for a bitmask being set.

15 years ago[docs] Update ClutterMedia section
Emmanuele Bassi [Fri, 16 Jan 2009 10:58:51 +0000 (10:58 +0000)]
[docs] Update ClutterMedia section

The ClutterMedia API has been changed, so we need to update
the API reference to reflect that.

15 years agoBug 1404 - ClutterMedia issues
Emmanuele Bassi [Fri, 16 Jan 2009 10:38:36 +0000 (10:38 +0000)]
Bug 1404 - ClutterMedia issues

ClutterMedia was a rough cut at a simple media API; it needs some
re-evaluation before 1.0 in order to keep it simple to use, and
simple to implement.

- ClutterMedia:position

  The position property accessors collide with the corresponding
  ClutterActor methods, which make it impossible to bind them in
  high-level languages:

    video_texture.set_position()
    video_texture.get_position()

  In order to resolve the collision, we have to go through the
  GObject properties API:

    video_texture.set('position', value)
    value = video_texture.get('position')

  A :position in seconds is also a GStreamer-ism, and should rather
  be converted to a :progress property, with a normalized value
  between 0 and 1. the current position in seconds would then simply
  be progress*duration. For non-seekable streams, 0.0 would always
  be returned. This makes it easier to use the progress inside
  animations, Timelines or ClutterPath instances.

- ClutterMedia:volume should be renamed to :audio-volume and normalized
  as well, instead of being a floating point value between 0 and 100.

- ClutterMedia:buffer-percent should just be :buffer-fill and normalized
  between 0.0 and 1.0

15 years agoRenames the mesh api to the "vertex buffer api".
Robert Bragg [Tue, 20 Jan 2009 21:12:44 +0000 (21:12 +0000)]
Renames the mesh api to the "vertex buffer api".

This better reflects the fact that the api manages sets of vertex attributes,
and the attributes really have no implied form. It is only when you use the
attributes to draw that they become mesh like; when you specify how they should
be interpreted, e.g. as triangle lists or fans etc. This rename frees up the
term "mesh", which can later be applied to a concept slightly more fitting.
E.g. at some point it would be nice to have a higher level abstraction that
sits on top of cogl vertex buffers that adds the concept of faces. (Somthing
like Blender's mesh objects.) There have also been some discussions over
particle engines, and these can be defined in terms of emitter faces; so some
other kind of mesh abstraction might be usefull here.

15 years agoRemoves the fixed-to-float scripts and patches
Robert Bragg [Tue, 20 Jan 2009 18:52:15 +0000 (18:52 +0000)]
Removes the fixed-to-float scripts and patches

Now that the conversion has been applied the scripts aren't needed any more

15 years agoMerge branch 'cogl-float'
Robert Bragg [Tue, 20 Jan 2009 17:22:21 +0000 (17:22 +0000)]
Merge branch 'cogl-float'

Okey; to summarise the changes...

We have converted Clutter and Cogl over to using floating point internally
instead of 16.16 fixed, but we have maintained the cogl-fixed API as a
utility to applications in case they want to implement their own optimizations.

The Clutter API has not changed (though ClutterFixed and ClutterUnit are now
internally floats) but all Cogl entry points have been changed to accept floats
now instead of CoglFixed.

To summarise the rationale...

There have been a number of issues with using fixed point though out Clutter
and Cogl including: lack of precision, lack of range, excessive format
conversion (GPUs tend to work nativly with IEEE floats) and maintainability.
One of the main arguments for fixed point - performance - hasn't shown
itself to be serious in practice so far since we seem to be more limited
by GPU performance and making improvements regarding how we submit data to
OpenGL[ES]/the GPU has had a more significant impact.

Ref: The recent multiple rectangle queuing changes + the
cogl-texture-agressive-batching branch which show significant performance
gains, and that recent tests on the ipodtouch (ARM + MBX) also showed no
loss of performance running with floats.

So finally; please forgive the inevitable fallout, this is a far reaching
change. There are still a few known issues with the fixed to float
conversion but enough works for all our conformance tests to pass, and the
remaining issues hopefully wont be too tricky to solve. For reference two
tags will be available either side of this change: "cogl-fixed-end" and
"cogl-float-start"

15 years ago[script] Parse easing modes by name
Emmanuele Bassi [Tue, 20 Jan 2009 18:24:58 +0000 (18:24 +0000)]
[script] Parse easing modes by name

The easing modes for a ClutterAlpha can either be parsed by using
the enumeration "nickname" (the shorthand form of the enumeration
value) or by using the common naming policy used in other
animation frameworks, like:

        easeInCubic
        easeOutElastic
        easeInOutBounce

15 years ago[docs] Update the easing modes documentation
Emmanuele Bassi [Tue, 20 Jan 2009 18:13:36 +0000 (18:13 +0000)]
[docs] Update the easing modes documentation

The ClutterAlpha API reference page should also list the
easing modes Clutter provides by default, by showing the
curves used by each entry in the AnimationMode enumeration.

We can also remove the incomplete graph showing the old
alpha functions.

15 years ago[animation] Implement new easing functions
Emmanuele Bassi [Tue, 20 Jan 2009 17:57:30 +0000 (17:57 +0000)]
[animation] Implement new easing functions

Instead of using our own homegrown alpha functions, we should
use the easing functions also shared by other animation frameworks,
like jQuery and Tween, in the interests of code portability.

The easing functions have been defined by Robert Penner and
are divided into three categories:

        In    Out     InOut

Each category has a particular curve:

        Quadratic
        Cubic
        Quartic
        Quintic
        Sinusoidal
        Exponential
        Circular

In addition, there are "physical" curves:

        Elastic
        Back (overshooting cubic)
        Bounce (exponentially decaying parabolic)

Finally, the Linear curve is also provided as a reference.

The functions are private, and are meant to be used only
through their logical id as provided by the AnimationMode
enumeration.

The tests should be updated as well to match the new
easing functions.