Emmanuele Bassi [Wed, 29 Sep 2010 13:10:38 +0000 (14:10 +0100)]
cally: Do not use deprecated functions
The function g_strcasecmp() has been deprecated since GLib 2.2.
Emmanuele Bassi [Wed, 29 Sep 2010 10:44:46 +0000 (11:44 +0100)]
animator: Code style fixes
Stephen Kennedy [Wed, 29 Sep 2010 09:56:48 +0000 (10:56 +0100)]
ClutterAnimator doesn't ref timeline properly
ClutterAnimator currently has a number of bugs related to its
referencing of its internal timeline.
1) The default timeline created in _init is not unreffed (it appears the
programmer has wrongly thought ClutterTimeline has a floating reference
based on the use of g_object_ref_sink in _set_timeline)
2) The timeline and slave_timeline vars are unreffed in finalize instead
of dispose
3) The signal handlers set up in _set_timeline are not disconnected when
the animator is disposed
http://bugzilla.clutter-project.org/show_bug.cgi?id=2347
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Neil Roberts [Mon, 27 Sep 2010 21:17:12 +0000 (22:17 +0100)]
Add a conformance test for clutter_actor_contains
This adds a conformance test for clutter_actor_contains to assert that
it gets the expected results for the given tree of actors.
Neil Roberts [Mon, 27 Sep 2010 16:51:01 +0000 (17:51 +0100)]
Simplify the loop for clutter_actor_contains
This reorganizes the loop for clutter_actor_contains so that it is a
for loop rather than a while loop. Although this is mostly just
nitpicking, I think this change could make the loop slightly faster if
not optimized because it doesn't perform the self == descendant check
twice and it is clearer.
Neil Roberts [Mon, 27 Sep 2010 16:47:38 +0000 (17:47 +0100)]
Document what happens when self==descendant in clutter_actor_contains
The documentation for clutter_actor_contains didn't specify what
happens when self==descendant. A strict reading of it might lead you
to think that it would return FALSE because in that case the
descendant isn't an immediate child or a deeper descendant. The code
actually would return TRUE. I think this is more useful so this patch
fixes the docs rather than the code.
Emmanuele Bassi [Mon, 27 Sep 2010 15:46:26 +0000 (16:46 +0100)]
Post-branch version bump to 1.5.1
Emmanuele Bassi [Sun, 26 Sep 2010 17:48:04 +0000 (18:48 +0100)]
doap: Remove mallum from the maintainers list
Emmanuele Bassi [Sun, 26 Sep 2010 15:52:58 +0000 (16:52 +0100)]
actor: Dispose all constrains
We are leaking the ClutterMetaGroup with all the constraints when
disposing an Actor.
Emmanuele Bassi [Sat, 25 Sep 2010 19:23:41 +0000 (20:23 +0100)]
json: Allow NULL as a value for strings, arrays and objects
We should not warn when asking for a string, array or object if the
contents were 'null'.
Patch from JSON-GLib.
Emmanuele Bassi [Fri, 24 Sep 2010 15:21:06 +0000 (16:21 +0100)]
test-clutter-units: Force a known resolution to avoid fuzzyness
Instead of taking the current resolution, whatever it may be, use a
known DPI. This should alleviate fuzzyness and create consistent
results.
Emmanuele Bassi [Fri, 24 Sep 2010 14:25:15 +0000 (15:25 +0100)]
Post-release version bump to 1.4.1
Emmanuele Bassi [Fri, 24 Sep 2010 14:07:17 +0000 (15:07 +0100)]
Release 1.4.0 (stable)
Elliot Smith [Fri, 24 Sep 2010 13:48:53 +0000 (14:48 +0100)]
cookbook: Reduce complexity of sample ClutterAnimator code for recipe
http://bugzilla.clutter-project.org/show_bug.cgi?id=2341
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Øyvind Kolås [Fri, 24 Sep 2010 12:28:08 +0000 (13:28 +0100)]
animator: fix removal of all keys
When removing all keys in a ClutterAnimator, the hash table with
object/property name pairs went out of sync. This change makes
the animator always clear this hash table upon key-removal; and
refreshing it if the animator's timeline is running.
Fixes bug #2335
Robert Bragg [Thu, 23 Sep 2010 21:18:42 +0000 (22:18 +0100)]
material: Don't prune ancestry if it owns some layers
Each time a material property changes we look to see if any of its
ancestry has become redundant and if so we prune that redundant
ancestry.
There was a problem with the logic that handles this though because we
weren't considering that a material which is a layer state authority may
still defer to ancestors to define the state of individual layers.
For example a material that derives from a parent with 5 layers can
become a STATE_LAYERS authority by simply changing it's ->n_layers count
to 4 and in that case it can still defer to its ancestors to define the
state of those 4 layers.
This patch checks first if a material is a layer state authority and if
so only tries to prune its ancestry if it also *owns* all the individual
layers it depends on. (I.e. if g_list_length
(material->layer_differences) != material->n_layers then it's not safe
to try pruning its ancestry!)
http://bugzilla-attachments.gnome.org/attachment.cgi?id=170907
Jammy Zhou [Tue, 21 Sep 2010 03:37:52 +0000 (11:37 +0800)]
cogl-framebuffer.c: GL_DEPTH_STENCIL not supported in gles
There is GL_INVALID_ENUM error for GL_DEPTH_STENCIL when call
glRenderbufferStorage() with OpenGL ES backend. So enable this
only for OpenGL backend.
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Emmanuele Bassi [Thu, 23 Sep 2010 16:03:17 +0000 (17:03 +0100)]
cookbook: Further clarification of the anchor point
Make sure to add a note on the behaviour of the anchor point. Ideally,
it would be nice to have a recipe about it in the Actor section.
Elliot Smith [Thu, 23 Sep 2010 15:18:29 +0000 (16:18 +0100)]
cookbook: Recipe for "moving actors"
This recipe explains how to use the three animation
approaches (implicit, State, Animator) to animate movement
of actors.
Includes some guidelines about which approach to use when, with
a full code example for each approach.
The discussion section covers some subtleties around animated
movement; namely: moving actors out of their containers; anchor
points and movement; moving in the depth axis; interactions
between animated movement and constraints.
Elliot Smith [Thu, 23 Sep 2010 10:19:00 +0000 (11:19 +0100)]
cookbook: Fixed markup in animations section
Fixed indentation on some mark-up in an unrelated recipe.
Elliot Smith [Wed, 22 Sep 2010 15:58:08 +0000 (16:58 +0100)]
cookbook: Example of animated movement with ClutterAnimator
Added an example showing how to randomly animate the
simultaneous movement on the x axis of three actors,
using ClutterAnimator.
Elliot Smith [Tue, 21 Sep 2010 16:45:03 +0000 (17:45 +0100)]
cookbook: Example of animated movement with ClutterState
Added an example showing how to move two actors between
two states (one minimised, one maximised) using ClutterState
to do the movement. Also shows how movement can be mixed
with other animation (in this case, scaling).
Elliot Smith [Tue, 21 Sep 2010 16:44:00 +0000 (17:44 +0100)]
cookbook: Example of simple movement animation
Added example showing how to move an actor in one of the
three axes (x,y,z) in response to a button event on the
actor.
Emmanuele Bassi [Thu, 23 Sep 2010 15:17:24 +0000 (16:17 +0100)]
Add some more argument validation
This is all internal, so we shouldn't need it; unfortunately, it seems
we're passing invalid data internally, so for the time being catching
inconsistencies should at least emit a warning for us to backtrace.
Robert Bragg [Thu, 23 Sep 2010 15:03:06 +0000 (16:03 +0100)]
actor: don't pass NULL to _stage_set_pick_buffer_valid
This adds a check in clutter_actor_real_queue_redraw after calling
_clutter_actor_get_stage_internal to check in case the actor doesn't yet
have an associated stage so we can avoid passing a NULL stage pointer to
_clutter_stage_set_pick_buffer_valid which could cause a crash.
Robert Bragg [Thu, 23 Sep 2010 14:45:27 +0000 (15:45 +0100)]
docs: Put deprecated Cogl symbols into new section
This adds a "Cogl deprecated API" chapter to the Cogl reference manual
so we can group all the documentation for deprecated symbols together
instead of having them clutter up the documentation of symbols we would
rather developers used.
Robert Bragg [Wed, 25 Aug 2010 21:31:30 +0000 (22:31 +0100)]
docs: update the overview paragraph for Cogl
Instead of describing OpenGL as "a low level OpenGL abstraction
library" it is now summarised as "modern 3D graphics API".
Robert Bragg [Wed, 25 Aug 2010 19:36:20 +0000 (20:36 +0100)]
docs: cogl-texture-3d wasn't listed as experimental
The CoglTexture3D API is only available when defining
COGL_ENABLE_EXPERIMENTAL_API so it should be listed in the experimental
section of the API reference.
Robert Bragg [Wed, 25 Aug 2010 19:33:27 +0000 (20:33 +0100)]
docs: Use "Cogl" not "COGL" in Cogl API reference
Cogl isn't an acronym so we should use "Cogl" instead of "COGL" in
our documentation.
Emmanuele Bassi [Thu, 23 Sep 2010 14:15:37 +0000 (15:15 +0100)]
table-layout: Invert row/column in arguments
*** This is an API change ***
The general pattern for axis-aligned arguments is:
x argument
y argument
If we consider columns an x-aligned argument, and row a y-aligned
argument, then we need to update the TableLayout functions to be:
column
row
and not:
row
column
Emmanuele Bassi [Thu, 23 Sep 2010 12:36:56 +0000 (13:36 +0100)]
docs: Mention Uncrustify in the coding style document
Emmanuele Bassi [Thu, 23 Sep 2010 12:36:41 +0000 (13:36 +0100)]
Update the uncrustify configuration
Emmanuele Bassi [Thu, 23 Sep 2010 12:00:06 +0000 (13:00 +0100)]
Add uncrustify configuration file
Patch submission should include a pass of uncrustify to conform to the
coding style.
Uncrustify is not perfect - but at least it's a start.
Robert Bragg [Fri, 10 Sep 2010 23:29:05 +0000 (00:29 +0100)]
picking: Fix tracking of pick buffer validity
We have an optimization to track when there are multiple picks per
frame so we can do a full render of the pick buffer to reduce the
number of pick renders for a static scene.
There was a problem though in that we were tracking this information in
the ClutterMainContext, but conceptually this doesn't really make sense
because the pick buffer is associated with a stage framebuffer and there
can be multiple stages for one context.
This patch moves the state tracking to ClutterStage.
Robert Bragg [Thu, 23 Sep 2010 10:35:42 +0000 (11:35 +0100)]
Revert "picking: Fix tracking of pick buffer validity"
This reverts commit
d7e86e26960f4cb2f5f0600357f5df89bd1c46c1.
This was a half baked patch that was pushed a bit early since it broke
test-texture-pick-with-alpha + the commit message refers to a change on
the wip/paint-box branch that hasn't happened yet.
Robert Bragg [Fri, 10 Sep 2010 23:29:05 +0000 (00:29 +0100)]
picking: Fix tracking of pick buffer validity
We have an optimization to track when there are multiple picks per
frames so we can do a full render of the pick buffer to reduce the
number of pick renders for a static scene.
There were two problems with how we were tracking this state though.
Firstly we were tracking this information in the ClutterMainContext, but
conceptually this doesn't really make sense because the pick buffer is
associated with a stage framebuffer and there can be multiple stages for
one context. Secondly - since the change to how redraws are queued - we
weren't marking the pick buffer as invalid when a queuing a redraw, we
were only marking the buffer invalid when signaling/finishing the
queue-redraw process, which is now deferred until just before a paint.
This meant using clutter_stage_get_actor_at_pos after a scenegraph
change could give a wrong result if it just read from an existing (but
technically invalid) pick buffer.
This patch moves the state tracking to ClutterStage, and ensures the
buffer is invalidated in _clutter_stage_queue_actor_redraw.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2283
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Wed, 22 Sep 2010 11:46:47 +0000 (12:46 +0100)]
box-layout: Small cleanups
Emmanuele Bassi [Wed, 22 Sep 2010 09:07:42 +0000 (10:07 +0100)]
docs: Update the coding style
Make sure to document:
• nested if
• conditions
• interface definition
Neil Roberts [Tue, 21 Sep 2010 12:17:53 +0000 (13:17 +0100)]
test-conform: Delay initializing Clutter until a test is run
Instead of calling clutter_init immediately, test-conformance now only
calls it as part of test_conform_simple_fixture_setup. The conformance
tests assert that only one test is run per instance of
test-conformance so it should never end up calling clutter_init
twice. Delaying clutter_init has the advantage that calling
"test-conformance -l" will still work even on systems with no X
server. This could be useful for automated build systems.
Emmanuele Bassi [Tue, 21 Sep 2010 12:32:31 +0000 (13:32 +0100)]
effects: Make sure we're using GLSL 1.10
Emmanuele Bassi [Tue, 21 Sep 2010 12:17:51 +0000 (13:17 +0100)]
introspection: Build ClutterJson before Clutter
Since the latter requires the former.
Emmanuele Bassi [Tue, 21 Sep 2010 12:15:56 +0000 (13:15 +0100)]
Require the installed JSON-GLib
Continue to provide the internal copy for 1.4, but require an explicit
override to use it.
The internal copy will be removed for Clutter 1.6.
Emmanuele Bassi [Tue, 21 Sep 2010 11:02:41 +0000 (12:02 +0100)]
build: Update the remote publish path for the cookbook
Neil Roberts [Mon, 20 Sep 2010 11:04:51 +0000 (12:04 +0100)]
clutter-box-layout: Swap the default request mode
The request mode set by the box layout was previously width-for-height
in a vertical layout and height-for-width in a horizontal layout which
seems to be wrong. For example, if width-for-height is used in a
vertical layout then the width request will come second with the
for_height parameter set. However a vertical layout doesn't pass the
for_height parameter on to its children so doing the requests in that
order doesn't help. If the layout contains a ClutterText then both the
width and height request for it will have -1 for the for_width and
for_height parameters so the text would end up allocated too small.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2328
Emmanuele Bassi [Mon, 20 Sep 2010 13:33:26 +0000 (14:33 +0100)]
Merge branch 'cookbook-layouts-bind-constraint'
* cookbook-layouts-bind-constraint:
cookbook: Add recipe about sync'ing actor sizes
cookbook: Example using allocation-changed to sync actor size
cookbook: Simple example to demonstrate bind constraint
cookbook: Example of using a bind constraint for an overlay
Emmanuele Bassi [Mon, 20 Sep 2010 13:31:53 +0000 (14:31 +0100)]
docs: Description fixes for State.set_animator()
Bastian Winkler [Fri, 17 Sep 2010 11:21:03 +0000 (13:21 +0200)]
state: Request the animator for the default state
Try to use the default-state animator in case there is no animator for
this specific state change request.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2325
Bastian Winkler [Wed, 15 Sep 2010 13:59:39 +0000 (15:59 +0200)]
state: Fix the usage of ClutterAnimator in ClutterScript
Fix the transition parser to allow transitions that have only an
animator and no keys defined.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2325
Bastian Winkler [Wed, 15 Sep 2010 12:46:19 +0000 (14:46 +0200)]
state: Create a new target state in clutter_state_set_animator
clutter_state_set_animator needs to create a new state in order to use a
ClutterAnimator with a target state that doesn't exist yet.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2325
Dominique Leuenberger [Mon, 20 Sep 2010 13:13:49 +0000 (14:13 +0100)]
build: Pass CLUTTER_CFLAGS to g-ir-scanner
http://bugzilla.clutter-project.org/show_bug.cgi?id=2327
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Mon, 20 Sep 2010 12:15:44 +0000 (13:15 +0100)]
docs: API reference fixes
Emmanuele Bassi [Mon, 20 Sep 2010 10:30:23 +0000 (11:30 +0100)]
build: Remove unnecessary newline
Frederik Hahne [Mon, 20 Sep 2010 10:23:31 +0000 (11:23 +0100)]
po: Update German translation
Emmanuele Bassi [Sat, 18 Sep 2010 07:41:52 +0000 (08:41 +0100)]
texture: Add more validation on the material
If set_cogl_texture() is called after unsetting the Texture's material
then we really want to make a copy of the template.
Also, we should assert more often if the internal state goes horribly
wrong: at least, we'll have a backtrace.
Neil Roberts [Fri, 17 Sep 2010 16:10:39 +0000 (17:10 +0100)]
Fix the ordering of the arguments for clutter_table_layout_set_span
The order of the row_span and column_span arguments was different in
the declaration from that in the definition. This was causing the
gtk-doc to also have the wrong order.
Neil Roberts [Fri, 17 Sep 2010 16:18:09 +0000 (17:18 +0100)]
cogl-object-private.h: Include cogl-debug.h
If COGL_OBJECT_DEBUG is defined then cogl-object-private.h will call
COGL_NOTE in the ref and unref macros. For this to work the debug
header needs to also be included or COGL_NOTE won't necessarily be
defined.
Elliot Smith [Thu, 16 Sep 2010 14:55:21 +0000 (15:55 +0100)]
cookbook: Add recipe about sync'ing actor sizes
The recipe covers how to use ClutterBindConstraint
to bind actor sizes together.
It gives some examples of where this approach is appropriate,
as well as explaining an alternative using allocation-changed
or notify::* signals.
Three examples are given:
1. Resizing a texture to the stage.
2. Resizing a rectangle to act as a transparent overlay on
top of a texture (using constraints).
3. Resizing a rectangle to act as a transparent overlay on
top of a texture, but with a size proportional to the texture
(using a handler connected to allocation-changed signals
emitted by the texture).
Elliot Smith [Thu, 16 Sep 2010 12:42:09 +0000 (13:42 +0100)]
cookbook: Example using allocation-changed to sync actor size
An alternative method (not using constraints) to bind
one actor's size and position to another. Used as
an example in the recipe about resizing one actor in
sync with a source actor.
Elliot Smith [Wed, 15 Sep 2010 15:05:15 +0000 (16:05 +0100)]
cookbook: Simple example to demonstrate bind constraint
A simple example showing how to scale an actor to the stage.
Demonstrates ClutterBindConstraint and ClutterAlignConstraint
in a fashion suitable for a short recipe.
Elliot Smith [Wed, 15 Sep 2010 14:50:32 +0000 (15:50 +0100)]
cookbook: Example of using a bind constraint for an overlay
Example code which loads an image into a texture, and resizes
the image in response to +/- key presses. The overlay is
a transparent rectangle which is bound to the height and
width of the texture; on clicking the texture, the overlay
is made visible by increasing its opacity.
This demonstrates how to use constraints to simplify code
for resizing an actor which is "dependent" on another actor.
Emmanuele Bassi [Fri, 17 Sep 2010 13:54:31 +0000 (14:54 +0100)]
docs: Add sub-classing notes on ActorMeta and Constraint
Emmanuele Bassi [Fri, 17 Sep 2010 11:43:23 +0000 (12:43 +0100)]
flow-layout: Blow the cached preferred size if needed
If the FlowLayout layout manager wasn't allocated the same size it
requested then it should blow its caches and recompute the layout
with the given allocation size.
Emmanuele Bassi [Fri, 17 Sep 2010 11:13:29 +0000 (12:13 +0100)]
constraint: Re-implement using update_allocation()
Instead of using the fixed position and size API, use the newly added
update_allocation() virtual function in ClutterConstraint to change the
allocation of a ClutterActor. This allows using constraints inside
layout managers, and also allows Constraints to react to changes in the
size of an actor without causing relayout cycles.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2319
Emmanuele Bassi [Fri, 17 Sep 2010 11:09:56 +0000 (12:09 +0100)]
constraint: Add ::update_allocation()
The Constraint should plug directly into the allocation mechanism, and
modify the allocation of the actor to which they are applied to. This is
similar to the mechanism used by the Effect class to modify the paint
sequence of an actor.
Emmanuele Bassi [Fri, 17 Sep 2010 11:08:52 +0000 (12:08 +0100)]
test-bind: Fix colors and set the name of the boxes
Emmanuele Bassi [Fri, 17 Sep 2010 10:40:10 +0000 (11:40 +0100)]
build: Use the power of abs_builddir
When calling test-conformance to get the list of conformance tests.
Emmanuele Bassi [Fri, 17 Sep 2010 10:39:20 +0000 (11:39 +0100)]
build: Enable COGL_OBJECT_DEBUG in the debug flags
The CoglObject debugging code is enabled by a separate flag.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2318
Robert Bragg [Thu, 16 Sep 2010 11:58:42 +0000 (12:58 +0100)]
offscreen-effect: Update handling of transforms
In line with the changes made in
f5f066df9ce7 to clean up how Clutter
deals with transformations of actors this patch updates the code in
clutter-offscreen-effect.c. We now query the projection matrix from the
stage instead of the perspective and instead of duplicating the logic to
setup the stage view transform we now use
_clutter_actor_apply_modelview_transform for the stage instead.
Neil Roberts [Thu, 16 Sep 2010 10:12:51 +0000 (11:12 +0100)]
clutter.modules: Specify the checkoutdir for the gtk2 module
If no checkoutdir is specified then jhbuild seems to use the name of
the module which in this case would be 'gtk+'. This ends up
overwriting the checkout of the master branch of gtk+ and causes all
kinds of build problems. This patch adds a checkoutdir attribute to
the gtk2 module to force it to checkout into the gtk2 directory.
Emmanuele Bassi [Wed, 15 Sep 2010 15:46:06 +0000 (16:46 +0100)]
Post-release version bump to 1.3.15
Emmanuele Bassi [Wed, 15 Sep 2010 15:12:39 +0000 (16:12 +0100)]
Release Clutter 1.3.14 (developers snapshot)
Emmanuele Bassi [Wed, 15 Sep 2010 14:56:42 +0000 (15:56 +0100)]
build: Add cogl-debug-options.h
Emmanuele Bassi [Wed, 15 Sep 2010 14:35:05 +0000 (15:35 +0100)]
docs: Fix the name of the parameters
Neil Roberts [Wed, 15 Sep 2010 13:39:05 +0000 (14:39 +0100)]
cogl: Make cogl_util_next_p2 internal and fix the documentation
cogl_util_next_p2 is declared in cogl-util.h which is a private header
so it shouldn't be possible for an application to use it. It's
probably not a function we'd like to export from Cogl so it seems
better to keep it private. This patch renames it to _cogl_util_next_p2
so that it won't be exported from the shared library.
The documentation for the function is also slightly wrong because it
stated that the function returned the next power greater than
'a'. However the code would actually return 'a' if it's already a
power of two. I think the actual behaviour is more useful so this
patch changes the documentation rather than the code.
Neil Roberts [Wed, 15 Sep 2010 13:07:30 +0000 (14:07 +0100)]
cogl-vertex-buffer: Don't always set COGL_MATERIAL_FLUSH_FALLBACK_MASK
Previously CoglVertexBuffer would always set the flush options flags
to at least contain COGL_MATERIAL_FLUSH_FALLBACK_MASK. The code then
later checks whether any flags are set before deciding whether to copy
the material to implement the overrides. This means that it would
always end up copying the material even if there are no fallback
layers. This patch changes it so that it only sets
COGL_MATERIAL_FLUSH_FALLBACK_MASK if fallback_layers != 0.
Robert Bragg [Tue, 14 Sep 2010 19:25:23 +0000 (20:25 +0100)]
material-arbfp: fix updating params if sharing progs
If a single arbfp program is being shared between multiple CoglMaterials
then we need to make sure we update all program.local params when
switching between materials. Previously we had a dirty flag to track
when combine_constant params were changed but didn't take in to account
that different materials sharing the same program may have different
combine constants.
Robert Bragg [Tue, 14 Sep 2010 17:50:50 +0000 (18:50 +0100)]
material-arbfp: Another pass at simplifying the code
Previously the backend private state was used to either link to an
authority material or provide authoritative program state. The mechanism
seemed overly complex and felt very fragile. I made a recent comment
which added a lot of documentation to make it easier to understand but
still it didn't feel very elegant.
This patch takes a slightly different approach; we now have a
ref-counted ArbfpProgramState object which encapsulates a single ARBfp
program and the backend private state now just has a single member which
is a pointer to one of these arbfp_program_state objects. We no longer
need to cache pointers to our arbfp-authority and so we can get rid of
a lot of awkward code that ensured these pointers were
updated/invalidated at the right times. The program state objects are
not tightly bound to a material so it will also allow us to later
implement a cache mechanism that lets us share state outside a materials
ancestry. This may help to optimize code not following the
recommendations of deriving materials from templates, avoiding one-shot
materials and not repeatedly modifying materials because even if a
material's ancestry doesn't naturally lead us to shareable state we can
fallback to searching for shareable state using central hash tables.
Robert Bragg [Mon, 5 Jul 2010 20:33:26 +0000 (21:33 +0100)]
material: Adds experimental cogl_material_foreach_layer API
This adds a way to iterate the layer indices of the given material since
cogl_material_get_layers has been deprecated. The user provides a
callback to be called once for each layer.
Because modification of layers in the callback may potentially
invalidate any number of the internal CoglMaterialLayer structures and
invalidate the material's layer cache this should be more robust than
cogl_material_get_layers() which used to return a const GList *
pointing directly to internal state.
Robert Bragg [Tue, 14 Sep 2010 11:13:30 +0000 (12:13 +0100)]
material: don't declare backend vtables in headers
This fixes the material backends to declare their constant vtable in the
c file with a corresponding extern declaration in the header. This
should fix complaints about duplicate symbols seen on OSX.
Robert Bragg [Mon, 13 Sep 2010 23:33:46 +0000 (00:33 +0100)]
material-arbfp: don't recompile for constant changes
Instead of lazily incorporating combine constants as arbfp PARAM
constants in the source directly we now use program.local parameters
instead so we can avoid repeating codegen if a material's combine
constant is updated. This should be a big win for applications animating
a constant used for example in an animated interpolation, such as
gnome-shell.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2280
Robert Bragg [Mon, 13 Sep 2010 23:27:57 +0000 (00:27 +0100)]
material-arbfp: don't redo codegen for texture changes
This makes it so we don't consider LAYER_STATE_TEXTURE changes to affect
the arbfp code. This should avoid a lot of unneeded passes of
code generation for applications modifying the texture for a layer.
Robert Bragg [Mon, 13 Sep 2010 23:18:02 +0000 (00:18 +0100)]
material: make layer/material_pre_changes mutually exclusive
This makes it so we only notify backends of either a single material
change or a single layer change. Previously all material STATE_LAYERS
changes would be followed by a more detailed layer change.
For backends that perform code generation for fragment processing they
typically need to understand the details of how layers get changed to
determine if they need to repeat codegen. It doesn't help them to report
a material STATE_LAYERS change for all layer changes since it's so
broad, they really need to wait for the layer change to be notified.
What does help though is to report a STATE_LAYERS change for a change in
material->n_layers because they typically do need to repeat codegen in
that case.
Robert Bragg [Mon, 13 Sep 2010 22:52:18 +0000 (23:52 +0100)]
material-arbfp: fixes for how we track private state
This fixes a number of issues relating to how we track the arbfp private
state associated with CoglMaterials. At the same time it adds much more
extensive code documentation to try and make it a bit more approachable.
Robert Bragg [Mon, 13 Sep 2010 22:05:49 +0000 (23:05 +0100)]
material: pass material owner for layer pre changes
When notifying a backend about a layer being modified we now pass the
layers current owner for reference. NB: Although a layer can indirectly
be referenced by multiple layers, a layer is considered immutable once
it has dependants, so there is only ever one material associated with a
layer being modified. Passing the material pointer to the backends
layer_pre_change callback can be useful for backends that associate
their private state with materials and may need to update that state in
response to layer changes.
Robert Bragg [Mon, 13 Sep 2010 21:56:44 +0000 (22:56 +0100)]
arbfp: rename get_arbfp_authority clarifying semantics
This renames the get_arbfp_authority function to
get_arbfp_authority_no_check to clarify that the function doesn't
validate that the authority cache is still valid by looking at the age
of the referenced material. The function should only be used when we
*know* the cache has already been checked.
Robert Bragg [Mon, 13 Sep 2010 20:26:31 +0000 (21:26 +0100)]
material: track if material change is layer change
We now pass a boolean to _cogl_material_pre_change_notify to know when
a material change is as a result of a layer change. We plan to use this
information to avoid notifying the backends about material changes if
they are as a result of layer changes. This will simplify the handling
of state changes in the backends because they can assume that layer and
material changes are mutually exclusive.
Robert Bragg [Mon, 13 Sep 2010 20:21:09 +0000 (21:21 +0100)]
material: Adds _get_layer_combine_constant API
This adds an internal _cogl_material_get_layer_combine_constant function
so we can query the current layer combine constant back. We should
probably make this a public property getter, but for now we just need
this so we can read the constant in the arbfp backend.
Robert Bragg [Mon, 13 Sep 2010 20:17:30 +0000 (21:17 +0100)]
material: track unit state with arbfp private state
We are going to start tracking more per-texture unit state with arbfp
private state so this adds an internal UnitState type and we allocate an
array of these when setting up a new private state structure. The first
thing that has been moved into this is the sampled boolean to know when
a particular texture unit gets sampled from in the generated arbfp code.
Emmanuele Bassi [Wed, 15 Sep 2010 10:56:59 +0000 (11:56 +0100)]
Enumeration value should be on the same line
The glib-mkenums script is not clever enough to deal with
FLAGS_VALUE = FLAGS_A |
FLAGS_B
And since this breaks the enumeration GType and the introspection data,
we cannot really wait for it to be fixed.
See: https://bugzilla.gnome.org/show_bug.cgi?id=629741
http://bugzilla.clutter-project.org/show_bug.cgi?id=2238
Robert Bragg [Wed, 1 Sep 2010 14:15:20 +0000 (15:15 +0100)]
cogl-framebuffer: fix leak when popping framebuffer
We were using g_slist_remove_link instead of g_slist_delete_link
resulting in a memory leak. Thanks to Simon Lanzmich for
reporting this bug.
Robert Bragg [Mon, 16 Aug 2010 20:11:42 +0000 (21:11 +0100)]
Initialize the cogl uprof state in cogl_create_context
This avoids the use of of gcc constructor and destructor attributes to
initialize the cogl uprof context and optionally print a cogl uprof
report at app exit. We now initialize the uprof context in
cogl_context_create instead.
Robert Bragg [Mon, 26 Jul 2010 14:21:18 +0000 (15:21 +0100)]
journal: provide more detailed uprof instrumentation
This adds more timing around key stages of the journal flushing process.
Robert Bragg [Mon, 21 Jun 2010 14:36:46 +0000 (15:36 +0100)]
profile: Update to uprof-0.3 dep for --enable-profile
When building with --enable-profile we now depend on the uprof-0.3
developer release which brings a few improvements:
» It lets us "fix" how we initialize uprof so that instead of using a shared
object constructor/destructor (which was a hack used when first adding
uprof support to Clutter) we can now initialize as part of clutter's
normal initialization code. As a side note though, I found that the way
Clutter initializes has some quite serious problems whenever it
involves GOptionGroups. It is not able to guarantee the initialization
of dependencies like uprof and Cogl. For this reason we still use the
contructor/destructor approach to initialize uprof in Cogl.
» uprof-0.3 provides a better API for adding custom columns when reporting
timer and counter statistics which lets us remove quite a lot of manual
report generation code in clutter-profile.c.
» uprof-0.3 provides a shared context for tracking mainloop timer
statistics. This means any mainloop based library following the same
"Mainloop" timer naming convention can use the shared context and no
matter who ends up owning the final mainloop the statistics will always
be in the same place. This allows profiling of Clutter with an
external mainloop such as with the Mutter compositor.
» uprof-0.3 can export statistics over dbus and comes with an ncurses
based ui to vizualize timer and counter stats live.
The latest version of uprof can be cloned from:
git://github.com/rib/UProf.git
Neil Roberts [Mon, 6 Sep 2010 16:18:11 +0000 (17:18 +0100)]
cogl-framebuffer: Clear the renderbuffer list on failure
When try_creating_fbo fails it deletes any intermediate render buffers
that were created. However it doesn't clear the list so I think if it
failed a second time it would try to delete the render buffers
again. This could potentially cause problems if a subsequent fbo is
created because the destructor for the original might delete the
renderbuffers of the new fbo.
Robert Bragg [Sat, 11 Sep 2010 01:31:03 +0000 (02:31 +0100)]
clone: scale src with apply_transform not cogl_scale
Since a ClutterClone may be allocated a different size than its source
actor we need to apply a scale factor before painting the source actor.
We were manually using cogl_scale to do this in clutter_clone_paint but
really this kind of thing is best handled in an implementation of the
apply_transform virtual so Clutter can be aware of the transform for
other purposes, such as input transformations. Also we want to provide
an implementation of the get_paint_volume virtual where Clutter will
also expect to be able to use the apply_transform virtual to transform
the volume into its parent's coordinate space.
Robert Bragg [Wed, 8 Sep 2010 00:41:01 +0000 (01:41 +0100)]
glx: Mark stage clip initialized even for NULL user clip
If a NULL clip is passed to clutter_stage_glx_add_redraw_clip then we
update the redraw clip to have width of 0, but we weren't setting
stage_glx->initialized_redraw_clip = TRUE. This could result in a full,
unclipped stage redraw being reduced to a clipped redraw.
Robert Bragg [Tue, 7 Sep 2010 21:02:23 +0000 (22:02 +0100)]
actor: warn if allocating actor not descending from stage
This adds a verbose warning that will be displayed if
clutter_actor_allocate is passed an actor that isn't a descendent of a
ClutterStage. Layouting should always bubble up from a stage so this
condition is likely to indicate a buggy container that allocating a
child that it has already unparented.
Robert Bragg [Tue, 7 Sep 2010 16:00:49 +0000 (17:00 +0100)]
geometry: Adds a clutter_geometry_intersects API
This adds a public function named clutter_geometry_intersects which
determines if two geometries intersect or not returning TRUE if so else
FALSE.
Emmanuele Bassi [Mon, 16 Aug 2010 15:02:53 +0000 (16:02 +0100)]
actor-box: Correctly clamp to pixel
Use ceilf() to round up the right side of the actor's box, and floorf()
to round down the left side.
Robert Bragg [Tue, 7 Sep 2010 12:10:55 +0000 (13:10 +0100)]
Try to clean up how we handle actor transformations
When building actor relative transforms, instead of using the matrix
stack to combine transformations and making assumptions about what is
currently on the stack we now just explicitly initialize an identity
matrix and apply transforms to that.
This removes the full_vertex_t typedef for internal transformation code
and we just use ClutterVertex.
ClutterStage now implements apply_transform like any other actor now
and the code we had in _cogl_setup_viewport has been moved to the
stage's apply_transform instead.
ClutterStage now tracks an explicit projection matrix and viewport
geometry. The projection matrix is derived from the perspective whenever
that changes, and the viewport is updated when the stage gets a new
allocation. The SYNC_MATRICES mechanism has been removed in favour of
_clutter_stage_dirty_viewport/projection() APIs that get used when
switching between multiple stages to ensure cogl has the latest
information about the onscreen framebuffer.