Robert Bragg [Tue, 26 May 2009 14:41:53 +0000 (15:41 +0100)]
[cogl] Remove cogl_{create,destroy}_context from the public API
cogl_create_context is dealt with internally when _cogl_get_default context
is called, and cogl_destroy_context is currently never called.
It might be nicer later to get an object back when creating a context so
Cogl can support multiple contexts, so these functions are being removed
from the API until we get a chance to address context management properly.
For now cogl_destroy_context is still exported as _cogl_destroy_context so
Clutter could at least install a library deinit handler to call it.
Robert Bragg [Tue, 26 May 2009 15:27:36 +0000 (16:27 +0100)]
[vbo indices] tweak add_indices api to return an id and add delete_indices api
Originally cogl_vertex_buffer_add_indices let the user pass in their own unique
ID for the indices; now the Id is generated internally and returned to the
caller.
Robert Bragg [Sun, 24 May 2009 10:33:29 +0000 (11:33 +0100)]
[cogl-vertex-buffer] Seal GL types from the public API
We now have CoglAttributeType and CoglVerticesMode typedefs to replace the
use of GLenum in the public API.
Robert Bragg [Sun, 24 May 2009 03:04:38 +0000 (04:04 +0100)]
[cogl-vertex-buffers] Support putting index arrays into VBOS
It's now possible to add arrays of indices to a Cogl vertex buffer and
they will be put into an OpenGL vertex buffer object. Since it's quite
common for index arrays to be static it saves the OpenGL driver from
having to validate them repeatedly.
This changes the cogl_vertex_buffer_draw_elements API: It's no longer
possible to provide a pointer to an index array at draw time. So
cogl_vertex_buffer_draw_elements now takes an indices identifier that
should correspond to an idendifier returned when calling
cogl_vertex_buffer_add_indices ()
Robert Bragg [Sat, 23 May 2009 16:52:18 +0000 (17:52 +0100)]
[cogl] Remove cogl_flush_gl_state from the API
This is being removed before we release Clutter 1.0 since the implementation
wasn't complete, and so we assume no one is using this yet. Util we have
someone with a good usecase, we can't pretend to support breaking out into
raw OpenGL.
Robert Bragg [Sat, 23 May 2009 16:42:10 +0000 (17:42 +0100)]
[material] Reduce the material API in preperation for releasing Clutter 1.0
There were a number of functions intended to support creating of new
primitives using materials, but at this point they aren't used outside of
Cogl so until someone has a usecase and we can get feedback on this
API, it's being removed before we release Clutter 1.0.
Robert Bragg [Sat, 23 May 2009 15:23:00 +0000 (16:23 +0100)]
[cogl-material] Removes all the API made redundant by the blend strings API
This removes the following API:
cogl_material_set_blend_factors
cogl_material_set_layer_combine_function
cogl_material_set_layer_combine_arg_src
cogl_material_set_layer_combine_arg_op
These were rather awkward to use, so since it's expected very few people are
using them at this point and it should be straight forward to switch over
to blend strings, the API is being removed before we release Clutter 1.0.
Robert Bragg [Sun, 10 May 2009 23:40:41 +0000 (00:40 +0100)]
[cogl-material] Support string based blending and layer combine descriptions
Setting up layer combine functions and blend modes is very awkward to do
programatically. This adds a parser for string based descriptions which are
more consise and readable.
E.g. a material layer combine function could now be given as:
"RGBA = ADD (TEXTURE[A], PREVIOUS[RGB])"
or
"RGB = REPLACE (PREVIOUS)"
"A = MODULATE (PREVIOUS, TEXTURE)"
The simple syntax and grammar are only designed to expose standard fixed
function hardware, more advanced combining must be done with shaders.
This includes standalone documentation of blend strings covering the aspects
that are common to blending and texture combining, and adds documentation
with examples specific to the new cogl_material_set_blend() and
cogl_material_layer_set_combine() functions.
Note: The hope is to remove the now redundant bits of the material API
before 1.0
Robert Bragg [Wed, 27 May 2009 22:39:18 +0000 (23:39 +0100)]
[build] Fixes some compiler warnings when building for GLES 2
There were a number of variables shadowing other symbols, and an unused
display variable.
Emmanuele Bassi [Wed, 27 May 2009 17:28:37 +0000 (18:28 +0100)]
[animation] Simplify the Animation code
After long deliberation, the Animation class handling of the
:mode, :duration and :loop properties, as well as the conditions
for creating the Alpha and Timeline instances, came out as far too
complicated for their own good.
This is a rework of the API/parameters matrix and behaviour:
- :mode accessors will create an Alpha, if needed
- :duration and :loop accessors will create an Alpha and a Timeline
if needed
- :alpha will set or unset the Alpha
- :timeline will set or unset the Timeline
Plus, more documentation on the Animation class itself.
Many thanks to Jonas Bonn <jonas@southpole.se> for the feedback
and the ideas.
Emmanuele Bassi [Wed, 27 May 2009 12:01:31 +0000 (13:01 +0100)]
[animatable] Allow validation in ::animate_property
The Animatable interface implementation will always have the computed
value applied, whilst the non-Animatable objects go through the
interval validation first to avoid incurring in assertions and
warnings.
The Animatable::animate_property() should also be able to validate the
property it's supposed to interpolate, and eventually discard it. This
requires adding a return value to the virtual function (and its wrapper
function).
The Animation code will then apply the computed value only if the
animate_property() returns TRUE -- unifying the code path with the
non-Animatable objects.
Emmanuele Bassi [Wed, 27 May 2009 11:12:11 +0000 (12:12 +0100)]
[animation] Proxy properties whenever possible
The Animation class should proxy the :mode, :duration and :loop
properties whenever possible, to avoid them going out of sync when
changed using the Alpha and Timeline instances directly.
Currently, if Timeline:duration is changed, querying Animation:duration
will yield the old value, but the animation itself (being driven by
the Timeline) will use the Timeline's :duration new value. This holds
for the :loop and :mode properties as well.
Instead, the getters for the Animation's :duration, :loop and
:mode properties should ask the relevant object -- if any. The
loop, duration and mode values inside AnimationPrivate should only
be used if no Timeline or no Alpha instances are available, or
when creating new instances.
Emmanuele Bassi [Wed, 27 May 2009 10:52:40 +0000 (11:52 +0100)]
[animation] Defer the timeline handling to the Alpha
The Animation should not directly manipulate a Timeline instance,
but it should defer to the Alpha all handling of the timeline.
This means that:
- set_duration() and set_loop() will either create a Timeline or
will set the :duration and :loop properties on the Timeline; if
the Timeline must be created, and no Alpha instance is available,
then a new Alpha instance will be created as well and the newly
create Timeline will be assigned to the Alpha
- if set_mode() on an Animation instance without an Alpha, the
Alpha will be created; a Timeline will also be created
- set_alpha() will replace the Alpha; if the new Alpha does not
have a Timeline associated then a Timeline will be created using
the current :duration and :loop properties of Animation; otherwise,
if the replaced Alpha had a timeline, the timeline will be
transferred to the new one
Emmanuele Bassi [Tue, 26 May 2009 16:23:24 +0000 (17:23 +0100)]
[build] Decouple COGL debug level from Clutter's
Using --enable-debug, which controls Clutter's debug level, also
defines COGL_ENABLE_DEBUG. This should be left to --enable-cogl-debug
instead, since it's the configure switch that controls COGL debug
level.
Emmanuele Bassi [Mon, 25 May 2009 16:16:44 +0000 (17:16 +0100)]
[doap] Update
Long overdue update of the DOAP file for Clutter
* Repository update
* Add authors
Emmanuele Bassi [Mon, 25 May 2009 15:52:53 +0000 (16:52 +0100)]
[build] More spring clean fixes
* Remove the last if...fi with AS_IF
* Put back the regexp for the mingw32 check that commit
0d1c626a
inadvertedly removed
Emmanuele Bassi [Mon, 25 May 2009 13:04:53 +0000 (14:04 +0100)]
[build] Spring cleanup of configure.ac
Let's try to bring configure.ac into this century, shall we?
* Use the proper shell macros AS_IF and AS_CASE instead of if...fi
and case...esac
* Check for X11 and relative extensions only when building for GLX
and EGLX backends
* Add documentation on the behaviour of binary_age and interface_age
* Coalesce all the common checks to avoid redundancy
* Escape everything that requires escaping
Emmanuele Bassi [Mon, 25 May 2009 11:42:17 +0000 (12:42 +0100)]
Use GLib variant of strcasecmp()
The GLib version of strcasecmp() ignores any non-ASCII character,
unlike the original which is locale-dependent.
Emmanuele Bassi [Mon, 25 May 2009 11:41:16 +0000 (12:41 +0100)]
[build] Clean up cogl-pango Makefile
Emmanuele Bassi [Sat, 23 May 2009 18:18:18 +0000 (19:18 +0100)]
[cogl] Remove max_waste argument from Texture ctors
The CoglTexture constructors expose the "max-waste" argument for
controlling the maximum amount of wasted areas for slicing or,
if set to -1, disables slicing.
Slicing is really relevant only for large images that are never
repeated, so it's a useful feature only in controlled use cases.
Specifying the amount of wasted area is, on the other hand, just
a way to mess up this feature; 99% the times, you either pull this
number out of thin air, hoping it's right, or you try to do the
right thing and you choose the wrong number anyway.
Instead, we can use the CoglTextureFlags to control whether the
texture should not be sliced (useful for Clutter-GST and for the
texture-from-pixmap actors) and provide a reasonable value for
enabling the slicing ourself. At some point, we might even
provide a way to change the default at compile time or at run time,
for particular platforms.
Since max_waste is gone, the :tile-waste property of ClutterTexture
becomes read-only, and it proxies the cogl_texture_get_max_waste()
function.
Inside Clutter, the only cases where the max_waste argument was
not set to -1 are in the Pango glyph cache (which is a POT texture
anyway) and inside the test cases where we want to force slicing;
for the latter we can create larger textures that will be bigger than
the threshold we set.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>
Emmanuele Bassi [Mon, 30 Mar 2009 12:49:03 +0000 (13:49 +0100)]
Add repaint functions
Sometimes it is necessary for third party code to have a
function called during the redraw process, so that you can
update the scenegraph before it is painted.
Emmanuele Bassi [Sat, 23 May 2009 18:32:24 +0000 (19:32 +0100)]
[git ignore] Add test-text-perf
Emmanuele Bassi [Fri, 22 May 2009 11:00:33 +0000 (12:00 +0100)]
Merge branch 'master' into 1.0-integration
* master:
[cogl-vertex-buffer] Ensure the clip state before rendering
[test-text-perf] Small fix-ups
Add a test for text performance
[build] Ensure that cogl-debug is disabled by default
[build] The cogl GE macro wasn't passing an int according to the format string
Use the right internal format for GL_ARB_texture_rectangle
[actor_paint] Ensure painting is a NOP for actors with opacity = 0
Make backface culling work with vertex buffers
Neil Roberts [Fri, 22 May 2009 10:41:02 +0000 (11:41 +0100)]
[cogl-vertex-buffer] Ensure the clip state before rendering
Before any rendering is done by Cogl it needs to ensure the clip stack
is set up correctly by calling cogl_clip_ensure. This was not being
done for the Cogl vertex buffer so it would still use the clip from
the previous render.
Damien Lespiau [Fri, 22 May 2009 00:23:29 +0000 (01:23 +0100)]
[texture] size-change closure is now VOID:FLOAT,FLOAT
Now that everything is float, the marsharlling function of the
size-change signal should reflect that fact.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Neil Roberts [Thu, 21 May 2009 16:43:41 +0000 (17:43 +0100)]
[test-text-perf] Small fix-ups
- Fix a typo in a for loop in create_label which left 'i'
uninitialised and caused a crash if you're unlucky.
- Set the CLUTTER_VBLANK=none environment variable.
- Don't quit on a keypress.
- Trailing whitespace tidy up.
Owen W. Taylor [Sun, 23 Nov 2008 00:26:56 +0000 (19:26 -0500)]
Add a test for text performance
Add tests/test-text-perf, which allows testing text performance as
a function of the length of text strings and font size.
Neil Roberts [Thu, 21 May 2009 15:51:16 +0000 (16:51 +0100)]
Merge branch 'pango-vbo' into 1.0-integration
This makes it cache the geometry of PangoLayouts into a VBO as
described in bug #1572.
Neil Roberts [Thu, 21 May 2009 14:49:14 +0000 (15:49 +0100)]
[cogl-pango-display-list] Use GL_TRIANGLES under GLES
GLES doesn't support GL_QUADS. This patch makes it use GL_TRIANGLES
instead in that case. Unfortunately this means submitting two extra
vertices per quad. It could be better to use indexed elements once
CoglVertexBuffers gains support for that.
Robert Bragg [Thu, 21 May 2009 14:25:31 +0000 (15:25 +0100)]
[build] Ensure that cogl-debug is disabled by default
The new cogl-debug option was accidentally being enabled by default since
configure.ac checked the 'default_enable' variable not 'cogl_default_enable'
Robert Bragg [Thu, 21 May 2009 14:04:38 +0000 (15:04 +0100)]
[build] The cogl GE macro wasn't passing an int according to the format string
This patch simply updates the arguments passed to g_warning inline with the
given format string.
Owen W. Taylor [Thu, 7 May 2009 03:35:01 +0000 (23:35 -0400)]
Use the right internal format for GL_ARB_texture_rectangle
When ClutterGLXTexturePixmap uses GL_ARB_texture_rectangle,
it needs to pass the right internal format (GL_RGB or GL_RGBA)
when it initializes the texture with glTexImage2D() or later
handling won't recognize the alpha channel.
http://bugzilla.openedhand.com/show_bug.cgi?id=1586
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Robert Bragg [Wed, 20 May 2009 16:55:29 +0000 (17:55 +0100)]
[actor_paint] Ensure painting is a NOP for actors with opacity = 0
Since it is convenient to use geometry with an opacity of 0 for input only
purposes it's a worthwhile optimization to avoid submitting anything
for such actors while painting.
Neil Roberts [Thu, 21 May 2009 13:56:38 +0000 (14:56 +0100)]
Make backface culling work with vertex buffers
Backface culling is enabled as part of cogl_enable so the different
rendering functions in Cogl need to explicitly opt-in to have backface
culling enabled. Cogl vertex buffers should allow backface culling so
they should check whether it is enabled and then set the appropriate
cogl_enable flag.
Neil Roberts [Thu, 21 May 2009 11:17:12 +0000 (12:17 +0100)]
[pango-render] Keep a reference to the first line to detect layout changes
In order to cope with the situation where an application renders with
a PangoLayout, makes some changes and then renders again with the same
layout, CoglPangoRenderer needs to detect that the changes have
occured so that it can recreate the display list. This is acheived by
keeping a reference to the first line of the layout. When the layout
is changed Pango will clear the layout pointer in the first line and
create a new line. So if the layout pointer in the line becomes NULL
then we know the layout has changed. This trick was suggested by
Behdad Esfahbod in this email:
http://mail.gnome.org/archives/gtk-i18n-list/2009-May/msg00019.html
Neil Roberts [Thu, 21 May 2009 11:09:16 +0000 (12:09 +0100)]
[cogl-pango-render] Fix the positioning when calling cogl_pango_render_layout
When a position is given to cogl_pango_render_layout_subpixel it
translates the GL matrix by the coordinates. However it was not
dividing by PANGO_SCALE so the coordinates were completely wrong.
Emmanuele Bassi [Wed, 20 May 2009 16:38:58 +0000 (17:38 +0100)]
[texture] Use a box instead of int coordinates
Most of the operations involving the texture's allocated area require
floats -- either for computations or for setting the geometry into
COGL. So it doesn't make any sense to use get_allocation_coords() and
cast everything to floats.
Emmanuele Bassi [Wed, 20 May 2009 16:26:39 +0000 (17:26 +0100)]
[actor] Do not try to dereference NULL data
If the shader_data bound to an Actor is NULL we should not try to access
its members.
Emmanuele Bassi [Wed, 20 May 2009 15:49:22 +0000 (16:49 +0100)]
Merge commit 'origin/master' into 1.0-integration
Conflicts:
clutter/clutter-texture.c
clutter/cogl/gl/cogl-fbo.c
Emmanuele Bassi [Wed, 20 May 2009 15:06:09 +0000 (16:06 +0100)]
Add more padding in Model and ModelIter classes
ClutterModel and ClutterModelIter have 4 padding slots, but if they
have to survive the 1.x API cycle they will need at least twice that
amount.
Emmanuele Bassi [Wed, 20 May 2009 14:15:25 +0000 (15:15 +0100)]
[cogl] Do no include gprintf.h
We are not using any of the g_printf* family of functions, so we
can import glib.h instead.
Emmanuele Bassi [Tue, 19 May 2009 15:00:18 +0000 (16:00 +0100)]
[cogl] Move debugging to a configure-time switch
Currently, COGL depends on defining debug symbols by manually
modifying the source code. When it's done, it will forcefully
print stuff to the console.
Since COGL has also a pretty, runtime selectable debugging API
we might as well switch everything to it.
In order for this to happen, configure needs a new:
--enable-cogl-debug
command line switch; this will enable COGL debugging, the
CoglHandle debugging and will also turn on the error checking
for each GL operation.
The default setting for the COGL debug defines is off, since
it slows down the GL operations; enabling it for a particular
debug build is trivial, though.
Emmanuele Bassi [Tue, 19 May 2009 13:44:29 +0000 (14:44 +0100)]
[cogl] Rework the debug messages
COGL has a debug message system like Clutter's own. In parallel,
it also uses a coupld of #defines. Spread around there are also
calls to printf() instead to the more correct g_log* wrappers.
This commit tries to unify and clean up the macros and the
debug message handling inside COGL to be more consistent.
Emmanuele Bassi [Tue, 19 May 2009 13:42:37 +0000 (14:42 +0100)]
Remove duplicate cogl-internal.h header
The cogl-internal.h header has been moved inside cogl/common in
commit
8a1b4f8326 but has been left behind inside cogl/gl and
cogl/gles.
Emmanuele Bassi [Tue, 19 May 2009 11:51:29 +0000 (12:51 +0100)]
[texture] Add missing accessors
ClutterTexture has many properties that can only be accessed using
the GObject API. This is fairly inefficient and makes binding the
class overly complicated.
The Texture class should have accessor methods for all its properties,
properly documented.
Emmanuele Bassi [Mon, 18 May 2009 18:38:03 +0000 (19:38 +0100)]
[cogl] Rework the GL-error-to-string conversion
The code for the conversion of the GL error enumeration code
into a string is not following the code style and conventions
we follow in Clutter and COGL.
The GE() macro is also using fprintf(stderr) directly instead
of using g_warning() -- which is redirectable to an alternative
logging system using the g_log* API.
Emmanuele Bassi [Tue, 19 May 2009 11:53:37 +0000 (12:53 +0100)]
[gitignore] Add more gtk-doc droppings
Emmanuele Bassi [Thu, 14 May 2009 22:23:00 +0000 (23:23 +0100)]
[build] Link Cogl against -lm
We use math routines inside Cogl, so it's correct to have it in
the LIBADD line. In normal usage something else was pulling in
-lm, but the introspection is relying on linking against the
convenience library.
Based on a patch by: Colin Walters <walters@verbum.org>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Thu, 14 May 2009 18:51:03 +0000 (19:51 +0100)]
[build] List cogl-internal.h
During the Makefile clean up, cogl-internal.h got lost and this
broke the dist. Let's put it back in.
Emmanuele Bassi [Thu, 7 May 2009 17:39:07 +0000 (18:39 +0100)]
[animation] Do not leak timelines
The timeline created when calling set_timeline(NULL) is referenced
even though we implicitly own it. When the Animation is destroyed,
the timeline is then leaked.
Thanks to: Richard Heatley <richard.heatley@starleaf.com>
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1548
Emmanuele Bassi [Wed, 6 May 2009 16:18:12 +0000 (17:18 +0100)]
[text] Expose position_to_coords()
The clutter_text_position_to_coords() is useful for ClutterText
subclasses.
See bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1521
Based on a patch by: Raymond Liu <raymond.liu@intel.com>
Emmanuele Bassi [Wed, 6 May 2009 16:08:25 +0000 (17:08 +0100)]
[text] Add ClutterText::delete_selection()
Add a method for deleting the current selection inside a Text actor.
This is useful for subclasses.
See bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1521
Based on a patch by: Raymond Liu <raymond.liu@intel.com>
Emmanuele Bassi [Wed, 6 May 2009 16:01:44 +0000 (17:01 +0100)]
[animation] Remove InitiallyUnowned from Animation
ClutterAnimation currently inherits the initial floating reference
semantics from GInitiallyUnowned. An Animation is, though, meant to
be used as a top-level object, like a Timeline or a Behaviour, and
not "owned" by another object. For this reason, the initial floating
reference does not make any sense.
Emmanuele Bassi [Wed, 6 May 2009 15:43:52 +0000 (16:43 +0100)]
[docs] Add Animation get_type() function
We need to reference clutter_animation_get_type() if we want the
properties, signals and object hierarchy to show up in the API
reference
Emmanuele Bassi [Wed, 6 May 2009 15:42:57 +0000 (16:42 +0100)]
[docs] Document the destructor for Timeline
The rest of the API reference lists the destructor for the class
inside the constructor's return value -- except Timeline.
Dan Winship [Thu, 14 May 2009 13:28:12 +0000 (09:28 -0400)]
[cairo-texture] Document redrawing behavior
Document that repeated calls to clutter_cairo_texture_create()
continue drawing on the same cairo_surface_t. Add
clutter_cairo_texture_clear() for when you don't want that behavior.
http://bugzilla.openedhand.com/show_bug.cgi?id=1599
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Thomas Wood [Thu, 14 May 2009 14:08:31 +0000 (15:08 +0100)]
[text] fix problems with scrolling interaction
The cursor x position is already translated, so we do not need to take the
actors allocation into account when calculating scrolling.
Additionally, we need to update the text_x value before running
clutter_text_ensure_cursor_position.
Thomas Wood [Thu, 14 May 2009 12:31:51 +0000 (13:31 +0100)]
[text] scroll to the cursor position if it is outside the allocation
Adjust the text offset to keep the cursor within the allocation. This means
the text will scroll per character
Thomas Wood [Thu, 14 May 2009 09:55:25 +0000 (10:55 +0100)]
[text] account for scrolling in text selections
Account for any scrolling offset in single line mode when calculating the
area that should be selected.
Thomas Wood [Thu, 14 May 2009 09:53:44 +0000 (10:53 +0100)]
[text] account for scrolling in clutter_text_position_to_coords
Add any scrolling offset to the x value when in single line mode.
Now that the offset is taken into account in the position_to_coords
function, we do not need to adjust the cursor x manually in
clutter_text_paint.
Thomas Wood [Thu, 14 May 2009 09:51:58 +0000 (10:51 +0100)]
[text] take scrolling into account when calculating cursor position
Account for the scrolling in single line more when calculating the cursor
position from coordinates.
Thomas Wood [Thu, 14 May 2009 09:17:24 +0000 (10:17 +0100)]
[text] position the cursor correctly in single line mode
The position of the text should be increased by the value of TEXT_PADDING
and the cursor offset by the same value as the text offset.
Thomas Wood [Thu, 14 May 2009 08:53:41 +0000 (09:53 +0100)]
[text] take text padding into account when in single line mode
In single line mode, extra padding is added to the text which must be
taken into account when reporting the natural size of the actor.
Emmanuele Bassi [Thu, 14 May 2009 11:05:57 +0000 (12:05 +0100)]
[tests] Verify cursor position
Print out the cursor and selection positions in order to verify
the behaviour of the Text actor.
This is a likely candidate for a conformance test unit as well.
Emmanuele Bassi [Thu, 14 May 2009 11:00:51 +0000 (12:00 +0100)]
[text] Maintain the cursor at the end when deleting
If the cursor is already at the end of the Text contents then we
need to maintain its position when deleting the previous character
using the relative key binding.
Emmanuele Bassi [Thu, 14 May 2009 10:50:42 +0000 (11:50 +0100)]
[text] Reset the cursor when setting empty text
When setting the contents of Text to an empty string we should
reset the cursor position and selection bound to -1.
Emmanuele Bassi [Thu, 14 May 2009 09:02:06 +0000 (10:02 +0100)]
[build] Fix with --disable-introspection
The required "fake" libclutter-cogl.la upon with the main clutter
shared object depends is only built with introspection enabled
instead of being built unconditionally.
Emmanuele Bassi [Thu, 14 May 2009 07:32:46 +0000 (08:32 +0100)]
[build] Do not rebuild the conformance tests scripts
Make the build output a little bit cleaner by not re-creating the
small shell scripts that allow launching the test units separately.
Owen W. Taylor [Wed, 13 May 2009 22:14:24 +0000 (23:14 +0100)]
Don't build Cogl.gir against installed Clutter library
Passing:
--library=clutter-@CLUTTER_FLAVOUR@-@CLUTTER_API_VERSION@
to g-ir-scanner, when building Cogl was causing g-ir-scanner to
link the introspection program against the installed clutter library,
if it existed or fail otherwise. Instead copy the handling from
the json/ directory where we link against the convenience library
to scan, and do the generation of the typelib later in the
main clutter/directory.
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1594
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Wed, 13 May 2009 22:04:25 +0000 (23:04 +0100)]
[text] Return the correct minimum height
If text is set, ClutterText should never return less than the layout
height for minimum and preferred heights.
This holds unless ellipsize and wrap are enabled, in which case the
minimum height should be the height of the first line -- which is
the height needed to at the very least show the ellipsization.
Based on a patch by: Thomas Wood <thomas@openedhand.com>
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1598
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Wed, 13 May 2009 21:21:48 +0000 (22:21 +0100)]
[backend] Abstract the GL context creation
This is the another step into abstracting the backend operations
that are currently spread all across the board back into the
backend implementations where they belong.
The GL context creation, for instance, is demanded to the stage
realization which makes it a critical path for every operation
that is GL-context bound. This usually does not make any difference
since we realize the default stage, but at some point we might
start looking into avoiding the default stage realization in order
to make the Clutter startup faster.
It also makes the code maintainable because every part is self
contained and can be reworked with the minimum amount of pain.
Emmanuele Bassi [Wed, 13 May 2009 21:20:19 +0000 (22:20 +0100)]
Update the redraw priority
The master clock is using the redraw priority to create the source
that will be used to spin the paint sequence if something is being
animated using a timeline.
Unfortunately, the priority is too high and this causes starvation
when embedding into other toolkits -- like gtk+.
Thanks to Havoc Pennington for catching this.
Emmanuele Bassi [Wed, 13 May 2009 20:49:45 +0000 (21:49 +0100)]
[x11] Abstract XVisualInfo creation
The XVisualInfo for GL is created when a stage is being realized.
When embedding Clutter inside another toolkit we might not want to
realize a stage to extract the XVisualInfo, then set the stage
window using a foreign X Window -- which will cause a re-realization.
Instead, we should abstract as much as possible into the X11 backend.
Unfortunately, the XVisualInfo for GL is requested using GLX API; for
this reason we have to create a ClutterBackendX11 method that we
override inside the ClutterBackendGLX implementation.
This also allows us to move a little bit of complexity from out of
the stage realization, which is currently a very delicate and hard
to debug section.
Robert Bragg [Wed, 13 May 2009 11:11:54 +0000 (12:11 +0100)]
[text] Ensure clutter_text_get_selection copes with start/end positions of -1
I was seeing clutter_text_get_selection trying to malloc up to 4Gb due to
unexpected negative arithmetic for the start/end offsets which resulted
in a crash.
This just tests for positions of -1 before deciding if the start/end
positions need to be swapped. The conversion from position to byte offset
already works with -1.
Emmanuele Bassi [Tue, 12 May 2009 18:22:25 +0000 (19:22 +0100)]
[tests] Add command line option to the picking test
The picking test has two configurables: the number of actors and
the number of events per frame. It makes sense to have them as
command line options to test with multiple configurations without
having to change defines and recompile.
Owen W. Taylor [Sun, 10 May 2009 00:09:42 +0000 (20:09 -0400)]
Fix chain-up in clutter_list_model_dispose()
Chain up to parent class's dispose() method not parent class's
finalize() method.
http://bugzilla.openedhand.com/show_bug.cgi?id=1595
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Chris Lord [Tue, 12 May 2009 15:17:51 +0000 (16:17 +0100)]
[tests/micro-bench] Add a picking performance test
Approved by Robert Bragg.
Robert Bragg [Tue, 12 May 2009 00:02:25 +0000 (01:02 +0100)]
[picking] Use cogl_clip_push_window_rect to greatly reduce the cost of picking.
cogl_clip_push_window_rect is implemented using GPU scissoring which allows
the GPU to cull anything that falls outside a given rectangle. Since in the
case of picking we only ever care about a single pixel we can get the GPU to
ignore all geometry that doesn't intersect that pixel and only rasterize for
one pixel.
Robert Bragg [Fri, 8 May 2009 15:32:01 +0000 (16:32 +0100)]
[cogl-clip-stack] Support pushing rectangles onto the stack using window coords
Previously clipping could only be specified in object coordinates, now
rectangles can also be pushed in window coordinates.
Internally rectangles pushed this way are intersected and then clipped using
scissoring. We also transparently try to convert rectangles pushed in
object coordinates into window coordinates as we anticipate the scissoring
path will be faster then the clip planes and undoubtably it will be faster
than using the stencil buffer.
Neil Roberts [Tue, 12 May 2009 14:36:16 +0000 (15:36 +0100)]
Don't clear the stencil buffer before painting and picking
The stencil buffer is always cleared the first time a clip is used
that needs it and the stencil test is disabled otherwise so there is
no need to clear before a paint.
Robert Bragg [Tue, 12 May 2009 13:15:18 +0000 (14:15 +0100)]
[cogl] Remove the COGL{enum,int,uint} typedefs
COGLenum, COGLint and COGLuint which were simply typedefs for GL{enum,int,uint}
have been removed from the API and replaced with specialised enum typedefs, int
and unsigned int. These were causing problems for generating bindings and also
considered poor style.
The cogl texture filter defines CGL_NEAREST and CGL_LINEAR etc are now replaced
by a namespaced typedef 'CoglTextureFilter' so they should be replaced with
COGL_TEXTURE_FILTER_NEAREST and COGL_TEXTURE_FILTER_LINEAR etc.
The shader type defines CGL_VERTEX_SHADER and CGL_FRAGMENT_SHADER are handled by
a CoglShaderType typedef and should be replaced with COGL_SHADER_TYPE_VERTEX and
COGL_SHADER_TYPE_FRAGMENT.
cogl_shader_get_parameteriv has been replaced by cogl_shader_get_type and
cogl_shader_is_compiled. More getters can be added later if desired.
Robert Bragg [Tue, 12 May 2009 13:20:22 +0000 (14:20 +0100)]
[ClutterTexture] Remove a spurious line I accidentally committed in
741c4bb5
I accidentally changed clutter_texture_set_cogl_texture to always set the
filter quality for the new Cogl texture to medium.
Robert Bragg [Wed, 6 May 2009 18:01:09 +0000 (19:01 +0100)]
Don't call glFinish in _clutter_do_pick
Calling glReadPixels is bad enough in forcing us to synchronize the CPU with
the GPU, but glFinish has even stronger synchonization semantics than
glReadPixels which may negate some driver optimizations possible in
glReadPixels.
Neil Roberts [Tue, 12 May 2009 13:15:37 +0000 (14:15 +0100)]
[build] Fix out-of-tree builds for Cogl
Commit
43fa38fcf5 broke out-of-tree builds by removing some of the
builddir directories from the include path. builddir/clutter/cogl and
builddir/clutter are needed because cogl.h and cogl-defines-gl.h are
automatically generated by the configure script. The main clutter
headers are in the srcdir so this needs to be in the path too.
Raymond Liu [Thu, 7 May 2009 10:20:19 +0000 (18:20 +0800)]
Emit key focus signal when stage state changes
When the stage state changes between active/deactive, send out
key-focus-in/key-focus-out signal for the current key focused
actor on the stage.
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1503
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Mon, 11 May 2009 17:17:30 +0000 (18:17 +0100)]
[x11] Unset the GL context when re-realizing
Setting the stage window using the set_stage_foreign() method will
lead to a re-realization. We need to make sure that the Drawable
currently associated to the GL context is set to None, to avoid a
BadDrawable error or, if we're unlucky, a segfault in the X server.
Emmanuele Bassi [Mon, 11 May 2009 11:36:14 +0000 (12:36 +0100)]
Add more debugging notes
Emmanuele Bassi [Mon, 11 May 2009 11:36:55 +0000 (12:36 +0100)]
[backend] Unset the current stage if it is unrealized
This commit reverts part of commit
5bcde25c - specifically the
part that forced a realization of the stage if we are ensuring
the GL context with it. This makes Clutter behave like it did
prior to commit
5bcde25c: if we are asked to ensure the GL context
with an unrealized stage we simply pass NULL to the backend
implementation.
Emmanuele Bassi [Mon, 11 May 2009 11:43:37 +0000 (12:43 +0100)]
[stage] Chain up ::show before showing the implementation
When showing a Stage for the first time we end up realizing the stage
implementation before realizing the wrapper. This leads to segmentation
faults or errors coming from the backend because we're fumbling the
state and realization sequence.
Emmanuele Bassi [Mon, 11 May 2009 11:39:46 +0000 (12:39 +0100)]
[x11] Do not needlessly check XVisualInfo
Since we are destroying any previously set VisualInfo we keep we know
for sure that stage->xvisinfo is going to be None; hence, no reason to
check this condition.
Emmanuele Bassi [Mon, 11 May 2009 11:43:56 +0000 (12:43 +0100)]
[actor] Conditionally verify the map state
The verify_map_state() internal method is conditionally compiled
if we have CLUTTER_ENABLE_DEBUG set; for this reason, all calls to
that method should be made conditional.
Emmanuele Bassi [Sat, 9 May 2009 23:41:17 +0000 (00:41 +0100)]
[build] Unbreak compilation
When building Clutter with introspection enabled everything stops
at Cogl GIR generation because it depends on the installed library
to work. Since we still require some changes in the API to be able
to build the GIR and the typelib for Cogl we should disable the
generation of the GIR as well.
Emmanuele Bassi [Fri, 8 May 2009 16:17:48 +0000 (17:17 +0100)]
Tentative fix for multi-stage support on GLX
The fix for bug 1138 broke multi-stage support on GLX, causing
X11 to segfault with the following stack trace:
Backtrace:
0: /usr/X11R6/bin/X(xf86SigHandler+0x7e) [0x80c91fe]
1: [0xb7eea400]
2: /usr/lib/xorg/modules/extensions//libglx.so [0xb7ae880c]
3: /usr/lib/xorg/modules/extensions//libglx.so [0xb7aec0d6]
4: /usr/X11R6/bin/X [0x8154c24]
5: /usr/X11R6/bin/X(Dispatch+0x314) [0x808de54]
6: /usr/X11R6/bin/X(main+0x4b5) [0x8074795]
7: /lib/i686/cmov/libc.so.6(__libc_start_main+0xe5) [0xb7c75775]
8: /usr/X11R6/bin/X(FontFileCompleteXLFD+0x21d) [0x8073a81]
which I can only track down to clutter_backend_glx_ensure_current()
being passed a NULL stage -- something that happens when a stage
is not correct realized. That should lead to a glXMakeCurrent(None)
and not to a segmentation fault, though.
Emmanuele Bassi [Fri, 8 May 2009 16:14:49 +0000 (17:14 +0100)]
[actor] Relax some of the invariants checks
When destroying a top-level actor we can actually relax the verification
of the map state, since it might be fully asynchronous and we might not
re-enter inside the mainloop in time to receive the unmap notification.
Rob Bradford [Fri, 8 May 2009 09:57:56 +0000 (10:57 +0100)]
[list-model] Return NULL for first row in a fully filtered model
If the filter means that the there should be no rows left in the model,
clutter_model_get_iter_at_row (model, 0) should return NULL.
Howevever the currene implementation misbehaves and returns a bad iterator.
This change resolves the issue by tracking if we actually found any
non-filtered rows in our pass through the sequence.
OH Bugzilla: 1591
Emmanuele Bassi [Thu, 7 May 2009 18:14:48 +0000 (19:14 +0100)]
[stage] Chain up to the correct vfunc when picking
The stage is chaining up to the ClutterGroup::paint instead of
the ClutterGroup::pick method. This works anyway because we
detect the stage by default, but it's not a reliable solution
in case we decide to change the picking further on.
Emmanuele Bassi [Thu, 7 May 2009 18:14:29 +0000 (19:14 +0100)]
[debug] Show the actor name/type on queue_redraw()
Emmanuele Bassi [Thu, 7 May 2009 18:07:21 +0000 (19:07 +0100)]
[clock] Rework the master clock
The master clock is currently advanced using a frame source driven
by the default frame rate. This breaks the sync to vblank because
the vblanking rate could be different than 60 Hz -- or it might be
completely disabled (e.g. with CLUTTER_VBLANK=none).
We should be using the main loop to check if we have timelines
playing, and if so queue a redraw on the stages we own.
We should also prepare the subsequent frame at the end of the redraw
process, so if there are new redraw we will have the scene already
in place.
This makes Clutter redraw at the maximum frame rate, which is
limited by the vblanking frequency.
Emmanuele Bassi [Thu, 7 May 2009 17:47:50 +0000 (18:47 +0100)]
[group] Implement pick
Currently, picking in ClutterGroup pollutes the CLUTTER_DEBUG=paint
logs since it just calls the paint function. Reimplementing the pick
doesn't make us lose anything -- it might even be slightly faster
since we don't have to do a (typed) cast and a class dereference.
Emmanuele Bassi [Thu, 7 May 2009 17:39:07 +0000 (18:39 +0100)]
[animation] Do not leak timelines
The timeline created when calling set_timeline(NULL) is referenced
even though we implicitly own it. When the Animation is destroyed,
the timeline is then leaked.
Thanks to: Richard Heatley <richard.heatley@starleaf.com>
Fixes bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1548