Commit Graph

5111 Commits

Author SHA1 Message Date
Emmanuele Bassi
ce3311df26 conform: Remove unnecessary destroy() calls
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.
2010-10-19 12:32:02 +01:00
Emmanuele Bassi
b5bbdd6cec build: Add test wrappers to the main ignore file
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.
2010-10-19 11:03:13 +01:00
Emmanuele Bassi
e80825535a build: Show whether we have XComposite
Since we're doing it for other optional X11 extensions as well.
2010-10-19 10:48:39 +01:00
Emmanuele Bassi
dd2f55c6f6 x11: Protect XComposite API calls
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.
2010-10-19 10:43:50 +01:00
Emmanuele Bassi
21eb49098a script: Fix the memory management
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
2010-10-19 01:42:19 +01:00
Emmanuele Bassi
20a359cc53 debug: Do not use '&' in the messages
Use ':' as a separator between G_STRLOC and the debug message, like we
do for warnings.
2010-10-19 01:42:19 +01:00
Emmanuele Bassi
78d4073f8e Remove unused variables 2010-10-19 01:42:19 +01:00
Damien Lespiau
1c9dcdaeb2 build: Fix CLUTTER_EGL_BACKEND definition for eglnative and cex100
CLUTTER_EGL_BACKEND is used to define a special EGL native backend to
use and was introduced for the CEX100 EGL backend. Unfortunately
CLUTTER_EGL_BACKEND was defined to "cex100" for eglnative, which is
obviously wrong.

The paches defines the right values for CLUTTER_EGL_BACKEND for the
eglnative and cex100 flavours.
2010-10-18 16:09:31 +01:00
Damien Lespiau
32270730bd build: Fix EGL/CEX100 build with GLES2
Some headers files have been renamed or removed and the gles(2) did not
compile anymore, fix that.
2010-10-18 16:08:47 +01:00
Emmanuele Bassi
0f613ea134 cairo-texture: Allow overriding the surface creation
By using a new signal, ::create-surface (width, height), it should be
possible for third party code and sub-classes to override the default
surface creation code in CairoSurface.

This commit takes a bit of the patch from:

  http://bugzilla.clutter-project.org/show_bug.cgi?id=1878

which cleans up CairoTexture; the idea, mutuated from that bug, is that
the CairoTexture actor checks whether the surface it has it's an image
one, and in that case it uses a Cogl texture as the backing store. In
case the surface is not an image one we assume that the surface itself
has some way of updating the GL state and flush the surface.
2010-10-18 11:26:45 +01:00
Emmanuele Bassi
63e314b07e build: Depend on cairo-gobject
Starting from version 1.10, Cairo ships GTypes for its data types.
2010-10-18 11:26:45 +01:00
Emmanuele Bassi
8729c01377 build: Remove unnecessary g-i version check 2010-10-18 11:26:45 +01:00
Emmanuele Bassi
050e775da2 Move more classes to install_properties() 2010-10-18 11:26:45 +01:00
Emmanuele Bassi
8429aa8d75 Remove unnecessary GLib version checks
We now depend on a newer version of GLib than those checks tested for.
2010-10-18 11:26:45 +01:00
Emmanuele Bassi
7dd09e2186 Use G_DEFINE_BOXED_TYPE for all boxed types
We actually need a couple more macros for registering GValue
transformation functions. Those should be added to upstream
GLib.
2010-10-18 11:26:45 +01:00
Emmanuele Bassi
09a830d294 Remove conditional wrappers for property installation/notification
For the time being, just keep the #define's.
2010-10-18 11:26:45 +01:00
Emmanuele Bassi
9caf11f2d8 Use G_DEFINE_INTERFACE
GObject provides us with a nice, safe macro for defining interface
types.
2010-10-18 11:26:44 +01:00
Emmanuele Bassi
8f5d6cb790 build: Depend on GLib ≥ 2.26.0
We are going to need some new macros and API.
2010-10-18 11:26:44 +01:00
Emmanuele Bassi
2b4ee9ab54 actor: Add more checks to the redraw queue 2010-10-15 16:05:44 +01:00
Emmanuele Bassi
ad0e7a9e15 moduleset: Add Atk as a Clutter dependency 2010-10-15 15:24:58 +01:00
Emmanuele Bassi
56c89bd86b osx: Fix glib.h include path
The fix for removing glib/gmain.h introduced the wrong path for glib.h.
2010-10-15 12:40:43 +01:00
Roland Peffer
d842619755 osx: Add button mask to the modifier state translation
The modifier state translation is missing the CLUTTER_BUTTON*_MASK.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2365

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-10-14 18:23:02 +01:00
Kristian Høgsberg
134ce072e7 The amazing lazy-copy-back-repaint-page-flip
Always use pageflipping, but avoid full repaint by copying back dirty
regions from front to back.  Additionally, we dealy copying back until
we're ready to paint the new frame, so we can avoid copying areas that
will be repainted anyway.

This is the least amount of copying per frame we can get away with at all
and at the same time we don't have to worry about stalling the GPU on
synchronized blits since we always pageflip.
2010-10-14 16:23:05 +01:00
Kristian Høgsberg
cb5582c4ab Add wayland backend
This adds a clutter backend for running under the wayland window system.
Initial cogl framebuffer integration by Robert Bragg.
2010-10-14 16:23:05 +01:00
Kristian Høgsberg
a7cf98ebfc Initialize color masks lazily
When we don't use a window system drawable, we can't query the color
masks at context initialization time.  Do it lazily so we're sure to have
a current context with a valid framebuffer.
2010-10-14 16:23:05 +01:00
Robert Bragg
f456116c18 When unparenting an actor, remove queued redraws for all descendants
We need to make sure that redraws queued for actors on a stage are for
actors actually in the stage. So in clutter_actor_unparent() descend
through the children and remove redraws. Just removing the actor itself
isn't good enough since an entire hierarchy can be removed from the
stage without breaking it up into individual actors.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2359

This is based on an original patch from Owen Taylor who debugged the
root cause of this bug; thanks.
2010-10-14 16:19:55 +01:00
Robert Bragg
07f2dba7e2 stage: handle unclipped redraw following clipped
In the case that an unclipped redraw of an actor is queued after a
clipped we should update any existing ClutterStageQueueRedrawEntry
so entry->has_clip = FALSE and free the previous clip.
2010-10-14 15:29:33 +01:00
Emmanuele Bassi
d032b9b2bf conform: Start cleaning up the conformance test suite
Re-order the units into a sensible list, with basic tests at the
beginning, and per-class tests at the end - with Cogl last.

Also, start renaming the unit functions from test_<foo> to <foo>,
so that the executable wrappers and the reports have sensible names.
2010-10-12 17:42:18 +01:00
Emmanuele Bassi
b5d5b9628e conform: Implement TEST_CONFORM_TODO() correctly
The TODO() macro for adding new tests to the test suite has always meant
to be implemented like the TODO block in Test::More, i.e. a test that is
assumed to fail, and which warns if it unexpectedly succeeds.

Since GTest lacks the expressivity of Test::More, the implementation
just verifies that the tests marked as TODO actually fail, and will fail
if they happen to succeed - at which point the developer will have to
change the macro to SIMPLE or SKIP.
2010-10-12 17:11:52 +01:00
Emmanuele Bassi
2a23bab819 conform: Save the revision and date inside the test report
Even if gtester-report doesn't use that information (yet), we should
store the revision of Clutter that generated the report, and the date in
which the test suite was ran.
2010-10-12 15:44:57 +01:00
Emmanuele Bassi
e6418a9dec constraints: Remove unused variable 2010-10-12 15:44:57 +01:00
Neil Roberts
7fd6273c25 tests: Generate the stub scripts using sed
Instead of trying to run ./test-conformance with the -l option to
generate a list of available tests it now runs sed on the
test-conform-main.c file instead. Running the generated executable is
a pain for cross-compiling so it would be nice to avoid it unless it's
absolutely necessary. Although you could tell people who are cross
compiling to just disable the conformance tests, this seems a shame
because they could still be useful along with the wrappers for example
if the cross compile is built to a shared network folder where the
tests can be run on the actual device.

The sed script is a little more ugly than it could be because it tries
to avoid using the GNU extensions '\+' and '\|'.

The script ends up placing restrictions on the format of the C file
because the tests must all be listed on one line each. There is now a
comment to explain this. Hopefully the trade off is worth it.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2363
2010-10-12 15:24:32 +01:00
Neil Roberts
100d541f47 tests: Re-enable the test-anchors conformance test
This test was disabled in b5d58213. The commit message doesn't mention
this so I'm guessing it was a mistake. In any case the test appears to
work now anyway so it should be re-enabled.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2363
2010-10-12 15:24:32 +01:00
Emmanuele Bassi
2831addcf5 test-flow-layout: Track stage size by default
Instead of requiring a special command line switch.
2010-10-12 14:53:20 +01:00
Emmanuele Bassi
4e724aed46 bind-constraint: Use ::queue-relayout
Instead of using the allocation-changed signal, use the queue-relayout
signal on the source to queue a relayout on the actor to which the
BindConstraint has been attached to.

The ::allocation-changed signal is not always enough, given that a
BindConstraint can use the position as well as the size of an actor to
drive the allocation of another; in this regard, it's much similar
to a ClutterClone, which requires a notification on every change, even
potential, and not just real ones, given the short-circuiting done
inside ClutterActor.
2010-10-12 14:09:47 +01:00
Emmanuele Bassi
5c82b2551c constraints: Do not check for :enabled
ClutterActor will do it for us.
2010-10-12 14:09:17 +01:00
Emmanuele Bassi
3f27afde24 actor: Use an explicit check for NULL
Follow the coding style, and don't use the implicit C boolean
equivalence for NULL pointers.
2010-10-12 14:08:07 +01:00
Emmanuele Bassi
3b72fdb20c actor: Queue a relayout when adding/removing constraints
Constraints change the way an actor is allocated; this warrants a
relayout.
2010-10-12 14:07:27 +01:00
Emmanuele Bassi
91a9a355c3 actor: Check CluterActorMeta:enabled
Instead of delegating the check for the ActorMeta:enabled property to
the sub-classes of ClutterActorMeta, ClutterActor can do the check prior
to using the ClutterActorMeta instances.
2010-10-12 14:07:17 +01:00
Emmanuele Bassi
3f6b82c9c9 actor: Add debugging note for allocation changes 2010-10-12 14:04:05 +01:00
Emmanuele Bassi
89a389cd2b actor-box: Split out ActorBox into its own file
clutter-actor.c is getting way too large, so splitting it up wherever
possible makes sense.
2010-10-11 15:57:22 +01:00
Emmanuele Bassi
7a54bdc65d vertex: Register progress function
This allows animating properties storing a ClutterVertex.
2010-10-11 15:52:50 +01:00
Emmanuele Bassi
4931802fee geometry: Register a progress function
This allows animating properties storing a ClutterGeometry.
2010-10-11 15:44:09 +01:00
Emmanuele Bassi
a5fc90d4d9 actor-box: Register a progress function
So that we can animate properties storing ClutterActorBox.
2010-10-11 15:39:19 +01:00
Emmanuele Bassi
2f21c851ea script: Fix annotation for get_object()'s return value 2010-10-11 15:39:19 +01:00
Emmanuele Bassi
dcf2662616 interval: Remove special casing for ClutterColor
ClutterColor registers a progress function on type initialization, so we
don't need to special case it any more.
2010-10-11 15:39:19 +01:00
Emmanuele Bassi
d5376bf317 color: Add Color.interpolate() method
The interpolate() method does what it says on the tin: it interpolates
between two colors using the given factor.

ClutterColor uses it to register a progress function for Intervals.
2010-10-11 15:39:19 +01:00
Neil Roberts
7e112472b5 cogl-texture-2d-sliced: Use the smallest possible waste
When picking a size for the last slice in a texture, Cogl would always
pick the biggest power of two size that doesn't create too much
waste and is less than or equal to the previous slice size. However
this can end up creating a texture that is bigger than needed if there
is a smaller power of two.

For example, if the maximum waste is 127 (the current default) and we
try to create a texture that is 257 pixels wide it will decide that
the next power of two (512) is too much waste (255) so it will create
the first slice at 256 pixels wide. Then we only have 1 pixel left to
allocate but Cogl would pick the next smaller size that has a small
enough waste which is 128. But of course 1 is already a power of two
so that's redundantly oversized by 127.

This patch fixes it so that whenever it finds a size that would be big
enough, instead of using exactly that it picks the next power of two
up from the size we need to fill.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2355
2010-10-11 14:40:04 +01:00
Emmanuele Bassi
1f106b35a9 Whitespace alignment fixes 2010-10-11 13:52:09 +01:00
Emmanuele Bassi
68d656c61b paint-volume: Add arguments checks
In some cases we access the arguments in public functions without, or
prior to checking the arguments.
2010-10-11 13:51:12 +01:00