profile/ivi/clutter.git
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 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.

15 years ago[animation] Move the alpha value to floating point
Emmanuele Bassi [Tue, 20 Jan 2009 16:42:49 +0000 (16:42 +0000)]
[animation] Move the alpha value to floating point

The current Alpha value is an unsigned integer that can be used
implicitly as a fixed point value. This makes writing an alpha
function overshooting below and above the current range basically
impossible without complicating an already complex code, and
creating weird corner cases.

For this reason, the Alpha value should be defined as a floating
point normalized value, spanning a range between 0.0 and 1.0; in
order to allow overshooting, the valid range is extended one unit
below and one unit above, thus making it -1.0 .. 2.0.

This commit updates the various users of the ClutterAlpha API
and the tests cases.

This commit also removes all the current alpha functions exposed
in the public API.

15 years ago[Automatic fixed-to-float.sh change] Hand coded changes for clutter-{fixed,units}
Robert Bragg [Tue, 20 Jan 2009 16:20:55 +0000 (16:20 +0000)]
[Automatic fixed-to-float.sh change] Hand coded changes for clutter-{fixed,units}

To avoid clashing with all the scripted changes, clutter-fixed.h and
clutter-units.h were manually converted to internally use floats instead of
16.16 fixed numbers.

Note: again no API changes were made in Clutter.

15 years ago[Automatic fixed-to-float.sh change] Applies a number fixed to float patches
Robert Bragg [Tue, 20 Jan 2009 16:20:54 +0000 (16:20 +0000)]
[Automatic fixed-to-float.sh change] Applies a number fixed to float patches

To deal with all the corner cases that couldn't be scripted a number of patches
were written for the remaining 10% of the effort.

Note: again no API changes were made in Clutter, only in Cogl.

15 years ago[Automatic fixed-to-float.sh change] Applies all scripted changes
Robert Bragg [Tue, 20 Jan 2009 16:20:54 +0000 (16:20 +0000)]
[Automatic fixed-to-float.sh change] Applies all scripted changes

This is the result of running a number of sed and perl scripts over the code to
do 90% of the work in converting from 16.16 fixed to single precision floating
point.

Note: A pristine cogl-fixed.c has been maintained as a standalone utility API
      so that applications may still take advantage of fixed point if they
      desire for certain optimisations where lower precision may be acceptable.

Note: no API changes were made in Clutter, only in Cogl.

Overview of changes:
- Within clutter/* all usage of the COGL_FIXED_ macros have been changed to use
the CLUTTER_FIXED_ macros.

- Within cogl/* all usage of the COGL_FIXED_ macros have been completly stripped
and expanded into code that works with single precision floats instead.

- Uses of cogl_fixed_* have been replaced with single precision math.h
alternatives.

- Uses of COGL_ANGLE_* and cogl_angle_* have been replaced so we use a float for
angles and math.h replacements.

15 years agoImproves the git commit messages used by fixed-to-float.sh
Robert Bragg [Tue, 20 Jan 2009 14:52:47 +0000 (14:52 +0000)]
Improves the git commit messages used by fixed-to-float.sh

In preperation for commiting a final conversion into master

15 years agoImproves the unit test to verify more awkward scaling and some corresponding fixes
Robert Bragg [Mon, 19 Jan 2009 19:11:00 +0000 (19:11 +0000)]
Improves the unit test to verify more awkward scaling and some corresponding fixes

This simplifies the mucking about with the model-view matrix that was previously
done which improves its efficiency when scaling is necessary.

Notably: There should now be no performance advantage to using
ClutterCloneTexture as a special case clone actor since this method is just as
efficient.

The unit test was renamed to test-actor-clone.

15 years agoImplements a generic ClutterActorClone that doesn't need fbos.
Robert Bragg [Sat, 17 Jan 2009 16:51:03 +0000 (16:51 +0000)]
Implements a generic ClutterActorClone that doesn't need fbos.

Many use cases for clonning an actor don't require running a shader on the
resulting clone image and so requiring FBOs in these cases is overkill and
in-efficient as it requires kicking and synchronizing a render for each clone.

This approach basically just uses the paint function of another actor to
implement the painting for the clone actor with some fiddling of the model-
view matrix to scale according to the different allocation box sizes of
each of the actors.

A simple unit test called test-actors2 was added for testing.

15 years agoChange default tile-waste from 64 to 63
Owen W. Taylor [Sun, 11 Jan 2009 00:25:27 +0000 (19:25 -0500)]
Change default tile-waste from 64 to 63

It's more sensible to use 2^n-1 for a max tile-waste value rather
than 2^n, so change the value default from 64 to 63. Example:
191 and 192 will both be sliced to 128+64 rather than having
191=>128+64, 192=>256.

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years agoFix properties that have X11 types to be 'long'
Owen W. Taylor [Fri, 16 Jan 2009 23:01:04 +0000 (18:01 -0500)]
Fix properties that have X11 types to be 'long'

While X11 Pixmap and Window types only have 32-bits of data, they
are actually 'unsigned long'. Change the "window" and "pixmap"
property of ClutterX11TexturePixmaps to be ulong.

This fixes 64-bit bugs where ClutterGLXTexturePixmap passed a
reference to Pixmap to g_object_get("pixmap", &pixmap, ...);

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years ago[eglnative] Set the SYNC_MATRICES on stage realization
Emmanuele Bassi [Fri, 16 Jan 2009 22:13:44 +0000 (22:13 +0000)]
[eglnative] Set the SYNC_MATRICES on stage realization

Since the stage in the EGL native backend only has one size, and it
is determined at realization, we can simply set the SYNC_MATRICES
private flag and let _clutter_stage_maybe_setup_viewport() set up
the GL viewport at the first redraw.

15 years ago[fixed-to-float.sh] Apply the automatic changes to the tests as well
Neil Roberts [Fri, 16 Jan 2009 18:29:29 +0000 (18:29 +0000)]
[fixed-to-float.sh] Apply the automatic changes to the tests as well

Some of the tests are using the Cogl API so they should be updated to
float as well.

The patches have been updated to apply cleanly.

15 years ago[fixed-to-float.sh] Group some of the sed expressions into one command
Neil Roberts [Fri, 16 Jan 2009 17:52:26 +0000 (17:52 +0000)]
[fixed-to-float.sh] Group some of the sed expressions into one command

This has no effect other than to make the script run faster.

15 years ago[fixed-to-float-patches] Replace the cogl_color_*x functions with *f
Neil Roberts [Fri, 16 Jan 2009 14:55:48 +0000 (14:55 +0000)]
[fixed-to-float-patches] Replace the cogl_color_*x functions with *f

cogl_set_source_color4x and cogl_color_set_from_4x actually take float
values now so they are renamed to *4f.

15 years ago[docs] Clarify what API registers a global alpha function
Emmanuele Bassi [Fri, 16 Jan 2009 14:53:42 +0000 (14:53 +0000)]
[docs] Clarify what API registers a global alpha function

Both clutter_alpha_new_with_func() and clutter_alpha_set_func()
will not register a global alpha function, so we need to update
the documentation to explicitly say so.

15 years ago[fixed-to-float-patches] Merge the two patches to remove cogl fixed params
Neil Roberts [Fri, 16 Jan 2009 13:56:42 +0000 (13:56 +0000)]
[fixed-to-float-patches] Merge the two patches to remove cogl fixed params

The two patches for removing cogl apis taking fixed params have been
merged into one patch.

15 years ago[doc] Clarify the animation mode meaning
Emmanuele Bassi [Fri, 16 Jan 2009 14:16:02 +0000 (14:16 +0000)]
[doc] Clarify the animation mode meaning

The animation mode parameters and properties are now slightly
anonymous unsigned longs, so we need to clarify in the documentation
that the user should either pass a ClutterAnimationMode value or
the result of registering an alpha function.

15 years agoRemove AnimationMode from the Animation API
Emmanuele Bassi [Fri, 16 Jan 2009 14:01:46 +0000 (14:01 +0000)]
Remove AnimationMode from the Animation API

The animation mode symbolic id might come from the AnimationMode
enumeration or from the clutter_alpha_register_*() family of
functions. For this reason, we should use a gulong instead of
ClutterAnimationMode whenever we have an "animation mode" parameter
or property.

15 years ago[alpha] Allow registering alpha functions
Emmanuele Bassi [Fri, 16 Jan 2009 13:42:06 +0000 (13:42 +0000)]
[alpha] Allow registering alpha functions

In order to unify alpha functions and animation modes in ClutterAlpha
we should be able to register alpha functions and get a logical id
for them; the logical id will then be available to be used by
clutter_alpha_set_mode().

The registration requires API changes in ClutterAlpha constructors
and methods. It also provides the chance to shift ClutterAlpha
towards the use of animations modes only, and to alpha functions
as a convenience API for language bindings alone.

15 years ago[fixed-to-float.sh] Use float names for the GLES2 wrappers
Neil Roberts [Fri, 16 Jan 2009 12:16:28 +0000 (12:16 +0000)]
[fixed-to-float.sh] Use float names for the GLES2 wrappers

For example cogl_wrap_glFrustumx -> cogl_wrap_glFrustumf.

The wrappers get #defined to the float versions anyway but it helps
avoid some confusion.

The conversion is done using a regular expression in the upgrade
script. Some of the patches had to be updated to apply cleanly.

15 years ago[fixed-to-float-patches] Move the changes to gles2-wrapper.h into the patch
Neil Roberts [Fri, 16 Jan 2009 10:50:53 +0000 (10:50 +0000)]
[fixed-to-float-patches] Move the changes to gles2-wrapper.h into the patch

It looks like the changes to cogl-gles2-wrapper.h were accidentally
committed to the actual file instead of the patch in commit
de27da0e. This commit moves the changes back into the patch so
cogl-gles2-wrapper.h is reverted back to master.

15 years ago[fixed-to-float-patches] Fix use of glClearColor and glColor under GLES 2
Neil Roberts [Thu, 15 Jan 2009 18:53:52 +0000 (18:53 +0000)]
[fixed-to-float-patches] Fix use of glClearColor and glColor under GLES 2

The wrapper for glClearColor was taking fixed arguments but was given
floating point values so it ended up always setting the clear color to
black. Now that GLES 1.1 is using the floating point version, there is
no need for the wrapper so both versions now just use glClearColor
directly.

A similar problem was happening for glColor but this does still need a
wrapper because it needs to set the vertex attribute.

15 years agoMerge branch 'master' into cogl-float
Neil Roberts [Thu, 15 Jan 2009 16:38:49 +0000 (16:38 +0000)]
Merge branch 'master' into cogl-float

The patches have been updated to apply cleanly.

The patches for the g_warnings in clutter-actor.c have been removed
because master now uses CLUTTER_UNITS_FORMAT so they aren't
necessary. The clutter-units.h patch now sets CLUTTER_UNITS_FORMAT to
'f'.

15 years agoFix GLES backends after merging the async-textures branch
Neil Roberts [Thu, 15 Jan 2009 18:09:54 +0000 (18:09 +0000)]
Fix GLES backends after merging the async-textures branch

The changes from the GL version of cogl-texture.c have been mirrored
in the GLES version. This adds the cogl_texture_new_from_bitmap
function and fixes the build errors.

15 years ago[fixed-to-float.sh] Remove the mtx_transform patch from the script
Neil Roberts [Thu, 15 Jan 2009 16:35:46 +0000 (16:35 +0000)]
[fixed-to-float.sh] Remove the mtx_transform patch from the script

The patch got deleted and merged into the clutter-actor.c patch in
commit 012b16 so it was just causing unnecessary errors.