profile/ivi/clutter.git
14 years agoactor: Turn push/pop_internal into Actor methods
Emmanuele Bassi [Mon, 15 Feb 2010 16:09:26 +0000 (16:09 +0000)]
actor: Turn push/pop_internal into Actor methods

Since the "internal" state is global, it will leak onto actors that you
didn't intend for it to, because it applies not just to the actors you
create, but also to any actors *they* create. Eg, if you have a dialog
box class, you might push/pop_internal around creating its buttons, so
that those buttons get marked as internal to the dialog box. But
ctx->internal_child will still be set during the *button*'s constructor
as well, and so, eg, the label and icon inside the button actor will
*also* be marked as internal children, even if that isn't what the
button class wanted.

The least intrusive change at this point is to make push_internal() and
pop_internal() two methods of the Actor class, and take a ClutterActor
pointer as the argument - thus moving the locality of the internal_child
counter to the Actor itself.

http://bugzilla.openedhand.com/show_bug.cgi?id=1990

14 years agostage: Add sanity checks for get_pending_swaps()
Emmanuele Bassi [Mon, 15 Feb 2010 12:04:50 +0000 (12:04 +0000)]
stage: Add sanity checks for get_pending_swaps()

The master clock might have a Stage during its destruction phase,
without a StageWindow attached to it. If this happens and we try
to dereference the StageWindow to get its class and call a virtual
function we might experience some slight turbulence and... then...
explode.

http://bugzilla.openedhand.com/show_bug.cgi?id=1987

14 years agobuild: Enable experimental COGL API in tests/conform
Emmanuele Bassi [Mon, 15 Feb 2010 11:58:55 +0000 (11:58 +0000)]
build: Enable experimental COGL API in tests/conform

Enable the experimental API when building the conformance test suite.

14 years agobuild: Disable deprecated API in tests/conform
Emmanuele Bassi [Mon, 15 Feb 2010 11:57:48 +0000 (11:57 +0000)]
build: Disable deprecated API in tests/conform

We should not be using deprecated API in the conformance test suite.

14 years agoconform: Do not use deprecated API
Emmanuele Bassi [Mon, 15 Feb 2010 11:56:34 +0000 (11:56 +0000)]
conform: Do not use deprecated API

There is no more type-specific ref/unref pairs: it is all under
CoglHandle now.

14 years agox11: Do not set pid or title on foreign windows
Emmanuele Bassi [Mon, 15 Feb 2010 11:45:35 +0000 (11:45 +0000)]
x11: Do not set pid or title on foreign windows

If a StageX11 is using a foreign window we should not need to set the
_NET_WM_PID or the WM_TITLE properies.

http://bugzilla.openedhand.com/show_bug.cgi?id=1989

14 years agodocs: Mention signal-swapped-after modifier
Emmanuele Bassi [Mon, 15 Feb 2010 11:44:02 +0000 (11:44 +0000)]
docs: Mention signal-swapped-after modifier

The signal-swapped-after:: modifier for signal connection inside the
clutter_actor_animate* variadic arguments functions is not mentioned in
the documentation.

14 years agodocs: Add 2010 in COGL's Copyright notice
Damien Lespiau [Mon, 8 Feb 2010 19:18:36 +0000 (19:18 +0000)]
docs: Add 2010 in COGL's Copyright notice

While at it, fix the usage of <year> in <copyright> to let the
stylesheet do the collation when having several years.

14 years agocogl-buffer: fix compilation for GL ES
Damien Lespiau [Fri, 12 Feb 2010 17:24:15 +0000 (17:24 +0000)]
cogl-buffer: fix compilation for GL ES

In the frenzy of the last 10mins before API freeze, I obviously forgot
to update the OpenGL path for _cogl_buffer_hints_to_gl_enum(). This
commit fixes this.

14 years agocogl-atlas-texture: Flush the journal before adding a new texture
Neil Roberts [Fri, 12 Feb 2010 15:33:56 +0000 (15:33 +0000)]
cogl-atlas-texture: Flush the journal before adding a new texture

When the atlas is reorganised we could potentially be moving around
textures that are already referenced in the journal. We therefore need
to flush the journal otherwise they will be rendered with incorrect
texture coordinates. We also need to flush the journal even if we are
not reorganizing so that we can rely on the old texture contents
remaining in the atlas after migrating a texture out.

14 years agocogl-sub-texture: Optimise taking a sub texture of a sub texture
Neil Roberts [Fri, 12 Feb 2010 10:08:51 +0000 (10:08 +0000)]
cogl-sub-texture: Optimise taking a sub texture of a sub texture

When creating a Cogl sub-texture, if the full texture is also a sub
texture it will now just offset the x and y and reference the full
texture instead. This avoids one level of indirection when rendering
the texture which reduces the chances of getting rounding errors in
the calculations.

14 years agoactor: Split get_paint_opacity() from the type check
Emmanuele Bassi [Fri, 12 Feb 2010 16:24:27 +0000 (16:24 +0000)]
actor: Split get_paint_opacity() from the type check

Since get_paint_opacity() recurses through the hierarchy it might lead
to a lot of type checks while we walk the parent-child chain. We can
split the recursive function from the public entry point and perform the
type check just once.

14 years agoactor: Do not call get_opacity() from get_paint_opacity()
Emmanuele Bassi [Fri, 12 Feb 2010 16:18:12 +0000 (16:18 +0000)]
actor: Do not call get_opacity() from get_paint_opacity()

We already have access to the opacity private field, there's no need to
go through the public API.

14 years agodocs: Fixes for Cogl
Emmanuele Bassi [Fri, 12 Feb 2010 15:52:07 +0000 (15:52 +0000)]
docs: Fixes for Cogl

14 years agobuild: Use -Wuninitialized instead of -Wno-uninitialized
Emmanuele Bassi [Fri, 12 Feb 2010 14:46:43 +0000 (14:46 +0000)]
build: Use -Wuninitialized instead of -Wno-uninitialized

We want to be warned about uninitialized variables.

14 years agoanalysis: Interactive tests
Emmanuele Bassi [Fri, 12 Feb 2010 14:45:49 +0000 (14:45 +0000)]
analysis: Interactive tests

Abort if test-behave was passed the wrong type of behaviour to test.

14 years agoanalysis: Conformance tests
Emmanuele Bassi [Fri, 12 Feb 2010 14:45:04 +0000 (14:45 +0000)]
analysis: Conformance tests

Initialize ClutterPathNote members to 0 using "{ 0, }".

14 years agoanalysis: x11: ClutterEvent
Emmanuele Bassi [Thu, 11 Feb 2010 15:24:41 +0000 (15:24 +0000)]
analysis: x11: ClutterEvent

Remove an unused variable.

14 years agoanalysis: CoglPangoRenderer
Emmanuele Bassi [Thu, 11 Feb 2010 15:24:17 +0000 (15:24 +0000)]
analysis: CoglPangoRenderer

Remove unused variables.

14 years agoanalysis: ClutterTimeoutPool
Emmanuele Bassi [Thu, 11 Feb 2010 15:20:25 +0000 (15:20 +0000)]
analysis: ClutterTimeoutPool

Do not pre-initialize the list iterator, the for loop will do it for us.

14 years agoanalysis: ClutterTimeline
Emmanuele Bassi [Thu, 11 Feb 2010 15:20:07 +0000 (15:20 +0000)]
analysis: ClutterTimeline

Remove an unused variable.

14 years agoanalysis: ClutterTexture
Emmanuele Bassi [Thu, 11 Feb 2010 15:19:46 +0000 (15:19 +0000)]
analysis: ClutterTexture

Remove unused variables.

14 years agoanalysis: ClutterText
Emmanuele Bassi [Thu, 11 Feb 2010 15:19:32 +0000 (15:19 +0000)]
analysis: ClutterText

Remove unused variables.

14 years agoanalysis: ClutterStage
Emmanuele Bassi [Thu, 11 Feb 2010 15:19:18 +0000 (15:19 +0000)]
analysis: ClutterStage

Remove unused variables.

14 years agoanalysis: ClutterScriptParser
Emmanuele Bassi [Thu, 11 Feb 2010 15:17:53 +0000 (15:17 +0000)]
analysis: ClutterScriptParser

We parse a JSON value depending on the initial state of an uninitialized
variable. Ouch.

14 years agoanalysis: ClutterRectangle
Emmanuele Bassi [Thu, 11 Feb 2010 15:17:32 +0000 (15:17 +0000)]
analysis: ClutterRectangle

Remove unused variables.

14 years agoanalysis: ClutterModel
Emmanuele Bassi [Thu, 11 Feb 2010 15:17:07 +0000 (15:17 +0000)]
analysis: ClutterModel

Remove unused variables.

14 years agoanalysis: ClutterMain
Emmanuele Bassi [Thu, 11 Feb 2010 15:13:40 +0000 (15:13 +0000)]
analysis: ClutterMain

• Remove unused variables.

• Do not pre-initialize ClutterActor's GType; pre-emptive optimizations
  like these are more black magic than real optimization.

14 years agoanalysis: ClutterInterval
Emmanuele Bassi [Thu, 11 Feb 2010 15:13:20 +0000 (15:13 +0000)]
analysis: ClutterInterval

Remove unused variables.

14 years agoanalysis: ClutterBoxLayout
Emmanuele Bassi [Thu, 11 Feb 2010 15:11:51 +0000 (15:11 +0000)]
analysis: ClutterBoxLayout

Remove an useless assignment. The n_expand_children is not used outside
the extra_space check, and if n_expand_children is 0 then the extra
space we allocate is 0.

14 years agoanalysis: ClutterBehaviour
Emmanuele Bassi [Thu, 11 Feb 2010 15:11:25 +0000 (15:11 +0000)]
analysis: ClutterBehaviour

Remove an unused variable.

14 years agoanalysis: ClutterAnimation
Emmanuele Bassi [Thu, 11 Feb 2010 15:09:51 +0000 (15:09 +0000)]
analysis: ClutterAnimation

• Remove one unused variable.

• We ignore the result of get_timeline_internal() so we need to tell
  the compiler that - though a better solution would be to split the
  timeline implicit creation into its own function.

14 years agoanalysis: ClutterAnimator/2
Emmanuele Bassi [Thu, 11 Feb 2010 15:09:12 +0000 (15:09 +0000)]
analysis: ClutterAnimator/2

Clean up an unused variable.

14 years agoanalysis: ClutterAnimator/1
Emmanuele Bassi [Thu, 11 Feb 2010 15:08:19 +0000 (15:08 +0000)]
analysis: ClutterAnimator/1

Do not de-reference a void*; use a temporary variable -- after
checking the contents of the pointer. This actually simplifies
the readability and avoids pulling a Lisp with the parentheses.

14 years agoanalysis: ClutterAlpha
Emmanuele Bassi [Thu, 11 Feb 2010 15:07:38 +0000 (15:07 +0000)]
analysis: ClutterAlpha

Clean up unused variables.

14 years agoanalysis: ClutterActor
Emmanuele Bassi [Thu, 11 Feb 2010 15:05:18 +0000 (15:05 +0000)]
analysis: ClutterActor

Clean up ClutterActor for unused variables.

14 years agocogl: Cache the value for GL_MAX_TEXTURE_UNITS
Neil Roberts [Fri, 12 Feb 2010 14:26:33 +0000 (14:26 +0000)]
cogl: Cache the value for GL_MAX_TEXTURE_UNITS

The function _cogl_get_max_texture_units is called quite often while
rendering and it returns a constant value so we might as well cache
the result. Calling glGetInteger on Mesa can be expensive because it
flushes a lot of state.

14 years agocogl: resolves some low hanging issues flagged by clang
Robert Bragg [Thu, 11 Feb 2010 16:12:26 +0000 (16:12 +0000)]
cogl: resolves some low hanging issues flagged by clang

An initial pass over the Cogl source code using the Clang static
analysis tool flagged a few low hanging issues such as un-used variables
or redundant initializing of variables which this patch fixes.

14 years agocogl_rectangle: avoid redundant copy of geometry
Robert Bragg [Thu, 11 Feb 2010 15:33:01 +0000 (15:33 +0000)]
cogl_rectangle: avoid redundant copy of geometry

All the cogl_rectangle* APIs normalize their input into into an array of
_CoglMutiTexturedRect rectangles and pass these on to our work horse;
_cogl_rectangles_with_multitexture_coords. The definition of
_CoglMutiTexturedRect had 4 separate float members, x_1, y_1, x_2 and
y_2 which meant for some common cases we were having to copy out from an
array into these members. We are now able to simply point into the users
array avoiding a copy which seems desirable when submiting lots of
rectangles.

14 years agocogl: explicitly mark cogl_<object>_ref/unref APIs as deprecated
Robert Bragg [Wed, 10 Feb 2010 22:47:49 +0000 (22:47 +0000)]
cogl: explicitly mark cogl_<object>_ref/unref APIs as deprecated

This uses the G_GNUC_DEPRECATED macros to mark the
cogl_{texture,vertex_buffer,shader}_ref and unref APIs as deprecated.
Since this flagged that cogl-pango-display-list.c and
clutter-glx-texture-pixmap.c were still using deprecated _ref/_unref
APIs they have now been changed to use the cogl_handle_ref/unref API
instead.

14 years agocogl: cleanly separate primitives + paths code
Robert Bragg [Wed, 10 Feb 2010 22:30:37 +0000 (22:30 +0000)]
cogl: cleanly separate primitives + paths code

The function prototypes for the primitives API were spread between
cogl-path.h and cogl-texture.h and should have been in a
cogl-primitives.h.

As well as shuffling the prototypes around into more sensible places
this commit splits the cogl-path API out from cogl-primitives.c into
a cogl-path.c

14 years agocogl: remove redundant _cogl_journal_flush prototype
Robert Bragg [Wed, 10 Feb 2010 18:18:30 +0000 (18:18 +0000)]
cogl: remove redundant _cogl_journal_flush prototype

There was a redundant _cogl_journal_flush function prototype in
cogl-primitives.h

14 years agocogl: improves header and coding style consistency
Robert Bragg [Wed, 10 Feb 2010 01:57:32 +0000 (01:57 +0000)]
cogl: improves header and coding style consistency

We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.

There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.

The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:

 return_type
 cogl_function_name (CoglType arg0,
                     CoglType arg1);

Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.

The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.

The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.

The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.

14 years agocogl: deprecates cogl_check_extension
Robert Bragg [Fri, 5 Feb 2010 16:32:19 +0000 (16:32 +0000)]
cogl: deprecates cogl_check_extension

OpenGL is an implementation detail for Cogl so it's not appropriate to
expose OpenGL extensions through the Cogl API.

Note: Clutter is currently still using this API, because it is still
doing raw GL calls in ClutterGLXTexturePixmap, so this introduces a
couple of (legitimate) build warnings while compiling Clutter.

14 years agonever presume queuing redraws on invisible actors is redundant
Robert Bragg [Tue, 9 Feb 2010 19:34:32 +0000 (19:34 +0000)]
never presume queuing redraws on invisible actors is redundant

This replaces code like this:
  if (CLUTTER_ACTOR_IS_VISIBLE (self))
    clutter_actor_queue_redraw (self);
with:
  clutter_actor_queue_redraw (self);

clutter_actor_queue_redraw internally knows what can be optimized when
the actor is not visible, but it also knows that the queue_redraw signal
must always be sent in case a ClutterClone is cloning a hidden actor.

14 years agobox: port a ClutterGroup::foreach fix to ClutterBox
Robert Bragg [Tue, 9 Feb 2010 19:19:44 +0000 (19:19 +0000)]
box: port a ClutterGroup::foreach fix to ClutterBox

ClutterGroup::foreach was recently changed (ref: ce030a3fce) to use
g_list_foreach() to iterate the children instead of manually iterating
the list so it would safely handle calls like:

  clutter_container_foreach (container, clutter_actor_destroy);

  (In this example clutter_actor_destroy will result in the current
   list item being iterated being freed.)

14 years agobox: Adds missing copyright header
Robert Bragg [Tue, 9 Feb 2010 19:06:59 +0000 (19:06 +0000)]
box: Adds missing copyright header

Adds a Copyright (C) 2009,2010  Intel Corporation header

14 years agogroup: make it comparable to ClutterBox
Robert Bragg [Tue, 9 Feb 2010 18:54:28 +0000 (18:54 +0000)]
group: make it comparable to ClutterBox

There is a lot of duplication between ClutterGroup and ClutterBox so
this makes the two files diff-able so that new fixes can easily be
ported to both and bug fixes missing in one or the other can be spotted
more easily. This doesn't change the behaviour of either actor; it's
really just a shuffle around of code and normalizes the coding style to
make the files comparable.

This has already uncovered one bug in ClutterBox, and also highlights
a bug in ClutterGroup + many other actors:

1) ClutterGroup::real_foreach was recently changed to use
   g_list_foreach instead of manually iterating the child list so it can
   safely handle calls like:
     clutter_container_foreach (container, clutter_actor_destroy);
   ClutterBox is still manually iterating the list.

2) In ClutterGroup we guard _queue_redraw() calls like this:
    if (CLUTTER_ACTOR_IS_VISIBLE (container))
clutter_actor_queue_redraw (CLUTTER_ACTOR (container));
   In ClutterBox we don't:
     I think ClutterBox is correct here because
     clutter_actor_queue_redraw already optimizes the case where the
     actor's not visible, but it also considers that the actor may be
     cloned and so the guard in ClutterGroup could break clones. This
     actually highlights a wider clutter bug since the same kinds of
     guards can be found in all other clutter actors.

14 years agodocs: Update the backend HACKING file
Emmanuele Bassi [Fri, 12 Feb 2010 11:38:47 +0000 (11:38 +0000)]
docs: Update the backend HACKING file

Clarify the Backend::create_context() vfunc role, and the
Stage::realize() vfunc with regards to creating the GL/GLES
context.

14 years agocogl: Add a fallback for when the signbit macro is missing
Neil Roberts [Thu, 11 Feb 2010 14:20:48 +0000 (14:20 +0000)]
cogl: Add a fallback for when the signbit macro is missing

The signbit macro is defined in C99 so it should be available but some
versions of GCC don't appear to define it by default. If it's not
available we can use a hack to test the bit directly.

14 years agoDo a sanity check on _clutter_do_pick() arguments
Emmanuele Bassi [Wed, 10 Feb 2010 17:20:31 +0000 (17:20 +0000)]
Do a sanity check on _clutter_do_pick() arguments

We should check that the passed ClutterStage pointer is indeed: a) still
valid and b) a Stage.

14 years agoinput-device: Do not pick() on NULL stages
Emmanuele Bassi [Wed, 10 Feb 2010 17:12:27 +0000 (17:12 +0000)]
input-device: Do not pick() on NULL stages

If the stage associated to the InputDevice is not set we should
short-circuit out and return NULL. This will result in a pick()
done on the event's stage - if applicable.

http://bugzilla.moblin.org/show_bug.cgi?id=9602

14 years agotext: Bump up the preferred height
Emmanuele Bassi [Wed, 10 Feb 2010 15:38:41 +0000 (15:38 +0000)]
text: Bump up the preferred height

Instead of returning a sub-pixel height round up the preferred height to
the nearest integral value that is not less than the size reported by
Pango, once converted in pixels.

14 years agotest-text-field: Tone down the border
Emmanuele Bassi [Wed, 10 Feb 2010 15:38:07 +0000 (15:38 +0000)]
test-text-field: Tone down the border

Use a low opacity for the text field border.

14 years agotest-text-field: Use ActorBox methods for the border
Emmanuele Bassi [Wed, 10 Feb 2010 15:37:26 +0000 (15:37 +0000)]
test-text-field: Use ActorBox methods for the border

Clamp to pixel and use get_size() when painting the border of the text
field.

14 years agouprof: make the Redrawing timer a child of the Master Clock
Robert Bragg [Wed, 10 Feb 2010 11:57:58 +0000 (11:57 +0000)]
uprof: make the Redrawing timer a child of the Master Clock

Previously it was a child of the Mainloop, but it's more closely
a child of the Master Clock.

14 years agobackend-glx: Fix glXQueryVersion test
Robert Bragg [Wed, 10 Feb 2010 12:18:41 +0000 (12:18 +0000)]
backend-glx: Fix glXQueryVersion test

This fixes some backwards logic for asserting that we have a GLX major
version == 1 and a minor version >= 2. (NB: Although we technically
depend on GLX 1.3 features, we still have to support drivers that report
GLX 1.2 because there are a lot of mesa drivers out there incorrectly
report GLX 1.2 even though they export extensions that depend on GLX
1.3)

14 years agocogl-material: Layers are not equal if the filters aren't equal
Neil Roberts [Wed, 10 Feb 2010 12:41:09 +0000 (12:41 +0000)]
cogl-material: Layers are not equal if the filters aren't equal

A material layer can not be considered equal if it is using different
texture filtering modes. This was causing problems where rectangles
with different filters would end up batched together and then rendered
with the wrong filter mode.

14 years agobuild: Tweak internal defines for building Clutter
Emmanuele Bassi [Wed, 10 Feb 2010 10:58:14 +0000 (10:58 +0000)]
build: Tweak internal defines for building Clutter

When building Clutter we should:

  • disable Cogl deprecated API;
  • enable experimental API.

14 years agodebug: Adds CLUTTER_DEBUG=disable-swap-events option
Robert Bragg [Wed, 20 Jan 2010 18:53:36 +0000 (18:53 +0000)]
debug: Adds CLUTTER_DEBUG=disable-swap-events option

This allows us to forcibly disable the use of the GLX_INTEL_swap_events
extension for testing or debugging purposes.

14 years agoglx backend: Adds support for GLX_INTEL_swap_event
Robert Bragg [Thu, 12 Nov 2009 20:37:01 +0000 (20:37 +0000)]
glx backend: Adds support for GLX_INTEL_swap_event

If your OpenGL driver supports GLX_INTEL_swap_event that means when
glXSwapBuffers is called it returns immediatly and an XEvent is sent when
the actual swap has finished.

Clutter can use the events that notify swap completion as a means to
throttle rendering in the master clock without blocking the CPU and so it
should help improve the performance of CPU bound applications.

14 years agoglx backend: when running with GLX 1.3 then create GLXWindows for stages
Robert Bragg [Thu, 14 Jan 2010 14:03:23 +0000 (14:03 +0000)]
glx backend: when running with GLX 1.3 then create GLXWindows for stages

Some extensions only support GLX versions > 1.3 and may not support
old style X Windows as GLXDrawables, so we now create GLXWindows for
stages when possible.

14 years agoclutter-backend: Fix the error check in _clutter_backend_create_stage
Neil Roberts [Tue, 9 Feb 2010 18:33:09 +0000 (18:33 +0000)]
clutter-backend: Fix the error check in _clutter_backend_create_stage

Commit d2bdd3cb62 fixed some compiler warnings but also broke the
ability to create a stage. Although not having warnings from the
compiler is nice, it is also nice to be able to create a stage so lets
not invert the meaning of the error check.

14 years agocogl: Move material_copy() out of the deprecated section
Emmanuele Bassi [Tue, 9 Feb 2010 17:07:08 +0000 (17:07 +0000)]
cogl: Move material_copy() out of the deprecated section

We strongly suggest people should be using cogl_material_copy(), but it
was hidden behind the deprecation guards.

14 years agoFix some compiler warnings
Emmanuele Bassi [Tue, 9 Feb 2010 16:57:14 +0000 (16:57 +0000)]
Fix some compiler warnings

GCC complains that some variable might be used uninitialized.

14 years agocogl-bitmap: Remove const from premult_alpha_last_four_pixels_sse2
Neil Roberts [Tue, 9 Feb 2010 16:30:28 +0000 (16:30 +0000)]
cogl-bitmap: Remove const from premult_alpha_last_four_pixels_sse2

The function modifies the pixels pointed by p in-place so the pointer
can not be constant. The compiler was accepting this because the
modification is done from inline assembler.

14 years agodocs: Clean up the unused symbols for Cogl
Emmanuele Bassi [Tue, 9 Feb 2010 15:29:29 +0000 (15:29 +0000)]
docs: Clean up the unused symbols for Cogl

Gtk-doc is reporting a lot of false positives in the unused text file,
mostly because of new private files that have been added to Cogl but not
to the gtk-doc ignore list for the Cogl API reference.

Once the false positives have been removed we have a couple of really
missing symbols that should be added to the cogl-sections.txt file.

14 years agocogl-buffer: Use correct argument types in cogl_buffer_set_data_EXP
Bastian Winkler [Tue, 9 Feb 2010 14:19:03 +0000 (15:19 +0100)]
cogl-buffer: Use correct argument types in cogl_buffer_set_data_EXP

offset and size arguments are gsize in cogl-buffer.h

http://bugzilla.openedhand.com/show_bug.cgi?id=1980

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agodocs: Move some Cogl defines in the private section
Emmanuele Bassi [Tue, 9 Feb 2010 14:48:11 +0000 (14:48 +0000)]
docs: Move some Cogl defines in the private section

The PixelFormat bit and mask #defines should not be used and are there
mostly for convenience, so we can push them to the "private" sub-section
of the API reference.

This pushed Cogl's API reference coverage to 100%.

14 years agodocs: Fixes for Cogl API reference
Emmanuele Bassi [Tue, 9 Feb 2010 14:41:37 +0000 (14:41 +0000)]
docs: Fixes for Cogl API reference

  98% symbol docs coverage.
  335 symbols documented.
  0 symbols incomplete.
  8 not documented.

Not bad, if I may say so.

14 years agoPost-release bump to 1.1.11
Emmanuele Bassi [Tue, 9 Feb 2010 13:39:08 +0000 (13:39 +0000)]
Post-release bump to 1.1.11

14 years agoRelease 1.1.10
Emmanuele Bassi [Tue, 9 Feb 2010 12:31:42 +0000 (12:31 +0000)]
Release 1.1.10

Brown paper bag release.

14 years agoUpdate NEWS file
Emmanuele Bassi [Tue, 9 Feb 2010 12:59:18 +0000 (12:59 +0000)]
Update NEWS file

14 years agobuild: Always build conformance tests with debug symbols
Emmanuele Bassi [Tue, 9 Feb 2010 11:29:39 +0000 (11:29 +0000)]
build: Always build conformance tests with debug symbols

Having the conformance test suite build without debug symbols doesn't
make any sense.

14 years agoconform: fix stack corruption in test-behaviours.c
Robert Bragg [Tue, 9 Feb 2010 13:00:39 +0000 (13:00 +0000)]
conform: fix stack corruption in test-behaviours.c

The test was calling g_object_get to fetch the "opacity-start" property
(unsigned int) into a guint8 local variable. It's a bit of a mean trap
given that the getter function returns guint8 values so this also adds a
comment explaining what's going on.

14 years agocogl-texture-2d: Use _cogl_texture_driver_gen to generate the GL tex
Neil Roberts [Tue, 9 Feb 2010 12:21:10 +0000 (12:21 +0000)]
cogl-texture-2d: Use _cogl_texture_driver_gen to generate the GL tex

_cogl_texture_driver_gen is needed to set the texture minification
mode to Cogl's default of GL_LINEAR. There was also a line to set this
in _cogl_texture_2d_new_with_size but it wasn't working because it was
called *before* the texture was bound. If the texture was later
rendered with the default material it then it would end up with GL's
default mipmap filtering mode but without mipmaps so it would render
white squares instead.

14 years agocogl: Use SSE2 when possible for premultiplying
Neil Roberts [Fri, 18 Dec 2009 21:17:21 +0000 (21:17 +0000)]
cogl: Use SSE2 when possible for premultiplying

This adds a fast path for premultiplying an RGBA image using SSE2
instructions. SSE registers are 128-bit and we need at least 16-bits
per component for the intermediate result of the multiplication so we
can do two pixels in parallel with one register. The function
interleaves 2 SSE registers to multiply 4 pixels in one function call
with the hope that this will pipeline better.

http://bugzilla.openedhand.com/show_bug.cgi?id=1939
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agoactor: Improve readability of raise/lower warnings
Emmanuele Bassi [Tue, 9 Feb 2010 10:34:41 +0000 (10:34 +0000)]
actor: Improve readability of raise/lower warnings

• Add the function name in the warning, since the text is the same in
  both clutter_actor_raise() and clutter_actor_lower().

• If an actor has a name then prefer it to the type name.

14 years agoRemove return from void functions
Halton Huo [Tue, 9 Feb 2010 10:21:37 +0000 (10:21 +0000)]
Remove return from void functions

This patch fixes compilation on suncc.

http://bugzilla.openedhand.com/show_bug.cgi?id=1978

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agoPost-release bump to 1.1.9
Emmanuele Bassi [Mon, 8 Feb 2010 18:09:14 +0000 (18:09 +0000)]
Post-release bump to 1.1.9

14 years agoRelease Clutter 1.1.8
Emmanuele Bassi [Mon, 8 Feb 2010 17:57:48 +0000 (17:57 +0000)]
Release Clutter 1.1.8

14 years agotest-animator: Do not use mid-function blocks
Emmanuele Bassi [Mon, 8 Feb 2010 17:56:35 +0000 (17:56 +0000)]
test-animator: Do not use mid-function blocks

The test_animator_properties unit is so small that declaring a
mid-function block for two variables is not that clever.

14 years agoanimator: Zero the AnimatorKey:value member
Emmanuele Bassi [Mon, 8 Feb 2010 17:55:29 +0000 (17:55 +0000)]
animator: Zero the AnimatorKey:value member

The test suite is showing random segfaults because the GValue member of
AnimatorKey is not zero-ed on creation.

14 years agodocs: Fixes for ClutterAnimator
Emmanuele Bassi [Mon, 8 Feb 2010 17:37:00 +0000 (17:37 +0000)]
docs: Fixes for ClutterAnimator

14 years agoMerge me
Emmanuele Bassi [Mon, 8 Feb 2010 17:34:11 +0000 (17:34 +0000)]
Merge me

14 years agodocs: Update NEWS
Emmanuele Bassi [Mon, 8 Feb 2010 17:27:20 +0000 (17:27 +0000)]
docs: Update NEWS

14 years agodocs: Update the release notes
Emmanuele Bassi [Mon, 8 Feb 2010 17:27:13 +0000 (17:27 +0000)]
docs: Update the release notes

14 years agocogl-buffer: Use TEXTURE as the only value for CoglBufferUsageHint
Damien Lespiau [Mon, 8 Feb 2010 17:11:43 +0000 (17:11 +0000)]
cogl-buffer: Use TEXTURE as the only value for CoglBufferUsageHint

We should try to use more explicit defines than GL for our hints. For
now we only support using a CoglBuffer to generate textures.

14 years agocogl-buffer: make sure the code compiles on GL ES
Damien Lespiau [Tue, 2 Feb 2010 16:44:16 +0000 (16:44 +0000)]
cogl-buffer: make sure the code compiles on GL ES

OpenGL ES has no PBO extension, so we fallback to using a malloc'ed
buffer. Make sure the OpenGL-only defines don't leak into the OpenGL ES
compilation.

14 years agocogl-pixel-buffer: Add a fallback path
Damien Lespiau [Tue, 2 Feb 2010 12:59:51 +0000 (12:59 +0000)]
cogl-pixel-buffer: Add a fallback path

First, let's add a new public feature called, surprisingly,
COGL_FEATURE_PBOS to check the availability of PBOs and provide a
fallback path when running on older GL implementations or on OpenGL ES

In case the underlying OpenGL implementation does not provide PBOs, we
need a fallback path (a malloc'ed buffer). The CoglPixelBufer
constructors will instanciate a subclass of CoglBuffer that handles
map/unmap and set_data() with a malloc'ed buffer.

The public feature is useful to check before using set_data() on a
buffer as it will mean doing a memcpy() when not supporting PBOs (in
that case, it's better to create the texture directly instead of using a
CoglBuffer).

14 years agotests: Add a test for CoglPixelBuffers
Damien Lespiau [Fri, 22 Jan 2010 15:38:31 +0000 (15:38 +0000)]
tests: Add a test for CoglPixelBuffers

Exercise the whole public CoglBuffer / CoglPixelBuffer and
cogl_texture_new_from_buffer API.

14 years agocogl-texture: Add a new constructor to turn CoglBuffers into textures
Damien Lespiau [Fri, 22 Jan 2010 15:07:27 +0000 (15:07 +0000)]
cogl-texture: Add a new constructor to turn CoglBuffers into textures

The only goal of using COGL buffers is to use them to create
textures. cogl_texture_new_from_buffer() is the new symbol to create
textures out of buffers.

14 years agocogl-pixel-buffer: add a pixel buffer object class
Damien Lespiau [Sun, 10 Jan 2010 18:04:29 +0000 (18:04 +0000)]
cogl-pixel-buffer: add a pixel buffer object class

This subclass of CoglBuffer aims at wrapping PBOs or other system
surfaces like DRM buffer objects. Two constructors are available:

cogl_pixel_buffer_new() with a size when you only care about the size of
the buffer (such a buffer can be used to store several texture data such
as the three planes of a I420 frame).

cogl_pixel_buffer_new_full() is more a 1:1 mapping between the data and
an underlying surface, with the possibility of having access to a low
level memory buffer that may have a stride.

14 years agocogl-buffer: add an abstract class around openGL's buffer objects
Damien Lespiau [Sun, 10 Jan 2010 17:28:24 +0000 (17:28 +0000)]
cogl-buffer: add an abstract class around openGL's buffer objects

Buffer objects are cool! This abstracts the buffer API first introduced
by GL_ARB_vertex_buffer_object and then extended to other objects.

The coglBuffer abstract class is intended to be the base class of all
the buffer objects, letting the user map() buffers. If the underlying
implementation does not support buffer objects (or only support VBO but
not FBO for instance), fallback paths should be provided.

14 years agocogl: new textures sould have GL_TEXTURE_MIN_FILTER set to GL_LINEAR
Damien Lespiau [Mon, 25 Jan 2010 11:21:05 +0000 (11:21 +0000)]
cogl: new textures sould have GL_TEXTURE_MIN_FILTER set to GL_LINEAR

The only way the user has to set the mipmap filters is through the
material/layer API. This API defaults to GL_LINEAR/GL_LINEAR for the max
and min filters. With the main use case of cogl being 2D interfaces, it
makes sense do default to GL_LINEAR for the min filter.

When creating new textures, we did not set any filter on them, using
OpenGL defaults': GL_NEAREST_MIPMAP_LINEAR for the min filter and
GL_LINEAR for the max filter. This will make the driver allocate memory
for the mipmap tree, memory that will not be used in the nominal case
(as the material API defaults to GL_LINEAR).

This patch tries to ensure that the min filter is set to GL_LINEAR
before any glTexImage*() call is done on the texture by setting the
filter when generating new OpenGL handles.

14 years agocogl: Introduce the GE_RET() debug macro
Damien Lespiau [Mon, 11 Jan 2010 00:15:25 +0000 (00:15 +0000)]
cogl: Introduce the GE_RET() debug macro

Some GL functions have a return value that the GE() macro is not able to
handle. Let's define a new Ge_RET() macro which will be able to handle
functions such as glMapBuffer().

While at it, removed the unused variadic dots to the GE() macro.

14 years agoMerge branch 'animator-parser'
Emmanuele Bassi [Mon, 8 Feb 2010 16:53:11 +0000 (16:53 +0000)]
Merge branch 'animator-parser'

* animator-parser:
  docs: Describe the Animation definition syntax
  animator: Provide a ClutterScript parser
  animator: Allow retrieving type property type from a key
  script: Use a node when resolving an animation mode

14 years agodocs: Describe the Animation definition syntax
Emmanuele Bassi [Mon, 8 Feb 2010 16:50:29 +0000 (16:50 +0000)]
docs: Describe the Animation definition syntax

The ClutterAnimator documentation needs a section on the syntax of its
ClutterScript definition, possibly with an example.

14 years agoanimator: Provide a ClutterScript parser
Emmanuele Bassi [Mon, 8 Feb 2010 15:52:18 +0000 (15:52 +0000)]
animator: Provide a ClutterScript parser

The whole point of having the Animator class is that the developer can
describe a complex animation using ClutterScript. Hence, ClutterAnimator
should hook into the Script machinery and parse a specific description
format for its keys.

14 years agoanimator: Allow retrieving type property type from a key
Emmanuele Bassi [Mon, 8 Feb 2010 15:47:46 +0000 (15:47 +0000)]
animator: Allow retrieving type property type from a key

When asking a key for its target value we also ask the developer to pass
in an initialized GValue - but we don't make it easy to know the type of
the GValue. A developer has to ask the GObject class for the GParamSpec
and then initialize the GValue, instead.

Since we know the type of the GValue we should provide a getter for it.

We should also allow developers to throw at us GValue with compatible and
transformable types.

Finally, all the accessors should be constified.