Commit Graph

4584 Commits

Author SHA1 Message Date
Robert Bragg
c6a0427c69 pick: Use Cogl API not GL API to disable dithering
When picking we need to disable dithering to be sure that the hardware
will not modify the colors we use as actor identifiers. Clutter was
manually calling glEnable/Disable GL_DITHER to handle this, but that was
a layering violation since Cogl is intended to handle all interactions
with OpenGL. Since we are now striving for GL vs GLES to be a runtime
choice we need to remove this last direct usage of GL from Clutter so it
doesn't have to be linked with GL at build time.

Signed-off-by: Neil Roberts <neil@linux.intel.com>
2011-07-14 13:54:16 +01:00
Robert Bragg
3183240fef Provide stable paint-boxes for fixed sized actors
This updates _clutter_paint_volume_get_stage_paint_box to try and
calculate more stable paint-box sizes for fixed sized paint-volumes by
not basing the size on the volume's sub-pixel position.

So the aim is that for a given rectangle defined with floating point
coordinates we want to determine a stable quantized size in pixels that
doesn't vary due to the original box's sub-pixel position.

The reason this is important is because effects will use this API to
determine the size of offscreen framebuffers and so for a fixed-size
object that may be animated across the screen we want to make sure that
the stage paint-box has an equally stable size so that effects aren't
made to continuously re-allocate a corresponding fbo.

The other thing we consider is that the calculation of this box is
subject to floating point precision issues that might be slightly
different to the precision issues involved with actually painting the
actor, which might result in painting slightly leaking outside the
user's calculated paint-volume. This patch now adds padding to consider
this too.

Signed-off-by: Neil Roberts <neil@linux.intel.com>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-07-14 13:54:12 +01:00
Robert Bragg
df751a8a25 actor: improve rounding in get_allocation_geometry
Instead of relying on C to round the floating point allocation to
integers by flooring the values we now use CLUTTER_NEARBYINT to round
the allocation's position and size to the nearest integers instead. Using
floor leads to rather unstable rounding for the width and height when
there may be tiny fluctuations in the floating point width/height.

Signed-off-by: Neil Roberts <neil@linux.intel.com>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-07-14 13:54:09 +01:00
Robert Bragg
32487af55b Adds a CLUTTER_NEARBYINT macro for float rounding
This is a replacement for the nearbyint function which always rounds to
the nearest integer. nearbyint is a C99 function so it might not always
be available but also it seems in glibc it is defined as a function call
so this macro could end up faster anyway. We can't just add 0.5 because
it will break for negative numbers.

Signed-off-by: Neil Roberts <neil@linux.intel.com>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-07-14 13:54:05 +01:00
Robert Bragg
ad234b303c paint-volume: don't round paint-volume from allocation
The implementation of _clutter_actor_set_default_paint_volume which
simply uses the actor's allocation to determine a paint-volume was
needlessly using the allocation rounded to integers by internally using
clutter_actor_get_allocation_geometry instead of
clutter_actor_get_allocation_box. This was introducing a lot of
instability into the paint-volume due to the way rounding was done.

The code has now been updated to use clutter_actor_get_allocation_box
so we are dealing with the floating point allocation instead.

Signed-off-by: Neil Roberts <neil@linux.intel.com>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-07-14 13:54:01 +01:00
Tomeu Vizoso
01cf70594d Make sure the gesture is cancelled even if we miss the release event 2011-07-14 13:11:12 +02:00
Tomeu Vizoso
439c7e6ee7 Remove unneeded class closure 2011-07-14 11:46:12 +02:00
Emmanuele Bassi
18b3da95ef osx: Code style cleanups 2011-07-13 19:33:11 +01:00
Tomeu Vizoso
c8e3db105c Add default closures for the signals in ClutterGestureAction
Also make sure we cancel the gesture as soon as we know we have to
2011-07-13 19:15:20 +02:00
Dinh Bowman
48426c28bf Fixed typo of bidng to bind
https://bugzilla.gnome.org/show_bug.cgi?id=654103
2011-07-13 15:19:22 +01:00
Emmanuele Bassi
9a3b97b55e Revert "build: Detect the appropriate default flavour"
Ouch, butterfingers and git commit -a.

This reverts commit 81e8c8dec9.
2011-07-13 14:26:05 +01:00
Emmanuele Bassi
81e8c8dec9 build: Detect the appropriate default flavour
If we're building on/for Windows, set 'win32' as the default flavour; if
we're building on OS X, set 'osx' as the default flavour. For everything
else, use 'glx'.
2011-07-13 14:20:47 +01:00
Neil Roberts
a72237b876 clutter-stage: Add clutter_stage_get_redraw_clip_bounds
This adds a public function to get the bounds of the current clipped
redraw on a stage. This should only be called while the stage is being
painted. The function diverts to a virtual function on the
ClutterStageWindow implementation. If the function isn't implemented
or it returns FALSE then the entire stage is reported. The clip bounds
are in integer pixel coordinates in the stage's coordinate space.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2421
2011-07-13 13:54:50 +01:00
Damien Lespiau
25a7435a86 uprof: Add the units in the name of the "Per Frame" timer attribute
So it shows up in the profile report. Take the opportunity to write a
better long description for the attribute.

https://bugzilla.gnome.org/show_bug.cgi?id=654363
2011-07-12 10:57:18 +01:00
Robert Bragg
ab6be41ea0 build: update cogl_onscreen_x11 syms to cogl_x11_onscreen
Cogl recently renamed symbols with the form
cogl_onscreen_<platform>_blah to be consistent with other platform
specific APIs so they are now named like cogl_<platform>_onscreen_blah.
This makes the corresponding change to clutter.
2011-07-11 16:59:26 +01:00
Robert Bragg
d182d5a171 backend-cogl: update _get_egl_context symbol name
Cogl changed has changed the name of cogl_context_egl_get_egl_context to
cogl_egl_context_get_egl_context to be consistent with other platform
specific symbols.
2011-07-11 16:59:26 +01:00
Robert Bragg
71d0872b76 don't call cogl_set_default_context since it's been removed
cogl_set_default_context has been removed from Cogl so this updates
Clutter in-line with that change.
2011-07-11 16:59:26 +01:00
Damien Lespiau
c17ddfd6a9 uprof: Rename timers to remove the EGL specific bits
Cogl abstracts the winsys, Remove the egl prefix from the timer names.

https://bugzilla.gnome.org/show_bug.cgi?id=654361
2011-07-11 01:53:53 +01:00
Emmanuele Bassi
5d10a7141c text: Make sure that the selection box is big enough
Do not use integers to store the result of the PANGO_UNITS scaling to
avoid rounding issues with the default C rules. We should use cielf()
instead.
2011-07-10 10:24:40 +01:00
Emmanuele Bassi
f6cdeb9858 osx: Fix a compiler warning
No declaration after statement.
2011-07-10 10:12:08 +01:00
Emmanuele Bassi
96440acffe texture: Deprecate the new_from_actor() function
Now that we have proper offscreen and shader handling using the
ClutterEffect API, we can finally deprecate this hard to bind, easy
to break function.
2011-07-08 12:08:19 +01:00
Emmanuele Bassi
e677ebc3e8 Deprecate ClutterScore
The class is of dubious utility, now that we have a complex animation
API in ClutterAnimator and ClutterState, as opposed to a simple one
in ClutterBehaviour. The Score API also suffers from some naïve design
issues that made it far less useful than intended.
2011-07-08 12:01:08 +01:00
Philippe Normand
eb28d16300 a11y: cally-text get_offset_at_point implementation
See http://bugzilla.clutter-project.org/show_bug.cgi?id=1733
2011-07-06 17:05:49 +02:00
Philippe Normand
7565fcaab0 a11y: cally-text get_character_extents implementation
See http://bugzilla.clutter-project.org/show_bug.cgi?id=1733
2011-07-06 16:56:30 +02:00
Philippe Normand
61ea64c8c1 a11y: expose _cally_actor_get_top_level_origin in cally-actor-private
As this function is needed for atktext get_character_extents and
get_offset_at_point implementations.
2011-07-06 16:55:55 +02:00
Philippe Normand
ae0aa9e4cf a11y: get_default_attributes implementation on cally-text
See http://bugzilla.clutter-project.org/show_bug.cgi?id=1733
2011-07-06 16:51:49 +02:00
Philippe Normand
11efaf8297 a11y: use actor color if no fgcolor found in pango attributes 2011-07-06 16:44:40 +02:00
Philippe Normand
49d4317420 a11y: factor some PangoAttributes->AtkTextAttributes mappings
That code can then be used by get_run_attributes and
get_default_attributes implementations.
2011-07-06 16:34:36 +02:00
Alejandro Piñeiro
7e9ee85c7d [a11y] Exposing via ATK the proper toolkit name and version 2011-07-06 14:25:02 +02:00
Neil Roberts
bd3762b719 clutter-actor: Don't apply shaders during picking
Commit 0ede622f51 inadvertently made it so that shaders are applied
during picking. This was making test-shader fail to respond to clicks.

The commit also makes it so that culling is applied during
picking. Presumably this is also unintentional because the commit
message does not mention it. However I think it may make sense to do
culling during picking so it might as well stay that way.

https://bugzilla.gnome.org/show_bug.cgi?id=653959
2011-07-05 13:30:42 +01:00
Emmanuele Bassi
87f35a3434 build: Fix the path to the tslib event source 2011-07-04 16:09:41 +01:00
Samuel Degrande
2544e87869 clutter-media: mention the asynchronous behavior of set_playing() in the doc.
Depending on the ClutterMedia implementation, the set_playing()
call can be asynchronous, the playing state's change being not
immediate.

https://bugzilla.gnome.org/show_bug.cgi?id=650675
2011-07-04 15:58:08 +01:00
Jasper St. Pierre
037138d3bf clutter-text: Always update cursor positions when painting
The cursor's on-screen rectangle is defined in terms of the text
length, the current index, and text_x and text_y, which hold the text
offset in overflowing text fields.

When deleting large amounts of text, text_x is set to 0. In some
edge case branch paths, the cursor rectangle could be calculated
after the current index and text length were updated, but before
the text_x offset could be. This left a negative x position, which
consequently blew up Cogl and the widget.

https://bugzilla.gnome.org/show_bug.cgi?id=651079
2011-07-04 15:58:08 +01:00
Emmanuele Bassi
e9a42f23fe Deprecate mallum's add() macros for Group and Stage
I think we're way past overdue.
2011-07-04 15:58:08 +01:00
Robert Bragg
d65161a7fd build: fix Makefile.am to build glx tfp code on x11 platforms
It was already the intention that the ClutterGLXTexturePixmap API should
be built and made available on any X11 based platforms since there was
nothing specific about the API and it is useful to have for
compatibility. There was a mistake in the Makefile.am though which meant
only the header was getting installed but the code wasn't being built.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-07-04 15:41:38 +01:00
Robert Bragg
5ab10e0f7a glx-tfp: Don't include glx.h
Since the implementation of ClutterGLXTexturePixmap has nothing GLX
specific about it (it is simply layered on top of
ClutterX11TexturePixmap) we don't need to include glx.h. Removing this
include also means that the code can be built for compatibility against
GLES drivers.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-07-04 15:41:38 +01:00
Peter Ward
c94e8d1292 Arrays in parameters were not correctly annotated.
https://bugzilla.gnome.org/show_bug.cgi?id=653607
2011-07-01 12:32:19 +01:00
Robert Bragg
8bc265d22c paint-volume: remove more is_axis_aligned assertions
This removes the is_axis_aligned assertions for the width/height/depth
getters and setters, since for example it is legitimate to query the
width, height or depth of a container's child actors which aren't
necessarily axis aligned.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-06-30 14:53:40 +01:00
Robert Bragg
cc5808387e backend-cogl: update in line with Cogl API change
cogl_renderer_xlib_set_foreign_display was renamed to
cogl_xlib_renderer_set_foriegn_display so this is the corresponding
change to clutter.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-06-30 14:53:40 +01:00
Robert Bragg
aacdbb4a55 win32: use typesafe cogl_win32_renderer_handle_event
The generic cogl_renderer_handle_native_event API was removed from the
Cogl public API in favour of typesafe functions, so this updates the
win32 backend in line with that change.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-06-30 14:53:40 +01:00
Peter Ward
2dc8e2f866 Annotate ClutterTexture::load-finished with the correct type for error.
https://bugzilla.gnome.org/show_bug.cgi?id=653307
2011-06-27 11:49:19 +01:00
Emmanuele Bassi
478014041b build: Create and install clutter-glx pkg-config file
For backward compatibility.
2011-06-24 19:22:22 +01:00
Peter Ward
2528ad8cb8 Support multiple pointers in ClutterDragAction.
https://bugzilla.gnome.org/show_bug.cgi?id=653066
2011-06-21 18:29:01 +01:00
Emmanuele Bassi
459e1e7fc9 docs: Fix the GLX section
The whole thing should just go away.
2011-06-20 19:45:14 +01:00
Emmanuele Bassi
f3f1c87d8c docs: Fix deprecation notice for ClutterBehaviour 2011-06-20 19:44:55 +01:00
Emmanuele Bassi
513f218c38 docs: Add the Deprecate tag to Behaviours
And link the migration guide.
2011-06-20 18:46:48 +01:00
Emmanuele Bassi
7b064a0bda build: Build the GLX symbols
The change from the GLX backend to the Cogl backend left out the GLX
source code from the list of source files to be built.
2011-06-20 18:26:34 +01:00
Emmanuele Bassi
71b6554176 Fix the deprecation guard for ClutterGLXTexturePixmap
It's CLUTTER_DISABLE_DEPRECATED.
2011-06-20 18:22:06 +01:00
Emmanuele Bassi
e5641dabf8 docs: Document ClutterDropAction
And add it to the API reference.

https://bugzilla.gnome.org/show_bug.cgi?id=652842
2011-06-20 15:25:54 +01:00
Emmanuele Bassi
1238e0ddf9 Add ClutterDropAction
ClutterDropAction is an Action sub-class that allows writing actors that
react to dragged actors being dropped on them.

https://bugzilla.gnome.org/show_bug.cgi?id=652842
2011-06-20 15:25:53 +01:00