Emmanuele Bassi [Mon, 15 Jun 2009 09:53:43 +0000 (10:53 +0100)]
[animation] Rework animation chaining
In order to chain up animations using clutter_actor_animate() and
friends you have to use an idle handler that guarantees that the
main loop spins at least once after the animation pointer has been
detached from the actor.
This has several drawbacks, first and foremost the fact that the
slice of the main loop for the idle handler might be starved by
other operations, like redrawing. This inevitably leads to tricks
with priorities and the like, contributing to the overall complexity.
Instead, we should guarantee that the animation instance created by
clutter_actor_animate() is valid for the ::completed signal until
it reaches its default handler; after that, the animation is detached
from the actor and destroyed. This means that it's possible to
create a new animation after the first is complete by simply using
g_signal_connect_after().
This unfortunately makes it impossible to keep a reference to the
animation pointer attached to the actor by using g_object_ref(); a
way to "fix" this would be to have a clutter_animation_attach()
and a clutter_animation_detach() pair of methods that allow attaching
any animation to an actor. This might overcomplicate what it is
the simple animation API, though, so it's currently not implemented
and left for future versions.
The test-easing interactive demo has been modified to show how
the animation queuing works by adding a command line switch that
recenters the animated actor once the first animation has ended.
Emmanuele Bassi [Mon, 15 Jun 2009 10:24:54 +0000 (11:24 +0100)]
[animation] Allow swapped/after signal variants
Continuing in the tradition on making clutter_actor_animate() the
next g_object_connect(), here's the addition of the signal-after::
and signal-swapped:: modifiers for the automagic signal connection
arguments.
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1646
Emmanuele Bassi [Mon, 15 Jun 2009 09:48:56 +0000 (10:48 +0100)]
Disable single header inclusion for GLib
In order to be ready for the next major version of GLib we need to
disable single header inclusion by using the G_DISABLE_SINGLE_INCLUDES
define in the build process.
Owen W. Taylor [Thu, 11 Jun 2009 22:56:27 +0000 (18:56 -0400)]
Fix redraw queueing in the presence of cloning
We can't short-circuit the emission of ::queue-redraw for not-visible
actors, since ClutterClone uses that signal to know when things need
to be redrawn.
Calling clutter_actor_queue_redraw() out of clutter_actor_real_map() /
clutter_actor_real_unmap() was causing the flag state to get set
incorrectly from _clutter_actor_set_enable_paint_unmapped(), because
a paint queueing a redraw was not expected.
Moving queuing the redraw to clutter_actor_hide()/show() fixes this, and
also fixes a problem where showing a child of a cloned actor wouldn't
cause the clone to be repainted.
http://bugzilla.openedhand.com/show_bug.cgi?id=1484
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Fri, 12 Jun 2009 02:46:38 +0000 (03:46 +0100)]
[tests] Add unit for Clone behaviour
A clone actor should not modify the state of its source, so we need
to check that it's not breaking any invariant.
Owen W. Taylor [Thu, 11 Jun 2009 22:46:44 +0000 (18:46 -0400)]
Fix handling of not-visible texture pixmaps
If we have an not-visible texture pixmap, we need to:
- Still update it if it is realized, since it won't be
updated when shown. And it might be also be cloned.
- Queue a redraw if even if not visible, since it
it might be cloned.
http://bugzilla.openedhand.com/show_bug.cgi?id=1647
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Damien Lespiau [Sun, 14 Jun 2009 00:16:30 +0000 (01:16 +0100)]
[gitignore] ignore TAGS and new test
* ignore files generated by make tags
* ignore the newly introduced premult test
Neil Roberts [Fri, 12 Jun 2009 10:05:26 +0000 (11:05 +0100)]
[test-cogl-tex-tile] Fix breakages from ClutterFixed removal and timelines
The test has been broken since the change to use floats instead of
fixed point because it was passing degrees to sin and cos but they
expect radians.
It was further broken since the timeline changes because it was
directly using the parameter of the new-frame signal as a frame number
but it now represents the elapsed time.
Robert Bragg [Mon, 8 Jun 2009 16:43:34 +0000 (17:43 +0100)]
[_cogl_texture_bitmap_prepare] use bitmap format for FORMAT_ANY + no alpha
My patch to choose a premultiplied format when the user gives
COGL_PIXEL_FORMAT_ANY for the internal_format broke the case where the data
in question doesn't have and alpha channel.
This was accidentally missed when merging the premultiplication branch
since I merged a local version of the branch that missed this commit.
Emmanuele Bassi [Thu, 11 Jun 2009 15:59:50 +0000 (16:59 +0100)]
[tests] Fix the cogl_polygon() interactive test
We need to premultiply the alpha, and we also need to change the
frame painting to use the frame-less Timeline.
Emmanuele Bassi [Thu, 11 Jun 2009 15:53:52 +0000 (16:53 +0100)]
[tests] Fix the VBO interactive test
We need to fix the VBO premultiplication; we also do not need to
forcibly queue a redraw in an idle handler: the timeline and the
master clock will do that for us.
Emmanuele Bassi [Thu, 11 Jun 2009 15:23:26 +0000 (16:23 +0100)]
[tests] Update test-actors (and clones)
The test-actors test (and its clones, test-actor-clone and
test-paint-wrapper) was written a long time ago for a different API
and has been tweaked to bits. We should probably have something a
little bit more complicated, but at least we should not use semantics
and coding patterns from Clutter 0.2, otherwise we won't be testing
anything except that Clutter 0.2 worked.
Robert Bragg [Mon, 8 Jun 2009 11:18:34 +0000 (12:18 +0100)]
[cogl] Don't allow calling cogl_set_source_texture with an INVALID_HANDLE
Although the underlying materials should allow layers with INVALID_HANDLES
it shouldn't be necissary to expose that via cogl_set_source_texture() and
it's easier to resolve a warning/crash here than odd artefacts/crashes later
in the pipeline.
Robert Bragg [Thu, 11 Jun 2009 14:16:27 +0000 (15:16 +0100)]
Bug 1406 - Handling of premultiplication in clutter
Merge branch 'premultiplication'
[cogl-texture docs] Improves the documentation of the internal_format args
[test-premult] Adds a unit test for texture upload premultiplication semantics
[fog] Document that fogging only works with opaque or unmultipled colors
[test-blend-strings] Explicitly request RGBA_888 tex format for test textures
[premultiplication] Be more conservative with what data gets premultiplied
[bitmap] Fixes _cogl_bitmap_fallback_unpremult
[cogl-bitmap] Fix minor copy and paste error in _cogl_bitmap_fallback_premult
Avoid unnecesary unpremultiplication when saving to local data
Don't unpremultiply Cairo data
Default to a blend function that expects premultiplied colors
Implement premultiplication for CoglBitmap
Use correct texture format for pixmap textures and FBO's
Add cogl_color_premultiply()
Robert Bragg [Thu, 11 Jun 2009 13:31:01 +0000 (14:31 +0100)]
[cogl-texture docs] Improves the documentation of the internal_format args
Clarifies that if you give COGL_PIXEL_FORMAT_ANY as the internal format for
cogl_texture_new_from_file or cogl_texture_new_from_data then Cogl will
choose a premultiplied internal format.
Robert Bragg [Sun, 7 Jun 2009 15:31:12 +0000 (16:31 +0100)]
[test-premult] Adds a unit test for texture upload premultiplication semantics
cogl_texture_new_from_data lets you specify a source format for the users given
data, and an internal format which the user wants the GPU to see. This unit
test verifies that the users data is premultiplied, un-premultiplied or
left alone for a number of (source format, internal format) pairs.
cogl_texture_set_region allows specifying a source format, and the internal
format is determined from the texture being updated. As above we test
a number of format pairs and check Cogl is converting data correctly.
The test verifies that if the user allows COGL_FORMAT_ANY for the
internal_format then by default Cogl will choose a premultipled format for
RGBA textures.
Note: Currently this only tests cogl_texture_new_from_data and
cogl_texture_set_region, we should also test cogl_texture_new_from_file,
cogl_texture_new_from_bitmap and cogl_texture_new_from_foreign.
Robert Bragg [Sun, 7 Jun 2009 10:54:05 +0000 (11:54 +0100)]
[fog] Document that fogging only works with opaque or unmultipled colors
The fixed function fogging provided by OpenGL only works with unmultiplied
colors (or if the color has an alpha of 1.0) so since we now premultiply
textures and colors by default a note to this affect has been added to
clutter_stage_set_fog and cogl_set_fog.
test-depth.c no longer uses clutter_stage_set_fog for this reason.
In the future when we can depend on fragment shaders we should also be
able to support fogging of premultiplied primitives.
Robert Bragg [Sat, 6 Jun 2009 20:55:05 +0000 (21:55 +0100)]
[test-blend-strings] Explicitly request RGBA_888 tex format for test textures
This test assumes that the textures will be stored internally with exactly
the color given so that specific texture combining arithmetic can be
tested. Using COGL_PIXEL_FORMAT_ANY allows Cogl to internally premultiply
the textures, so we have to explicitly request an unmultiplied format.
Robert Bragg [Sat, 6 Jun 2009 20:45:05 +0000 (21:45 +0100)]
[premultiplication] Be more conservative with what data gets premultiplied
We don't want to force texture data to be premultipled if the user
explicitly specifies a non premultiplied internal_format such as
COGL_PIXEL_FORMAT_RGBA_8888. So now Cogl will only automatically
premultiply data when COGL_PIXEL_FORMAT_ANY is given for the
internal_format, or a premultiplied internal format such as
COGL_PIXEL_FORMAT_RGBA_8888_PRE is requested but non-premultiplied source
data is given.
This approach is consistent with OpenVG image formats which have already
influenced Cogl's pixel format semantics.
Robert Bragg [Sun, 7 Jun 2009 14:58:56 +0000 (15:58 +0100)]
[bitmap] Fixes _cogl_bitmap_fallback_unpremult
The _cogl_unpremult_alpha_{first,last} functions which
_cogl_bitmap_fallback_unpremult depends on were incorrectly casting each
of the byte components of a texel to a gulong and performing shifts as
if it were dealing with the whole texel.
It now just uses array indexing to access the byte components without
needing to cast or manually shift any bits around.
Even though we used to depend on unpremult whenever we used a
ClutterCairoTexture, clutter_cairo_texture_context_destroy had it's own
unpremult code which worked which is why this bug wouldn't have been noticed
before.
Robert Bragg [Sun, 7 Jun 2009 19:29:13 +0000 (20:29 +0100)]
[cogl-bitmap] Fix minor copy and paste error in _cogl_bitmap_fallback_premult
The returned bitmap format should include the COGL_PREMULT_BIT flag not
have it explicitly removed as for _cogl_bitmap_fallback_unpremult.
Owen W. Taylor [Sat, 9 May 2009 18:39:01 +0000 (14:39 -0400)]
Avoid unnecesary unpremultiplication when saving to local data
Now that we typically have premultiplied data stored in Cogl
textures, when fetching a texture into local data for temporary
storage, use a premultiplied format to avoid an unpremultiply/
premultiply roundtrip.
http://bugzilla.openedhand.com/show_bug.cgi?id=1406
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Owen W. Taylor [Thu, 4 Jun 2009 17:45:43 +0000 (13:45 -0400)]
Don't unpremultiply Cairo data
Instead of unpremultiplying the Cairo data, pass it directly to Cogl
in premultiplied form; we now *prefer* premultiplied data.
http://bugzilla.openedhand.com/show_bug.cgi?id=1406
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Owen W. Taylor [Sat, 9 May 2009 18:39:01 +0000 (14:39 -0400)]
Default to a blend function that expects premultiplied colors
Many operations, like mixing two textures together or alpha-blending
onto a destination with alpha, are done most logically if texture data
is in premultiplied form. We also have many sources of premultiplied
texture data, like X pixmaps, FBOs, cairo surfaces. Rather than trying
to work with two different types of texture data, simplify things by
always premultiplying texture data before uploading to GL.
Because the default blend function is changed to accommodate this,
uses of pure-color CoglMaterial need to be adapted to add
premultiplication.
gl/cogl-texture.c gles/cogl-texture.c: Always premultiply
non-premultiplied texture data before uploading to GL.
cogl-material.c cogl-material.h: Switch the default blend functions
to ONE, ONE_MINUS_SRC_ALPHA so they work correctly with premultiplied
data.
cogl.c: Make cogl_set_source_color() premultiply the color.
cogl.h.in color-material.h: Add some documentation about
premultiplication and its interaction with color values.
cogl-pango-render.c clutter-texture.c tests/interactive/test-cogl-offscreen.c:
Use premultiplied colors.
http://bugzilla.openedhand.com/show_bug.cgi?id=1406
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Owen W. Taylor [Sat, 9 May 2009 18:39:01 +0000 (14:39 -0400)]
Implement premultiplication for CoglBitmap
cogl-bitmap.c cogl-bitmap-pixbuf.c cogl-bitmap-fallback.c cogl-bitmap-private.h:
Add _cogl_bitmap_can_premult(), _cogl_bitmap_premult() and implement
a reasonably fast implementation in the "fallback" code.
http://bugzilla.openedhand.com/show_bug.cgi?id=1406
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Owen W. Taylor [Sat, 9 May 2009 18:39:01 +0000 (14:39 -0400)]
Use correct texture format for pixmap textures and FBO's
RGBA data in X pixmaps and in FBOs is already premultiplied; use
the right format when creating cogl textures.
http://bugzilla.openedhand.com/show_bug.cgi?id=1406
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Owen W. Taylor [Sat, 9 May 2009 18:39:01 +0000 (14:39 -0400)]
Add cogl_color_premultiply()
Add a convenience function to convert an ARGB color from
non-premultiplied to premultiplied form.
http://bugzilla.openedhand.com/show_bug.cgi?id=1406
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Emmanuele Bassi [Thu, 11 Jun 2009 12:24:34 +0000 (13:24 +0100)]
[build] Fix distcheck for the json-glib internal copy
Since commit
d743aeaa updated the internal copy of JSON-GLib and
added a new private header file, we need to fix the build to avoid
a distcheck failure.
Emmanuele Bassi [Thu, 11 Jun 2009 12:01:34 +0000 (13:01 +0100)]
Bug 1637 - Master clock improvements
Merge branch 'master-clock-updates'
* master-clock-updates: (22 commits)
Change the paint forcing on the Text cache text
[timelines] Improve marker hit check and don't fudge the delta
Revert "[timeline] Don't clamp the elapsed time when a looping tl reaches the end"
[tests] Don't add a newline to the end of g_test_message calls
[test-timeline] Add a marker at the beginning of the timeline
[timeline] Don't clamp the elapsed time when a looping tl reaches the end
[master-clock] Throttle if no redraw was performed
[docs] Update Clutter's API reference
Force a paint instead of calling clutter_redraw()
Fix clutter_redraw() to match the redraw cycle
Run the repaint functions inside the redraw cycle
Remove useless manual timeline ticking
Move elapsed-time calculations into ClutterTimeline
Limit the frame rate when not syncing to VBLANK
Decrease the main-loop priority of the frame cycle
Avoid motion-compression in test-picking test
Compress events as part of the frame cycle
Remove stage update idle and do updates from the master clock
Call g_main_context_wakeup() when we start running timelines
Remove unused msecs_delta member
...
Emmanuele Bassi [Thu, 11 Jun 2009 11:36:41 +0000 (12:36 +0100)]
[tests] Fix a segfault in the binding-pool test
The commit that moved all the properties to floats missed the
test-binding-pool interactive test.
Emmanuele Bassi [Wed, 10 Jun 2009 17:10:32 +0000 (18:10 +0100)]
Change the paint forcing on the Text cache text
The changes in the master clock and the repaint cycle have been
changed, and broke the way the test for the Text actor cache of
PangoLayouts forces a redraw.
We have to call clutter_actor_paint() on the Stage embedding the
Text actor we want to test; this is kinda fugly because if the
Layout has changed it will end up causing a reallocation cycle
in the middle of the Text actor paint. Since it's a test case,
and since forcing redraws is a bit of a hack as well, we can
close both our eyes on that.
Neil Roberts [Thu, 11 Jun 2009 11:14:53 +0000 (12:14 +0100)]
[timelines] Improve marker hit check and don't fudge the delta
Markers added at the start of the timeline need to be special cased
because we effectively check whether the marker time is greater than
the old frame time or less than or equal to the new frame time but we
never actually emit a frame for the start of the timeline.
If the timeline is looping then it adjusts the position to interpolate
a wrapped around position. However we do not emit a new frame after
setting this position so we need to check for markers again there.
clutter_timeline_get_delta should return the actual wall clock time
between emissions of the new-frame signal - even if the elapsed time
has been fudged at the end of the timeline. To make this work it no
longer directly manipulates priv->msecs_delta but instead passes a
delta value to check_markers.
Tommi Komulainen [Fri, 24 Apr 2009 15:43:39 +0000 (16:43 +0100)]
stage: set key focus actor to NULL before emitting focus-out
Someone might hide the previously focused actor in the focus-out signal
handler and as key focus still appears to be on that actor we'd get
re-entrant call and get glib critical from g_object_weak_unref
This changes clutter_stage_get_key_focus() to return stage/NULL during
focus-out signal emission. It used to be the actor focus-out was being
emitted on.
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1547
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Neil Roberts [Thu, 11 Jun 2009 09:55:52 +0000 (10:55 +0100)]
Revert "[timeline] Don't clamp the elapsed time when a looping tl reaches the end"
This reverts commit
9c5663d6717722d6d77162060f284355b5081174.
The patch was causing problems for applications that expect the
elapsed_time to be at either end of the timeline when the completed
signal is fired. For example test-behave swaps the direction of the
timeline in the completed handler but if the time has overflowed the
end then the timeline would only take a short time to get back the
beginning. This caused the animation to just vibrate around the
beginning.
Neil Roberts [Thu, 11 Jun 2009 10:38:49 +0000 (11:38 +0100)]
[tests] Don't add a newline to the end of g_test_message calls
Two of the timeline tests were calling g_test_message and adding a \n
so the output looked odd.
Neil Roberts [Thu, 11 Jun 2009 10:23:45 +0000 (11:23 +0100)]
[test-timeline] Add a marker at the beginning of the timeline
The beginning of the timeline needs special treatment to detect a
marker so it should have one in the conformance test.
Neil Roberts [Wed, 10 Jun 2009 16:41:16 +0000 (17:41 +0100)]
[timeline] Don't clamp the elapsed time when a looping tl reaches the end
The new-frame signal of a timeline was previously guaranteed to be
emitted with the elapsed_time set to the end before it emits the
completed signal. This doesn't necessarily make sense for looping
timelines because it would cause the elapsed time to be clamped to a
slightly off value whenever the timeline restarts. This patch makes it
perform the wrap around before emitting the new-frame signal so that
the elapsed time always corresponds to the time elapsed since the
timeline was started.
Additionally it no longer fudges the msecs_delta property to make the
marker check work so clutter_timeline_get_delta will always return the
wall clock time since the last frame.
Emmanuele Bassi [Wed, 10 Jun 2009 15:23:35 +0000 (16:23 +0100)]
[text] Do not leak the effective attributes
Thanks to Iain Holmes for catching the leak.
Neil Roberts [Wed, 10 Jun 2009 14:50:27 +0000 (15:50 +0100)]
[master-clock] Throttle if no redraw was performed
A flag in the master clock is now set whenever the dispatch caused an
actual redraw of a stage. If this flag is not set during the prepare
and check functions then it will resort to limiting the redraw
attempts to the default frame rate as if vblank syncing was
disabled. Otherwise if a timeline is running that does not cause the
scene to change then it would busy-wait with 100% CPU until the next
frame.
This fix was suggested by Owen Taylor in:
http://bugzilla.openedhand.com/show_bug.cgi?id=1637
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Wed, 10 Jun 2009 13:54:42 +0000 (14:54 +0100)]
[docs] Annotate fixed sized arrays
Emmanuele Bassi [Wed, 10 Jun 2009 13:54:19 +0000 (14:54 +0100)]
[docs] Update Clutter's API reference
Emmanuele Bassi [Wed, 10 Jun 2009 13:52:53 +0000 (14:52 +0100)]
Force a paint instead of calling clutter_redraw()
We do not need the whole redraw machinery inside
clutter_stage_read_pixels(): instead, we want Clutter to drop everything,
paint and call glReadPixels() with the current buffer.
Emmanuele Bassi [Wed, 10 Jun 2009 13:24:33 +0000 (14:24 +0100)]
[build] Use top_srcdir instead of relative paths
Emmanuele Bassi [Wed, 10 Jun 2009 13:23:45 +0000 (14:23 +0100)]
[l10n] Add LINGUAS
Use the LINGUAS file to generate the contents of the ALL_LINGUAS
variable.
Emmanuele Bassi [Wed, 10 Jun 2009 11:50:45 +0000 (12:50 +0100)]
[docs] Various gtk-doc fixes for COGL
Try to keep the gtk-doc errors down to a minimum.
Emmanuele Bassi [Tue, 9 Jun 2009 15:29:29 +0000 (16:29 +0100)]
Fix clutter_redraw() to match the redraw cycle
The clutter_redraw() function is used by embedding toolkits to
force a redraw on a stage. Since everything is performed by
toggling a flag inside the Stage itself and then letting the
master clock advance, we need a ClutterStage method to ensure
that we start the master clock and redraw.
Emmanuele Bassi [Tue, 9 Jun 2009 15:28:25 +0000 (16:28 +0100)]
Run the repaint functions inside the redraw cycle
Now that every redraw is performed within the master clock we
need to run the repaint functions inside it.
Owen W. Taylor [Mon, 8 Jun 2009 17:13:18 +0000 (13:13 -0400)]
Remove useless manual timeline ticking
The master clock now works fine whether or not there are any stages,
so in the timeline conformance tests don't need to set up their
own times.
Set CLUTTER_VBLANK=none for the conformance tests, which in addition
to removing an test-environment dependency, will result in the ticking
for timeline tests being throttled to the default frame rate.
http://bugzilla.openedhand.com/show_bug.cgi?id=1637
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Owen W. Taylor [Mon, 8 Jun 2009 17:00:09 +0000 (13:00 -0400)]
Move elapsed-time calculations into ClutterTimeline
Instead of calculating a delta in the master clock, and passing that
into each timeline, make each timeline individually responsible for
remembering the last time and computing the delta.
This:
- Fixes a problem where we could spin infinitely processing
timeline-only frames with < 1msec differences.
- Makes timelines consistently start timing on the first frame;
instead of doing different things for the first started timeline
and other timelines.
- Improves accuracy of elapsed time computations by avoiding
accumulating microsecond => millisecond truncation errors.
http://bugzilla.openedhand.com/show_bug.cgi?id=1637
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Owen W. Taylor [Sun, 7 Jun 2009 02:48:15 +0000 (22:48 -0400)]
Limit the frame rate when not syncing to VBLANK
clutter-master-clock.c clutter-master-clock.h: When the
SYNC_TO_VBLANK feature is not available, wait for 1/frame_rate
seconds since the start of the last frame before drawing the next
frame. Add _clutter_master_clock_start_running() to abstract
the usage of g_main_context_wakeup()
clutter-stage.c: Add _clutter_master_clock_start_running()
clutter-main.c: Update docs for clutter_set_default_frame_rate()
clutter_get_default_frame_rate() to no longer talk about timeline
frame rates.
test-text-perf.c test-text.c: Set a frame rate of 1000fps so that
frame-rate limiting doesn't affect the result.
http://bugzilla.openedhand.com/show_bug.cgi?id=1637
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Owen W. Taylor [Sat, 6 Jun 2009 23:31:32 +0000 (19:31 -0400)]
Decrease the main-loop priority of the frame cycle
Change CLUTTER_PRIORITY_REDRAW to be lower than the GTK+ resize
and relayout priorities to avoid starving GTK+ when run in the
same process as clutter.
Remove the unused CLUTTER_PRIORITY_TIMELINE
http://bugzilla.openedhand.com/show_bug.cgi?id=1637
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Owen W. Taylor [Sun, 7 Jun 2009 02:55:34 +0000 (22:55 -0400)]
Avoid motion-compression in test-picking test
Using clutter_stage_get_actor_at_pos() rather than synthesizing
events; the synthesized events were being compressed, so we were
only tesitng one pick per frame.
http://bugzilla.openedhand.com/show_bug.cgi?id=1637
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Owen W. Taylor [Sat, 6 Jun 2009 23:10:41 +0000 (19:10 -0400)]
Compress events as part of the frame cycle
Instead of trying to guess about which motion events are
extraneous, queue up all events until we process a frame.
This allows us to look ahead and reliably compress consecutive
sequence of motion events.
clutter-main.c: Feed received events to the stage for queueing.
Remove old compression code. Remove clutter_get_motion_events_frequency()
clutter_set_motion_events_frequency()
clutter-stage.c: Keep a queue of pending events.
clutter-master-clock.c: Add processng of queued events to the
clock source dispatch function.
http://bugzilla.openedhand.com/show_bug.cgi?id=1637
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Owen W. Taylor [Sat, 6 Jun 2009 22:22:51 +0000 (18:22 -0400)]
Remove stage update idle and do updates from the master clock
When a redraw is queued on a stage, simply set a flag; then in
the check/prepare functions of the master clock source, check
for stages that need redrawing.
This avoids the complexity of having multiple competing sources
at the same priority and makes the update ordering more reliable and
understandable.
http://bugzilla.openedhand.com/show_bug.cgi?id=1637
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Owen W. Taylor [Sat, 6 Jun 2009 22:12:26 +0000 (18:12 -0400)]
Call g_main_context_wakeup() when we start running timelines
If a timeline is added from a different thread, we need to
call g_main_context_wakeup() to wake the main thread up to
start updating the timeline.
http://bugzilla.openedhand.com/show_bug.cgi?id=1637
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Owen W. Taylor [Sat, 6 Jun 2009 22:11:19 +0000 (18:11 -0400)]
Remove unused msecs_delta member
msecs_delta member of ClutterMasterClock was set but not used.
http://bugzilla.openedhand.com/show_bug.cgi?id=1637
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Owen W. Taylor [Sat, 6 Jun 2009 21:44:40 +0000 (17:44 -0400)]
Simplify timeout list handling for the master clock
Instead of keeping a list of all timelines, and connecting to
signals and weak notifies, simply keep a list of running timelines;
this greatly simplifies both the book-keeping, and also determining
if there are any running timelines.
http://bugzilla.openedhand.com/show_bug.cgi?id=1637
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Owen W. Taylor [Sat, 6 Jun 2009 21:54:05 +0000 (17:54 -0400)]
Only advance the master clock before drawing a frame
Remove code to advance the master clock after drawing a frame; if
there are any running timelines the master clock will do another
frame by itself, and the clock will be advanced before running
that frame.
With this change, there is no point in queueing an extra frame
redraw after completing a timeline, since we are always advancing
the timeline *before* redrawing, so remove that code as well.
(This does mean that calling clutter_timeline_stop() won't implicitly
cause the stage to be redrawn; this doesn't seem like something
an app should rely on in any case.)
http://bugzilla.openedhand.com/show_bug.cgi?id=1637
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Tue, 9 Jun 2009 13:47:36 +0000 (14:47 +0100)]
[docs] Various gtk-docs fixes
Emmanuele Bassi [Tue, 9 Jun 2009 13:05:03 +0000 (14:05 +0100)]
[stage] Rename fullscreen methods
The clutter_stage_fullscreen() and clutter_stage_unfullscreen() are
a GDK-ism. The underlying implementation is already using an accessor
with a boolean parameter.
This should take the amount of collisions between properties, methods
and signals to zero.
Emmanuele Bassi [Tue, 9 Jun 2009 12:48:03 +0000 (13:48 +0100)]
[stage] Rename :fullscreen to :fullscreen-set
The :fullscreen property is very much confusing as it is implemented.
It can be written to a value, but the whole process might fail. If we
set:
g_object_set (stage, "fullscreen", TRUE, NULL);
and the fullscreen process fails or it is not implemented, the value
will be reset to FALSE (if we're lucky) or left TRUE (most of the
times).
The writability is just a shorthand for invoking clutter_stage_fullscreen()
or clutter_stage_unfullscreen() depending on a boolean value without
using an if.
The :fullscreen property also greatly confuses high level languages,
since the same symbol is used:
- for a method name (Clutter.Stage.fullscreen())
- for a property name (Clutter.Stage.fullscreen)
- for a signal (Clutter.Stage::fullscreen)
For these reasons, the :fullscreen should be renamed to :fullscreen-set
and be read-only. Implementations of the Stage should only emit the
StageState event to change from normal to fullscreen, and the Stage
will automatically update the value of the property and emit a notify
signal for it.
Emmanuele Bassi [Tue, 9 Jun 2009 11:43:57 +0000 (12:43 +0100)]
[build] Update the experimental features checks
Instead of blacklisting experimental features at the end we can
explicitly mark backends and image backends near their checks and
provide a summary at the end.
Emmanuele Bassi [Tue, 9 Jun 2009 11:42:19 +0000 (12:42 +0100)]
[json] Update the internal JSON-GLib copy
There have been changes in JSON-GLib upstream to clean up the
data structures, and facilitate introspection.
We still not use the updated JsonParser with the (private) JsonScanner
code, since it's a fork of GLib's GScanner.
Emmanuele Bassi [Tue, 9 Jun 2009 11:40:06 +0000 (12:40 +0100)]
[introspection] Add --c-include to g-ir-scanner
Since Clutter has a single-include header policy we need to put
the header to be included inside the GIR file.
Emmanuele Bassi [Tue, 9 Jun 2009 11:39:28 +0000 (12:39 +0100)]
[build] Add as-compiler-flag.m4 to the dist
Neil Roberts [Tue, 9 Jun 2009 10:13:11 +0000 (11:13 +0100)]
[CoglTexture] Initialise tex->first_pixels to NULL in all constructors
Otherwise if there is an error before the slices are created it will
try to free the first_pixels array and crash.
It now also checks whether first_pixels has been created before using
it to update the mipmaps. This should only happen for
cogl_texture_new_from_foreign and doesn't matter if the FBO extension
is available. It would be better in this case to fetch the first pixel
using glGetTexImage as Owen mentioned in the last commit.
Owen W. Taylor [Mon, 8 Jun 2009 20:45:43 +0000 (16:45 -0400)]
Fix unitialized first_pixels for foreign textures
tex->first_pixels was never set for foreign textures, leading
to a crash when the texture object is freed.
As a quick fix, simply set to NULL. A more complete fix would
require remembering if we had ever seen the first pixel uploaded,
and if not, doing a glReadPixel to get it before triggering the
mipmap update.
http://bugzilla.openedhand.com/show_bug.cgi?id=1645
Signed-off-by: Neil Roberts <neil@linux.intel.com>
Owen W. Taylor [Mon, 8 Jun 2009 13:26:57 +0000 (09:26 -0400)]
On bad blend strings, print the error if not returning it
It's very common that there's no reasonable fallback to do if the
blend or combine string you set isn't supported. So, rather than
requiring everybody to pass in a GError purely to catch syntax erorrs,
automatically g_warning() if a parse error is encountered and @error
is NULL.
http://bugzilla.openedhand.com/show_bug.cgi?id=1642
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Garry Bodsworth [Mon, 8 Jun 2009 10:56:59 +0000 (11:56 +0100)]
Fix for new potential memory leak in ClutterGLXTexturePixmap.
This fixes a new instance of glXDestroyGLXPixmap which should be
glXDestroyPixmap.
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Owen W. Taylor [Mon, 8 Jun 2009 11:57:41 +0000 (07:57 -0400)]
Properly adjust msecs_delta when clamping elapsed time
When we complete a timeline, we clamp the elapsed_time variable
to the range of the timeline. We need to adjust msecs_delta so that
when we check for hit markers we have the correct interval.
http://bugzilla.openedhand.com/show_bug.cgi?id=1641
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Mon, 8 Jun 2009 13:42:22 +0000 (14:42 +0100)]
[animation] Keep a reference during notify::alpha
The Animation should be referenced during the notification of the
alpha value, since the callback is invoked depending on the Alpha
and it won't vivify the Animation instance for us.
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1537
Emmanuele Bassi [Sat, 6 Jun 2009 14:27:37 +0000 (15:27 +0100)]
introspection-friendly ClutterEvent accessors
ClutterEvent is not really gobject-introspection friendly because
of the whole discriminated union thing. In particular, if you get
a ClutterEvent in a signal handler, you probably can't access the
event-type-specific fields, and you probably can't call methods
like clutter_key_event_symbol() either, because you can't cast the
ClutterEvent to a ClutterKeyEvent.
The cleanest solution is to turn every accessor into ClutterEvent
methods, accepting a ClutterEvent* and internally checking the event
type.
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1585
Garry Bodsworth [Mon, 8 Jun 2009 07:46:33 +0000 (08:46 +0100)]
[glx-texture-pixmap] Unref a cogl texture handle.
According to clutter_texture_set_cogl_texture you should unref the handle as
the texture takes its own.
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Garry Bodsworth [Mon, 8 Jun 2009 07:38:50 +0000 (08:38 +0100)]
Fix memory leak in ClutterGLXTexturePixmap.
The OpenGL spec states that if you create a pixmap using glXCreatePixmap you
should use glXDestroyPixmap to destroy it.
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Owen W. Taylor [Sat, 6 Jun 2009 16:07:42 +0000 (12:07 -0400)]
Straighten out 'realize' handling for ClutterGLXTexturePixmap
Setting the pixmap for an unrealized ClutterGLXTexturePixmap should
not cause it to be realized, and certainly shouldn't cause the the
REALIZED flag to be set without using clutter_actor_realize().
This patch uses the simple approach that;
- pixmap changes on an unrealized ClutterGLXTexturePixmap
are ignored
- when the ClutterGLXTexturePixmap is realized, we then create
the GLXPixmap and the corresponding texture.
The call to clutter_glx_texture_pixmap_update_area() is moved
from create_cogl_texture() to
clutter_glx_texture_pixmap_create_glx_pixmap() since
create_cogl_texture() is only called from one place, and updating
the area is really something we do *after* creating the texture,
not part of creating the texture.
clutter_glx_texture_pixmap_create_glx_pixmap() is reorganized a
bit to avoid debug-logging confusingly if it's called before a pixmap
has been set, and for readability.
http://bugzilla.openedhand.com/show_bug.cgi?id=1635
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Owen W. Taylor [Sat, 6 Jun 2009 13:55:00 +0000 (09:55 -0400)]
Remove unnecessary setting of CLUTTER_ACTOR_REALIZED flag
An implementaton of realize() never needs to set the
CLUTTER_ACTOR_REALIZED flag, though it can unset the flag if
things fail unexpectedly. (Previously, stage backend implementations
had to do this since clutter_actor_realize() wasn't used; this
is no longer the case.)
http://bugzilla.openedhand.com/show_bug.cgi?id=1634
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Owen W. Taylor [Sat, 6 Jun 2009 15:37:18 +0000 (11:37 -0400)]
Be more tolerant about natural_width < min_width
Due to the accumulation of floating point errors, natural_width
and min_width can diverge significantly even if the math for
computing them is correct. So just clamp natural_width to
min_width instead of warning about it.
http://bugzilla.openedhand.com/show_bug.cgi?id=1632
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Owen W. Taylor [Sat, 6 Jun 2009 15:28:02 +0000 (11:28 -0400)]
Use double temporaries when computing group size
If we use float temporaries when computing the bounds of
a group, then, depending on what variables are kept in registers
and what stored on the stack, the accumulated difference between
natural_width and min_width can be more than FLOAT_EPSILON.
Using double temporaries will eliminate the difference in most
cases, or, very rarely, reduce it to a last-bit error.
http://bugzilla.openedhand.com/show_bug.cgi?id=1632
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Owen W. Taylor [Sat, 6 Jun 2009 15:56:08 +0000 (11:56 -0400)]
Handle a clone of an actor with an unmapped parent
If we are cloning an source actor with an unmapped parent, then when
we temporarily map the source actor:
- We need to skip the check that a mapped actor has a mapped
parent.
- We need to realize the actor's parents before mapping it,
or we'll get an assertion failure in clutter_actor_update_map_state()
because an actor with an unmapped parent is !may_be_realized.
http://bugzilla.openedhand.com/show_bug.cgi?id=1633
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Mon, 8 Jun 2009 09:59:22 +0000 (10:59 +0100)]
[tests] Clarify the numbers
Emmanuele Bassi [Mon, 8 Jun 2009 09:58:20 +0000 (10:58 +0100)]
[tests] The ::focus-in signal was renamed ::key-focus-in
The test-events interactive test is still using the old name.
Emmanuele Bassi [Mon, 8 Jun 2009 01:22:26 +0000 (02:22 +0100)]
[build] Add AS_COMPILER_FLAGS
Use the AS_COMPILER_FLAGS to check whether the maintainer compiler flags
we use are supported; this should fail gracefully and only use the ones
that the compiler actually understands.
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1639
Emmanuele Bassi [Mon, 8 Jun 2009 01:04:27 +0000 (02:04 +0100)]
[x11] Do not forcibly set the stage size on fullscreen
Setting the stage size using clutter_actor_set_size() is almost always
wrong: the X11 stage implementation should save the size and queue a
relayout -- like it does when receiving a ConfigureNotify. The same
should happen when setting it to be full screen.
Owen W. Taylor [Mon, 8 Jun 2009 00:51:02 +0000 (01:51 +0100)]
[build] Search for Cogl GIR in the right place
Since we build the Cogl GIR inside /clutter/cogl we should be looking
there when building the Clutter GIR. Otherwise g-ir-scanner will look
inside the gir directory -- and if you never built Clutter before it
will error out.
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1638
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Robert Bragg [Sat, 6 Jun 2009 20:33:31 +0000 (21:33 +0100)]
[test-blend-strings] Fix a silly off by one that meant the test couldn't fail
The test was quiting after the 2nd frame but it should be the third frame because
the test doesn't actually check results until the third frame due to the workaround
for drivers with broken glReadPixels.
(When first written the test would have been verified with the
clutter_main_quit() commented out which gives visual feedback of what the
test does, so the off by one would have snuck in just before uncommenting
and pushing.)
Emmanuele Bassi [Sat, 6 Jun 2009 14:57:29 +0000 (15:57 +0100)]
[texture] Fix error reporting on ::load-finished
The load-finished signal has a GError* argument which is meant to
signify whether the loading was successful. However many of the
places in ClutterTexture that emit this signal directly pass their
'error' variable which is a GError** and will be NULL or not
completely independently of whether there was an error. If the
argument was dereferenced it would probably crash.
The test-texture-async interactive test case should also verify
that the ::load-finished signal is correctly emitted.
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1622
Emmanuele Bassi [Sat, 6 Jun 2009 13:39:21 +0000 (14:39 +0100)]
[units] Always recompute pixels
When asking for the pixels value we should always recompute it.
The "pixel_set" guard can be left in place for future use.
Emmanuele Bassi [Sat, 6 Jun 2009 13:38:10 +0000 (14:38 +0100)]
[build] Remove -Werror for the maintainer cflags
Now that we have Shave in place and don't risk losing warnings
we can avoid -Werror in the anal-retentive maintainer compiler
flags.
Emmanuele Bassi [Sat, 6 Jun 2009 13:37:41 +0000 (14:37 +0100)]
Fixes for some compiler warnings
Owen W. Taylor [Fri, 5 Jun 2009 21:53:57 +0000 (17:53 -0400)]
[actor] get_transformed_position(): initialize Z value
Initialize the Z value in the point we pass to
clutter_actor_apply_transform_to_point().
http://bugzilla.openedhand.com/show_bug.cgi?id=1630
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Owen W. Taylor [Fri, 5 Jun 2009 20:52:18 +0000 (16:52 -0400)]
Fix stopping a timeline
Correctly apply De Morgan's laws to the short-circuit test in
clutter_timeline_pause(); it was short-circuiting always and
never actually pausing.
http://bugzilla.openedhand.com/show_bug.cgi?id=1629
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Johan Bilien [Wed, 3 Jun 2009 21:08:17 +0000 (22:08 +0100)]
Fix the leak of the GList of layers in CoglMaterial
http://bugzilla.openedhand.com/show_bug.cgi?id=1624
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Bastian Winkler [Wed, 3 Jun 2009 12:36:18 +0000 (14:36 +0200)]
Broken fixed:: arguments
The commit
2c95b378 prevents clutter_animation_setup_property from being
called with fixed:: property names. This patch adds a additional
parameter "is_fixed" to clutter_animation_setup_property instead of
searching for "fixed::" in property_name.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Sat, 6 Jun 2009 11:34:00 +0000 (12:34 +0100)]
[build] Check for libXext
It seems GNU Gold (the new linker) either behaves as if with
--no-undefined by default, or has some issue preventing it from not
doing that when instructed to (I'm not sure if this actually
happens). In any case, clutter uses the Xshm extensions, but does not
link to libXext, which makes gold unhappy.
Based on a patch by: Xan Lopez <xan@gnome.org>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Neil Roberts [Fri, 5 Jun 2009 17:00:22 +0000 (18:00 +0100)]
[CoglPangoDisplayList] Don't store the base color in the display list
It should be possible render a single PangoLayout with different
colors without recalculating the layout. This was not working because
the color used at the first edit was being stored in the display
list. This broke changing the opacity on a ClutterText.
Now each node in the display list has a 'color override' flag which
marks whether it should use the base color or not. The base color is
now passed in from _cogl_pango_display_list_render_texture. The alpha
value is always taken from the base color.
Emmanuele Bassi [Fri, 5 Jun 2009 16:55:24 +0000 (17:55 +0100)]
[repaint] Run the repaint functions in clutter_redraw()
The clutter_redraw() function is used by libraries embedding
Clutter inside another toolkit, instead of queueing a redraw
on the embedded stage. This means that clutter_redraw() should
perform the same sequence of actions done by the redraw idle
callback.
Emmanuele Bassi [Fri, 5 Jun 2009 16:54:21 +0000 (17:54 +0100)]
[docs] Update README
* Remove mentions of Subversion
* Update the configure command line switches
Robert Bragg [Sat, 4 Apr 2009 18:21:22 +0000 (19:21 +0100)]
[cogl] cogl_material_set_layer does nothing if resetting the same texture
This avoids dirtying the layer, and should avoid some uneeded state changes
Robert Bragg [Fri, 22 May 2009 15:59:14 +0000 (16:59 +0100)]
[test-conformance] we were calling clutter_init with un-initialized arguments
This ensure we initialize shared_state->arg{c,v}_addr before calling
clutter_init
Emmanuele Bassi [Fri, 5 Jun 2009 15:46:12 +0000 (16:46 +0100)]
[build] Fix compiler warnings
Silence GCC