Commit Graph

47 Commits

Author SHA1 Message Date
Robert Bragg
a2cf7e4a19 [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.
2009-01-20 16:20:54 +00:00
Robert Bragg
e82f656590 [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.
2009-01-20 16:20:54 +00:00
Emmanuele Bassi
f6feed4386 Fix a typo in the ClutterParamSpecFixed declaration
The ClutterParamSpecFixed constructor is declared in the header
as taking ClutterFixed values, but the implementation takes
ClutterUnit values instead. This obviously works because fixed
and units are exactly the same type.

This commit fixes the wrong parameters.
2008-12-15 14:29:59 +00:00
Emmanuele Bassi
911b395c8a 2008-10-30 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1209 - Move fixed point API in COGL

	* clutter/cogl/cogl-fixed.h:
	* clutter/cogl/cogl.h.in:
	* clutter/cogl/common/Makefile.am:
	* clutter/cogl/common/cogl-fixed.c: Add fixed point API, modelled
	after the ClutterFixed. The CoglFixed API supercedes the ClutterFixed
	one and avoids the dependency of COGL on Clutter's own API.

	* clutter/cogl/common/cogl-clip-stack.c:
	* clutter/cogl/common/cogl-primitives.c:
	* clutter/cogl/common/cogl-primitives.h: Update internal usage of
	ClutterFixed to CoglFixed.

	* clutter/cogl/gl/Makefile.am:
	* clutter/cogl/gl/cogl-primitives.c:
	* clutter/cogl/gl/cogl-texture.c:
	* clutter/cogl/gl/cogl.c: Ditto, in the GL implementation of the
	COGL API.

	* clutter/cogl/gles/Makefile.am:
	* clutter/cogl/gles/cogl-fbo.c:
	* clutter/cogl/gles/cogl-gles2-wrapper.c:
	* clutter/cogl/gles/cogl-primitives.c:
	* clutter/cogl/gles/cogl-texture.c:
	* clutter/cogl/gles/cogl.c: Ditto, in the GLES implementation of
	the COGL API.

	* clutter/pango/pangoclutter-glyph-cache.c:
	* clutter/pango/pangoclutter-glyph-cache.h: Ditto, in the Pango
	renderer glyphs cache.

	* clutter/clutter-fixed.c:
	* clutter/clutter-fixed.h: ClutterFixed and related API becomes
	a simple transition API for bindings and public Clutter API.

	* clutter/clutter-actor.c:
	* clutter/clutter-alpha.c:
	* clutter/clutter-backend.c:
	* clutter/clutter-behaviour-depth.c:
	* clutter/clutter-behaviour-ellipse.c:
	* clutter/clutter-behaviour-path.c:
	* clutter/clutter-behaviour-rotate.c:
	* clutter/clutter-behaviour-scale.c:
	* clutter/clutter-clone-texture.c:
	* clutter/clutter-color.c:
	* clutter/clutter-entry.c:
	* clutter/clutter-stage.c:
	* clutter/clutter-texture.c:
	* clutter/clutter-timeline.c:
	* clutter/clutter-units.h: Move from the internal usage of
	ClutterFixed to CoglFixed.

	* doc/reference/clutter/clutter-sections.txt:
	* doc/reference/cogl/cogl-docs.sgml:
	* doc/reference/cogl/cogl-sections.txt: Update the documentation.

	* tests/test-cogl-tex-tile.c:
	* tests/test-project.c: Fix tests after the API change

	* README: Add release notes.
2008-10-30 16:37:55 +00:00
Tomas Frydrych
5f8dc01de3 2008-07-11 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-fixed.c:
	    Move G_IMPLEMENT_INLINES before all other #include statements (bug
	    #1038).
2008-07-11 10:36:07 +00:00
Tomas Frydrych
9b4daec78b 2008-07-11 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-fixed.c:
	    Changed #define G_IMPLEMENTS_INLINES to G_IMPLEMENT_INLINES (bug
	    #1038).
2008-07-11 10:12:05 +00:00
Tomas Frydrych
f3d5d9d757 2008-07-03 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-fixed.h:
	    * clutter/clutter-fixed.c
	    Fixed inlining of clutter_qmulx() and clutter_qdivx() (bug 1022).
2008-07-03 12:30:36 +00:00
Chris Lord
631277be44 * clutter/clutter-fixed.c: (clutter_sinx):
Fix clutter_sinx for angles > CFX_2PI - CFX_ONE. Also add note to
        documentation about being able to use modulus with ClutterFixed
2008-06-25 13:21:25 +00:00
Emmanuele Bassi
8ff6cec829 2008-06-12 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.[ch]: Documentation fixes.

	* clutter/clutter-backend.c: Documentation fixes.

	* clutter/clutter-container.h: Documentation fixes.

	* clutter/clutter-fixed.c (clutter_qdivx): Fix the return
	value to be after the description.

	* clutter/clutter-texture.[ch]: Documentation fixes.

	* clutter/clutter-timeline.c: Documentation fixes.
2008-06-12 11:43:25 +00:00
Neil Roberts
8bdb98736d Applied 'final patch' from bug #874
* clutter/cogl/gles/cogl.c:
	* clutter/cogl/gl/cogl.c: The clip planes are now set using the
	inverse projection matrix as the modelview matrix so that they can
	be specified in screen coordinates.

	* clutter/cogl/gles/cogl-context.h (CoglContext):
	* clutter/cogl/gl/cogl-context.h (CoglContext): Added a member to
	cache the inverse projection matrix

	* clutter/clutter-fixed.h: Added a constant for converting from
	radians to degrees.

	* clutter/clutter-fixed.c (clutter_atani, clutter_atan2i): Added
	fixed-point versions of atan and atan2.

	* tests/test-clip.c: Added a test for clipping with various
	rotations and depths.

	* tests/Makefile.am (noinst_PROGRAMS): Added test-clip
2008-06-02 12:34:10 +00:00
Emmanuele Bassi
f6dce7f9e5 2008-05-15 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/x11/clutter-backend-x11.c:
	* clutter/clutter-event.h:
	* clutter/clutter-feature.h:
	* clutter/clutter-fixed.c:
	* clutter/clutter-model.h: Fix documentation.

	* clutter/eglnative/clutter-backend-egl.[ch]:
	* clutter/eglnative/clutter-event-egl.c: Add the same solution
	used for the SDL backend in order to get the time of an event.
	This should fix the motion event throttling and the click count
	on button press.

	* tests/test-pixmap.c (create_pixmap), (main): Fix preprocessor
	directives.
2008-05-15 14:31:43 +00:00
Emmanuele Bassi
1abccbad21 2008-05-09 Emmanuele Bassi <ebassi@openedhand.com>
Bug #902 - Support transform from G_TYPE_INT to ClutterUnit

	* clutter/clutter-units.c:
	(clutter_value_transform_int_unit),
	(clutter_unit_get_type): Add GValue transformation function from
	integer values to ClutterUnit. (#902)

	(param_unit_validate): Fix validation for ClutterParamSpecUnit;
	this allows writable ClutterUnit properties.

	* clutter/clutter-fixed.c:
	(clutter_value_transform_int_fixed),
	(clutter_value_transform_double_fixed),
	(clutter_value_transform_float_fixed): Add GValue transformation
	functions from native types (int, double, float) to ClutterFixed.

	(clutter_fixed_get_type): Register the new transformation functions.

	(param_fixed_validate): Fix validation for ClutterParamSpecUnit;
	this allows writable ClutterFixed properties.
2008-05-09 10:58:26 +00:00
Emmanuele Bassi
a7f4767ecb 2008-04-28 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-units.c (param_unit_init): Use the right
	macros to set the default minimum and maximum values.

	* clutter/clutter-fixed.c (param_fixed_init): Ditto as above.
2008-04-28 13:37:28 +00:00
Emmanuele Bassi
fd70c7df49 2008-04-17 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-fixed.c:
	(clutter_value_transform_fixed_int),
	(clutter_value_transform_fixed_double),
	(clutter_value_transform_fixed_float),
	(clutter_fixed_get_type): Add GValue transformation functions
	for ClutterFixed; copying a CLUTTER_TYPE_FIXED GValue into
	a G_TYPE_FLOAT/G_TYPE_DOUBLE one will automatically transform
	the fixed point representation into a floating point one. Also
	add the G_TYPE_INT transformation function to do a plain
	fixed->int copy.

	* clutter/clutter-units.c:
	(clutter_value_transform_unit_int),
	(clutter_unit_get_type): Add a unit->int transformation function.
2008-04-17 14:08:26 +00:00
Emmanuele Bassi
fa3b3e7f55 2008-04-17 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-fixed.c (clutter_value_get_fixed): Fix typo
	in the function name.
2008-04-17 11:42:08 +00:00
Emmanuele Bassi
0ecfa9701f 2008-04-17 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-fixed.[ch]: Add a ClutterFixed fundamental
	type, and wrappers for storing it into GValues; also add a
	GParamSpec subclass for defining parameters holding
	ClutterFixed values. This allows creating GObject properties
	using fixed point values.

	* doc/reference/clutter-sections.txt: Document the newly
	added API.
2008-04-17 10:08:17 +00:00
Emmanuele Bassi
cf4ba6c512 2008-04-09 Emmanuele Bassi <ebassi@openedhand.com>
* autogen.sh: Clean up a bit

	* clutter/clutter-fixed.[ch]:
	(clutter_double_to_fixed),
	(clutter_double_to_int),
	(clutter_double_to_uint): Make these functions public, as they
	are expanded by their respective macros. This fixes the errors
	from the linker trying to resolve their name.
2008-04-09 10:51:15 +00:00
Tomas Frydrych
e833356561 2007-01-18 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-fixed.h:
	* clutter/clutter-fixed.c:
	Added CLUTTER_QDIV() for 64-bit division (bug 564, patch by
	Gwenole Beauchesne).
2008-01-18 12:17:41 +00:00
Emmanuele Bassi
5eecda2dba 2007-12-15 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.c:
	* clutter/clutter-alpha.h:
	* clutter/clutter-event.h:
	* clutter/clutter-fixed.[ch]:
	* clutter/clutter-model.h:
	* clutter/clutter-shader.[ch]:
	* clutter/clutter-stage.c: Documentation fixes.
2007-12-15 14:36:27 +00:00
Tomas Frydrych
58142d7ee7 2007-12-06 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-fixed.c:
	* clutter/clutter-fixed.h:
	(clutter_sqrti):
	Added extra iteration to the Newton-Rapson algorithm for argumens
	lesser than 342 to improve precission.
2007-12-06 16:21:48 +00:00
Tomas Frydrych
3b07be19ba 2007-11-06 Tomas Frydrych <tf@o-hand.com>
* clutter/clutter-fixed.h:
	Added CLUTTER_SQRTI_ARG_MAX, CLUTTER_SQRTI_5_PERCENT,
	CLUTTER_SQRTI_10_PERCENT expressing clutter_sqrti limits.
	Stripped trailing whitespace.

        * clutter/clutter-fixed.c:
	(clutter_sqrti):
	Updated documentation, stripped trailing whitespace.

        * clutter/clutter-behaviour-path.c:
	(node_distance):
	Use clib sqrt if clutter_sqrti() precission would be worse than
	10%.
	Stripped trailing whitespace.
2007-11-06 15:46:23 +00:00
Tomas Frydrych
174bd04b49 2007-10-12 Tomas Frydrych <tf@o-hand.com>
Portability fixes:

	* clutter/clutter-private.h:
	Bracket #include "unistd.h" with #ifdef HAVE_UNISTD_H

	* clutter/clutter-fixed.c:
	Use "", not <> for inclusion of local files.

	(clutter_sqrtx): forward declare local variables.

	* clutter/clutter-debug.h:
	Added non-gcc (c99) implementation of variadic debug macros for
	when not compiling with gcc.

	* clutter/pango/pangoclutter-render.c:
	Fixed some strange uses of CLUTTER_NOTE() + stripped trailing
	whitespace.
2007-10-12 09:39:41 +00:00
Tomas Frydrych
abd6832dd9 2007-10-12 Tomas Frydrych <tf@o-hand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-backend.c:
        * clutter/clutter-behaviour-depth.c:
        * clutter/clutter-box.c:
        * clutter/clutter-clone-texture.c:
        * clutter/clutter-container.c:
        * clutter/clutter-entry.c:
        * clutter/clutter-feature.c:
        * clutter/clutter-fixed.c:
        * clutter/clutter-group.c:
        * clutter/clutter-hbox.c:
        * clutter/clutter-label.c:
        * clutter/clutter-layout.c:
        * clutter/clutter-media.c:
        * clutter/clutter-rectangle.c:
        * clutter/clutter-score.c:
        * clutter/clutter-script.c:
        * clutter/clutter-stage.c:
        * clutter/clutter-texture.c:
        * clutter/clutter-timeline.c:
        * clutter/clutter-timeout-pool.c:
        * clutter/clutter-vbox.c:
        * clutter/cogl/gl/cogl.c:
        * clutter/cogl/gles/cogl.c:
        * clutter/eglnative/clutter-backend-egl.c:
        * clutter/eglnative/clutter-event-egl.c:
        * clutter/eglnative/clutter-stage-egl.c:
        * clutter/eglx/clutter-backend-egl.c:
        * clutter/eglx/clutter-event-egl.c:
        * clutter/eglx/clutter-stage-egl.c:
        * clutter/glx/clutter-event-glx.c:
        * clutter/json/json-array.c:
        * clutter/json/json-generator.c:
        * clutter/json/json-node.c:
        * clutter/json/json-object.c:
        * clutter/json/json-parser.c:
        * clutter/sdl/clutter-backend-sdl.c:
        * clutter/sdl/clutter-event-sdl.c:
        * clutter/sdl/clutter-stage-sdl.c:

	Fixedup config.h inclusion (must always be bracketed with #ifdef
	HAVE_CONFIG_H).
2007-10-12 08:17:00 +00:00
Emmanuele Bassi
4189c66a21 2007-10-01 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-fixed.h: Add CLUTTER_FIXED_TO_INT() and
	deprecate CLUTTER_FIXED_INT(), for symmetry with
	CLUTTER_FIXED_FROM_INT().

	* clutter/clutter-alpha.c:
	* clutter/clutter-behaviour-depth.c:
	* clutter/clutter-behaviour-ellipse.c:
	* clutter/clutter-behaviour-path.c:
	* clutter/clutter-fixed.h: Use CLUTTER_FIXED_TO_INT().
2007-10-02 14:53:32 +00:00
Tomas Frydrych
b1c040ce19 Fixes for 64-bit platforms; use of SSE builtin when available (patches by Gwenole Beauchesne). 2007-08-21 09:25:09 +00:00
Emmanuele Bassi
fffdeb64c7 Do not mask the y1 symbol exported by math.h
Do you ever wonder what would happen if glibc were a serious library
and not the joke it actually is?
2007-08-07 14:12:58 +00:00
Matthew Allum
363faccfd5 2007-08-07 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-fixed.c:
        * clutter/clutter-fixed.h:
        Add documentation.

        * clutter/cogl/gl/cogl.c: (cogl_perspective):
        Remove CFX_* shortened macros
2007-08-07 11:35:22 +00:00
Tomas Frydrych
5b92cc21cb fixed endianness issue in fast fp conversions 2007-07-25 18:34:05 +00:00
Tomas Frydrych
2c97bdf456 added --disable-fast-fp-converions configure option 2007-07-25 18:17:13 +00:00
Tomas Frydrych
cbf2830e5f added CLUTTER_FLOAT_TO_UINT 2007-07-04 15:30:44 +00:00
Emmanuele Bassi
e30df678ae 2007-06-07 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/*: Move documentation from the templates into the
	source code.
2007-06-07 15:28:59 +00:00
Tomas Frydrych
733de46f3b Fixed ellipse behaviour for negative angles; fixed double to int conversion for negative numbers; fixed CLUTTER_ANGLE_FROM_DEGX; added ClutterVertices and clutter_actor_get_transformed_vertices() 2007-05-31 09:29:12 +00:00
Tomas Frydrych
a4eeaceda4 added clutter_pow2x() and clutter_log2x() 2007-05-17 07:09:18 +00:00
Tomas Frydrych
4085070479 clutter_sini(): fixed reduction to 0,2pi 2007-04-30 08:39:15 +00:00
Tomas Frydrych
43593ab81f bezier spline behaviours 2007-04-12 12:42:07 +00:00
Tomas Frydrych
d1d746eab1 fixed typo in configure.ac; fixed point perspective() 2007-03-29 10:41:23 +00:00
Tomas Frydrych
685c583d51 more fixed point work 2007-01-23 11:48:04 +00:00
Tomas Frydrych
b8b0d01c91 work around punned-pointer problem 2007-01-19 20:00:41 +00:00
Tomas Frydrych
f924e2bbf7 more fixed point work 2007-01-19 16:04:06 +00:00
Tomas Frydrych
7078dc5254 documentation for fixed point API 2007-01-17 16:00:00 +00:00
Emmanuele Bassi
9bd77e25b2 2007-01-17 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-feature.h:
	* clutter/clutter-feature.c: Move the GL headers from the
	header file to the body.

	* clutter/clutter-fixed.h:
	* clutter/clutter-fixed.c: Fix apidoc.

	* clutter/clutter-color.h:
	* clutter/clutter-color.c: Ditto.
2007-01-17 13:51:14 +00:00
Tomas Frydrych
9a28ac34cd fixed point sqrt 2007-01-17 13:03:52 +00:00
Emmanuele Bassi
4e765d1a34 2007-01-16 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-feature.c: Use clutter_vblank_method() to
	get the VBlank method name from the environment variable OR
	the command line switch.

	(clutter_feature_do_init): Move the check on the features
	state here, to avoid an expensive function call, and inline
	the function.

	* clutter/clutter-fixed.c: Fix gtk-doc.

	* clutter/clutter-main.c: Add a --clutter-vblank command line
	switch controlling the VBlank method to be used: it overrides
	the CLUTTER_VBLANK environment variable.

	(pre_parse_hook), (clutter_init),
	(clutter_init_with_args): Move thread initialisation before
	type init, to avoid the warning that comes with newer GLib
	versions.

	* clutter/clutter-group.h:
	* clutter/clutter-group.c: Mark clutter_group_show_all() and
	clutter_group_hide_all() as deprecated.
2007-01-16 14:37:54 +00:00
Tomas Frydrych
3b7a8c0c5c replacement of floating point ops with fixed point 2007-01-16 10:39:18 +00:00
Tomas Frydrych
884cc0f5cf added ClutterAngle type and fast clutter_angle_sin() function; fixed clutter_fixed to work for negative angles; added convenience macros clutter_fixex_cos and clutter_angle_cos 2007-01-16 08:14:53 +00:00
Tomas Frydrych
44a89898ca pluged clutter_fixed_sin into clutter-alpha; updated change log 2007-01-15 19:43:09 +00:00
Tomas Frydrych
95840c47bf implemented fixed point sin(); fixed CLUTTER_FIXED_TO_FLOAT/DOUBLE macros 2007-01-15 18:37:12 +00:00