Emmanuele Bassi [Thu, 4 Jun 2009 15:27:21 +0000 (16:27 +0100)]
[x11] Rework map/unmap and resizing
The mapping and unmapping of the X11 stage implementation is
a bit bong. It's asynchronous, for starters, when it really
can avoid it by tracking the state internally.
The ordering of the map/unmap sequence is also broken with
respect to the resizing.
By tracking the state internally into StageX11 we can safely
remove the MapNotify and UnmapNotify X event handling.
In theory, we should use _NET_WM_STATE a lot more, and reuse
the X11 state flags for fullscreening as well.
Emmanuele Bassi [Thu, 4 Jun 2009 12:41:32 +0000 (13:41 +0100)]
[xinput] Check for the XInput entry points
Apparently, the XInput extension is using the same pkg-config
file ('xi') for both the 1.x and the 2.x API, so we need to
check for both the 1.x XGetExtensionVersion and the 2.x
XQueryInputVersion.
Emmanuele Bassi [Thu, 4 Jun 2009 11:15:15 +0000 (12:15 +0100)]
[units] Validate units against the ParamSpec
When declaring a property using ClutterParamSpecUnits we pass a
default type to limit the type of units we accept as valid values
for the property.
This means that we need to add the unit type check as part of the
validation process.
Emmanuele Bassi [Thu, 4 Jun 2009 11:00:58 +0000 (12:00 +0100)]
[actor] Add the ::allocation-changed signal
Sometimes it is useful to be able to track changes in the allocation
flags, like the absolute origin, inside children of a container.
Using the notify::allocation signal is not enough, in these cases, so
we need a specific signal that gives us both the allocation box and the
allocation flags.
Emmanuele Bassi [Wed, 3 Jun 2009 13:02:06 +0000 (14:02 +0100)]
[actor] Use flags to control allocations
Instead of passing a boolean value, the ::allocate virtual function
should use a bitmask and flags. This gives us room for expansion
without breaking API/ABI, and allows to encode more information to
the allocation process instead of just changes of absolute origin.
Emmanuele Bassi [Wed, 3 Jun 2009 10:12:09 +0000 (11:12 +0100)]
[units] Rework Units into logical distance value
Units as they have been implemented since Clutter 0.4 have always been
misdefined as "logical distance unit", while they were just pixels with
fractionary bits.
Units should be reworked to be opaque structures to hold a value and
its unit type, that can be then converted into pixels when Clutter needs
to paint or compute size requisitions and perform allocations.
The previous API should be completely removed to avoid collisions, and
a new type:
ClutterUnits
should be added; the ability to install GObject properties using
ClutterUnits should be maintained.
Emmanuele Bassi [Wed, 3 Jun 2009 09:09:56 +0000 (10:09 +0100)]
Remove a stray g_value_get_int()
Now that all properties are float, using g_value_get_int() to
retrieve the value of the :anchor-x property is going to print
out a warning.
Emmanuele Bassi [Tue, 2 Jun 2009 17:44:30 +0000 (18:44 +0100)]
Remove usage of Units and macros
The ClutterUnit and relative macros should not be used when dealing
with pixels -- which is to say, all the time when inside Clutter.
Neil Roberts [Wed, 3 Jun 2009 14:22:42 +0000 (15:22 +0100)]
[cogl-material] Allow setting a layer with an invalid texture handle
It was previously possible to create a material layer with no texture
by setting some property on it such as the matrix. However it was not
possible to get back to that state without removing the layer and
recreating it. It is useful to be able to remove the texture to free
resources without forgetting the state of the layer so we can put a
different texture in later.
Neil Roberts [Thu, 4 Jun 2009 11:04:47 +0000 (12:04 +0100)]
[gles/cogl-shader] Fix parameter spec for cogl_shader_get_info_log
The stub version of cogl_shader_get_info_log needed to be updated to
match the changes to the function signature in
61deeafa.
Neil Roberts [Thu, 4 Jun 2009 10:59:17 +0000 (11:59 +0100)]
[clutter-stage-win32] Call clutter_actor_map instead of setting the flags
The clutter_actor_map and unmap functions need to be called to
properly update the mapped state. This matches the changes to the X11
stage in
125bded8.
Neil Roberts [Thu, 4 Jun 2009 10:50:52 +0000 (11:50 +0100)]
[clutter-event-win32] Fix the argument types to clutter_actor_get_size
clutter_actor_get_size now takes float pointers so it was issuing a
warning.
Neil Roberts [Thu, 4 Jun 2009 10:50:06 +0000 (11:50 +0100)]
Load glBlendEquation and glBlendColor using cogl_get_proc_address
These are defined since OpenGL 1.2 and since Windows doesn't export
any functions defined after 1.1 we need to load them dynamically.
Neil Roberts [Thu, 4 Jun 2009 10:48:51 +0000 (11:48 +0100)]
Rename 'near' and 'far' variables to 'z_near' and 'z_far'
The Windows headers define near and far to be empty so it breaks the
build.
Emmanuele Bassi [Wed, 3 Jun 2009 11:59:16 +0000 (12:59 +0100)]
[actor] Unrealize on destroy
If the application code calls for destruction of an actor we need
to make sure that the actor is unrealized before running the dispose
sequence; otherwise, we might trigger an assertion failure on composite
actors.
Emmanuele Bassi [Wed, 3 Jun 2009 13:03:25 +0000 (14:03 +0100)]
Revert commit
762873e7
The commit
762873e79e501c949f3ef55cbac20276b6f6ed4e is completely
and utterly wrong and I should have never pushed it.
Serves me well for trying to work on three different branches and
on three different things.
Emmanuele Bassi [Wed, 3 Jun 2009 11:02:56 +0000 (12:02 +0100)]
[master clock] Avoid excessive redraws
Currently, the clock source spins a redraw every time there is at
least a timeline running. If the timelines were not advanced in
the previous frame, though, because their interval is larger than
the vblanking interval then this will lead to excessive redraws of
the scenegraph even if nothing has changed.
To avoid this a simple guard should be set by the MasterClock::advance
method in case no timeline was effectively advanced, and checked
before dispatching the stage redraws.
Emmanuele Bassi [Mon, 1 Jun 2009 17:43:47 +0000 (18:43 +0100)]
[tests] Add ClutterColor conformance tests
Add a conformance test unit for the to_string() and from_string()
methods.
Robert Staudinger [Mon, 1 Jun 2009 16:54:46 +0000 (18:54 +0200)]
[color] Add support for the "#rgba" color format
clutter_color_from_string() only supported the "#rrggbbaa" format with
alpha channel, this patch adds support for "#rgba".
Colors in "#rrggbb" format were parsed manually, this is now left to
the pango color parsing fallback, since that's handling it just fine.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Mon, 1 Jun 2009 16:35:41 +0000 (17:35 +0100)]
[docs] Rework the API reference version generation
Clutter copies the gtk-doc from the usual gtk+ template, and
has a version.xml.in containing only:
@VERSION@
Without a newline at the end. Unfortunately, it appears that
autoconf has started adding a newline to the generated version.xml
which then is used as the payload for the "version" XML entity.
Instead of using a secondary file we can make configure generate
the whole clutter-docs.xml and cogl-docs.xml files from a template;
this way we also get the ability to substitute more autoconf variables
into the documentation -- if needs be.
Emmanuele Bassi [Mon, 1 Jun 2009 15:31:32 +0000 (16:31 +0100)]
[cogl-shader] Make get_info_log() slightly nicer
The cogl_shader_get_info_log() function is very inconvenient for
language bindings and for regular use, as it requires a static
buffer to be filled -- basically just providing a wrapper around
glGetInfoLogARB().
Since COGL aims to be a more convenient API than raw GL we should
just make cogl_shader_get_info_log() return an allocated string
with the GLSL compiler log.
Neil Roberts [Mon, 1 Jun 2009 16:10:22 +0000 (17:10 +0100)]
Use GL_QUADS for flushing a quad batch
Instead of using GL_TRIANGLES and uploading the indices every time, it
now uses GL_QUADS instead on OpenGL. Under GLES it still uses indices
but it uses the new cogl_vertex_buffer_indices_get_for_quads function
to avoid uploading the vertices every time.
This requires the _cogl_vertex_buffer_indices_pointer_from_handle
function to be exposed privately to the rest of Cogl.
The static_indices array has been removed from the Cogl context.
Emmanuele Bassi [Mon, 1 Jun 2009 14:51:59 +0000 (15:51 +0100)]
[introspection] Remove Cogl symbols from Clutter GIR
The GIR file for Clutter still contains symbols from COGL, even
though we provide a Cogl GIR as well. The Clutter GIR should
depend on the Cogl GIR instead.
Marc-André Lureau [Sat, 30 May 2009 20:58:03 +0000 (23:58 +0300)]
build: don't double install clutter-version.h
Automake 1.11 installs several files in one command, and it fails if
the same file is installed two times.
See NEWS for details:
http://lists.gnu.org/archive/html/automake/2009-05/msg00093.html
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Mon, 1 Jun 2009 11:51:23 +0000 (12:51 +0100)]
[git ignore] Add report XML output file
Emmanuele Bassi [Sun, 31 May 2009 14:15:46 +0000 (15:15 +0100)]
Uniformly use floats in Actor properties
All the underlying implementation and the public entry points have
been switched to floats; the only missing bits are the Actor properties
that deal with positioning and sizing.
This usually means a major pain when dealing with GValues and varargs
functions. While GValue will warn you when dealing with the wrong
conversions, varags will simply die an horrible (and hard to debug)
death via segfault. Nothing much to do here, except warn people in the
release notes and hope for the best.
Emmanuele Bassi [Sun, 31 May 2009 14:07:58 +0000 (15:07 +0100)]
[texture] Increase verbosity of error messages
The GError messages in set_from_rgb_data() and set_from_yuv_data()
are a little bit too thin on details.
Emmanuele Bassi [Sun, 31 May 2009 14:06:16 +0000 (15:06 +0100)]
[docs] Remove misleading text
The documentation for ClutterTexture's set_from_rgb_data() and
set_from_yuv_data() says:
Note: This function is likely to change in future versions.
This is not true, since they'll remain for the whole 1.x API cycle.
Neil Roberts [Fri, 29 May 2009 10:52:21 +0000 (11:52 +0100)]
[pango-display-list] Use the CoglAttributeType macros instead of GL_FLOAT
Cogl now has an enum for the VBO attribute type so we should use that
instead of the GL enums.
Neil Roberts [Fri, 29 May 2009 10:38:03 +0000 (11:38 +0100)]
[pango-display-list] Use indexed vertices on GLES
Now that CoglVertexBuffers support indices we can use them with GLES
to avoid duplicating vertices. Regular GL still uses GL_QUADS because
it is shown to still have a performance benefit over indices with the
Intel drivers.
Neil Roberts [Thu, 28 May 2009 12:47:18 +0000 (13:47 +0100)]
[cogl-vertex-buffer] Add cogl_vertex_buffer_indices_get_for_quads
This function can be used as an efficient way of drawing groups of
quads without using GL_QUADS. It generates a VBO containing the
indices needed to render using pairs of GL_TRIANGLES. The VBO is
globally cached so that it only needs to be uploaded whenever more
indices are requested than ever before.
Emmanuele Bassi [Fri, 29 May 2009 16:53:19 +0000 (17:53 +0100)]
[actor] Add allocate_available_size()
The allocate_available_size() method is a convenience method in
the same spirit as allocate_preferred_size(). While the latter
will allocate the preferred size of an actor regardless of the
available size provided by the actor's parent -- and thus it's
suitable for simple fixed layout managers like ClutterGroup -- the
former will take into account the available size provided by the
parent and never allocate more than that; it is, thus, suitable
for simple fluid layout managers.
Emmanuele Bassi [Fri, 29 May 2009 16:50:58 +0000 (17:50 +0100)]
[build] Remove cogl-enum-types.h on distclean
The cogl-enum-types.h file is created by glib-mkenums under
/clutter/cogl/common, and then copied in /clutter/cogl in order
to make the inclusion of that file work inside cogl.h.
Since we're copying it in a different location, the Makefile
for that location has to clean up the copy.
Emmanuele Bassi [Fri, 29 May 2009 16:10:27 +0000 (17:10 +0100)]
[build] Fix dist issues
* cogl-deprecated.h is not being installed
* cogl-enum-types.c.in is not part of the dist
Jonas Bonn [Thu, 28 May 2009 07:47:45 +0000 (09:47 +0200)]
Freeze notifiers around property setters
Notifications should be fired off from both the internal timeline and
the wrapping animation here, so notifiers should be frozen around these
property setters.
Signed-off-by: Jonas Bonn <jonas@southpole.se>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Jonas Bonn [Thu, 28 May 2009 07:40:09 +0000 (09:40 +0200)]
[animation] Final cleanups to new Animation model
Just a couple of final cleanups after the reimplementation of the
Animation model.
i) _set_mode does not need to set the timeline on the alpha
ii) freeze notifications around the setting of a new alpha
Signed-off-by: Jonas Bonn <jonas@southpole.se>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Fri, 29 May 2009 13:52:49 +0000 (14:52 +0100)]
[master clock] Use StageManager::peek_stages()
Use the new StageManager::peek_stages() method to avoid a copy
of the stages list.
Emmanuele Bassi [Fri, 29 May 2009 13:45:53 +0000 (14:45 +0100)]
[stage manager] Add peek_stages()
We need an method for StageManager that returns a const pointer
to the internal list, to avoid the copy.
Emmanuele Bassi [Fri, 29 May 2009 13:25:19 +0000 (14:25 +0100)]
[master clock] Handle Timeline::started signal correctly
The "started" signal is sent first after the timeline has been set to the
'running' state. For this reason, checking if the clock has any running
timelines running will always return true in the "started" signal handler:
the timeline that sent the signal is running.
What needs to be checked in the signal handler is if there are any
timelines running other than the one that emitted the ::started signal,
which we know is running anyway.
This prevents frames from being lost at the beginning of an animation when
a timeline is started after a quiescent period.
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1617
Signed-off-by: Jonas Bonn <jonas@southpole.se>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Fri, 29 May 2009 13:27:55 +0000 (14:27 +0100)]
[build] Copy cogl-enum-types.h under the guard
We avoid rebuilding cogl-enum-types.h and cogl-enum-types.c by
using a "guard" -- a stamp file that will block Makefile. Since
we need cogl-enum-types.h into /clutter/cogl as well for the
cogl.h include to work, if we copy the cogl-enum-types.h
unconditionally it will cause a rebuild of the whole COGL; which
will cause a full rebuild.
To solve this, we can copy the header file when generating it
under the stamp file.
Neil Roberts [Fri, 29 May 2009 13:23:16 +0000 (14:23 +0100)]
[configure] Always execute the AM_CONDITIONAL call for X11_TESTS
Automake gets upset if an AM_CONDITIONAL call is itself conditionally
executed.
Emmanuele Bassi [Fri, 29 May 2009 11:50:48 +0000 (12:50 +0100)]
[build] Encode the target into the backend library
The libclutter-cogl internal object should be the only dependency
for Clutter, since we are already copying it inside clutter/cogl
for the introspection scanner. For this reason, the backend-specific,
real internal object should be built with the backend encoded into
the file name, like libclutter-common. This makes the build output
a little bit more clear: instead of having two:
LINK libclutter-cogl-common.la
...
LINK libclutter-cogl.la
LINK libclutter-cogl.la
We'll have:
LINK libclutter-cogl-common.la
...
LINK libclutter-cogl-gl.la
LINK libclutter-cogl.la
Same applies for the GLES backend.
Emmanuele Bassi [Fri, 29 May 2009 11:40:23 +0000 (12:40 +0100)]
Use g_once when registering enumeration types
Just like we do with GObject types and G_DEFINE_TYPE, we should
use the g_once_init_enter/g_once_init_leave mechanism to make the
GType registration of enumeration types thread safe.
Emmanuele Bassi [Fri, 29 May 2009 11:31:47 +0000 (12:31 +0100)]
[cogl] Generate enumeration GTypes
COGL is starting to have more enumerations than I can handle
by hand. Let's use glib-mkenums and be done with it.
Emmanuele Bassi [Thu, 28 May 2009 16:18:13 +0000 (17:18 +0100)]
[docs] Fixes for the API reference
* Add unused symbols
* Document and sync argument names with their gtk-doc counterpart
* Add missing descriptions
Emmanuele Bassi [Thu, 28 May 2009 16:18:10 +0000 (17:18 +0100)]
[git ignore] Add blend strings test
Emmanuele Bassi [Thu, 28 May 2009 14:53:56 +0000 (15:53 +0100)]
Merge branch 'master' into 1.0-integration
* master:
[test-text-perf] Use queue_redraw instead of painting the stage directly
[actor] In paint when opacity == 0, clear the queued_redraw flag
Neil Roberts [Thu, 28 May 2009 14:27:09 +0000 (15:27 +0100)]
[test-text-perf] Use queue_redraw instead of painting the stage directly
If it doesn't queue a redraw and allow the backend to clear and swap
the buffers then the results will be skewed because it is not
predictable when the driver will actually render the scene.
Emmanuele Bassi [Thu, 28 May 2009 12:03:19 +0000 (13:03 +0100)]
[cogl] Make cogl_setup_viewport() a private function
The setup_viewport() function should only be used by Clutter and
not by application code.
It can be emulated by changing the Stage size and perspective and
requeueing a redraw after calling clutter_stage_ensure_viewport().
Emmanuele Bassi [Thu, 28 May 2009 11:52:00 +0000 (12:52 +0100)]
[cogl deprecated] Add backface culling deprecation
The backface culling enabling function was split and renamed, just
like the depth testing one, so we need to add the macro to the
cogl-deprecated.h header.
Robert Bragg [Thu, 28 May 2009 11:49:29 +0000 (12:49 +0100)]
[cogl vertex buffers] Give indices a CoglHandle so they are shareable
Previously indices were tightly bound to a particular Cogl vertex buffer
but we would like to be able to share indices so now we have
cogl_vertex_buffer_indices_new () which returns a CoglHandle.
In particular we could like to have a shared set of indices for drawing
lists of quads that can be shared between the pango renderer and the
Cogl journal.
Robert Bragg [Thu, 28 May 2009 01:03:16 +0000 (02:03 +0100)]
[cogl journal] If we are only flushing one quad use a TRIANGLE_FAN
At the moment Cogl doesn't do much batching of quads so most of the time we
are flushing a single quad at a time. This patch simplifies how we submit
those quads to OpenGL by using glDrawArrays with GL_TRIANGLE_FAN mode
instead of sending indexed vertices using GL_TRIANGLES mode.
Note: I hope to follow up soon with changes that improve our batching and
also move the indices into a VBO so they don't need to be re-validated every
time we call glDrawElements.
Robert Bragg [Tue, 26 May 2009 17:25:00 +0000 (18:25 +0100)]
[deprecated defines] Adds some missing cogl_texture_* deprecated defines
To assist people porting code from 0.8, the cogl_texture_* functions that
have been replaced now have defines that give some hint as to how they
should be replaced.
Robert Bragg [Tue, 26 May 2009 15:55:11 +0000 (16:55 +0100)]
[cogl] renamed cogl_enable_* to cogl_set_*_enabled + added getters
cogl_enable_depth_test and cogl_enable_backface_culling have been renamed
and now have corresponding getters, the new functions are:
cogl_set_depth_test_enabled
cogl_get_depth_test_enabled
cogl_set_backface_culling_enabled
cogl_get_backface_culling_enabled
Robert Bragg [Tue, 26 May 2009 10:33:54 +0000 (11:33 +0100)]
[cogl matrix] Support ortho and perspective projections.
This adds cogl_matrix api for multiplying matrices either by a perspective
or ortho projective transform. The internal matrix stack and current-matrix
APIs also have corresponding support added.
New public API:
cogl_matrix_perspective
cogl_matrix_ortho
cogl_ortho
cogl_set_modelview_matrix
cogl_set_projection_matrix
Robert Bragg [Tue, 26 May 2009 14:41:53 +0000 (15:41 +0100)]
[cogl] Remove cogl_{create,destroy}_context from the public API
cogl_create_context is dealt with internally when _cogl_get_default context
is called, and cogl_destroy_context is currently never called.
It might be nicer later to get an object back when creating a context so
Cogl can support multiple contexts, so these functions are being removed
from the API until we get a chance to address context management properly.
For now cogl_destroy_context is still exported as _cogl_destroy_context so
Clutter could at least install a library deinit handler to call it.
Robert Bragg [Tue, 26 May 2009 15:27:36 +0000 (16:27 +0100)]
[vbo indices] tweak add_indices api to return an id and add delete_indices api
Originally cogl_vertex_buffer_add_indices let the user pass in their own unique
ID for the indices; now the Id is generated internally and returned to the
caller.
Robert Bragg [Sun, 24 May 2009 10:33:29 +0000 (11:33 +0100)]
[cogl-vertex-buffer] Seal GL types from the public API
We now have CoglAttributeType and CoglVerticesMode typedefs to replace the
use of GLenum in the public API.
Robert Bragg [Sun, 24 May 2009 03:04:38 +0000 (04:04 +0100)]
[cogl-vertex-buffers] Support putting index arrays into VBOS
It's now possible to add arrays of indices to a Cogl vertex buffer and
they will be put into an OpenGL vertex buffer object. Since it's quite
common for index arrays to be static it saves the OpenGL driver from
having to validate them repeatedly.
This changes the cogl_vertex_buffer_draw_elements API: It's no longer
possible to provide a pointer to an index array at draw time. So
cogl_vertex_buffer_draw_elements now takes an indices identifier that
should correspond to an idendifier returned when calling
cogl_vertex_buffer_add_indices ()
Robert Bragg [Sat, 23 May 2009 16:52:18 +0000 (17:52 +0100)]
[cogl] Remove cogl_flush_gl_state from the API
This is being removed before we release Clutter 1.0 since the implementation
wasn't complete, and so we assume no one is using this yet. Util we have
someone with a good usecase, we can't pretend to support breaking out into
raw OpenGL.
Robert Bragg [Sat, 23 May 2009 16:42:10 +0000 (17:42 +0100)]
[material] Reduce the material API in preperation for releasing Clutter 1.0
There were a number of functions intended to support creating of new
primitives using materials, but at this point they aren't used outside of
Cogl so until someone has a usecase and we can get feedback on this
API, it's being removed before we release Clutter 1.0.
Robert Bragg [Sat, 23 May 2009 15:23:00 +0000 (16:23 +0100)]
[cogl-material] Removes all the API made redundant by the blend strings API
This removes the following API:
cogl_material_set_blend_factors
cogl_material_set_layer_combine_function
cogl_material_set_layer_combine_arg_src
cogl_material_set_layer_combine_arg_op
These were rather awkward to use, so since it's expected very few people are
using them at this point and it should be straight forward to switch over
to blend strings, the API is being removed before we release Clutter 1.0.
Robert Bragg [Sun, 10 May 2009 23:40:41 +0000 (00:40 +0100)]
[cogl-material] Support string based blending and layer combine descriptions
Setting up layer combine functions and blend modes is very awkward to do
programatically. This adds a parser for string based descriptions which are
more consise and readable.
E.g. a material layer combine function could now be given as:
"RGBA = ADD (TEXTURE[A], PREVIOUS[RGB])"
or
"RGB = REPLACE (PREVIOUS)"
"A = MODULATE (PREVIOUS, TEXTURE)"
The simple syntax and grammar are only designed to expose standard fixed
function hardware, more advanced combining must be done with shaders.
This includes standalone documentation of blend strings covering the aspects
that are common to blending and texture combining, and adds documentation
with examples specific to the new cogl_material_set_blend() and
cogl_material_layer_set_combine() functions.
Note: The hope is to remove the now redundant bits of the material API
before 1.0
Robert Bragg [Wed, 27 May 2009 22:39:18 +0000 (23:39 +0100)]
[build] Fixes some compiler warnings when building for GLES 2
There were a number of variables shadowing other symbols, and an unused
display variable.
Emmanuele Bassi [Wed, 27 May 2009 17:28:37 +0000 (18:28 +0100)]
[animation] Simplify the Animation code
After long deliberation, the Animation class handling of the
:mode, :duration and :loop properties, as well as the conditions
for creating the Alpha and Timeline instances, came out as far too
complicated for their own good.
This is a rework of the API/parameters matrix and behaviour:
- :mode accessors will create an Alpha, if needed
- :duration and :loop accessors will create an Alpha and a Timeline
if needed
- :alpha will set or unset the Alpha
- :timeline will set or unset the Timeline
Plus, more documentation on the Animation class itself.
Many thanks to Jonas Bonn <jonas@southpole.se> for the feedback
and the ideas.
Emmanuele Bassi [Wed, 27 May 2009 12:01:31 +0000 (13:01 +0100)]
[animatable] Allow validation in ::animate_property
The Animatable interface implementation will always have the computed
value applied, whilst the non-Animatable objects go through the
interval validation first to avoid incurring in assertions and
warnings.
The Animatable::animate_property() should also be able to validate the
property it's supposed to interpolate, and eventually discard it. This
requires adding a return value to the virtual function (and its wrapper
function).
The Animation code will then apply the computed value only if the
animate_property() returns TRUE -- unifying the code path with the
non-Animatable objects.
Emmanuele Bassi [Wed, 27 May 2009 11:12:11 +0000 (12:12 +0100)]
[animation] Proxy properties whenever possible
The Animation class should proxy the :mode, :duration and :loop
properties whenever possible, to avoid them going out of sync when
changed using the Alpha and Timeline instances directly.
Currently, if Timeline:duration is changed, querying Animation:duration
will yield the old value, but the animation itself (being driven by
the Timeline) will use the Timeline's :duration new value. This holds
for the :loop and :mode properties as well.
Instead, the getters for the Animation's :duration, :loop and
:mode properties should ask the relevant object -- if any. The
loop, duration and mode values inside AnimationPrivate should only
be used if no Timeline or no Alpha instances are available, or
when creating new instances.
Emmanuele Bassi [Wed, 27 May 2009 10:52:40 +0000 (11:52 +0100)]
[animation] Defer the timeline handling to the Alpha
The Animation should not directly manipulate a Timeline instance,
but it should defer to the Alpha all handling of the timeline.
This means that:
- set_duration() and set_loop() will either create a Timeline or
will set the :duration and :loop properties on the Timeline; if
the Timeline must be created, and no Alpha instance is available,
then a new Alpha instance will be created as well and the newly
create Timeline will be assigned to the Alpha
- if set_mode() on an Animation instance without an Alpha, the
Alpha will be created; a Timeline will also be created
- set_alpha() will replace the Alpha; if the new Alpha does not
have a Timeline associated then a Timeline will be created using
the current :duration and :loop properties of Animation; otherwise,
if the replaced Alpha had a timeline, the timeline will be
transferred to the new one
Emmanuele Bassi [Tue, 26 May 2009 16:23:24 +0000 (17:23 +0100)]
[build] Decouple COGL debug level from Clutter's
Using --enable-debug, which controls Clutter's debug level, also
defines COGL_ENABLE_DEBUG. This should be left to --enable-cogl-debug
instead, since it's the configure switch that controls COGL debug
level.
Emmanuele Bassi [Mon, 25 May 2009 16:16:44 +0000 (17:16 +0100)]
[doap] Update
Long overdue update of the DOAP file for Clutter
* Repository update
* Add authors
Emmanuele Bassi [Mon, 25 May 2009 15:52:53 +0000 (16:52 +0100)]
[build] More spring clean fixes
* Remove the last if...fi with AS_IF
* Put back the regexp for the mingw32 check that commit
0d1c626a
inadvertedly removed
Emmanuele Bassi [Mon, 25 May 2009 13:04:53 +0000 (14:04 +0100)]
[build] Spring cleanup of configure.ac
Let's try to bring configure.ac into this century, shall we?
* Use the proper shell macros AS_IF and AS_CASE instead of if...fi
and case...esac
* Check for X11 and relative extensions only when building for GLX
and EGLX backends
* Add documentation on the behaviour of binary_age and interface_age
* Coalesce all the common checks to avoid redundancy
* Escape everything that requires escaping
Emmanuele Bassi [Mon, 25 May 2009 11:42:17 +0000 (12:42 +0100)]
Use GLib variant of strcasecmp()
The GLib version of strcasecmp() ignores any non-ASCII character,
unlike the original which is locale-dependent.
Emmanuele Bassi [Mon, 25 May 2009 11:41:16 +0000 (12:41 +0100)]
[build] Clean up cogl-pango Makefile
Emmanuele Bassi [Sat, 23 May 2009 18:18:18 +0000 (19:18 +0100)]
[cogl] Remove max_waste argument from Texture ctors
The CoglTexture constructors expose the "max-waste" argument for
controlling the maximum amount of wasted areas for slicing or,
if set to -1, disables slicing.
Slicing is really relevant only for large images that are never
repeated, so it's a useful feature only in controlled use cases.
Specifying the amount of wasted area is, on the other hand, just
a way to mess up this feature; 99% the times, you either pull this
number out of thin air, hoping it's right, or you try to do the
right thing and you choose the wrong number anyway.
Instead, we can use the CoglTextureFlags to control whether the
texture should not be sliced (useful for Clutter-GST and for the
texture-from-pixmap actors) and provide a reasonable value for
enabling the slicing ourself. At some point, we might even
provide a way to change the default at compile time or at run time,
for particular platforms.
Since max_waste is gone, the :tile-waste property of ClutterTexture
becomes read-only, and it proxies the cogl_texture_get_max_waste()
function.
Inside Clutter, the only cases where the max_waste argument was
not set to -1 are in the Pango glyph cache (which is a POT texture
anyway) and inside the test cases where we want to force slicing;
for the latter we can create larger textures that will be bigger than
the threshold we set.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>
Emmanuele Bassi [Mon, 30 Mar 2009 12:49:03 +0000 (13:49 +0100)]
Add repaint functions
Sometimes it is necessary for third party code to have a
function called during the redraw process, so that you can
update the scenegraph before it is painted.
Emmanuele Bassi [Sat, 23 May 2009 18:32:24 +0000 (19:32 +0100)]
[git ignore] Add test-text-perf
Neil Roberts [Fri, 22 May 2009 13:49:37 +0000 (14:49 +0100)]
[actor] In paint when opacity == 0, clear the queued_redraw flag
If we are short-circuiting the paint when the opacity is zero we still
need to clear the queued_redraw flag otherwise it won't be possible to
queue another redraw of the actor until something else has caused a
paint first.
Emmanuele Bassi [Fri, 22 May 2009 11:00:33 +0000 (12:00 +0100)]
Merge branch 'master' into 1.0-integration
* master:
[cogl-vertex-buffer] Ensure the clip state before rendering
[test-text-perf] Small fix-ups
Add a test for text performance
[build] Ensure that cogl-debug is disabled by default
[build] The cogl GE macro wasn't passing an int according to the format string
Use the right internal format for GL_ARB_texture_rectangle
[actor_paint] Ensure painting is a NOP for actors with opacity = 0
Make backface culling work with vertex buffers
Neil Roberts [Fri, 22 May 2009 10:41:02 +0000 (11:41 +0100)]
[cogl-vertex-buffer] Ensure the clip state before rendering
Before any rendering is done by Cogl it needs to ensure the clip stack
is set up correctly by calling cogl_clip_ensure. This was not being
done for the Cogl vertex buffer so it would still use the clip from
the previous render.
Damien Lespiau [Fri, 22 May 2009 00:23:29 +0000 (01:23 +0100)]
[texture] size-change closure is now VOID:FLOAT,FLOAT
Now that everything is float, the marsharlling function of the
size-change signal should reflect that fact.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Neil Roberts [Thu, 21 May 2009 16:43:41 +0000 (17:43 +0100)]
[test-text-perf] Small fix-ups
- Fix a typo in a for loop in create_label which left 'i'
uninitialised and caused a crash if you're unlucky.
- Set the CLUTTER_VBLANK=none environment variable.
- Don't quit on a keypress.
- Trailing whitespace tidy up.
Owen W. Taylor [Sun, 23 Nov 2008 00:26:56 +0000 (19:26 -0500)]
Add a test for text performance
Add tests/test-text-perf, which allows testing text performance as
a function of the length of text strings and font size.
Neil Roberts [Thu, 21 May 2009 15:51:16 +0000 (16:51 +0100)]
Merge branch 'pango-vbo' into 1.0-integration
This makes it cache the geometry of PangoLayouts into a VBO as
described in bug #1572.
Neil Roberts [Thu, 21 May 2009 14:49:14 +0000 (15:49 +0100)]
[cogl-pango-display-list] Use GL_TRIANGLES under GLES
GLES doesn't support GL_QUADS. This patch makes it use GL_TRIANGLES
instead in that case. Unfortunately this means submitting two extra
vertices per quad. It could be better to use indexed elements once
CoglVertexBuffers gains support for that.
Robert Bragg [Thu, 21 May 2009 14:25:31 +0000 (15:25 +0100)]
[build] Ensure that cogl-debug is disabled by default
The new cogl-debug option was accidentally being enabled by default since
configure.ac checked the 'default_enable' variable not 'cogl_default_enable'
Robert Bragg [Thu, 21 May 2009 14:04:38 +0000 (15:04 +0100)]
[build] The cogl GE macro wasn't passing an int according to the format string
This patch simply updates the arguments passed to g_warning inline with the
given format string.
Owen W. Taylor [Thu, 7 May 2009 03:35:01 +0000 (23:35 -0400)]
Use the right internal format for GL_ARB_texture_rectangle
When ClutterGLXTexturePixmap uses GL_ARB_texture_rectangle,
it needs to pass the right internal format (GL_RGB or GL_RGBA)
when it initializes the texture with glTexImage2D() or later
handling won't recognize the alpha channel.
http://bugzilla.openedhand.com/show_bug.cgi?id=1586
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Robert Bragg [Wed, 20 May 2009 16:55:29 +0000 (17:55 +0100)]
[actor_paint] Ensure painting is a NOP for actors with opacity = 0
Since it is convenient to use geometry with an opacity of 0 for input only
purposes it's a worthwhile optimization to avoid submitting anything
for such actors while painting.
Neil Roberts [Thu, 21 May 2009 13:56:38 +0000 (14:56 +0100)]
Make backface culling work with vertex buffers
Backface culling is enabled as part of cogl_enable so the different
rendering functions in Cogl need to explicitly opt-in to have backface
culling enabled. Cogl vertex buffers should allow backface culling so
they should check whether it is enabled and then set the appropriate
cogl_enable flag.
Neil Roberts [Thu, 21 May 2009 11:17:12 +0000 (12:17 +0100)]
[pango-render] Keep a reference to the first line to detect layout changes
In order to cope with the situation where an application renders with
a PangoLayout, makes some changes and then renders again with the same
layout, CoglPangoRenderer needs to detect that the changes have
occured so that it can recreate the display list. This is acheived by
keeping a reference to the first line of the layout. When the layout
is changed Pango will clear the layout pointer in the first line and
create a new line. So if the layout pointer in the line becomes NULL
then we know the layout has changed. This trick was suggested by
Behdad Esfahbod in this email:
http://mail.gnome.org/archives/gtk-i18n-list/2009-May/msg00019.html
Neil Roberts [Thu, 21 May 2009 11:09:16 +0000 (12:09 +0100)]
[cogl-pango-render] Fix the positioning when calling cogl_pango_render_layout
When a position is given to cogl_pango_render_layout_subpixel it
translates the GL matrix by the coordinates. However it was not
dividing by PANGO_SCALE so the coordinates were completely wrong.
Emmanuele Bassi [Wed, 20 May 2009 16:38:58 +0000 (17:38 +0100)]
[texture] Use a box instead of int coordinates
Most of the operations involving the texture's allocated area require
floats -- either for computations or for setting the geometry into
COGL. So it doesn't make any sense to use get_allocation_coords() and
cast everything to floats.
Emmanuele Bassi [Wed, 20 May 2009 16:26:39 +0000 (17:26 +0100)]
[actor] Do not try to dereference NULL data
If the shader_data bound to an Actor is NULL we should not try to access
its members.
Emmanuele Bassi [Wed, 20 May 2009 15:49:22 +0000 (16:49 +0100)]
Merge commit 'origin/master' into 1.0-integration
Conflicts:
clutter/clutter-texture.c
clutter/cogl/gl/cogl-fbo.c
Emmanuele Bassi [Wed, 20 May 2009 15:06:09 +0000 (16:06 +0100)]
Add more padding in Model and ModelIter classes
ClutterModel and ClutterModelIter have 4 padding slots, but if they
have to survive the 1.x API cycle they will need at least twice that
amount.
Emmanuele Bassi [Wed, 20 May 2009 14:15:25 +0000 (15:15 +0100)]
[cogl] Do no include gprintf.h
We are not using any of the g_printf* family of functions, so we
can import glib.h instead.
Emmanuele Bassi [Tue, 19 May 2009 15:00:18 +0000 (16:00 +0100)]
[cogl] Move debugging to a configure-time switch
Currently, COGL depends on defining debug symbols by manually
modifying the source code. When it's done, it will forcefully
print stuff to the console.
Since COGL has also a pretty, runtime selectable debugging API
we might as well switch everything to it.
In order for this to happen, configure needs a new:
--enable-cogl-debug
command line switch; this will enable COGL debugging, the
CoglHandle debugging and will also turn on the error checking
for each GL operation.
The default setting for the COGL debug defines is off, since
it slows down the GL operations; enabling it for a particular
debug build is trivial, though.
Emmanuele Bassi [Tue, 19 May 2009 13:44:29 +0000 (14:44 +0100)]
[cogl] Rework the debug messages
COGL has a debug message system like Clutter's own. In parallel,
it also uses a coupld of #defines. Spread around there are also
calls to printf() instead to the more correct g_log* wrappers.
This commit tries to unify and clean up the macros and the
debug message handling inside COGL to be more consistent.
Emmanuele Bassi [Tue, 19 May 2009 13:42:37 +0000 (14:42 +0100)]
Remove duplicate cogl-internal.h header
The cogl-internal.h header has been moved inside cogl/common in
commit
8a1b4f8326 but has been left behind inside cogl/gl and
cogl/gles.