Bug 1499 - clutter_actor_notify_if_geometry_changed causes sync
layout cycles
Whenever clutter_actor_set_{width,height,x,y,size...} is used, extra
synchronous size requests are triggered in
clutter_actor_notify_if_geometry_changed.
If the get_preferred_width() and get_preferred_height() implementations
are particularly costly (e.g. ClutterText) this will result in a performance
impact.
To avoid excessive allocation or requisition cycles we use the
cached values and flags. If we don't have an allocation, we assume
that we need to notify all the properties; if we don't have a size
requisition we notify only width and height; finally, if we do have
a valid allocation we notify only on the changed values.
* cogl-client-matrix-stacks:
Maintain the Cogl assumption that the modelview matrix is normally current
Finish GLES{1,2} support for client side matrix stacks
Explicitly make the modelview-matrix current in cogl_{rotate,transform,etc}
Avoid casting CoglMatrix to a GLfloat * when calling glGetFloatv
Removes need for casting const float * in _cogl_set_clip_planes
Virtualize GL matrix operations and use a client-side matrix when GL is indirect
_cogl_add_path_to_stencil_buffer and _cogl_add_stencil_clip were leaving
the projection matrix current when calling cogl_rectangle which was
upsetting _cogl_current_matrix_state_flush.
Adds glFrustum wrappers (GLES only accepts floats not doubles, and GLES2
needs to use our internal cogl_wrap_glFrustumf)
Adds GL_TEXTURE_MATRIX getter code in cogl_wrap_glGetFloatv
Adds a GL_TEXTURE_MATRIX define for GLES2
Its not intended that users should use these with any other matrix mode, and
internally we now have the _cogl_current_matrix API if we need to play with
other modes.
If we later add internal flags to CoglMatrix then this code wouldn't
initialize those flags. The ways it's now done adds a redundant copy, but
if that turns out to be something worth optimizing we can look again at
using a cast but adding another way for initializing internal flags.
This is useful because sometimes we need to get the current matrix, which
is too expensive when indirect rendering.
In addition, this virtualization makes it easier to clean up the API in
the future.
This commit yesterday:
89e3e3a4cc
[animation] Add vector variants for ::animate()
broke the "fixed::" attribute on properties in clutter_actor_animate(),
because the fixed:: part is still on the string when it checks to see if
it's a valid property the class knows about.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
This update fixes a few issues:
- the use of shave with mingw32 bash on windows,
- fix the unmangling of libtool names
- fix build on solaris
- add an --enable/disable-shave configure option (while still
defaulting to enabled)
As a convenience, if NULL is passed for the text argument of
clutter_text_set_text() (and for consistency,
clutter_text_set_markup()), treat that the same as "".
Bug 1480 - Clutter groups don't output their name when
CLUTTER_DEBUG=paint
This is a really useful thing to do debugging-wise - as you can see
istantly when (and if) clutter objects are being drawn - as often
there's quite a hierarchy of objects in groups.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Add missing (out) annotations to the doc comments for ClutterActor methods
with multiple return values.
Fix the definition of clutter_actor_get_allocation_vertices() to be
consistent with the declaration and have verts[4] rather than verts[].x
http://bugzilla.openedhand.com/show_bug.cgi?id=1481
Bug 1501 - clutter_text_insert_text not working right with non-onebyte
character
In clutter_text_insert_text(), the position is expressed in characters, not
in bytes.
Actually, it turns out to be working on bytes, so when there are already
multi-byte character in the text buffer, insert text at the position after
the multi-byte character will not work right.
Also, the position is not updated after the insert work is done.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1500 - [Patch] clutter_text crash with non one-byte utf8 text exceed
max_length
In clutter_text_set_text_internal(), when text length in character is greater
than max_length, and there are multi-byte character in it, then the new text
string buffer is not malloc()'ed with right length. This will cause the app to
crash with segmention fault.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Clutter uses the standard git format for commit messages:
short description
<newline>
long description...
And everyone asking for their patches or trees to be merged upstream
should conform to the same commit messages format, just like they
should conform to the coding style.
The fixed-point values are converted to integers, which obviously
messes up the conversion. Instead, they should be converted to
floating point values before normalizing to bytes for the assignment
to ClutterColor components.
$(builddir) isn't always defined in earlier versions of Automake
(although I can't track down exactly which version it appeared
in). According to the autoconf docs it is "rigorously equal to `.'" so
we might as well not use it.
The private CoglContext is created using g_malloc() and not
zeroed; this means we have to initialize the values we are
going to check, to avoid hitting garbage.
Thanks to Tommi Komulainen.
Commit a383929 added the $(srcdir) prefix to all of the source files
but some files are generated by the configure script and other make
rules so they actually live in $(builddir). Out-of-tree builds
therefore broke.
Bug 1438 - Implicit Animation API could use animatev variants
The clutter_actor_animate* family of functions use va_lists to
handle the property/value pairs for the final state of the
animation.
Language bindings have problems with variadic arguments functions,
and usually prefer vector-based API which allow a greater level
of control and conversion from native data types.
For each variadic arguments function in the clutter_actor_animate*
family there should be a vector-based version that takes:
- the number of property/value pairs
- a constant array of constant strings
- an array of GValues
Most of the internal implementation can be refactored from the
current one, thus both the var_args and the vector entry points
share a common implementation of the code; then, both versions
of the API are just loops over a list of arguments.
Based on a patch by: Robert Carr <carrr@rpi.edu>
Since the switch from fixed point to floating point, and the introduction
of CoglFixed, ClutterFixed has been typedef'd into a float. This makes
ClutterFixed the worst fixed point API ever.
Now that Clutter has been migrated to CoglFixed and gfloat whenever needed,
ClutterFixed can be safely removed.
The only thing that Clutter should still provide is ClutterParamSpecFixed,
for installing fixed point properties into GObject classes.
The ClutterFixed symbols have been entirely removed from the API.
A GValue containing a ClutterUnit should be transformable into a
GValue holding an integer, a floating point value or a fixed point
value.
This means adding more transformation functions when registering
the ClutterUnit GType.
The fog and perspective API is currently split in two parts:
- the floating point version, using values
- the fixed point version, using structures
The relative properties are using the structure types, since they
are meant to set multiple values at the same time. Instead of
using bare values, the whole API should be coalesced into two
simple calls using structures to match the GObject properties.
Thus:
clutter_stage_set_fog (ClutterStage*, const ClutterFog*)
clutter_stage_get_fog (ClutterStage*, ClutterFog*)
clutter_stage_set_perspective (ClutterStage*, const ClutterPerspective*)
clutter_stage_get_perspective (ClutterStage*, ClutterPerspective*)
Which supercedes the fixed point and floating point variants.
More importantly, both ClutterFog and ClutterPerspective should
using floating point values, since that's what get passed to
COGL anyway.
ClutterFog should also drop the "density" member, since ClutterStage
only allows linear fog; non-linear fog distribution can be achieved
using a signal handler and calling cogl_set_fog() directly; this keeps
the API compact yet extensible.
Finally, there is no ClutterStage:fog so it should be added.
The type machinery for CoglFixed should be implemented by COGL
itself, now that COGL exports the GType of its types.
This allows moving most of what ClutterFixed did directly to
CoglFixed where it belongs.
ClutterFixed as a type is going away, superceded by CoglFixed. The
fixed point entry points in the API should be ported to the
CoglFixed type so that they are useful again.
Since the conversion of a floating point value to a fixed point
value is already done in double precision we can safely expose
a macro that converts a double precision floating point value to
a CoglFixed one.
Grabs are an entirely evil way to override the whole event delivery
machinery that Clutter has in place.
A pointer grab can be effectively replaced by a much more reliable
::captured-event signal handler, for instance.
Sometimes, grabs are a necessary evil -- and that is why Clutter
exposes them in the API; that should not fool anyone into thinking
that they should be used unless strictly necessary.