profile/ivi/clutter.git
15 years ago[build] Fix distcheck for the json-glib internal copy
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.

15 years agoBug 1637 - Master clock improvements
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
  ...

15 years ago[tests] Fix a segfault in the binding-pool test
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.

15 years agoChange the paint forcing on the Text cache text
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.

15 years ago[timelines] Improve marker hit check and don't fudge the delta
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.

15 years agostage: set key focus actor to NULL before emitting focus-out
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>
15 years agoRevert "[timeline] Don't clamp the elapsed time when a looping tl reaches the end"
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.

15 years ago[tests] Don't add a newline to the end of g_test_message calls
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.

15 years ago[test-timeline] Add a marker at the beginning of the timeline
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.

15 years ago[timeline] Don't clamp the elapsed time when a looping tl reaches the end
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.

15 years ago[text] Do not leak the effective attributes
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.

15 years ago[master-clock] Throttle if no redraw was performed
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>
15 years ago[docs] Annotate fixed sized arrays
Emmanuele Bassi [Wed, 10 Jun 2009 13:54:42 +0000 (14:54 +0100)]
[docs] Annotate fixed sized arrays

15 years ago[docs] Update Clutter's API reference
Emmanuele Bassi [Wed, 10 Jun 2009 13:54:19 +0000 (14:54 +0100)]
[docs] Update Clutter's API reference

15 years agoForce a paint instead of calling clutter_redraw()
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.

15 years ago[build] Use top_srcdir instead of relative paths
Emmanuele Bassi [Wed, 10 Jun 2009 13:24:33 +0000 (14:24 +0100)]
[build] Use top_srcdir instead of relative paths

15 years ago[l10n] Add LINGUAS
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.

15 years ago[docs] Various gtk-doc fixes for COGL
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.

15 years agoFix clutter_redraw() to match the redraw cycle
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.

15 years agoRun the repaint functions inside the redraw cycle
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.

15 years agoRemove useless manual timeline ticking
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>
15 years agoMove elapsed-time calculations into ClutterTimeline
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>
15 years agoLimit the frame rate when not syncing to VBLANK
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>
15 years agoDecrease the main-loop priority of the frame cycle
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>
15 years agoAvoid motion-compression in test-picking test
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>
15 years agoCompress events as part of the frame cycle
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>
15 years agoRemove stage update idle and do updates from the master clock
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>
15 years agoCall g_main_context_wakeup() when we start running timelines
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>
15 years agoRemove unused msecs_delta member
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>
15 years agoSimplify timeout list handling for the master clock
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>
15 years agoOnly advance the master clock before drawing a frame
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>
15 years ago[docs] Various gtk-docs fixes
Emmanuele Bassi [Tue, 9 Jun 2009 13:47:36 +0000 (14:47 +0100)]
[docs] Various gtk-docs fixes

15 years ago[stage] Rename fullscreen methods
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.

15 years ago[stage] Rename :fullscreen to :fullscreen-set
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.

15 years ago[build] Update the experimental features checks
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.

15 years ago[json] Update the internal JSON-GLib copy
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.

15 years ago[introspection] Add --c-include to g-ir-scanner
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.

15 years ago[build] Add as-compiler-flag.m4 to the dist
Emmanuele Bassi [Tue, 9 Jun 2009 11:39:28 +0000 (12:39 +0100)]
[build] Add as-compiler-flag.m4 to the dist

15 years ago[CoglTexture] Initialise tex->first_pixels to NULL in all constructors
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.

15 years agoFix unitialized first_pixels for foreign textures
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>
15 years agoOn bad blend strings, print the error if not returning it
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>
15 years agoFix for new potential memory leak in ClutterGLXTexturePixmap.
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>
15 years agoProperly adjust msecs_delta when clamping elapsed time
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>
15 years ago[animation] Keep a reference during notify::alpha
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

15 years agointrospection-friendly ClutterEvent accessors
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

15 years ago[glx-texture-pixmap] Unref a cogl texture handle.
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>
15 years agoFix memory leak in ClutterGLXTexturePixmap.
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>
15 years agoStraighten out 'realize' handling for ClutterGLXTexturePixmap
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>
15 years agoRemove unnecessary setting of CLUTTER_ACTOR_REALIZED flag
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>
15 years agoBe more tolerant about natural_width < min_width
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>
15 years agoUse double temporaries when computing group size
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>
15 years agoHandle a clone of an actor with an unmapped parent
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>
15 years ago[tests] Clarify the numbers
Emmanuele Bassi [Mon, 8 Jun 2009 09:59:22 +0000 (10:59 +0100)]
[tests] Clarify the numbers

15 years ago[tests] The ::focus-in signal was renamed ::key-focus-in
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.

15 years ago[build] Add AS_COMPILER_FLAGS
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

15 years ago[x11] Do not forcibly set the stage size on fullscreen
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.

15 years ago[build] Search for Cogl GIR in the right place
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>
15 years ago[test-blend-strings] Fix a silly off by one that meant the test couldn't fail
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.)

15 years ago[texture] Fix error reporting on ::load-finished
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

15 years ago[units] Always recompute pixels
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.

15 years ago[build] Remove -Werror for the maintainer cflags
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.

15 years agoFixes for some compiler warnings
Emmanuele Bassi [Sat, 6 Jun 2009 13:37:41 +0000 (14:37 +0100)]
Fixes for some compiler warnings

15 years ago[actor] get_transformed_position(): initialize Z value
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>
15 years agoFix stopping a timeline
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>
15 years agoFix the leak of the GList of layers in CoglMaterial
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>
15 years agoBroken fixed:: arguments
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>
15 years ago[build] Check for libXext
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>
15 years ago[CoglPangoDisplayList] Don't store the base color in the display list
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.

15 years ago[repaint] Run the repaint functions in clutter_redraw()
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.

15 years ago[docs] Update README
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

15 years ago[cogl] cogl_material_set_layer does nothing if resetting the same texture
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

15 years ago[test-conformance] we were calling clutter_init with un-initialized arguments
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

15 years ago[build] Fix compiler warnings
Emmanuele Bassi [Fri, 5 Jun 2009 15:46:12 +0000 (16:46 +0100)]
[build] Fix compiler warnings

Silence GCC

15 years agoFix a compiler warning
Emmanuele Bassi [Fri, 5 Jun 2009 14:18:43 +0000 (15:18 +0100)]
Fix a compiler warning

15 years ago[ClutterActor] Fix check for zero opacity when being painted from a clone
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.

15 years ago[build] Add all dependencies for pkg-config
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.

15 years agoMerge branch '1.0-integration'
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

15 years ago[x11] Disable XInput by default
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.

15 years agoMerge branch 'timeline-no-fps' into 1.0-integration
Neil Roberts [Fri, 5 Jun 2009 11:20:41 +0000 (12:20 +0100)]
Merge branch 'timeline-no-fps' into 1.0-integration

15 years ago[xinput] Invert the XI extension version check
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.

15 years ago[cogl-primitives] Fix an unused variable warning when building GLES
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.

15 years ago[clutter-stage-egl] Pass -1,-1 to clutter_stage_x11_fix_window_size
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.

15 years agoUpdate the GLES backend to have the layer filters in the material
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.

15 years ago[gles/cogl-shader] Add a missing semicolon
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.

15 years ago[cogl] Move the texture filters to be a property of the material layer
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.

15 years ago[text] Fix Pango unit to pixels conversion
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.

15 years ago[actor] Force unrealization on destroy only for non-toplevels
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.

15 years ago[x11] Rework map/unmap and resizing
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.

15 years ago[xinput] Check for the XInput entry points
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.

15 years ago[units] Validate units against the ParamSpec
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.

15 years ago[actor] Add the ::allocation-changed signal
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.

15 years ago[actor] Use flags to control allocations
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.

15 years ago[units] Rework Units into logical distance value
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.

15 years agoRemove a stray g_value_get_int()
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.

15 years agoRemove usage of Units and macros
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.

15 years ago[cogl-material] Allow setting a layer with an invalid texture handle
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.

15 years ago[timeline] Remove the concept of frames from timelines
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.

15 years ago[gles/cogl-shader] Fix parameter spec for cogl_shader_get_info_log
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.

15 years ago[clutter-stage-win32] Call clutter_actor_map instead of setting the flags
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.

15 years ago[clutter-event-win32] Fix the argument types to clutter_actor_get_size
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.