Robert Bragg [Thu, 29 Jan 2009 16:24:24 +0000 (16:24 +0000)]
Some updates for the 1.0 release notes regarding Cogl
Documents that the cogl_rectangle arguments changed from x1, y1, width, height
to x1, y1, x2, y2; notes that cogl_scale now accepts a z-scale; adds a note
about the new vertex buffer API and fixes a s/CoglMesh/CoglMatrix/ typo.
Emmanuele Bassi [Thu, 29 Jan 2009 16:15:05 +0000 (16:15 +0000)]
[build] Fix distcheck of ChangeLog
Relax the copy failure condition.
Emmanuele Bassi [Thu, 29 Jan 2009 16:00:15 +0000 (16:00 +0000)]
Add cogl-material-private.h to the source files
The material-private.h file was not added to the dist files and
caused a build failure.
Emmanuele Bassi [Thu, 29 Jan 2009 15:44:11 +0000 (15:44 +0000)]
[gitignore] Update ignore file
Emmanuele Bassi [Thu, 29 Jan 2009 15:38:28 +0000 (15:38 +0000)]
[build] Add automatic ChangeLog generation on dist
Since we moved to Git from Subversion we've abandoned the ChangeLog
file in favour of a more detailed commit log.
In order to maintain a ChangeLog for users of the tarballs, we need
to generate a ChangeLog file out of the commit log when distchecking
a Clutter release.
For this reason, we use a simple Perl script that is invoked by the
dist-hook and generates a ChangeLog file starting from the previous
stable release.
Emmanuele Bassi [Thu, 29 Jan 2009 13:31:11 +0000 (13:31 +0000)]
Fix a variable masking warning
The usual issue with math.h defined symbols.
Emmanuele Bassi [Wed, 28 Jan 2009 17:01:26 +0000 (17:01 +0000)]
Move the old ChangeLog into its own file
The old ChangeLog is there to track the project history when it
was in SVN -- also because the commit messages we imported from
Subversion were not that great.
Unfortunately, we need a ChangeLog for autotools to work in
GNU mode; for this reason, we can use a dummy ChangeLog redirecting
to git log.
The ChangeLog will be generated on release from the commit
messages, for users of the tarballs.
Neil Roberts [Thu, 29 Jan 2009 12:21:56 +0000 (12:21 +0000)]
[cogl] Add an NULL terminator to the call to material_flush_gl_state
This fixes a compiler warning and a potential crash.
Robert Bragg [Wed, 28 Jan 2009 14:09:51 +0000 (14:09 +0000)]
Another Cogl gl vs gles normalizaion pass
This tries to make a number of files more comparable with the intention of
moving some code into cogl/common/
Files normalized:
cogl.c
cogl-context.c
cogl-context.h
cogl-texture.c
Robert Bragg [Tue, 27 Jan 2009 11:07:22 +0000 (11:07 +0000)]
Removes cogl_color_set_from_4d as it may mislead people.
Someone not sure which cogl_color_set_from_* version is "best" may use
set_from_4d because taking doubles implies higher precision. Currently
it doesn't have any advantage.
Robert Bragg [Wed, 28 Jan 2009 14:47:03 +0000 (14:47 +0000)]
Changes cogl_rectangle to take x1, y1, x2, y2 args not x1, y1, width, height
This makes it consistent with cogl_rectangle_with_{multi,}texture_coords.
Notably the reason cogl_rectangle_with_{multi,}texture_coords wasn't changed
instead is that the former approach lets you describe back facing rectangles.
(though technically you could pass negative width/height values to achieve
this; it doesn't seem as neat.)
Robert Bragg [Wed, 28 Jan 2009 13:46:39 +0000 (13:46 +0000)]
Adds some debug code to _cogl_journal_flush_quad_batch
The code is #if 0 guarded, but when uncommented it outlines all drawn
rectangles with an un-blended red, green or blue border. This may e.g. help
with debugging texture slicing issues or blending issues, plus it looks quite
cool.
Emmanuele Bassi [Wed, 28 Jan 2009 16:44:22 +0000 (16:44 +0000)]
[clutter-docs] Update the animation tutorial
The Alpha API and usage has been changed by the recent overhaul
of the ClutterAlpha class; hence, we need to update the relative
documentation in the animation tutorial.
Emmanuele Bassi [Wed, 28 Jan 2009 16:43:05 +0000 (16:43 +0000)]
[cogl-docs] Add the Materials section
The COGL Materials API was not linked from the COGL reference
index.
Emmanuele Bassi [Wed, 28 Jan 2009 15:19:24 +0000 (15:19 +0000)]
Update the pkg-config requires list
Clutter depends on various libraries, some of them backend-specific
like the X11 libraries.
Whenever possible, we should add those requirements to the pkg-config
file. For this reason, we have a variable inside the configure.ac
template file which should be filled with the backend-specific modules
we check for during configure time, and then added to the standard
list of dependencies that we write inside the clutter.pc file.
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.
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
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.
Emmanuele Bassi [Wed, 28 Jan 2009 14:36:45 +0000 (14:36 +0000)]
Update NEWS file
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.
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.
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.
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.
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.
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.
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.
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.
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().
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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
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.
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.
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.
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.
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)
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.
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.
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.
Emmanuele Bassi [Tue, 27 Jan 2009 13:22:47 +0000 (13:22 +0000)]
[tests] Remove an unused variable
This fixes a compiler warning.
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.
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.
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.
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.
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().
Emmanuele Bassi [Tue, 27 Jan 2009 10:31:53 +0000 (10:31 +0000)]
[timeline] Whitespace 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.
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.
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.
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
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>
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>
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.
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.
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.
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.
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.
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.
Neil Roberts [Fri, 23 Jan 2009 23:41:26 +0000 (23:41 +0000)]
[test-cogl-primitives] Remove trailing whitespace
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.
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.
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.
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);
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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
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.
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.
Emmanuele Bassi [Thu, 22 Jan 2009 16:55:51 +0000 (16:55 +0000)]
[gitignore] Update ignore file with the new tests
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.
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>
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>
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.
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>
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>
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.
Emmanuele Bassi [Thu, 22 Jan 2009 13:24:20 +0000 (13:24 +0000)]
Fix typo in the flags update
Epic en_GB keyboard FAIL.
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.
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.
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.
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().