This adds internal _cogl_material_get_layer_filters and
_cogl_material_get_layer_{min,mag}_filter functions which can be used to
query the filters associated with a layer using a layer_index, as
opposed to a layer pointer. Accessing layer pointers is considered
deprecated so we need to provide layer_index based replacements.
When we come to submitting the users given attributes we sort them into
different types of buffers. Previously we had three types; strided,
unstrided and multi-pack. Really though unstrided was just a limited
form of multi-pack buffer and didn't imply any hind of special
optimization so this patch consolidates some code by reducing to just
two types; strided and multi-pack.
This is a counter part for _cogl_material_layer_pre_paint which takes a
layer index instead of a direct CoglMaterialLayer pointer. The aim is to
phase out code that directly iterates the internal layer pointers of a
material since the layer pointers can change if any property of any
layer is changed making direct layer pointers very fragile.
This exposes the idea of a stack of source materials instead of just
having a single current material. This allows the writing of orthogonal
code that can change the current source material and restore it to its
previous state. It also allows the implementation of new composite
primitives that may want to validate the current source material and
possibly make override changes in a derived material.
* private-cleanup:
Add copyright notices
Clean up clutter-private.h/6
Clean up clutter-private.h/5
Clean up clutter-private.h/4
Clean up clutter-private.h/3
Clean up clutter-private.h/2
Clean up clutter-private.h/1
Correct the argument order and replace all occurrences of
clutter_state_change() with the appropriate clutter_state_set_state() or
clutter_state_warp_to_state().
If you warp to a state, it should be immediately set. Check if the
animation is in progress when warping to a state and don't short-circuit
in the already-set check if we're not animating.
Add special behaviour when you set the key of the current target state:
- If the state is transitioning, add/modify the interval so that the new
key transitions from the current time (taking into account pre-delay) to
its target final property
- If the state is set but has already finished animating/was warped to,
set the property immediately
If ClutterState is in the middle of a transition and you remove all the
keys from the target state, the target state will be destroyed without
stopping the animation/unsetting the target state. This caused an invalid
memory access.
Allow setting a %NULL state. This has the effect of unsetting the current
state and stopping all animation. This allows you to, for example, start
a state transition, set the state to NULL, alter the state transition
and then resume it again, by just setting it.
* wip/path-constraint:
docs: Add PathConstraint
tests: Add a PathConstraint interactive test
Add ClutterPathConstraint
actor-box: Add setters for origin and size
ClutterPathConstraint is a simple Constraint implementation that
modifies the allocation of the Actor to which is has been applied using
a progress value and a ClutterPath.
There was previously a flag that gets set when this function was
called but nothing checked it so the function effectively did
nothing. Also the flag was a member of the backend struct but this
can't be used because the function should be called before
clutter_init so the backend is not ready yet. This patch makes the
event disabling work more like the X11 backend and set a global
variable instead.
This function handles a single windows message. The idea is that it
could be used by clutter-gtk to forward on events from a
GdkEventFilter. The function replaces the old message_translate()
function. That function didn't translate the event anymore anyway and
instead it could generate multiple events so
clutter_win32_handle_event seems like a more appropriate name. The
function returns TRUE or FALSE depending on whether the event was
completely handled instead of setting call_window_proc.
When handling an allocation on the stage, Clutter uses the oppurtunity
to inform Cogl of the new size of the framebuffer so that it can
handle the viewport correctly. It queries the size of the window
implementation using a backend virtual function. However it was doing
this before letting the backend handle the allocation so on Win32 it
would end up using the previous framebuffer size. This wasn't
affecting the X11 backend because in that case the resizes are
asynchronous so setting the stage size causes one allocation which
ends up sending a window size request. Eventually a ConfigureNotify is
received which causes the size of the stage to be set again and
another allocation is fired meaning the framebuffer size will be set
again this time with the correct size. In Win32 the resizes are
synchronous so we don't have this second allocation.
When compiling for non-glx platforms the winsys feature data array
ends up empty. Empty arrays cause problems for MSVC so this patch adds
a stub entry so that the array always has at least one entry.
Based on a patch by Ole André Vadla Ravnås
There was an array whose length was define by a static const int
variable. GCC seems to consider this a variable-length array so it
will cause warnings now that -Wvla is enabled. We might as well make
this constant a #define instead to avoid the warning.
Instead of directly manipulating GL textures itself,
CoglTexture2DSliced now works in terms of CoglHandles. It creates the
texture slices using cogl_texture_new_with_size which should always
end up creating a CoglTexture2D because the size should fit. This
allows us to avoid replicating some code such as the first pixel
mipmap tracking and it better enforces the separation that each
texture backend is the only place that contains code dealing with each
texture target.
This adds two new internal functions to create a foreign texture for
the texture 2d and rectangle backends. cogl_texture_new_from_foreign
will now use one of these backends directly if there is no waste
instead of always using the sliced texture backend.
Move the private Backend API to a separate header.
This also allows us to finally move the class vtable and instance
structure to a separate file and plug the visibility hole that left
the Backend class bare for everyone to poke into.
After testing and distchecking, I verified that autoreconf can still be
used to rebuild the autotools setup.
Thanks to Javier Jardón for the second pair of eyes.
Unparented actors are owned by the Script instance, and if that goes
away then the actors go away with it. The fact that we needed an
explicit destroy() before was a hint of a memory management issue that I
blissfully - and regretfully - ignored for the sake of a passing test
suite.
They are generated at configure time, so it's a good idea to have them
in the main ignore file instead of adding them to the built ignore files
under tests.
Since we allow compiling Clutter without the XComposite extension
available, we need to protect the calls to the XComposite API with
the guards provided by the configure script.
Currently, the memory management in ClutterScript is overly complicated.
The basic design tenet should be:
- ClutterScript owns a reference on every object it creates
This allows the Script instance to reliably handle the lifetime of the
instances from creation to disposal.
In case of unmerge, the Script instance should destroy any Actor
instance, except for the Stage, and release the reference it owns. The
Stage is special because it's really owned by Clutter itself, and it
should be destroyed explicitly.
When disposing the Script itself, it should just release the reference;
any parented actor, or any InitiallyUnowned instance, will then be
managed by the parent object, as they should, while every GObject
instance will go away, as documented.
This commit is based on a patch by:
Henrik Hedberg <hhedberg@innologies.fi>
http://bugzilla.clutter-project.org/show_bug.cgi?id=2316