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.
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: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 [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
Emmanuele Bassi [Fri, 5 Jun 2009 14:18:43 +0000 (15:18 +0100)]
Fix a compiler warning
Neil Roberts [Fri, 5 Jun 2009 15:25:39 +0000 (16:25 +0100)]
[ClutterActor] Fix check for zero opacity when being painted from a clone
Clutter short-circuits painting when an actor's opacity is
zero. However if the actor is being painted from a ClutterClone then
it will be painted using the clone's opacity instead so the test was
broken.
Emmanuele Bassi [Fri, 5 Jun 2009 11:46:37 +0000 (12:46 +0100)]
[build] Add all dependencies for pkg-config
A merge conflict gone bad: the IMAGE_PC_FILES variable was not appended
to the CLUTTER_REQUIRES one, thus leading to Clutter depending on
GdkPixbuf but never actually checking for it.
Emmanuele Bassi [Fri, 5 Jun 2009 11:41:42 +0000 (12:41 +0100)]
Merge branch '1.0-integration'
* 1.0-integration: (138 commits)
[x11] Disable XInput by default
[xinput] Invert the XI extension version check
[cogl-primitives] Fix an unused variable warning when building GLES
[clutter-stage-egl] Pass -1,-1 to clutter_stage_x11_fix_window_size
Update the GLES backend to have the layer filters in the material
[gles/cogl-shader] Add a missing semicolon
[cogl] Move the texture filters to be a property of the material layer
[text] Fix Pango unit to pixels conversion
[actor] Force unrealization on destroy only for non-toplevels
[x11] Rework map/unmap and resizing
[xinput] Check for the XInput entry points
[units] Validate units against the ParamSpec
[actor] Add the ::allocation-changed signal
[actor] Use flags to control allocations
[units] Rework Units into logical distance value
Remove a stray g_value_get_int()
Remove usage of Units and macros
[cogl-material] Allow setting a layer with an invalid texture handle
[timeline] Remove the concept of frames from timelines
[gles/cogl-shader] Fix parameter spec for cogl_shader_get_info_log
...
Conflicts:
configure.ac
Emmanuele Bassi [Fri, 5 Jun 2009 11:26:29 +0000 (12:26 +0100)]
[x11] Disable XInput by default
The XInput support in Clutter is still using XI 1.x. This will never
work correctly, and we are all waiting for XInput 2 anyway. The changes
internally should be minimal, so we can leave everything in place, but
it's better to disable XInput support by default -- at least for the
time being.
Neil Roberts [Fri, 5 Jun 2009 11:20:41 +0000 (12:20 +0100)]
Merge branch 'timeline-no-fps' into 1.0-integration
Emmanuele Bassi [Fri, 5 Jun 2009 11:06:09 +0000 (12:06 +0100)]
[xinput] Invert the XI extension version check
Since having XQueryInputVersion means also having XGetExtensionVersion
we need to check the former first to avoid the deprecation warning.
Neil Roberts [Thu, 4 Jun 2009 21:20:18 +0000 (22:20 +0100)]
[cogl-primitives] Fix an unused variable warning when building GLES
The 'tex' variable is only used if #ifdef'd GL code so it was throwing
an error under GLES. The variable is now moved into a block inside the
#ifdef.
Neil Roberts [Thu, 4 Jun 2009 21:15:41 +0000 (22:15 +0100)]
[clutter-stage-egl] Pass -1,-1 to clutter_stage_x11_fix_window_size
This reflects the changes made to
e4ff24bc for the egl stage.
Neil Roberts [Thu, 4 Jun 2009 21:12:33 +0000 (22:12 +0100)]
Update the GLES backend to have the layer filters in the material
This reflects the changes made in
54d8aadf1d86 for the GLES backend.
Neil Roberts [Thu, 4 Jun 2009 21:10:33 +0000 (22:10 +0100)]
[gles/cogl-shader] Add a missing semicolon
cogl_shader_get_info_log was missing a semicolon which broke the build
on GLES 2.
Neil Roberts [Thu, 4 Jun 2009 15:04:57 +0000 (16:04 +0100)]
[cogl] Move the texture filters to be a property of the material layer
The texture filters are now a property of the material layer rather
than the texture object. Whenever a texture is painted with a material
it sets the filters on all of the GL textures in the Cogl texture. The
filter is cached so that it won't be changed unnecessarily.
The automatic mipmap generation has changed so that the mipmaps are
only generated when the texture is painted instead of every time the
data changes. Changing the texture sets a flag to mark that the
mipmaps are dirty. This works better if the FBO extension is available
because we can use glGenerateMipmap. If the extension is not available
it will temporarily enable automatic mipmap generation and reupload
the first pixel of each slice. This requires tracking the data for the
first pixel.
The COGL_TEXTURE_AUTO_MIPMAP flag has been replaced with
COGL_TEXTURE_NO_AUTO_MIPMAP so that it will default to
auto-mipmapping. The mipmap generation is now effectively free if you
are not using a mipmap filter mode so you would only want to disable
it if you had some special reason to generate your own mipmaps.
ClutterTexture no longer has to store its own copy of the filter
mode. Instead it stores it in the material and the property is
directly set and read from that. This fixes problems with the filters
getting out of sync when a cogl handle is set on the texture
directly. It also avoids the mess of having to rerealize the texture
if the filter quality changes to HIGH because Cogl will take of
generating the mipmaps if needed.
Emmanuele Bassi [Thu, 4 Jun 2009 16:28:35 +0000 (17:28 +0100)]
[text] Fix Pango unit to pixels conversion
When going from Pango units to pixels we need to divide by 1024,
and not multiply by 1024.
Emmanuele Bassi [Thu, 4 Jun 2009 15:50:19 +0000 (16:50 +0100)]
[actor] Force unrealization on destroy only for non-toplevels
We cannot force unrealization on toplevels ourselves, so we need
to check inside clutter_actor_destroy() if we want to avoid a
warning.
Emmanuele Bassi [Thu, 4 Jun 2009 15:27:21 +0000 (16:27 +0100)]
[x11] Rework map/unmap and resizing
The mapping and unmapping of the X11 stage implementation is
a bit bong. It's asynchronous, for starters, when it really
can avoid it by tracking the state internally.
The ordering of the map/unmap sequence is also broken with
respect to the resizing.
By tracking the state internally into StageX11 we can safely
remove the MapNotify and UnmapNotify X event handling.
In theory, we should use _NET_WM_STATE a lot more, and reuse
the X11 state flags for fullscreening as well.
Emmanuele Bassi [Thu, 4 Jun 2009 12:41:32 +0000 (13:41 +0100)]
[xinput] Check for the XInput entry points
Apparently, the XInput extension is using the same pkg-config
file ('xi') for both the 1.x and the 2.x API, so we need to
check for both the 1.x XGetExtensionVersion and the 2.x
XQueryInputVersion.
Emmanuele Bassi [Thu, 4 Jun 2009 11:15:15 +0000 (12:15 +0100)]
[units] Validate units against the ParamSpec
When declaring a property using ClutterParamSpecUnits we pass a
default type to limit the type of units we accept as valid values
for the property.
This means that we need to add the unit type check as part of the
validation process.
Emmanuele Bassi [Thu, 4 Jun 2009 11:00:58 +0000 (12:00 +0100)]
[actor] Add the ::allocation-changed signal
Sometimes it is useful to be able to track changes in the allocation
flags, like the absolute origin, inside children of a container.
Using the notify::allocation signal is not enough, in these cases, so
we need a specific signal that gives us both the allocation box and the
allocation flags.
Emmanuele Bassi [Wed, 3 Jun 2009 13:02:06 +0000 (14:02 +0100)]
[actor] Use flags to control allocations
Instead of passing a boolean value, the ::allocate virtual function
should use a bitmask and flags. This gives us room for expansion
without breaking API/ABI, and allows to encode more information to
the allocation process instead of just changes of absolute origin.
Emmanuele Bassi [Wed, 3 Jun 2009 10:12:09 +0000 (11:12 +0100)]
[units] Rework Units into logical distance value
Units as they have been implemented since Clutter 0.4 have always been
misdefined as "logical distance unit", while they were just pixels with
fractionary bits.
Units should be reworked to be opaque structures to hold a value and
its unit type, that can be then converted into pixels when Clutter needs
to paint or compute size requisitions and perform allocations.
The previous API should be completely removed to avoid collisions, and
a new type:
ClutterUnits
should be added; the ability to install GObject properties using
ClutterUnits should be maintained.
Emmanuele Bassi [Wed, 3 Jun 2009 09:09:56 +0000 (10:09 +0100)]
Remove a stray g_value_get_int()
Now that all properties are float, using g_value_get_int() to
retrieve the value of the :anchor-x property is going to print
out a warning.
Emmanuele Bassi [Tue, 2 Jun 2009 17:44:30 +0000 (18:44 +0100)]
Remove usage of Units and macros
The ClutterUnit and relative macros should not be used when dealing
with pixels -- which is to say, all the time when inside Clutter.
Neil Roberts [Wed, 3 Jun 2009 14:22:42 +0000 (15:22 +0100)]
[cogl-material] Allow setting a layer with an invalid texture handle
It was previously possible to create a material layer with no texture
by setting some property on it such as the matrix. However it was not
possible to get back to that state without removing the layer and
recreating it. It is useful to be able to remove the texture to free
resources without forgetting the state of the layer so we can put a
different texture in later.
Neil Roberts [Thu, 4 Jun 2009 12:05:12 +0000 (13:05 +0100)]
[timeline] Remove the concept of frames from timelines
Timelines no longer work in terms of a frame rate and a number of
frames but instead just have a duration in milliseconds. This better
matches the working of the master clock where if any timelines are
running it will redraw as fast as possible rather than limiting to the
lowest rated timeline.
Most applications will just create animations and expect them to
finish in a certain amount of time without caring about how many
frames are drawn. If a frame is going to be drawn it might as well
update all of the animations to some fraction of the total animation
rather than rounding to the nearest whole frame.
The 'frame_num' parameter of the new-frame signal is now 'msecs' which
is a number of milliseconds progressed along the
timeline. Applications should use clutter_timeline_get_progress
instead of the frame number.
Markers can now only be attached at a time value. The position is
stored in milliseconds rather than at a frame number.
test-timeline-smoothness and test-timeline-dup-frames have been
removed because they no longer make sense.
Neil Roberts [Thu, 4 Jun 2009 11:04:47 +0000 (12:04 +0100)]
[gles/cogl-shader] Fix parameter spec for cogl_shader_get_info_log
The stub version of cogl_shader_get_info_log needed to be updated to
match the changes to the function signature in
61deeafa.
Neil Roberts [Thu, 4 Jun 2009 10:59:17 +0000 (11:59 +0100)]
[clutter-stage-win32] Call clutter_actor_map instead of setting the flags
The clutter_actor_map and unmap functions need to be called to
properly update the mapped state. This matches the changes to the X11
stage in
125bded8.
Neil Roberts [Thu, 4 Jun 2009 10:50:52 +0000 (11:50 +0100)]
[clutter-event-win32] Fix the argument types to clutter_actor_get_size
clutter_actor_get_size now takes float pointers so it was issuing a
warning.
Neil Roberts [Thu, 4 Jun 2009 10:50:06 +0000 (11:50 +0100)]
Load glBlendEquation and glBlendColor using cogl_get_proc_address
These are defined since OpenGL 1.2 and since Windows doesn't export
any functions defined after 1.1 we need to load them dynamically.
Neil Roberts [Thu, 4 Jun 2009 10:48:51 +0000 (11:48 +0100)]
Rename 'near' and 'far' variables to 'z_near' and 'z_far'
The Windows headers define near and far to be empty so it breaks the
build.
Neil Roberts [Thu, 4 Jun 2009 10:03:34 +0000 (11:03 +0100)]
[configure] Require pango 1.20 instead of 1.18
Clutter now calls pango_layout_set_height which is only available
since Pango 1.20.
Emmanuele Bassi [Wed, 3 Jun 2009 11:59:16 +0000 (12:59 +0100)]
[actor] Unrealize on destroy
If the application code calls for destruction of an actor we need
to make sure that the actor is unrealized before running the dispose
sequence; otherwise, we might trigger an assertion failure on composite
actors.
Emmanuele Bassi [Wed, 3 Jun 2009 13:03:25 +0000 (14:03 +0100)]
Revert commit
762873e7
The commit
762873e79e501c949f3ef55cbac20276b6f6ed4e is completely
and utterly wrong and I should have never pushed it.
Serves me well for trying to work on three different branches and
on three different things.
Emmanuele Bassi [Wed, 3 Jun 2009 11:02:56 +0000 (12:02 +0100)]
[master clock] Avoid excessive redraws
Currently, the clock source spins a redraw every time there is at
least a timeline running. If the timelines were not advanced in
the previous frame, though, because their interval is larger than
the vblanking interval then this will lead to excessive redraws of
the scenegraph even if nothing has changed.
To avoid this a simple guard should be set by the MasterClock::advance
method in case no timeline was effectively advanced, and checked
before dispatching the stage redraws.
Neil Roberts [Tue, 2 Jun 2009 17:01:18 +0000 (18:01 +0100)]
[cogl-texture] Don't take ownership of the data in cogl_texture_new_from_bitmap
When creating a Cogl texture from a Cogl bitmap it would steal the
data by setting the bitmap_owner flag and clearing the data pointer
from the bitmap. The data would be freed by the time the
new_from_bitmap is finished. There is no reason to do this because the
data will be freed when the Cogl bitmap is unref'd and it is confusing
not to be able to reuse the bitmap for creating multiple textures.
Emmanuele Bassi [Mon, 1 Jun 2009 17:43:47 +0000 (18:43 +0100)]
[tests] Add ClutterColor conformance tests
Add a conformance test unit for the to_string() and from_string()
methods.
Robert Staudinger [Mon, 1 Jun 2009 16:54:46 +0000 (18:54 +0200)]
[color] Add support for the "#rgba" color format
clutter_color_from_string() only supported the "#rrggbbaa" format with
alpha channel, this patch adds support for "#rgba".
Colors in "#rrggbb" format were parsed manually, this is now left to
the pango color parsing fallback, since that's handling it just fine.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Mon, 1 Jun 2009 16:35:41 +0000 (17:35 +0100)]
[docs] Rework the API reference version generation
Clutter copies the gtk-doc from the usual gtk+ template, and
has a version.xml.in containing only:
@VERSION@
Without a newline at the end. Unfortunately, it appears that
autoconf has started adding a newline to the generated version.xml
which then is used as the payload for the "version" XML entity.
Instead of using a secondary file we can make configure generate
the whole clutter-docs.xml and cogl-docs.xml files from a template;
this way we also get the ability to substitute more autoconf variables
into the documentation -- if needs be.
Emmanuele Bassi [Mon, 1 Jun 2009 15:31:32 +0000 (16:31 +0100)]
[cogl-shader] Make get_info_log() slightly nicer
The cogl_shader_get_info_log() function is very inconvenient for
language bindings and for regular use, as it requires a static
buffer to be filled -- basically just providing a wrapper around
glGetInfoLogARB().
Since COGL aims to be a more convenient API than raw GL we should
just make cogl_shader_get_info_log() return an allocated string
with the GLSL compiler log.
Neil Roberts [Mon, 1 Jun 2009 16:10:22 +0000 (17:10 +0100)]
Use GL_QUADS for flushing a quad batch
Instead of using GL_TRIANGLES and uploading the indices every time, it
now uses GL_QUADS instead on OpenGL. Under GLES it still uses indices
but it uses the new cogl_vertex_buffer_indices_get_for_quads function
to avoid uploading the vertices every time.
This requires the _cogl_vertex_buffer_indices_pointer_from_handle
function to be exposed privately to the rest of Cogl.
The static_indices array has been removed from the Cogl context.
Emmanuele Bassi [Mon, 1 Jun 2009 14:51:59 +0000 (15:51 +0100)]
[introspection] Remove Cogl symbols from Clutter GIR
The GIR file for Clutter still contains symbols from COGL, even
though we provide a Cogl GIR as well. The Clutter GIR should
depend on the Cogl GIR instead.
Marc-André Lureau [Sat, 30 May 2009 20:58:03 +0000 (23:58 +0300)]
build: don't double install clutter-version.h
Automake 1.11 installs several files in one command, and it fails if
the same file is installed two times.
See NEWS for details:
http://lists.gnu.org/archive/html/automake/2009-05/msg00093.html
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>