profile/ivi/clutter.git
15 years agoMake backface culling work with vertex buffers
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.

15 years agoAdd more padding in Model and ModelIter classes
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.

15 years ago[cogl] Do no include gprintf.h
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.

15 years ago[cogl] Move debugging to a configure-time switch
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.

15 years ago[cogl] Rework the debug messages
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.

15 years agoRemove duplicate cogl-internal.h header
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.

15 years ago[texture] Add missing accessors
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.

15 years ago[cogl] Rework the GL-error-to-string conversion
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.

15 years ago[gitignore] Add more gtk-doc droppings
Emmanuele Bassi [Tue, 19 May 2009 11:53:37 +0000 (12:53 +0100)]
[gitignore] Add more gtk-doc droppings

15 years ago[build] Link Cogl against -lm
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>
15 years ago[build] List cogl-internal.h
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.

15 years ago[animation] Do not leak timelines
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

15 years ago[text] Expose position_to_coords()
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>

15 years ago[text] Add ClutterText::delete_selection()
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>

15 years ago[animation] Remove InitiallyUnowned from Animation
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.

15 years ago[docs] Add Animation get_type() function
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

15 years ago[docs] Document the destructor for Timeline
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.

15 years ago[cairo-texture] Document redrawing behavior
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>
15 years ago[text] fix problems with scrolling interaction
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.

15 years ago[text] scroll to the cursor position if it is outside the allocation
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

15 years ago[text] account for scrolling in text selections
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.

15 years ago[text] account for scrolling in clutter_text_position_to_coords
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.

15 years ago[text] take scrolling into account when calculating cursor position
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.

15 years ago[text] position the cursor correctly in single line mode
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.

15 years ago[text] take text padding into account when in single line mode
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.

15 years ago[tests] Verify cursor position
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.

15 years ago[text] Maintain the cursor at the end when deleting
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.

15 years ago[text] Reset the cursor when setting empty text
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.

15 years ago[build] Fix with --disable-introspection
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.

15 years ago[build] Do not rebuild the conformance tests scripts
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.

15 years agoDon't build Cogl.gir against installed Clutter library
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>
15 years ago[text] Return the correct minimum height
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>
15 years ago[text] Ensure clutter_text_get_selection copes with start/end positions of -1
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.

15 years ago[tests] Add command line option to the picking test
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.

15 years agoFix chain-up in clutter_list_model_dispose()
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>
15 years ago[tests/micro-bench] Add a picking performance test
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.

15 years ago[picking] Use cogl_clip_push_window_rect to greatly reduce the cost of picking.
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.

15 years ago[cogl-clip-stack] Support pushing rectangles onto the stack using window coords
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.

15 years agoDon't clear the stencil buffer before painting and picking
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.

15 years ago[cogl] Remove the COGL{enum,int,uint} typedefs
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.

15 years ago[ClutterTexture] Remove a spurious line I accidentally committed in 741c4bb5
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.

15 years agoDon't call glFinish in _clutter_do_pick
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.

15 years ago[build] Fix out-of-tree builds for Cogl
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.

15 years ago[build] Unbreak compilation
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.

15 years ago[list-model] Return NULL for first row in a fully filtered model
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

15 years ago[x11] Use -1 as the default screen guard
Emmanuele Bassi [Wed, 6 May 2009 17:32:17 +0000 (18:32 +0100)]
[x11] Use -1 as the default screen guard

Currently, the default screen guard value is 0, which is a valid
screen number on X11, and it might not be the default.

Patch suggested by: Owen W. Taylor <otaylor@redhat.com>

15 years ago[build] Build Cogl introspection data
Emmanuele Bassi [Wed, 6 May 2009 10:18:31 +0000 (11:18 +0100)]
[build] Build Cogl introspection data

Currently, the introspection data for Cogl is built right into
Clutter's own typelib. This makes functions like:

  cogl_path_round_rectangle()

Appear as:

  Clutter.cogl_path_round_rectangle()

It should be possible, instead, to have a Cogl namespace and:

  Cogl.path_round_rectangle()

This means building introspection data for Cogl alone. Unfortunately,
there are three types defined in Cogl that confuse the introspection
scanner, and make it impossible to build a typelib:

  COGLint
  COGLuint
  COGLenum

These three types should go away before 1.0, substituted by int,
unsigned int and proper enumeration types. For this reason, we can
just set up the GIR build and wait until the last moment to create
the typelib. Once that has been done, we will be able to safely
remove the Cogl API from the Clutter GIR and typelib and let
people import Cogl if they want to use the Cogl API via introspection.

15 years ago[build] Clean up the makefile
Emmanuele Bassi [Wed, 6 May 2009 09:55:17 +0000 (10:55 +0100)]
[build] Clean up the makefile

Split out the files into their own variables to clean up the
Makefile template; also use top_srcdir with the header files
instead of top_builddir.

15 years agoFix inclusion guards and headers
Emmanuele Bassi [Wed, 6 May 2009 09:35:28 +0000 (10:35 +0100)]
Fix inclusion guards and headers

The C++ inclusion guards G_BEGIN_DECLS and G_END_DECLS are
defined by GLib; so we need to include glib.h before using
them.

15 years ago[model] Add a private row mutator to ClutterModelIter
Rob Bradford [Tue, 5 May 2009 19:15:01 +0000 (20:15 +0100)]
[model] Add a private row mutator to ClutterModelIter

When calling clutter_model_iter_next () / clutter_model_iter_prev () we need
to update the row for the iterator. In order to improve the peformance of
iterating this change adds a private row mutator and switches ClutterListModel
to use it.

15 years ago[list-model] Use an internal iterator for comparisons
Rob Bradford [Tue, 5 May 2009 18:39:26 +0000 (19:39 +0100)]
[list-model] Use an internal iterator for comparisons

In order to carry out various comparisons for e.g. identifying the first
iterator in the model we need a ClutterModelIter. This change switches from
creating a new iterator each time to reusing an existing iterator.

15 years ago[cogl-material] Adds a cogl_material_set_color4f convenience function
Robert Bragg [Fri, 1 May 2009 08:53:20 +0000 (09:53 +0100)]
[cogl-material] Adds a cogl_material_set_color4f convenience function

This is simply a wrapper around cogl_color_set_from_4f and
cogl_material_set_color. We already had a prototype for this, it was
an oversight that it wasn't already implemented.

15 years ago[cogl-offscreen] Cleans up the cogl offscreen API and adds documentation
Robert Bragg [Thu, 30 Apr 2009 21:19:43 +0000 (22:19 +0100)]
[cogl-offscreen] Cleans up the cogl offscreen API and adds documentation

There were several functions I believe no one is currently using that were
only implemented in the GL backend (cogl_offscreen_blit_region and
cogl_offscreen_blit) that have simply been removed so we have a chance to
think about design later with a real use case.

There was one nonsense function (cogl_offscreen_new_multisample) that
sounded exciting but in all cases it just returned COGL_INVALID_HANDLE
(though at least for GL it checked for multisampling support first!?)
it has also been removed.

The MASK draw buffer type has been removed. If we want to expose color
masking later then I think it at least would be nicer to have the mask be a
property that can be set on any draw buffer.

The cogl_draw_buffer and cogl_{push,pop}_draw_buffer function prototypes
have been moved up into cogl.h since they are for managing global Cogl state
and not for modifying or creating the actual offscreen buffers.

This also documents the API so for example desiphering the semantics of
cogl_offscreen_new_to_texture() should be a bit easier now.

15 years agoadd cogl_push_draw_buffer() and cogl_pop_draw_buffer()
Havoc Pennington [Fri, 20 Feb 2009 03:37:08 +0000 (22:37 -0500)]
add cogl_push_draw_buffer() and cogl_pop_draw_buffer()

These are necessary if nesting redirections to an fbo,
otherwise there's no way to know how to restore
previous state.

glPushAttrib(GL_COLOR_BUFFER_BIT) would save draw buffer
state, but also saves a lot of other stuff, and
cogl_draw_buffer() relies on knowing about all draw
buffer state changes. So we have to implement a
draw buffer stack ourselves.

Signed-off-by: Robert Bragg <robert@linux.intel.com>
15 years ago[cogl] Only expose CoglBitmap as a CoglHandle
Robert Bragg [Thu, 30 Apr 2009 17:00:22 +0000 (18:00 +0100)]
[cogl] Only expose CoglBitmap as a CoglHandle

It was inconsistent that we exposed the CoglBitmap struct instead of an
opaque CoglHandle.

15 years ago[cogl-material] make _cogl_material_layer_free check for an invalid texture handle
Robert Bragg [Wed, 29 Apr 2009 18:49:09 +0000 (19:49 +0100)]
[cogl-material] make _cogl_material_layer_free check for an invalid texture handle

It is valid in some situations to have a material layer with an invalid texture
handle (e.g. if you setup a texture combine mode before setting the texture)
and so _cogl_material_layer_free needs to check for a valid handle before
attempting to unref it.

15 years ago[cogl] Updates all file headers and removes lots of trailing white space
Robert Bragg [Mon, 27 Apr 2009 14:48:12 +0000 (15:48 +0100)]
[cogl] Updates all file headers and removes lots of trailing white space

Adds missing notices, and ensures all the notices are consistent. The Cogl
blurb also now reads:

 * Cogl
 *
 * An object oriented GL/GLES Abstraction/Utility Layer

15 years ago[cogl] Adds a bitfield argument to cogl_clear for specifying which buffers to clear
Robert Bragg [Fri, 24 Apr 2009 17:09:52 +0000 (18:09 +0100)]
[cogl] Adds a bitfield argument to cogl_clear for specifying which buffers to clear

Redundant clearing of depth and stencil buffers every render can be very
expensive, so cogl now gives control over which auxiliary buffers are
cleared.

Note: For now clutter continues to clear the color, depth and stencil buffer
each paint.

15 years ago[ClutterTexture] Check before unrefing the fbo_handle
Neil Roberts [Thu, 30 Apr 2009 14:00:01 +0000 (15:00 +0100)]
[ClutterTexture] Check before unrefing the fbo_handle

When replacing the fbo_handle with a new handle it first unrefs the
old handle. This was previously a call to cogl_offscreen_unref which
silently ignored attempts to unref COGL_INVALID_HANDLE. However the
new cogl_handle_unref does check for this so we should make sure the
handle is valid to avoid the warning.

15 years ago[ClutterTexture] Attach the FBO texture to a layer in the material
Neil Roberts [Thu, 30 Apr 2009 13:32:19 +0000 (14:32 +0100)]
[ClutterTexture] Attach the FBO texture to a layer in the material

Bug 1565 - test-fbo case failed in many platform

clutter_texture_new_from_actor was broken because it created the FBO
texture but then never attached it to the material so it was never
used for rendering. The old behaviour in Clutter 0.8 was to assign the
texture directly to priv->tex. In 0.9 priv->tex is replaced with
priv->material which has a reference to the tex in layer 0. So putting
the FBO texture directly in layer 0 more closely matches the original
behaviour.

15 years ago[events] Added handling of missing type to clutter_event_get_state
Øyvind Kolås [Thu, 30 Apr 2009 10:54:09 +0000 (11:54 +0100)]
[events] Added handling of missing type to clutter_event_get_state

clutter_event_get_state wasn't returning the state for
CLUTTER_BUTTON_RELEASE, the information was there it just needed to
be returned correctly.

15 years ago[gitignore] Update with the new Model test
Emmanuele Bassi [Wed, 29 Apr 2009 14:41:12 +0000 (15:41 +0100)]
[gitignore] Update with the new Model test

15 years ago[docs] Add ClutterModel::get_filter_set()
Emmanuele Bassi [Wed, 29 Apr 2009 14:40:13 +0000 (15:40 +0100)]
[docs] Add ClutterModel::get_filter_set()

15 years ago[tests] Exercise the Model filtering
Emmanuele Bassi [Wed, 29 Apr 2009 14:39:23 +0000 (15:39 +0100)]
[tests] Exercise the Model filtering

Add a test unit that exercises the ClutterModel iteration API
when there is a filter in place.

15 years ago[model] Rework Model behaviour with a filter
Emmanuele Bassi [Wed, 29 Apr 2009 14:26:05 +0000 (15:26 +0100)]
[model] Rework Model behaviour with a filter

Currently ClutterModel::get_iter_at_row() ignores whether we have
a filter in place. This also extends to the get_n_rows() method.

The more consistent, more intuitive and surely more correct way to
handle a Model with a filter in place is to take into account the
presence of the filter itself -- that is:

  - get_n_rows() should take into account the filter and return the
    number of *filtered* rows

  - get_iter_at_row() should also take the filter into account and
    get the first non-filtered row

These two changes make the ClutterModel with a filter function
behave like a subset of the original Model without a filter in
place.

For instance, given a model with three rows:

  - [row 0]     <does not match filter>
  - [row 1]     <matches filter>
  - [row 2]     <matches filter>
  - [row 3]     <does not match filter>

The get_n_rows() method will return "2", since only two rows will
match the filter; the get_first_iter() method will ask for the
zero-eth row, which will return an iterator pointing to the contents
of row 1 (but the :row property of the iterator will be set to 0);
the get_last_iter() method will ask for the last row, which will
return an iterator pointing to the contents of row 2 (but the :row
property of the iterator will be set to 1).

This changes will hopefully make the Model API more consistent
in its usage whether there is a filter in place or not.

15 years ago[model] Add :filter-set
Emmanuele Bassi [Wed, 29 Apr 2009 14:14:40 +0000 (15:14 +0100)]
[model] Add :filter-set

Currently, there is no way for implementations of the ClutterModel
abstract class to know whether there is a filter in place. Since
subclasses might implement some optimization in case there is no
filter present, we need a simple (and public) API to ask the model
itself.

15 years ago[ClutterText] Fix actors with a width but no wrapping and the wrap modes
Neil Roberts [Tue, 21 Apr 2009 13:15:19 +0000 (14:15 +0100)]
[ClutterText] Fix actors with a width but no wrapping and the wrap modes

Setting the wrap mode on the PangoLayout seems to have disappeared
during the text-actor-layout-height branch merge so this brings it
back. The test for this in test-text-cache no longer needs to be
disabled.

We also shouldn't set the width on the layout if there is no wrapping
or ellipsizing because otherwise it implicitly enables wrapping. This
only matters if the actor gets allocated smaller than its natural
size.

15 years ago[docs] Increase verbosity for commit messages
Emmanuele Bassi [Thu, 23 Apr 2009 10:38:58 +0000 (11:38 +0100)]
[docs] Increase verbosity for commit messages

Apparently, not everyone read the HACKING file, especially the
section about commit messages. This lead to some confusion with
regards to the acceptable (i.e. mandatory) format for commit
messages in Clutter. Let's clarify it a little bit before I start
enforcing it and reverting commits.

15 years ago[alpha] Sanitize easing equations
Emmanuele Bassi [Thu, 23 Apr 2009 10:35:10 +0000 (11:35 +0100)]
[alpha] Sanitize easing equations

Bug 1561 - Bad code in clutter-alpha.c

The implementation of the easing modes equations followed closely
the JavaScript and ActionScript counterparts. Obviously, JS and AS
are not C-compatible, so later versions of gcc (4.4.0 for instance)
would complain about uninitialized variables and such. The code is
also obfuscated and hard to debug/understand.

For these reasons, the implementation should be unobfuscated and
sanitized.

15 years ago[x11-texture-pixmap] Fixes a reported lockup due to an undesireable X server grab
Robert Bragg [Fri, 17 Apr 2009 18:05:21 +0000 (19:05 +0100)]
[x11-texture-pixmap] Fixes a reported lockup due to an undesireable X server grab

A lockup was reported by fargoilas on #clutter and removing the server grab in
clutter_x11_texture_pixmap_sync_window fixed the problem.

We were doing an x server grab to guarantee that if the XGetWindowAttributes
request reported that our redirected window was viewable then we would also
be able to get a valid pixmap name.  (the composite protocol says it's an
error to request a name for a window if it's not viewable) Without the grab
there would be a race condition.

Instead we now handle error conditions gracefully.

15 years ago[text] Avoid a Pango warning with empty markup
Emmanuele Bassi [Thu, 2 Apr 2009 09:28:37 +0000 (10:28 +0100)]
[text] Avoid a Pango warning with empty markup

When the markup string is empty Pango complains about invalid
characters.

15 years ago[test-pick] Improve to include a covering actor
Neil Roberts [Fri, 27 Mar 2009 21:55:40 +0000 (21:55 +0000)]
[test-pick] Improve to include a covering actor

Three tests are now performed on the picked squares. First there is no
covering actor which is the same as the original test. Then there is a
hidden covering actor which should not affect the results. Finally
there is a covering actor with a clip set on it so that only actors
at the borders of the stage should be pickable.

15 years ago[tests] Disable a subtest of the Text cache unit
Emmanuele Bassi [Tue, 21 Apr 2009 11:09:59 +0000 (12:09 +0100)]
[tests] Disable a subtest of the Text cache unit

The wrap mode sub-test inside the ClutterText layout cache test
unit has been broken by the recent changes inside the Text actor.

The sub-test itself might require tweaking.

15 years ago[text] Emit ::cursor-event only on changes
Emmanuele Bassi [Tue, 21 Apr 2009 11:06:14 +0000 (12:06 +0100)]
[text] Emit ::cursor-event only on changes

The documentation for the ::cursor-event says that the signal
is emitted only when the cursor position changes. Right now it
is being emitted every time we ensure the cursor position during
the Text paint sequence.

The clutter_text_ensure_cursor_position() function should check
whether the stored cursor position has changed since the last
paint, and emit the ::cursor-event signal only when there has
been a change.

15 years ago[tests] Visually verify ellipsization
Emmanuele Bassi [Tue, 21 Apr 2009 11:03:41 +0000 (12:03 +0100)]
[tests] Visually verify ellipsization

Verify that the non-editable, single line entries are still
correctly ellipsized when a maximum width is set.

15 years ago[text] Return the correct minimum height
Emmanuele Bassi [Tue, 21 Apr 2009 11:01:52 +0000 (12:01 +0100)]
[text] Return the correct minimum height

The correct minimum height in case of ellipsis is still 1px.

15 years ago[text] Limit the Layout width
Emmanuele Bassi [Tue, 21 Apr 2009 10:59:38 +0000 (11:59 +0100)]
[text] Limit the Layout width

We only want to eschew the pango_layout_set_width() on editable,
single-line Text actors because they can "scroll" the PangoLayout.

This fixes the ellipsization on entries.

15 years ago[gl/cogl.c] #include <gmodule.h> for OS X builds
Robert Bragg [Mon, 20 Apr 2009 11:36:43 +0000 (12:36 +0100)]
[gl/cogl.c] #include <gmodule.h> for OS X builds

In unifying the {gl,gles}/cogl.c code recently, moving most of the code into
common/cogl.c the gmodule.h include was also mistakenly moved.

Thanks to Felix Rabe for reporting this issue.

Note: I haven't tested this fix myself, as I'm not set up to be able to
build for OS X

15 years ago[cogl vertex buffers] Adds fallbacks for drivers without VBO support
Robert Bragg [Wed, 15 Apr 2009 18:25:55 +0000 (19:25 +0100)]
[cogl vertex buffers] Adds fallbacks for drivers without VBO support

Buffer objects aren't currently available for glx indirect contexts, so we
now have a fallback that simply allocates fake client side vbos to store the
attributes.

15 years ago[cogl debug] --cogl-debug=rectangles now outlines all cogl rectangles
Robert Bragg [Fri, 17 Apr 2009 14:10:55 +0000 (15:10 +0100)]
[cogl debug] --cogl-debug=rectangles now outlines all cogl rectangles

This makes the #if 0'd debug code that was in _cogl_journal_flush_quad_batch
- which we have repeatedly found usefull for debugging various geometry
issues in Clutter apps - a runtime debug option.

The outline colors rotate in order from red to green to blue which can also
help confirm the order that your geometry really drawn.

The outlines are not affected by the current material state, so if you e.g.
have a blending bug where geometry mysteriously disappears this can confirm
if the underlying rectangles are actually being emitted but blending is
causing them to be invisible.

15 years agoUse $(MAINTAINER_CFLAGS) in clutter/{x11,glx}/Makefile.am
Robert Bragg [Fri, 17 Apr 2009 13:53:24 +0000 (14:53 +0100)]
Use $(MAINTAINER_CFLAGS) in clutter/{x11,glx}/Makefile.am

These makefile weren't resulting in the addition of the maintainer flags while
building clutter.

15 years agoPrevent a possible zero division
Bastian Winkler [Thu, 16 Apr 2009 11:06:58 +0000 (13:06 +0200)]
Prevent a possible zero division

A zero division might occur in clutter_path_get_position if the length
of a curved node is zero.

Signed-off-by: Neil Roberts <neil@linux.intel.com>
15 years ago[ClutterText] Return 1 for min width when editable
Chris Lord [Thu, 16 Apr 2009 15:34:15 +0000 (16:34 +0100)]
[ClutterText] Return 1 for min width when editable

Editable ClutterText will scroll when allocated less width than is
necessary to lay out the entire layout on a single line, so return 1 for
the minimum width in this case.

Approved by Emmanuele Bassi, fixes bug #1555.

15 years agoMerge branch 'text-actor-layout-height'
Emmanuele Bassi [Wed, 15 Apr 2009 17:08:14 +0000 (18:08 +0100)]
Merge branch 'text-actor-layout-height'

* text-actor-layout-height:
  [clutter-text] Fix ellipsizing
  Support pango_layout_set_height() in ClutterText

Conflicts:
clutter/clutter-text.c

15 years ago[stage] Warn if perspective's z_far - z_near is 0
Emmanuele Bassi [Wed, 15 Apr 2009 16:27:04 +0000 (17:27 +0100)]
[stage] Warn if perspective's z_far - z_near is 0

Since we have to do (z_far - z_near) and use it in a division we
should check that the user is not passing a value that would
cause a division by zero.

15 years agoAdd debug annotations for the layout process
Emmanuele Bassi [Wed, 15 Apr 2009 16:25:50 +0000 (17:25 +0100)]
Add debug annotations for the layout process

If we need to check that the layout sequence is correct in
terms of order of execution and with respect to caching, then
having a CLUTTER_DEBUG_LAYOUT debug flag would make things
easier.

15 years ago[text] Do not ellipsize non-editable layouts
Emmanuele Bassi [Wed, 15 Apr 2009 16:23:45 +0000 (17:23 +0100)]
[text] Do not ellipsize non-editable layouts

If a ClutterText is set as non-editable then its PangoLayout
will occupy as much width as its contents and ignore the
ellipsization setting.

15 years ago[clutter-text] Fix ellipsizing
Neil Roberts [Wed, 15 Apr 2009 13:46:45 +0000 (14:46 +0100)]
[clutter-text] Fix ellipsizing

Ellipsizing was effectively broken for two reasons. There was a typo
in the code to set the width so it always ended up being some massive
value. If no height should be set on the layout it was being set to
G_MAXINT. Setting a height greater than 0 enables wrapping which so
ellipsizing is not performed. It should be left at the default of -1
instead.

15 years ago[json] Avoid leaks on error code paths
Emmanuele Bassi [Wed, 15 Apr 2009 11:18:55 +0000 (12:18 +0100)]
[json] Avoid leaks on error code paths

Bug 1476 - JSON Parser memory leak

Static analysis of the code showed that the in-tree copy of
the JsonParser object leaks objects and arrays on parse errors.

Thanks to Gordon Williams <gordon.williams@collabora.co.uk>

15 years ago[group] avoid double evaluation of arguments in clutter_group_add
Øyvind Kolås [Wed, 8 Apr 2009 17:18:31 +0000 (18:18 +0100)]
[group] avoid double evaluation of arguments in clutter_group_add

clutter_group_add would evaluate the actor argument twice, which is
bad if this is a function call creating a new actor and not a variable.

15 years agoFix fullscreening when the stage is unrealized and on dual-head
Neil Roberts [Tue, 7 Apr 2009 14:24:48 +0000 (15:24 +0100)]
Fix fullscreening when the stage is unrealized and on dual-head

If the stage is unrealized (such as will be the case if the stage was
created with clutter_stage_new) then it would set the size of the
stage display but it was not setting the fullscreen_on_map flag so it
never got the _NET_WM_STATE_FULLSCREEN property. Now it always sets
the flag regardless of whether the window is created yet.

There was also problems with dual-headed displays because in that case
DisplayWidth/Height will return the size of the combined display but
Metacity (and presumably other WMs) will sensibly try fit the window
to only one of the monitors. However we were setting the size hints so
that the minimum size is that of the combined display. Metacity tries
to honour this by setting the minimum size but then it no longer
positions the window at the top left of the screen.

The patch makes it avoid setting the minimum size when the stage is
fullscreen by checking the fullscreen_on_map flag. This also means we
can remove the static was_resizable flag which would presumably have
caused problems for multi-stage.

15 years ago[clutter-text] Add a separate property for the selection color
Neil Roberts [Mon, 6 Apr 2009 14:22:31 +0000 (15:22 +0100)]
[clutter-text] Add a separate property for the selection color

Adds a new property so that the selection color can be different from
the cursor color. If no selection color is specified it will use the
cursor color as before. If no cursor color is specified either it will
use the text color.

15 years ago[cogl-handle] Fix the broken debug macros
Neil Roberts [Mon, 6 Apr 2009 11:43:16 +0000 (12:43 +0100)]
[cogl-handle] Fix the broken debug macros

The debug macros for tracking reference counting of CoglHandles had
some typos introduced in c3d9f0 which meant it failed to compile when
COGL_DEBUG is 1.

15 years ago[cogl] cogl_is_*(): Don't dereference an invalid handle; just return FALSE
Robert Bragg [Sat, 4 Apr 2009 18:02:01 +0000 (19:02 +0100)]
[cogl] cogl_is_*(): Don't dereference an invalid handle; just return FALSE

An invalid handle is implicitly not of any type.

15 years ago[cogl-pango-render] Fix returning to default color after a color attribute
Neil Roberts [Mon, 6 Apr 2009 10:14:43 +0000 (11:14 +0100)]
[cogl-pango-render] Fix returning to default color after a color attribute

Since the Cogl material branch merge when changing the color of a part
using pango attributes (such as using <span color="red" /> markup)
then it wouldn't return to the default color for the rest of the
layout. pango_renderer_get_color returns NULL if there is no color
override in which case it needs to revert to the color specified as
the argument to cogl_pango_render_layout. The 'color' member of
CoglPangoRenderer has been reinstated to store that default color and
now cogl_pango_render_set_color_for_part is the only place that sets
the material color.

15 years ago[animation] Do not connect to ::completed multiple times
Emmanuele Bassi [Sun, 5 Apr 2009 19:32:15 +0000 (20:32 +0100)]
[animation] Do not connect to ::completed multiple times

The clutter_actor_animate*() family of functions should only connect
to the Animation::completed signal once, during the construction of
the Animation object attached to the Actor. Otherwise, the completed
signal handler will be run multiple times, and will try to unref()
the Animation for each call -- leading to a segmentation fault.

15 years ago[animation] Add the ::started signal
Emmanuele Bassi [Fri, 3 Apr 2009 13:19:20 +0000 (14:19 +0100)]
[animation] Add the ::started signal

The Animation class is missing a ::started signal matching the
::completed one. A ::started signal is useful for debugging,
initial state set up, and checks.

15 years ago[group] Fix compilation
Emmanuele Bassi [Fri, 3 Apr 2009 12:36:30 +0000 (13:36 +0100)]
[group] Fix compilation

A case of rebase FAIL. The sorting of the children was still
done using the now removed group function call instead of the
Container one.

15 years ago[animation] Do not unref on ::complete by default
Emmanuele Bassi [Fri, 3 Apr 2009 11:39:35 +0000 (12:39 +0100)]
[animation] Do not unref on ::complete by default

Bug 1535 - Complete animation always unrefs ClutterAnimation (even
           after g_object_ref_sink)

Animations created through clutter_animation_new() should not
automagically unref themselves by default on ::complete. We
only want that behaviour for Animations created by the
clutter_actor_animate* family of functions, since those provide
the automagic memory management.

15 years ago[group] Remove long deprecated API
Emmanuele Bassi [Wed, 1 Apr 2009 10:22:42 +0000 (11:22 +0100)]
[group] Remove long deprecated API

ClutterGroup still ships with API deprecated since 0.4. We did
promise to keep it around for a minor release cycle -- not for 3.

Since we plan on shipping 1.0 without the extra baggage of the
deprecated entry points, here's the chance to remove the accumulated
cruft.

All the removed methods and signals have a ClutterContainer
counterpart.