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.
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.
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.
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.
* 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
* 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.
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.
* 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.
* 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.
* 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.
* 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.
* 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.
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.
* 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.