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

15 years ago[fixed-to-float-patches] Fix some of the matrix getters and setters
Neil Roberts [Thu, 15 Jan 2009 15:24:05 +0000 (15:24 +0000)]
[fixed-to-float-patches] Fix some of the matrix getters and setters

The GL versions of get_modelview_matrix, get_projection_matrix and
get_viewport were using glGetDoublev and then converting them to
floats, but it might as well just call glGetFloatv directly.

The GL ES versions were using glGetFixedv but this was being replaced
with glGetFloatv by the #define in the GLES 2 wrappers.

The patch also replaces the glGetFixedv wrapper with
glGetFloatv. Previously this was calling
cogl_gles2_float_array_to_fixed which actually converted to
float. That function has been removed and memcpy is used instead.

15 years ago[test-text] queue redraws instead of calling clutter_actor_paint directly
Robert Bragg [Thu, 15 Jan 2009 13:58:31 +0000 (13:58 +0000)]
[test-text] queue redraws instead of calling clutter_actor_paint directly

Directly calling clutter_actor_paint skips out quite a bit code such as the
backend swap buffer call.

Since we are interested in the highest fps possible, and it now goes through
to the backend swap buffer call we now do a setenv (CLUTTER_VBLANK, none, 0)
before calling clutter_init.

15 years agoBug 1380 - Return booleans from CLUTTER_ACTOR_IS_* macros
Emmanuele Bassi [Wed, 14 Jan 2009 18:14:46 +0000 (18:14 +0000)]
Bug 1380 - Return booleans from CLUTTER_ACTOR_IS_* macros

If you try to use the CLUTTER_ACTOR_IS_* macros defined in ClutterActor
like this:

  typedef struct { unsigned int reactive : 1; } foo_t;

  foo_t f; f.reactive = CLUTTER_ACTOR_IS_REACTIVE (actor);

It will blow up because while the macros evaluate to 0 they can also
evaluate to non-zero values. Since most of the boolean flags in
Clutter and Clutter-based code are going to be stored like in the
example above, we should change the macros and let them evaluate
stricly either to 0 or to 1.

15 years agoRemove the Effects API
Emmanuele Bassi [Wed, 7 Jan 2009 18:30:46 +0000 (18:30 +0000)]
Remove the Effects API

The Effects API and all related symbols have been superceded by
the newly added Animation API and clutter_actor_animate().

This commit removes the Effects implementation, the documentation
and the interactive test/example code.

15 years agoEmit ::load-finished for every texture load
Emmanuele Bassi [Wed, 14 Jan 2009 15:30:10 +0000 (15:30 +0000)]
Emit ::load-finished for every texture load

The ::load-finished signal is emitted only when loading a texture
using clutter_texture_set_from_file(). Since this breaks user
expectations and consistency, we should also emit ::load-finished
when loading a texture from image data.

15 years ago[test-depth] cast width to gint when calculating -width/2
Robert Bragg [Wed, 14 Jan 2009 15:18:05 +0000 (15:18 +0000)]
[test-depth] cast width to gint when calculating -width/2

It was a fluke that this worked out due to how clutter_actor_set_depth
internally converts the incorrect integer result to fixed point.

15 years ago[tests] Adds a flowery clutter_cairo_texture unit test
Robert Bragg [Thu, 8 Jan 2009 18:54:48 +0000 (18:54 +0000)]
[tests] Adds a flowery clutter_cairo_texture unit test

This is simply a copy of flowers.c from the old clutter-cairo repo

15 years agoMerge branch 'async-textures'
Emmanuele Bassi [Wed, 14 Jan 2009 15:16:41 +0000 (15:16 +0000)]
Merge branch 'async-textures'

* async-textures:
  Whitespace fixes in ClutterTexture
  [async-loading] Do not force the texture size on async load
  [async-loading] Update asynchronous image loading
  Add API for extracting image size from a file
  Update/clean and apply the async-texture patch from bug #1144

15 years ago[ClutterStageX11] Remove the handling_configure flag
Neil Roberts [Wed, 14 Jan 2009 13:37:31 +0000 (13:37 +0000)]
[ClutterStageX11] Remove the handling_configure flag

Since Clutter changed to using a layout scheme the handling_configure
flag no longer works because the allocate method is not invoked
immediately during the call to set_size from the ConfigureNotify
handler. However it is also no longer neccessary because the resizes
are effectively batched up until a relayout is run so it won't cause
an infinite loop of resize and notify events anyway.

15 years agoAdd unused symbols
Emmanuele Bassi [Wed, 14 Jan 2009 15:05:03 +0000 (15:05 +0000)]
Add unused symbols

Append the newly added ClutterBindingPool symbols and
clutter_stage_ensure_viewport() to the API reference.

15 years agoFix compile warning for a possible uninitialized variable
Emmanuele Bassi [Wed, 14 Jan 2009 15:04:28 +0000 (15:04 +0000)]
Fix compile warning for a possible uninitialized variable

15 years agoAdd declaration of clutter_binding_pool_get_type()
Emmanuele Bassi [Wed, 14 Jan 2009 15:03:30 +0000 (15:03 +0000)]
Add declaration of clutter_binding_pool_get_type()

The function is automagically created by G_DEFINE_TYPE(), but
it should also be declared in the header.

15 years agoMerge branch 'animation-improvements'
Emmanuele Bassi [Wed, 14 Jan 2009 15:00:44 +0000 (15:00 +0000)]
Merge branch 'animation-improvements'

* animation-improvements:
  [docs] Add ClutterAnimatable to the API reference
  Add license notice to ClutterAnimation files
  [docs] Update the ClutterAnimation section
  [animation] Extend ClutterAnimation support to all objects
  [animation] Use ClutterAnimatable inside Animation
  [animation] Add ClutterAnimatable
  [animation] Allow registering custom progress function
  [animation] Interval::compute_value should return a boolean
  Animate ClutterColor properties

15 years agoFix compilation warning
Emmanuele Bassi [Wed, 14 Jan 2009 14:34:35 +0000 (14:34 +0000)]
Fix compilation warning

Declare the width and height variables as unsigned ints, in order
to match the required arguments for clutter_actor_get_size().

15 years ago[clutter-text] Fix x-position of cursor when moving up or down
Neil Roberts [Wed, 14 Jan 2009 11:12:02 +0000 (11:12 +0000)]
[clutter-text] Fix x-position of cursor when moving up or down

ClutterText already has code to try to preserve the x position when
moving up or down. A target x-position is stored and the cursor is
positioned at the nearest point to that in the appropriate line when
up or down is pressed. However the target position was never cleared
so it would always target the x-position of the cursor from the first
time you pressed up or down.

To fix this the patch clears the target position in set_position and
then sets it after the call in real_move_up/down. That way pressing
up or down sets the target position and any other movement will clear
it.

To get an index for the pixel position in the line
pango_layout_line_x_to_index is used. However when x is greater than
the length of the line then the index before the last grapheme is
returned which was causing it to jump to the penultimate
character. The patch makes it add on the trailing value so that it
will jump to the last character.

15 years ago[clutter-text] Fix offset_to_bytes to work when pos == 0
Neil Roberts [Tue, 13 Jan 2009 18:42:50 +0000 (18:42 +0000)]
[clutter-text] Fix offset_to_bytes to work when pos == 0

The old function ended up returning the length of the string when pos
was zero. This caused it to insert characters at the end when the
cursor was at the beginning of the string.

15 years ago[clutter-text] Don't allow control characters to be inserted
Neil Roberts [Tue, 13 Jan 2009 17:52:38 +0000 (17:52 +0000)]
[clutter-text] Don't allow control characters to be inserted

If an unbound control key is pressed (such as Ctrl+R) it would insert
a rectangle into the text.

Also zero is considered a valid unicode character by
g_unichar_validate so pressing a key such as shift would cause the
current selection to be deleted. The character isn't actually inserted
because insert_unichar disallows zeroes.

15 years agoFix GLES 2 after the multiple-texture-rectangle branch merge
Neil Roberts [Thu, 27 Nov 2008 16:44:39 +0000 (16:44 +0000)]
Fix GLES 2 after the multiple-texture-rectangle branch merge

The GLES 2 wrapper needs to set up some state before each
draw. Previously this was acheived by wrapping glDrawArrays. Since the
multiple-texture-rectangle branch merge, glDrawElements is used
instead so we also need a wrapper for that.

It was also directly calling glBindTexture. GLES 2 uses a wrapper for
this function so that it can cope with GL_ALPHA format textures. The
format of the current texture needs to be stored as well as the target
and object number for this to work.

15 years agoUpdate gtk-doc 'Since' field for cogl_texture_multiple_rectangles
Neil Roberts [Mon, 12 Jan 2009 18:32:49 +0000 (18:32 +0000)]
Update gtk-doc 'Since' field for cogl_texture_multiple_rectangles

The function has been backported to the 0.8 branch so it will also be
available in Clutter 0.8.6

15 years ago[gitignore] Update the ignore file
Emmanuele Bassi [Tue, 13 Jan 2009 14:05:35 +0000 (14:05 +0000)]
[gitignore] Update the ignore file

15 years agoAdd ClutterBindingPool:name
Emmanuele Bassi [Tue, 13 Jan 2009 12:51:03 +0000 (12:51 +0000)]
Add ClutterBindingPool:name

The BindingPool constructor should only check for duplicate pools
and then set the :name constructor-only property. If a BindingPool
is created without a name we also make a fuss about it.

It is also possible to simply dispose of a binding pool using
g_object_unref(), as long as it has been created by using
clutter_binding_pool_new() or directly with g_object_new(). Only
BindingPools attached to a class are not owned by the user.

15 years agoRemove cogl_blahx Cogl interfaces that used to take CoglFixed parameters.
Robert Bragg [Tue, 13 Jan 2009 11:38:55 +0000 (11:38 +0000)]
Remove cogl_blahx Cogl interfaces that used to take CoglFixed parameters.

Since they are no longer actually taking fixed point parameters the 'x' suffix is
no longer appropriate. To maintain support for sub-pixel precision the
corresponding interfaces that were taking integer parameters now get patched
to take float parameters instead.

15 years agoTurn ClutterBindingPool a GObject
Emmanuele Bassi [Tue, 13 Jan 2009 12:34:59 +0000 (12:34 +0000)]
Turn ClutterBindingPool a GObject

ClutterBindingPool is already "problematic" in terms of memory
management for language bindings and gobject-introspection. It
also lacks a GType.

Turning ClutterBindingPool into a GBoxed would not make much
sense, since it does not adhere to the copy/free semantics. It
could be referenced/unreferenced, but in that case we can just
as well use GObject as a base class instead of reimplemeting
a ref-counted object and then boxing it.

ClutterBindingPool is obviously a terminal class, so we just
hide the instance and class structures.

15 years ago[gl/cogl.c] Updates the cogl_rotatex prototype to take float x,y,z params
Robert Bragg [Mon, 12 Jan 2009 18:15:40 +0000 (18:15 +0000)]
[gl/cogl.c] Updates the cogl_rotatex prototype to take float x,y,z params

I missed this in my last commit; it just updates the prototype in gl/cogl.c
in line with the change made in cogl.h.in

15 years ago[cogl.h.in.0.patch] Fixes the cogl_rotatex prototype to take float x,y,z params
Robert Bragg [Mon, 12 Jan 2009 17:07:55 +0000 (17:07 +0000)]
[cogl.h.in.0.patch] Fixes the cogl_rotatex prototype to take float x,y,z params

The cogl_rotatex was incorrectly defined to take gint x,y,z params as opposed
to CoglFixed. This patch changes them directly to floats.

15 years ago[cogl/gles] Fixes for building for GLES 1 using floats
Robert Bragg [Thu, 8 Jan 2009 22:56:17 +0000 (22:56 +0000)]
[cogl/gles] Fixes for building for GLES 1 using floats

* This adds GLfixed -> GLfloat conversion
* redefines cogl_wrap_glBlahx macros as glBlahf
* Other misc fixes (mostly corresponding to cogl/gl equivalents)

15 years ago[fixed-to-float.sh] Replace uses of COGL_FIXED_FROM_INT not followed by a space
Robert Bragg [Thu, 8 Jan 2009 22:38:33 +0000 (22:38 +0000)]
[fixed-to-float.sh] Replace uses of COGL_FIXED_FROM_INT not followed by a space

Previously the script assumed a space before the open bracket, so it missed
a few cases in clutter/cogl/gles/cogl.c

15 years agoconverts clutter_{sin,cos,tan,atan}x angles to radians before calling math.h func
Robert Bragg [Thu, 8 Jan 2009 22:00:56 +0000 (22:00 +0000)]
converts clutter_{sin,cos,tan,atan}x angles to radians before calling math.h func

These functions are defined to take an angle in degrees, so the angle needs
converting before calling the corresponding {sin,cos,tan,atan}f()

This fixes test-cogl-tex-tile.

15 years ago[fixed-to-float-patches] Updates the patches in line with the last merge
Robert Bragg [Thu, 8 Jan 2009 13:10:32 +0000 (13:10 +0000)]
[fixed-to-float-patches] Updates the patches in line with the last merge

Most of the patches updated weren't failing but there were a number of
hunk offsets when applying so it tidies that up. The change in
mtx_transform.0.patch has been moved to clutter-actor.c.0.patch.

15 years agoWhitespace fixes in ClutterTexture
Emmanuele Bassi [Mon, 12 Jan 2009 17:12:24 +0000 (17:12 +0000)]
Whitespace fixes in ClutterTexture

Small whitespace fixes patch; ClutterTexture requires much more
love than I can provide at the moment.

15 years ago[async-loading] Do not force the texture size on async load
Emmanuele Bassi [Mon, 12 Jan 2009 17:09:47 +0000 (17:09 +0000)]
[async-loading] Do not force the texture size on async load

The size of the texture as retrieved by the filename should
be set as the image size, not as the actor size, in order to
respect the :sync-size property.

When the asynchronous loading process terminates, we queue
a relayout so that the scene is updated.

15 years ago[async-loading] Update asynchronous image loading
Emmanuele Bassi [Mon, 12 Jan 2009 16:54:30 +0000 (16:54 +0000)]
[async-loading] Update asynchronous image loading

Provide a main loop-based fallback to the asynchronous loading in
case the GLib threading support hasn't been enabled. This also
allows us to clean up the asynchronous loading machinery and have
it behave consistently across different scenarios.

Emit the ::load-finished even if the asynchronous loading from
disk was not enabled.

Finally, block clutter_texture_set_from_file() until we have an
image width and height, so that querying the texture actor size
after set_from_file() will still yield the correct result even
when asynchronous loading is set.

15 years agoAdd API for extracting image size from a file
Emmanuele Bassi [Mon, 12 Jan 2009 16:52:20 +0000 (16:52 +0000)]
Add API for extracting image size from a file

For the asynchronous loading we need a function call that parses
a file, given its path, and retrieves the image width and height.

This commit adds cogl_bitmap_get_size_from_file() to the CoglBitmap
API.

15 years agoMerge branch 'master' into async-textures
Emmanuele Bassi [Mon, 12 Jan 2009 14:43:53 +0000 (14:43 +0000)]
Merge branch 'master' into async-textures

15 years agoBug 1087 - virtualize stage_queue_redraw
Havoc Pennington [Mon, 12 Jan 2009 14:19:48 +0000 (14:19 +0000)]
Bug 1087 - virtualize stage_queue_redraw

Add a ClutterStage::queue-redraw signal.

The purpose of this signal is to allow combining the Clutter redraw
idle with another redraw idle such as gtk's (or any other one really;
this is desirable anytime Clutter is not the only thing drawing to
a toplevel window).

To override the default, you would connect to ::queue-redraw and then
stop the signal emission.