profile/ivi/clutter.git
15 years ago[build] Remove cogl-enum-types.h on distclean
Emmanuele Bassi [Fri, 29 May 2009 16:50:58 +0000 (17:50 +0100)]
[build] Remove cogl-enum-types.h on distclean

The cogl-enum-types.h file is created by glib-mkenums under
/clutter/cogl/common, and then copied in /clutter/cogl in order
to make the inclusion of that file work inside cogl.h.

Since we're copying it in a different location, the Makefile
for that location has to clean up the copy.

15 years ago[build] Fix dist issues
Emmanuele Bassi [Fri, 29 May 2009 16:10:27 +0000 (17:10 +0100)]
[build] Fix dist issues

* cogl-deprecated.h is not being installed

* cogl-enum-types.c.in is not part of the dist

15 years agoFreeze notifiers around property setters
Jonas Bonn [Thu, 28 May 2009 07:47:45 +0000 (09:47 +0200)]
Freeze notifiers around property setters

Notifications should be fired off from both the internal timeline and
the wrapping animation here, so notifiers should be frozen around these
property setters.

Signed-off-by: Jonas Bonn <jonas@southpole.se>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years ago[animation] Final cleanups to new Animation model
Jonas Bonn [Thu, 28 May 2009 07:40:09 +0000 (09:40 +0200)]
[animation] Final cleanups to new Animation model

Just a couple of final cleanups after the reimplementation of the
Animation model.

i)  _set_mode does not need to set the timeline on the alpha
ii) freeze notifications around the setting of a new alpha

Signed-off-by: Jonas Bonn <jonas@southpole.se>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years ago[master clock] Use StageManager::peek_stages()
Emmanuele Bassi [Fri, 29 May 2009 13:52:49 +0000 (14:52 +0100)]
[master clock] Use StageManager::peek_stages()

Use the new StageManager::peek_stages() method to avoid a copy
of the stages list.

15 years ago[stage manager] Add peek_stages()
Emmanuele Bassi [Fri, 29 May 2009 13:45:53 +0000 (14:45 +0100)]
[stage manager] Add peek_stages()

We need an method for StageManager that returns a const pointer
to the internal list, to avoid the copy.

15 years ago[master clock] Handle Timeline::started signal correctly
Emmanuele Bassi [Fri, 29 May 2009 13:25:19 +0000 (14:25 +0100)]
[master clock] Handle Timeline::started signal correctly

The "started" signal is sent first after the timeline has been set to the
'running' state. For this reason, checking if the clock has any running
timelines running will always return true in the "started" signal handler:
the timeline that sent the signal is running.

What needs to be checked in the signal handler is if there are any
timelines running other than the one that emitted the ::started signal,
which we know is running anyway.

This prevents frames from being lost at the beginning of an animation when
a timeline is started after a quiescent period.

Fixes bug:

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

Signed-off-by: Jonas Bonn <jonas@southpole.se>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years ago[build] Copy cogl-enum-types.h under the guard
Emmanuele Bassi [Fri, 29 May 2009 13:27:55 +0000 (14:27 +0100)]
[build] Copy cogl-enum-types.h under the guard

We avoid rebuilding cogl-enum-types.h and cogl-enum-types.c by
using a "guard" -- a stamp file that will block Makefile. Since
we need cogl-enum-types.h into /clutter/cogl as well for the
cogl.h include to work, if we copy the cogl-enum-types.h
unconditionally it will cause a rebuild of the whole COGL; which
will cause a full rebuild.

To solve this, we can copy the header file when generating it
under the stamp file.

15 years ago[configure] Always execute the AM_CONDITIONAL call for X11_TESTS
Neil Roberts [Fri, 29 May 2009 13:23:16 +0000 (14:23 +0100)]
[configure] Always execute the AM_CONDITIONAL call for X11_TESTS

Automake gets upset if an AM_CONDITIONAL call is itself conditionally
executed.

15 years ago[build] Encode the target into the backend library
Emmanuele Bassi [Fri, 29 May 2009 11:50:48 +0000 (12:50 +0100)]
[build] Encode the target into the backend library

The libclutter-cogl internal object should be the only dependency
for Clutter, since we are already copying it inside clutter/cogl
for the introspection scanner. For this reason, the backend-specific,
real internal object should be built with the backend encoded into
the file name, like libclutter-common. This makes the build output
a little bit more clear: instead of having two:

  LINK libclutter-cogl-common.la
  ...
  LINK libclutter-cogl.la
  LINK libclutter-cogl.la

We'll have:

  LINK libclutter-cogl-common.la
  ...
  LINK libclutter-cogl-gl.la
  LINK libclutter-cogl.la

Same applies for the GLES backend.

15 years agoUse g_once when registering enumeration types
Emmanuele Bassi [Fri, 29 May 2009 11:40:23 +0000 (12:40 +0100)]
Use g_once when registering enumeration types

Just like we do with GObject types and G_DEFINE_TYPE, we should
use the g_once_init_enter/g_once_init_leave mechanism to make the
GType registration of enumeration types thread safe.

15 years ago[cogl] Generate enumeration GTypes
Emmanuele Bassi [Fri, 29 May 2009 11:31:47 +0000 (12:31 +0100)]
[cogl] Generate enumeration GTypes

COGL is starting to have more enumerations than I can handle
by hand. Let's use glib-mkenums and be done with it.

15 years ago[docs] Fixes for the API reference
Emmanuele Bassi [Thu, 28 May 2009 16:18:13 +0000 (17:18 +0100)]
[docs] Fixes for the API reference

* Add unused symbols

* Document and sync argument names with their gtk-doc counterpart

* Add missing descriptions

15 years ago[git ignore] Add blend strings test
Emmanuele Bassi [Thu, 28 May 2009 16:18:10 +0000 (17:18 +0100)]
[git ignore] Add blend strings test

15 years agoMerge branch 'master' into 1.0-integration
Emmanuele Bassi [Thu, 28 May 2009 14:53:56 +0000 (15:53 +0100)]
Merge branch 'master' into 1.0-integration

* master:
  [test-text-perf] Use queue_redraw instead of painting the stage directly
  [actor] In paint when opacity == 0, clear the queued_redraw flag

15 years ago[test-text-perf] Use queue_redraw instead of painting the stage directly
Neil Roberts [Thu, 28 May 2009 14:27:09 +0000 (15:27 +0100)]
[test-text-perf] Use queue_redraw instead of painting the stage directly

If it doesn't queue a redraw and allow the backend to clear and swap
the buffers then the results will be skewed because it is not
predictable when the driver will actually render the scene.

15 years ago[cogl] Make cogl_setup_viewport() a private function
Emmanuele Bassi [Thu, 28 May 2009 12:03:19 +0000 (13:03 +0100)]
[cogl] Make cogl_setup_viewport() a private function

The setup_viewport() function should only be used by Clutter and
not by application code.

It can be emulated by changing the Stage size and perspective and
requeueing a redraw after calling clutter_stage_ensure_viewport().

15 years ago[cogl deprecated] Add backface culling deprecation
Emmanuele Bassi [Thu, 28 May 2009 11:52:00 +0000 (12:52 +0100)]
[cogl deprecated] Add backface culling deprecation

The backface culling enabling function was split and renamed, just
like the depth testing one, so we need to add the macro to the
cogl-deprecated.h header.

15 years ago[cogl vertex buffers] Give indices a CoglHandle so they are shareable
Robert Bragg [Thu, 28 May 2009 11:49:29 +0000 (12:49 +0100)]
[cogl vertex buffers] Give indices a CoglHandle so they are shareable

Previously indices were tightly bound to a particular Cogl vertex buffer
but we would like to be able to share indices so now we have
cogl_vertex_buffer_indices_new () which returns a CoglHandle.

In particular we could like to have a shared set of indices for drawing
lists of quads that can be shared between the pango renderer and the
Cogl journal.

15 years ago[cogl journal] If we are only flushing one quad use a TRIANGLE_FAN
Robert Bragg [Thu, 28 May 2009 01:03:16 +0000 (02:03 +0100)]
[cogl journal] If we are only flushing one quad use a TRIANGLE_FAN

At the moment Cogl doesn't do much batching of quads so most of the time we
are flushing a single quad at a time.  This patch simplifies how we submit
those quads to OpenGL by using glDrawArrays with GL_TRIANGLE_FAN mode
instead of sending indexed vertices using GL_TRIANGLES mode.

Note: I hope to follow up soon with changes that improve our batching and
also move the indices into a VBO so they don't need to be re-validated every
time we call glDrawElements.

15 years ago[deprecated defines] Adds some missing cogl_texture_* deprecated defines
Robert Bragg [Tue, 26 May 2009 17:25:00 +0000 (18:25 +0100)]
[deprecated defines] Adds some missing cogl_texture_* deprecated defines

To assist people porting code from 0.8, the cogl_texture_* functions that
have been replaced now have defines that give some hint as to how they
should be replaced.

15 years ago[cogl] renamed cogl_enable_* to cogl_set_*_enabled + added getters
Robert Bragg [Tue, 26 May 2009 15:55:11 +0000 (16:55 +0100)]
[cogl] renamed cogl_enable_* to cogl_set_*_enabled + added getters

cogl_enable_depth_test and cogl_enable_backface_culling have been renamed
and now have corresponding getters, the new functions are:
  cogl_set_depth_test_enabled
  cogl_get_depth_test_enabled
  cogl_set_backface_culling_enabled
  cogl_get_backface_culling_enabled

15 years ago[cogl matrix] Support ortho and perspective projections.
Robert Bragg [Tue, 26 May 2009 10:33:54 +0000 (11:33 +0100)]
[cogl matrix] Support ortho and perspective projections.

This adds cogl_matrix api for multiplying matrices either by a perspective
or ortho projective transform.  The internal matrix stack and current-matrix
APIs also have corresponding support added.

New public API:
cogl_matrix_perspective
cogl_matrix_ortho
cogl_ortho
cogl_set_modelview_matrix
cogl_set_projection_matrix

15 years ago[cogl] Remove cogl_{create,destroy}_context from the public API
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.

15 years ago[vbo indices] tweak add_indices api to return an id and add delete_indices api
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.

15 years ago[cogl-vertex-buffer] Seal GL types from the public API
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.

15 years ago[cogl-vertex-buffers] Support putting index arrays into VBOS
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 ()

15 years ago[cogl] Remove cogl_flush_gl_state from the API
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.

15 years ago[material] Reduce the material API in preperation for releasing Clutter 1.0
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.

15 years ago[cogl-material] Removes all the API made redundant by the blend strings API
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.

15 years ago[cogl-material] Support string based blending and layer combine descriptions
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

15 years ago[build] Fixes some compiler warnings when building for GLES 2
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.

15 years ago[animation] Simplify the Animation code
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.

15 years ago[animatable] Allow validation in ::animate_property
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.

15 years ago[animation] Proxy properties whenever possible
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.

15 years ago[animation] Defer the timeline handling to the Alpha
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

15 years ago[build] Decouple COGL debug level from Clutter's
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.

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

15 years ago[build] More spring clean fixes
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

15 years ago[build] Spring cleanup of configure.ac
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

15 years agoUse GLib variant of strcasecmp()
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.

15 years ago[build] Clean up cogl-pango Makefile
Emmanuele Bassi [Mon, 25 May 2009 11:41:16 +0000 (12:41 +0100)]
[build] Clean up cogl-pango Makefile

15 years ago[cogl] Remove max_waste argument from Texture ctors
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>
15 years agoAdd repaint functions
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.

15 years ago[git ignore] Add test-text-perf
Emmanuele Bassi [Sat, 23 May 2009 18:32:24 +0000 (19:32 +0100)]
[git ignore] Add test-text-perf

15 years ago[actor] In paint when opacity == 0, clear the queued_redraw flag
Neil Roberts [Fri, 22 May 2009 13:49:37 +0000 (14:49 +0100)]
[actor] In paint when opacity == 0, clear the queued_redraw flag

If we are short-circuiting the paint when the opacity is zero we still
need to clear the queued_redraw flag otherwise it won't be possible to
queue another redraw of the actor until something else has caused a
paint first.

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

15 years ago[cogl-vertex-buffer] Ensure the clip state before rendering
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.

15 years ago[texture] size-change closure is now VOID:FLOAT,FLOAT
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>
15 years ago[test-text-perf] Small fix-ups
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.

15 years agoAdd a test for text performance
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.

15 years agoMerge branch 'pango-vbo' into 1.0-integration
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.

15 years ago[cogl-pango-display-list] Use GL_TRIANGLES under GLES
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.

15 years ago[build] Ensure that cogl-debug is disabled by default
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'

15 years ago[build] The cogl GE macro wasn't passing an int according to the format string
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.

15 years agoUse the right internal format for GL_ARB_texture_rectangle
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>
15 years ago[actor_paint] Ensure painting is a NOP for actors with opacity = 0
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.

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 ago[pango-render] Keep a reference to the first line to detect layout changes
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

15 years ago[cogl-pango-render] Fix the positioning when calling cogl_pango_render_layout
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.

15 years ago[texture] Use a box instead of int coordinates
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.

15 years ago[actor] Do not try to dereference NULL data
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.

15 years agoMerge commit 'origin/master' into 1.0-integration
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

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[backend] Abstract the GL context creation
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.

15 years agoUpdate the redraw priority
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.

15 years ago[x11] Abstract XVisualInfo creation
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.

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>