profile/ivi/clutter.git
14 years agocogl: Do the premult conversion in-place rather than copying to a new buffer
Neil Roberts [Fri, 29 Jan 2010 15:15:08 +0000 (15:15 +0000)]
cogl: Do the premult conversion in-place rather than copying to a new buffer

The premult part of _cogl_convert_premult has now been split out as
_cogl_convert_premult_status. _cogl_convert_premult has been renamed
to _cogl_convert_format to make it less confusing. The premult
conversion is now done in-place instead of copying the
buffer. Previously it was copying the buffer once for the format
conversion and then copying it again for the premult conversion. The
premult conversion never changes the size of the buffer so it's quite
easy to do in place. We can also use the separated out function
independently.

14 years agocogl-atlas-texture: Use a single atlas for both RGB and RGBA textures
Neil Roberts [Fri, 29 Jan 2010 12:19:42 +0000 (12:19 +0000)]
cogl-atlas-texture: Use a single atlas for both RGB and RGBA textures

The internal format of the atlas texture is still set to the
appropriate format so Cogl will disable blending for textures that are
intended to be RGB. This should end up ignoring the alpha channel from
the texture in the atlas. This makes the code slightly easier to
maintain and should also improve the chances of batching.

14 years agocogl-atlas-texture: Add a debug option to disable the atlas
Neil Roberts [Thu, 21 Jan 2010 15:34:19 +0000 (15:34 +0000)]
cogl-atlas-texture: Add a debug option to disable the atlas

If the user specifies the 'disable-atlas' debug option then no texture
will be put in the atlas.

14 years agotest-cogl-npot-texture: Use the COGL_TEXTURE_NO_ATLAS flag
Neil Roberts [Tue, 19 Jan 2010 17:14:58 +0000 (17:14 +0000)]
test-cogl-npot-texture: Use the COGL_TEXTURE_NO_ATLAS flag

If the texture is put in the atlas it won't be sliced whatever size it
is so it negates the test. We can avoid this with the NO_ATLAS flag.

14 years agocogl-atlas-texture: Don't create atlas textures with the premult bit
Neil Roberts [Tue, 19 Jan 2010 17:06:28 +0000 (17:06 +0000)]
cogl-atlas-texture: Don't create atlas textures with the premult bit

Previously the atlas textures were being created with whatever format
the first sub texture is in. Only three formats are supported so this
only matters if the first texture is a premultiplied alpha
texture. Instead it now masks out the premultiplied bit so that the
textures are always either RGB_888 or RGBA_8888.

14 years agocogl-atlas-texture: Fix premultiplied texture formats
Neil Roberts [Mon, 18 Jan 2010 10:53:00 +0000 (10:53 +0000)]
cogl-atlas-texture: Fix premultiplied texture formats

When uploading texture data it was just calling cogl_texture_set_data
on the large texture. This would attempt to convert the data to the
format of the large texture. All of the textures with alpha channels
are stored together regardless of whether they are premultiplied so
this was causing premultiplied textures to be unpremultiplied
again. It now just uploads the data ignoring the premult bit of the
format so that it only gets converted once.

14 years agocogl-primitives: Ensure the mipmaps for a layer before logging quads
Neil Roberts [Thu, 14 Jan 2010 17:57:43 +0000 (17:57 +0000)]
cogl-primitives: Ensure the mipmaps for a layer before logging quads

With the atlas texture backend ensuring the mipmaps can make it become
a completely different texture which will have different texture
coordinates or may even be sliced. Therefore we need to ensure the
mipmaps before deciding which quads to log in the journal. This adds a
new private function to cogl-material which ensures the mipmaps if
needed.

14 years agocogl: Make CoglSubTexture only work for quad rendering
Neil Roberts [Mon, 18 Jan 2010 09:22:04 +0000 (09:22 +0000)]
cogl: Make CoglSubTexture only work for quad rendering

The sub texture backend doesn't work well as a completely general
texture backend because for example when rendering with cogl_polygon
it needs to be able to tranform arbitrary texture coordinates without
reference to the other coordintes. This can't be done when the texture
coordinates are a multiple of one because sometimes the coordinate
should represent the left or top edge and sometimes it should
represent the bottom or top edge. For example if the s coordinates are
0 and 1 then 1 represents the right edge but if they are 1 and 2 then
1 represents the left edge.

Instead the sub-textures are now documented not to support coordinates
outside the range [0,1]. The coordinates for the sub-region are now
represented as integers as this helps avoid rounding issues. The
region can no longer be a super-region of the texture as this
simplifies the code quite a lot.

There are two new texture virtual functions:

transform_quad_coords_to_gl - This transforms two pairs of coordinates
     representing a quad. It will return FALSE if the coordinates can
     not be transformed. The sub texture backend uses this to detect
     coordinates that require repeating which causes cogl-primitives
     to use manual repeating.

ensure_non_quad_rendering - This is used in cogl_polygon and
     cogl_vertex_buffer to inform the texture backend that
     transform_quad_to_gl is going to be used. The atlas backend
     migrates the texture out of the atlas when it hits this.

14 years agocogl-texture: Fix manual repeating for negative coordinates
Neil Roberts [Mon, 11 Jan 2010 16:23:38 +0000 (16:23 +0000)]
cogl-texture: Fix manual repeating for negative coordinates

When calculating the next integer position for negative coordinates it
would not increment if the position is already a multiple of one so we
need to manually add one.

14 years agocogl-texture-2d: Fix the coordinate wrapping for negative coordinates
Neil Roberts [Mon, 11 Jan 2010 16:21:56 +0000 (16:21 +0000)]
cogl-texture-2d: Fix the coordinate wrapping for negative coordinates

The formula to wrap the coordinates to the [0,1] range was broken when
the coordinates were negative.

14 years agoMerge branch 'master' into more-texture-backends
Neil Roberts [Fri, 15 Jan 2010 12:15:46 +0000 (12:15 +0000)]
Merge branch 'master' into more-texture-backends

14 years agotests: Add a simple conformance test for texture mipmaps
Neil Roberts [Fri, 15 Jan 2010 12:02:09 +0000 (12:02 +0000)]
tests: Add a simple conformance test for texture mipmaps

This adds a test which renders a texture into a 1x1 pixel quad with
and without filters that use mipmaps. The pixel without mipmaps will
be one of the colors from the texture and the one with will be the
average of all the pixels in the texture.

14 years agoAdd a notice of deprecation in the pre-Git ChangeLog
Emmanuele Bassi [Thu, 14 Jan 2010 15:23:41 +0000 (15:23 +0000)]
Add a notice of deprecation in the pre-Git ChangeLog

14 years agocogl-framebuffer: Return gboolean from try_creating_fbo
Neil Roberts [Tue, 12 Jan 2010 21:44:40 +0000 (21:44 +0000)]
cogl-framebuffer: Return gboolean from try_creating_fbo

When try_creating_fbo fails it returns 0 to report the error and if it
succeeds it returns ‘flags’. However cogl_offscreen_new_to_texture
also passes in 0 for the flags as the last fallback to create the fbo
with nothing but the color buffer. In that case it will return 0
regardless of whether it succeeded so the last fallback will always be
considered a failure.

To fix this it now just returns a gboolean to indicate whether it
succeeded and the flags used for each attempt is assigned when passing
the argument rather than from the return value of the function.

Also if the only configuration that succeeded was with flags==0 then
it would always try all combinations because last_working_flags would
also be zero. To avoid this it now uses a separate gboolean to mark
whether we found a successful set of flags.

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

14 years agoconform: Add operators tests for ClutterColor
Emmanuele Bassi [Thu, 14 Jan 2010 14:07:04 +0000 (14:07 +0000)]
conform: Add operators tests for ClutterColor

The clutter_color_add() and clutter_color_subtract() functions are
lacking unit testing to catch eventual regressions.

14 years agomaster-clock: Add profiling timers
Emmanuele Bassi [Thu, 14 Jan 2010 12:28:07 +0000 (12:28 +0000)]
master-clock: Add profiling timers

Use the newly-added profiling timers inside the master clock dispatch
function to see how much time we spend:

  • in the whole function
    • in the event processing for each stage
    • in the timeline advancement

14 years agounits: Improve coverage of clutter_units_from_string()
Emmanuele Bassi [Wed, 13 Jan 2010 17:31:13 +0000 (17:31 +0000)]
units: Improve coverage of clutter_units_from_string()

Add a unit for an empty string as well as units for the missing unit
types like cm, mm and px.

14 years agoAdd test-cogl-multitexture to the Git ignore file
Emmanuele Bassi [Wed, 13 Jan 2010 16:57:55 +0000 (16:57 +0000)]
Add test-cogl-multitexture to the Git ignore file

14 years agobuild: Add a script to format gcov report lines
Emmanuele Bassi [Wed, 13 Jan 2010 16:35:53 +0000 (16:35 +0000)]
build: Add a script to format gcov report lines

Instead of using echo let's try Perl and the format() built-in.

14 years agoAdd gcov support to the build
Emmanuele Bassi [Mon, 4 Jan 2010 14:53:03 +0000 (14:53 +0000)]
Add gcov support to the build

Using gcov it's possible to get a coverage report, that is a break down
of how much the exposed API is exercised by the conformance test suite.

14 years agobuild: Clean up COGL build flags
Emmanuele Bassi [Wed, 13 Jan 2010 15:40:36 +0000 (15:40 +0000)]
build: Clean up COGL build flags

14 years agotexture: Remove reading the texture data back in ::unrealize()
Damien Lespiau [Mon, 2 Nov 2009 17:08:55 +0000 (17:08 +0000)]
texture: Remove reading the texture data back in ::unrealize()

Reading back the texture data in unrealize does not seem like a
desirable feature any more, clutter has evolved a lot since it was
implemented.

What's wrong with it now:

  * It takes *a lot* of time to read the data back with glReadPixel(),
  * When several textures share the same CoglTexture, the same data can
    be read back multiple times,
  * If the underlying material uses multiple texture units, only the
    first one was copied back,
  * In ClutterCairoTexture, we end up having two separate copies of the
    data,
  * GL actually manages texture memory accross system/video memory
    for us!

For all the reasons above, let's get rid of the glReadPixel() in
Texture::unrealize()

Fixes: OHB#1842

14 years agocogl-framebuffer: Add some missing GL defines
Neil Roberts [Tue, 12 Jan 2010 14:49:55 +0000 (14:49 +0000)]
cogl-framebuffer: Add some missing GL defines

Since 755cce33a7 the framebuffer code is using the GL enums
GL_DEPTH_ATTACHMENT and GL_DEPTH_COMPONENT16. These aren't available
directly under GLES except with the OES suffix so we need to define
them manually as we do with the other framebuffer constants.

14 years agocogl: Remove the CGL_* defines
Neil Roberts [Tue, 12 Jan 2010 14:43:36 +0000 (14:43 +0000)]
cogl: Remove the CGL_* defines

These macros used to define Cogl wrappers for the GLenum values. There are
now Cogl enums everywhere in the API where these were required so we
shouldn't need them anymore. They were in the public headers but as
they are not neccessary and were not in the API docs for Clutter 1.0
it should be safe to remove them.

14 years agostage: Add the delete-event signal
Emmanuele Bassi [Tue, 12 Jan 2010 15:44:28 +0000 (15:44 +0000)]
stage: Add the delete-event signal

Using the ::event signal to match the CLUTTER_DELETE event type (and
block the stage destruction) can be costly, since it means checking
every single event.

The ::delete-event signal is similar in spirit to any other specialized
signal handler dealing with events, and retains the same semantics.

14 years agojournal: Fixes logging of multiple sets of texture coordinates
Robert Bragg [Tue, 12 Jan 2010 11:02:09 +0000 (11:02 +0000)]
journal: Fixes logging of multiple sets of texture coordinates

If a user supplied multiple groups of texture coordinates with
cogl_rectangle_with_multitexture_coords() then we would repeatedly log only
the first group in the journal.  This fixes that bug and adds a conformance
test to verify the fix.

Thanks to Gord Allott for reporting this bug.

14 years agotext: Zero out the cursor_pos member
Emmanuele Bassi [Mon, 11 Jan 2010 17:08:42 +0000 (17:08 +0000)]
text: Zero out the cursor_pos member

Do not trust the zero-ing done by GObject on the private data structure,
and use memset() instead to zero the ClutterGeometry structure.

14 years agoRemove obsolete code from test-text
Emmanuele Bassi [Mon, 11 Jan 2010 17:06:52 +0000 (17:06 +0000)]
Remove obsolete code from test-text

The test-text "fake scrolling" code stopped working somewhere between
0.8 and 0.9, with the new layout code. Instead of the ::cursor-event
signal it should use an approach similar to the Scrollable interface in
the Moblin User Experience toolkit.

Right now, it makes sense to ignore this code entirely.

14 years agocogl: Support multiple fallbacks in cogl_offscreen_new_to_texture()
Robert Bragg [Mon, 30 Nov 2009 20:04:41 +0000 (20:04 +0000)]
cogl: Support multiple fallbacks in cogl_offscreen_new_to_texture()

The Intel drivers in Mesa 7.6 (and possibly earlier versions) don't
support creating FBOs with a stencil buffer but without a depth
buffer. This reworks framebuffer allocation so that we try a number
of fallback options before failing.

The options we try in order are:
- the same options that were sucessful last time if available
- combined depth and stencil
- separate depth and stencil
- just stencil, no depth
- just depth, no stencil
- neither depth or stencil

14 years agomedia: Add an API to specify which font should be used for subtitles
Damien Lespiau [Wed, 6 Jan 2010 11:48:46 +0000 (11:48 +0000)]
media: Add an API to specify which font should be used for subtitles

Allow the user of the ClutterMedia interface to specify a Pango font
description to display subtitles. Even if the underlying implementation
of the interface does not natively use Pange, it must be capable of
parsing the grammar that pango_font_description_from_string() accepts.

14 years agobuild: Clean up private header/source files
Emmanuele Bassi [Sun, 10 Jan 2010 11:35:26 +0000 (11:35 +0000)]
build: Clean up private header/source files

Some source files should not be passed through the introspection parser,
as they are fully private and do not expose any valuable API.

Also the clutter-profile.h header is private and should not be
installed.

14 years agoframebuffers: cogl_offscreen_new_to_texture should take a ref on the texture
Robert Bragg [Wed, 25 Nov 2009 14:26:32 +0000 (14:26 +0000)]
framebuffers: cogl_offscreen_new_to_texture should take a ref on the texture

We weren't taking a reference on the texture to be used as the color buffer
for offscreen rendering, so it was possible to free the texture leaving the
framebuffer in an inconsistent state.

14 years agoprofiling: Adds initial UProf accounting to Cogl
Robert Bragg [Fri, 3 Jul 2009 15:22:35 +0000 (16:22 +0100)]
profiling: Adds initial UProf accounting to Cogl

This adds gives Cogl a dedicated UProf context which will be linked together
with Clutter's context during clutter_init_real().

Initial timers cover _cogl_journal_flush and _cogl_journal_log_quad

You can explicitly ask for a report of Cogl statistics by exporting
COGL_PROFILE_OUTPUT_REPORT=1 but since the context is linked with Clutter's
the statisitcs will also be shown in the automatic Clutter reports.

14 years agoprofiling: Allow limiting statisics just to picking
Robert Bragg [Fri, 17 Apr 2009 11:15:56 +0000 (12:15 +0100)]
profiling: Allow limiting statisics just to picking

This suspends and resumes all uprof timers and counters except while dealing
with picking, so as to give more focused statistics.

Be aware that there are still some issues with this profile option since
there are a few special case counters and timers that shouldn't be
suspended; noteably the frame counters are incorrect so the per frame stats
can't be trusted.

14 years agoprofiling: Parse --clutter-profile and CLUTTER_PROFILE= options
Robert Bragg [Wed, 6 Jan 2010 18:15:13 +0000 (18:15 +0000)]
profiling: Parse --clutter-profile and CLUTTER_PROFILE= options

As we have for debugging, this adds the ability to control profiling flags
either via the command line or an environment variable.

The first option added is CLUTTER_PROFILE=disable-report

This also changes the reporting to be opt-out so you don't need to export
CLUTTER_PROFILE_OUTPUT_REPORT=1 to see a report but you can use
CLUTTER_PROFILE=disable-report to disable it if desired.

14 years agoprofiling: Adds initial UProf support across clutter
Robert Bragg [Mon, 30 Mar 2009 15:41:02 +0000 (16:41 +0100)]
profiling: Adds initial UProf support across clutter

UProf is a small library that aims to help applications/libraries provide
domain specific reports about performance.  It currently provides high
precision timer primitives (rdtsc on x86) and simple counters, the ability
to link statistics between optional components at runtime and makes report
generation easy.

This adds initial accounting for:
- Total mainloop time
- Painting
- Picking
- Layouting
- Idle time

The timing done by uprof is of wall clock time. It's not based on stochastic
samples we simply sample a counter at the start and end.  When dealing with
the complexities of GPU drivers and with various kinds of IO this form of
profiling can be quite enlightening as it will be able to represent where
your application is blocking unlike tools such as sysprof.

To enable uprof accounting you must configure Clutter with --enable-profile
and have uprof-0.2 installed from git://git.moblin.org/uprof

If you want to see a report of statistics when Clutter applications exit you
should export CLUTTER_PROFILE_OUTPUT_REPORT=1 before running them.

Just a final word of caution; this stuff is new and the manual nature of
adding uprof instrumentation means it is prone to some errors when modifying
code.  This just means that when you question strange results don't rule out
a mistake in the instrumentation.  Obviously though we hope the benfits out
weigh e.g.  by focusing on very key stats and by having automatic reporting.

14 years agoAdds a --enable-profile option to configure.ac
Robert Bragg [Tue, 17 Mar 2009 13:07:46 +0000 (13:07 +0000)]
Adds a --enable-profile option to configure.ac

There is nothing else hooked up to this option so far

14 years agox11: Switch back to RGB visuals by default
Emmanuele Bassi [Fri, 8 Jan 2010 15:04:56 +0000 (15:04 +0000)]
x11: Switch back to RGB visuals by default

Since asking for ARGB by default is still somewhat experimental on X11
and not every toolkit or complex widgets (like WebKit) still do not like
dealing with ARGB visuals, we should switch back to RGB by default - now
that at least we know it works.

For applications (and toolkit integration libraries) that want to enable
the ClutterStage:use-alpha property there is a new function:

  void clutter_x11_set_use_argb_visual (gboolean use_argb);

which needs to be called before clutter_init().

The CLUTTER_DISABLE_ARGB_VISUAL environment variable can still be used
to force this value off at run-time.

14 years agodoc: Fix media::{get,set}_subtitle_uri() symbol names
Damien Lespiau [Wed, 6 Jan 2010 00:44:24 +0000 (00:44 +0000)]
doc: Fix media::{get,set}_subtitle_uri() symbol names

At first, those symbols were called {get,set}_subtitles_uri() but were
renamed to {get,set}_subtitle_uri() without updating the
clutter-section.txt file.

This fix makes gtk-doc document those symbols again.

14 years agoactor: Just emit a relayout cycle warning
Emmanuele Bassi [Thu, 7 Jan 2010 11:08:52 +0000 (11:08 +0000)]
actor: Just emit a relayout cycle warning

Currently, ClutterActor detects a relayout cycle (an actor causing a
relayout to be queued from within an allocate() function) and aborts
after printing out a warning. This might be a little bit too anal
retentive, and it currently breaks GTK+ embedding inside clutter-gtk
so we should probably relax the behaviour a bit. Now we just emit the
warning but we still go ahead with the relayout.

14 years agoDon't set the GLX_TRANSPARENT_TYPE attribute to choose an FBConfig
Neil Roberts [Thu, 7 Jan 2010 15:58:53 +0000 (15:58 +0000)]
Don't set the GLX_TRANSPARENT_TYPE attribute to choose an FBConfig

When Clutter tries to pick an ARGB visual it tried to set the
GLX_TRANSPARENT_TYPE attribute of the FBConfig to
GLX_TRANSPARENT_RGB. However the code to do this was broken so that it
was actually trying to set the non-existant attribute number 0x8008
instead. Mesa silently ignored this so it appeared as if it was
working but the Nvidia drivers do not like it.

It appears that the TRANSPARENT_TYPE attribute is not neccessary for
getting an ARGB visual anyway and instead it is intended to support
color-key transparency. Therefore we can just remove it and get all of
the FBConfigs. Then if we need an ARGB visual we can just walk the
list to look for one with depth == 32.

The fbconfig is now stored in a single variable instead of having a
separate variable for the rgb and rgba configs because the old code
only ever retrieved one of them anyway.

14 years agoCovert stb_image.c to Unix format
Emmanuele Bassi [Tue, 5 Jan 2010 18:02:29 +0000 (18:02 +0000)]
Covert stb_image.c to Unix format

The file is still in DOS format (CRLF instead of LF) and this confuses
the hell out of some versions of Git.

14 years agoInclude cogl-defines.h before using GL types
Emmanuele Bassi [Tue, 5 Jan 2010 17:54:45 +0000 (17:54 +0000)]
Include cogl-defines.h before using GL types

If we are using GL* types we should also be including cogl-defines.h, as
that will include the right GL header.

14 years agocogl: Fix array annotations
Emmanuele Bassi [Tue, 5 Jan 2010 16:11:45 +0000 (16:11 +0000)]
cogl: Fix array annotations

The arrays in the cogl_program_set_uniform_* API should be marked as
such, and have their length arguments specified.

14 years agotext: Store the markup attributes separately
Neil Roberts [Tue, 5 Jan 2010 11:58:12 +0000 (11:58 +0000)]
text: Store the markup attributes separately

Previously when the markup property is set it would generate an
attribute list from the markup and then merge it with the attributes
from the attribute property and store it as the effective
attributes. The markup attributes and the marked up text would then be
forgotten. This breaks if the application then later changes the
attributes property because it would try to regenerate the effective
attributes from the markup text but the stored text no longer contains
any markup. If the original markup text happened to contain entities
like '<' they would end up causing parse errors because they would
be converted to the actual symbols.

To fix this the attributes from the markup are now stored
independently from the effective attributes. The effective attributes
are now regenerated if either set of attributes changes right before a
layout is created.

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

14 years agotext: Free the Pango attribute list resources
Neil Roberts [Tue, 5 Jan 2010 11:44:17 +0000 (11:44 +0000)]
text: Free the Pango attribute list resources

The ClutterText owns three PangoAttrList resources which were not
being unref'd. This adds the unref calls to the finalize method.

14 years agox11 tfp: Plug a leak
Emmanuele Bassi [Tue, 5 Jan 2010 14:10:19 +0000 (14:10 +0000)]
x11 tfp: Plug a leak

Destroy the dummy XImage we create even on success.

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

Based on a patch by: Carlos Martín Nieto <carlos@cmartin.tk>

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agoMerge branch 'matrix-mode'
Emmanuele Bassi [Tue, 5 Jan 2010 11:04:50 +0000 (11:04 +0000)]
Merge branch 'matrix-mode'

* matrix-mode:
  build: Move CoglMatrixMode to cogl-matrix-stack.h

14 years agoRemove trailing comma from test UI definition
Emmanuele Bassi [Tue, 5 Jan 2010 11:02:39 +0000 (11:02 +0000)]
Remove trailing comma from test UI definition

The animation definition test has a trailing comma at the end of an
array item.

14 years agoscript: Copy the JSON node in PropertyInfo
Emmanuele Bassi [Tue, 5 Jan 2010 10:55:28 +0000 (10:55 +0000)]
script: Copy the JSON node in PropertyInfo

PropertyInfo should store a copy of the JsonNodes it references, so
that property_info_free() can safely dispose them, and we can reference
values across different UI definition data.

The implicit timeline parsing code is not copying the JsonNode; this
leads to a double free in some cases, which is masked by the GSlice
allocator and produces a heap corruption later on.

14 years ago[media] Add an API to play a subtitle file along with the media
Damien Lespiau [Mon, 28 Dec 2009 16:52:43 +0000 (17:52 +0100)]
[media] Add an API to play a subtitle file along with the media

Allow the user of the ClutterMedia interface to specify an external (as
in not multiplexed with the audio/video streams) location of a subtitle
stream.

14 years agotext: Use G_SIGNAL_ACTION for ::insert-text and ::delete-text
Emmanuele Bassi [Mon, 4 Jan 2010 12:03:47 +0000 (12:03 +0000)]
text: Use G_SIGNAL_ACTION for ::insert-text and ::delete-text

Both the ::insert-text and ::delete-text are "action" signals, that is
signals that are safe to (and should) be emitted using g_signal_emit()
directly.

14 years agoAdded ClutterText::insert-text and ClutterText::delete-text signals
Alejandro Piñeiro [Fri, 20 Nov 2009 14:17:41 +0000 (15:17 +0100)]
Added ClutterText::insert-text and ClutterText::delete-text signals

* clutter/clutter-marshal.list: added new marshaller
* clutter/clutter-text.c
(clutter_text_class_init): added insert-text and delete-text signals
(clutter_text_insert_unichar): emits insert-text signal
(clutter_text_insert_text): emits insert-text signal
(clutter_text_delete_text): emits delete-text signal
(clutter_text_delete_chars): emits delete-text signal
(clutter_text_set_markup_internal): emits delete-text and insert-text signals
(clutter_text_set_text): emits delete-text and insert-text signals

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

14 years agobuild: Move CoglMatrixMode to cogl-matrix-stack.h
Emmanuele Bassi [Mon, 4 Jan 2010 11:58:32 +0000 (11:58 +0000)]
build: Move CoglMatrixMode to cogl-matrix-stack.h

This avoids a redeclaration of _cogl_matrix_stack_flush_to_gl() from
using GLenum to CoglMatrixMode.

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

14 years agocogl-texture: Remove return in void functions
Halton Huo [Mon, 4 Jan 2010 11:49:50 +0000 (11:49 +0000)]
cogl-texture: Remove return in void functions

http://bugzilla.o-hand.com/show_bug.cgi?id=1929

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agobuild: Maintainer cflags go in the _CFLAGS target
Emmanuele Bassi [Mon, 4 Jan 2010 11:49:13 +0000 (11:49 +0000)]
build: Maintainer cflags go in the _CFLAGS target

The maintainer compiler flags are not pre-processor flags.

14 years agocogl: Const-ify vertices in cogl_polygon()
Emmanuele Bassi [Mon, 4 Jan 2010 11:43:00 +0000 (11:43 +0000)]
cogl: Const-ify vertices in cogl_polygon()

The CoglTextureVertex array passed to cogl_polygon() is a pure
in-argument and should be const-ified.

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

14 years agomaster-clock: Take a reference before advancing timelines
Emmanuele Bassi [Wed, 11 Nov 2009 11:00:29 +0000 (11:00 +0000)]
master-clock: Take a reference before advancing timelines

A timeline advancement might cause another timeline to be
destroyed, which will likely lead to a segmentation fault.

Before advancing the timelines we should take a reference
on them - just like we do for the stages before doing
event processing. This will prevent dispose() from running
until the end of the advancement.

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

14 years agoPost-release version bump to 1.1.5
Emmanuele Bassi [Sun, 3 Jan 2010 20:41:17 +0000 (20:41 +0000)]
Post-release version bump to 1.1.5

14 years agoRelease Clutter 1.1.4
Emmanuele Bassi [Sun, 3 Jan 2010 20:11:43 +0000 (20:11 +0000)]
Release Clutter 1.1.4

14 years agobuild: Remove dist rule for non-existing image files
Emmanuele Bassi [Sun, 3 Jan 2010 20:24:39 +0000 (20:24 +0000)]
build: Remove dist rule for non-existing image files

14 years agoDisable g_set_prgname()
Emmanuele Bassi [Sun, 3 Jan 2010 20:12:49 +0000 (20:12 +0000)]
Disable g_set_prgname()

Apparently, calling g_set_prgname() multiple times is not allowed
anymore, and hence clutter_init_* calls should not do that. Though this
is really GLib's fault - and a massive nuisance for us - we should
prolly comply to avoid the test suite dying on us.

14 years agoMerge branch 'animate-layout-manager' into ebassi-next
Emmanuele Bassi [Wed, 23 Dec 2009 10:38:02 +0000 (10:38 +0000)]
Merge branch 'animate-layout-manager' into ebassi-next

* animate-layout-manager:
  layout-manager: Document the animation support
  layout-manager: Rewind the timeline in begin_animation()
  box-layout: Remove the allocations hash table
  docs: Clean up the README file
  layout: Let begin_animation() return the Alpha
  box-layout: Add knobs for controlling animations
  box-layout: Animate layout properties
  layout: Add animation support to LayoutManager
  Add ActorBox animation methods

14 years agolayout-manager: Document the animation support
Emmanuele Bassi [Wed, 23 Dec 2009 10:35:16 +0000 (10:35 +0000)]
layout-manager: Document the animation support

Add a section inside the LayoutManager class API reference documenting,
with examples, how to implement animation support inside a layout
manager sub-class.

14 years agolayout-manager: Rewind the timeline in begin_animation()
Emmanuele Bassi [Wed, 23 Dec 2009 08:39:16 +0000 (08:39 +0000)]
layout-manager: Rewind the timeline in begin_animation()

If the default implementation begin_animation() is called twice then we
should rewind the timeline, as well as updating its duration and the
easing mode of the alpha.

14 years agobox-layout: Remove the allocations hash table
Emmanuele Bassi [Wed, 23 Dec 2009 08:34:08 +0000 (08:34 +0000)]
box-layout: Remove the allocations hash table

The BoxLayout uses a HashTable to map the latest stable allocation of
each child, in order to use that as the initial value during an
animation; this in spite of already having a perfectly valid per-child
storage as part of the layout manager: ClutterBoxChild.

The last stable allocation should be stored inside the ClutterBoxChild
instead of having it in the private data for ClutterBoxLayout. The
access remains O(1), since there is a 1:1 mapping between child and
BoxChild instances, but we save a little bit of memory and we avoid
keeping aroud allocations for old children.

14 years agodocs: Clean up the README file
Emmanuele Bassi [Tue, 22 Dec 2009 18:10:39 +0000 (18:10 +0000)]
docs: Clean up the README file

14 years agoMerge branch 'stage-use-alpha' into ebassi-next
Emmanuele Bassi [Sun, 20 Dec 2009 17:39:12 +0000 (17:39 +0000)]
Merge branch 'stage-use-alpha' into ebassi-next

* stage-use-alpha:
  tests: Use accessor methods for :use-alpha
  stage: Add accessors for :use-alpha
  tests: Allow setting the stage opacity in test-paint-wrapper
  stage: Premultiply the stage color
  stage: Composite the opacity with the alpha channel
  glx: Always request an ARGB visual
  stage: Add :use-alpha property
  materials: Get the right blend function for alpha

14 years agoMerge branch 'internal-flag' into ebassi-next
Emmanuele Bassi [Sun, 20 Dec 2009 17:33:51 +0000 (17:33 +0000)]
Merge branch 'internal-flag' into ebassi-next

* internal-flag:
  conform: Add test unit for the destruction of Containers
  actor: Add internal child flag
  Clean up whitespace, indentation and comments

14 years agoconform: Add test unit for the destruction of Containers
Emmanuele Bassi [Fri, 18 Dec 2009 23:29:11 +0000 (23:29 +0000)]
conform: Add test unit for the destruction of Containers

Verify that internal children do not go through the remove()
implementation, and that non-internal children do.

14 years agoactor: Add internal child flag
Emmanuele Bassi [Fri, 18 Dec 2009 23:20:04 +0000 (23:20 +0000)]
actor: Add internal child flag

ClutterActor checks, when destroying and reparenting, if the parent
actor implements the Container interface, and automatically calls the
remove() method to perform a clean removal.

Actors implementing Container, though, might have internal children;
that is, children that are not added through the Container API. It is
already possible to iterate through them using the Container API to
avoid breaking invariants - but calling clutter_actor_destroy() on
these children (even from the Container implementation, and thus outside
of Clutter's control) will either lead to leaks or to segmentation
faults.

Clutter needs a way to distinguish a clutter_actor_set_parent() done on
an internal child from one done on a "public" child; for this reason, a
push/pop pair of functions should be available to Actor implementations
to mark the section where they wish to add internal children:

  ➔ clutter_actor_push_internal ();
    ...
    clutter_actor_set_parent (child1, parent);
    clutter_actor_set_parent (child2, parent);
    ...
  ➔ clutter_actor_pop_internal ();

The set_parent() call will automatically set the newly added
INTERNAL_CHILD private flag on each child, and both
clutter_actor_destroy() and clutter_actor_unparent() will check for the
flag before deciding whether to call the Container's remove method.

14 years agolayout: Let begin_animation() return the Alpha
Emmanuele Bassi [Sun, 13 Dec 2009 01:23:54 +0000 (01:23 +0000)]
layout: Let begin_animation() return the Alpha

When beginning a new animation for a LayoutManager, the implementation
should return the ClutterAlpha used. This allows controlling the
timeline and/or modifying the animation parameters on the fly.

14 years agobox-layout: Add knobs for controlling animations
Emmanuele Bassi [Sun, 13 Dec 2009 01:07:44 +0000 (01:07 +0000)]
box-layout: Add knobs for controlling animations

ClutterLayoutManager does not have any state associated with it, and
defers all the state to its sub-classes.

The BoxLayout is thus in charge of controlling:

  • whether or not animations should be used
  • the duration of the animation
  • the easing mode of the animation

By adding three new properties:

  • ClutterBoxLayout:use-animations
  • ClutterBoxLayout:easing-duration
  • ClutterBoxLayout:easing-mode

And their relative accessors pairs we can make BoxLayout decide whether
or not, and with which parameters, call the begin_animation() method of
ClutterLayoutManager.

The test-box-layout has been modified to reflect this new functionality,
by checking the key-press event for the 'a' key symbol to toggle the use
of animations.

14 years agobox-layout: Animate layout properties
Emmanuele Bassi [Sat, 12 Dec 2009 00:13:05 +0000 (00:13 +0000)]
box-layout: Animate layout properties

Use the newly added animation support inside LayoutManager to animate
between state changes of the BoxLayout properties.

The implementation is based on equivalent code from Mx, written by:

  Thomas Wood <thomas.wood@intel.com>

14 years agolayout: Add animation support to LayoutManager
Emmanuele Bassi [Sat, 12 Dec 2009 00:02:43 +0000 (00:02 +0000)]
layout: Add animation support to LayoutManager

In order to animate a fluid layout we cannot use the common animation
code paths as they will override the size request and allocation paths
that are handled by the layout manager itself.

One way to introduce animations in the allocation sequence is to use a
Timeline and an Alpha to compute a progress value and then use that
value to interpolate an ActorBox between the initial and final states of
the animation - with the initial state being the last allocation of the
child prior to the animation start, and the final state the allocation
of the child at the end; for every frame of the Timeline we then queue a
relayout on the layout manager's container, which will result in an
animation.

ClutterLayoutManager is the most likely place to add a generic API for
beginning and ending an animation, as well as the place to provide a
default code path to create the ancillary Timeline and Alpha instances
needed to drive the animation.

A LayoutManager sub-class will need to:

  • call clutter_layout_manager_begin_animation() whenever it should
    animate between two states, for instance: whenever a layout property
    changes value;
  • eventually override begin_animation() and end_animation() in case
    further state needs to be set up, and then chain up to the default
    implementation provided by LayoutManager;
  • if a completely different implementation is required, the layout
    manager sub-class should override begin_animation(), end_animation()
    and get_animation_progress().

Inside the allocate() implementation the sub-class should also
interpolate between the last known allocation of a child and the newly
computed allocation.

14 years agoAdd ActorBox animation methods
Emmanuele Bassi [Fri, 11 Dec 2009 23:48:58 +0000 (23:48 +0000)]
Add ActorBox animation methods

ClutterActorBox should have an interpolate() method that allows to
compute the intermediate values between two states, given a progress
value, e.g.:

        clutter_actor_box_interpolate (start, end, alpha, &result);

Another utility method, useful for layout managers, is a modifier
that clamps the members of the actor box to the nearest integer
value.

14 years agoClean up whitespace, indentation and comments
Emmanuele Bassi [Fri, 11 Dec 2009 20:17:58 +0000 (20:17 +0000)]
Clean up whitespace, indentation and comments

14 years agoMerge branch 'get-current-event' into ebassi-next
Emmanuele Bassi [Thu, 10 Dec 2009 23:36:04 +0000 (23:36 +0000)]
Merge branch 'get-current-event' into ebassi-next

* get-current-event:
  Add clutter_get_current_event

14 years agoAdd clutter_get_current_event
Colin Walters [Thu, 12 Nov 2009 22:33:15 +0000 (17:33 -0500)]
Add clutter_get_current_event

When getting signals from higher level toolkits, occasionally
one wants access to the underlying event; say for a Button
widget's "clicked" signal, to get the keyboard state.

Rather than having all of the highlevel widgets emit
ClutterEvent just for the more unusual use cases,
add a global function to access the event state.

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agoMerge branch 'no-layout-flag' into ebassi-next
Emmanuele Bassi [Wed, 9 Dec 2009 23:32:41 +0000 (23:32 +0000)]
Merge branch 'no-layout-flag' into ebassi-next

* no-layout-flag:
  actor: Add a NO_LAYOUT flag for actors

14 years agoMerge branch 'size-cache' into ebassi-next
Emmanuele Bassi [Wed, 9 Dec 2009 23:32:18 +0000 (23:32 +0000)]
Merge branch 'size-cache' into ebassi-next

* size-cache:
  tests: Clean up the BoxLayout interactive test
  actor: Add debugging notes for size cache
  Add a cache of size requests

14 years agox11: Emulate XKB's detectable key auto-repeat
Emmanuele Bassi [Wed, 9 Dec 2009 18:46:25 +0000 (18:46 +0000)]
x11: Emulate XKB's detectable key auto-repeat

Old-style X11 terminals require that even modern X11 send KeyPress
and KeyRelease pairs when auto-repeating. For this reason modern(-ish)
API like XKB has a way to detect auto-repeat and do a single KeyRelease
at the end of a KeyPress sequence.

The newly added check emulates XKB's detectable auto-repeat by peeking
the next event after a KeyRelease and checking if it's a KeyPress for
the same key and timestamp - and then ignoring the KeyRelease if it
matches.

14 years agodocs: Move RELEASING under docs/
Emmanuele Bassi [Wed, 9 Dec 2009 18:10:52 +0000 (18:10 +0000)]
docs: Move RELEASING under docs/

14 years agostage: Deprecate default stage size macros
Emmanuele Bassi [Wed, 9 Dec 2009 01:52:09 +0000 (01:52 +0000)]
stage: Deprecate default stage size macros

The macros for getting the size of the default stage are a relic of the
past and they should be deprecated.

14 years agotests: Use accessor methods for :use-alpha
Emmanuele Bassi [Wed, 9 Dec 2009 17:17:33 +0000 (17:17 +0000)]
tests: Use accessor methods for :use-alpha

Instead of using g_object_set().

14 years agostage: Add accessors for :use-alpha
Emmanuele Bassi [Wed, 9 Dec 2009 02:04:56 +0000 (02:04 +0000)]
stage: Add accessors for :use-alpha

Use real accessors for the :use-alpha property.

14 years agotests: Allow setting the stage opacity in test-paint-wrapper
Emmanuele Bassi [Wed, 9 Dec 2009 01:46:52 +0000 (01:46 +0000)]
tests: Allow setting the stage opacity in test-paint-wrapper

This allows testing the Stage:use-alpha property and the blending done
by a compositor.

14 years agostage: Premultiply the stage color
Emmanuele Bassi [Wed, 9 Dec 2009 01:46:09 +0000 (01:46 +0000)]
stage: Premultiply the stage color

In case we are using Stage:use-alpha then we need to premultiply the
stage color to get the correct blending from the compositor.

14 years agox11: Do not manage a foreign window
Emmanuele Bassi [Tue, 8 Dec 2009 18:24:30 +0000 (18:24 +0000)]
x11: Do not manage a foreign window

If a Stage has been set to use a foreign Window then Clutter should not
be managing it; calling XWithdrawWindow and XMapWindow should be
reserved to the windows we manage ourselves.

14 years agoRemove clutter_set_default_text_direction()
Emmanuele Bassi [Mon, 7 Dec 2009 19:00:55 +0000 (19:00 +0000)]
Remove clutter_set_default_text_direction()

Setting the default text direction programmatically is wrong: it is a
value dependent on the locale or by the environment.

14 years agoQueue a relayout when the default text direction changes
Emmanuele Bassi [Mon, 7 Dec 2009 18:41:15 +0000 (18:41 +0000)]
Queue a relayout when the default text direction changes

We need a relayout cycle if the default direction for the text changes
while the main loop is running.

14 years agostage: Composite the opacity with the alpha channel
Emmanuele Bassi [Mon, 7 Dec 2009 17:35:17 +0000 (17:35 +0000)]
stage: Composite the opacity with the alpha channel

The Stage's opacity should be composited with the alpha component of the
Stage's background color.

14 years agoactor: Add a NO_LAYOUT flag for actors
Emmanuele Bassi [Wed, 7 Oct 2009 15:41:25 +0000 (16:41 +0100)]
actor: Add a NO_LAYOUT flag for actors

Some actor implementation might avoid imposing any layout on their
children. The Actor base class usually assumes some sort of layout
management is in place, so it will queue relayouts when, for instance,
an actor is shown or is hidden. If the parent of the actor does not
impose any layout, though, showing or hiding one of its children will
not affect the layout of the others.

An example of this kind of container is ClutterGroup.

By adding a new Actor flag, CLUTTER_ACTOR_NO_LAYOUT, and by making
the Group actor set it on itself, the Actor base class can now decide
whether or not to queue a relayout. The flag is not meant to be used
by application code, and should only be set when implementing a new
container.

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

14 years agocogl-material: Ensure mipmaps before doing anything else on a texture
Neil Roberts [Sat, 5 Dec 2009 14:20:00 +0000 (14:20 +0000)]
cogl-material: Ensure mipmaps before doing anything else on a texture

When the texture is in the atlas, ensuring the mipmaps can effectively
make it become a completely different texture so we should do this
before getting the GL handle.

14 years agocogl-atlas-texture: Remove textures from the atlas when mipmapping is required
Neil Roberts [Sat, 5 Dec 2009 13:48:03 +0000 (13:48 +0000)]
cogl-atlas-texture: Remove textures from the atlas when mipmapping is required

Mipmaps don't work very well in the current atlas because there is not
enough padding between the textures. If ensure_mipmaps is called it
will now create a new texture and migrate the atlased texture to
it. It will use the same blit mechanism as when migrating so it will
try to use an FBO for a fast blit. However if this is not possible it
will end up downloading the data for the entire atlas which is not
ideal.

14 years agocogl-atlas-texture: Try to do texture blits using an FBO
Neil Roberts [Sat, 5 Dec 2009 13:24:01 +0000 (13:24 +0000)]
cogl-atlas-texture: Try to do texture blits using an FBO

When reorganizing the textures, we can avoid downloading the entire
texture data if we bind the source texture in a framebuffer object and
copy the destination using glCopyTexSubImage2D. This is also
implemented using a much faster path in Mesa.

Currently it is calling the GL framebuffer API directly but ideally it
would use the Cogl offscreen API. However there is no way to tell Cogl
not to create a stencil renderbuffer which seems like a waste in this
situation.

If FBOs are not available it will fallback to reading back the entire
texture data as before.

14 years agocogl-atlas: Add a debug option to visualize the atlas
Neil Roberts [Fri, 4 Dec 2009 19:43:39 +0000 (19:43 +0000)]
cogl-atlas: Add a debug option to visualize the atlas

This adds a 'dump-atlas-image' debug category. When enabled, CoglAtlas
will use Cairo to create a png which visualizes the leaf rectangles of
the atlas.

14 years agocogl-texture-atlas: Add some debugging notes
Neil Roberts [Fri, 4 Dec 2009 18:55:53 +0000 (18:55 +0000)]
cogl-texture-atlas: Add some debugging notes

This adds an 'atlas' category to the COGL_DEBUG environment
variable. When enabled Cogl will display messages when textures are
added to the atlas and when the atlas is reorganized.

14 years agocogl-atlas-texture: Support reorganizing the atlas when it is full
Neil Roberts [Fri, 4 Dec 2009 18:24:15 +0000 (18:24 +0000)]
cogl-atlas-texture: Support reorganizing the atlas when it is full

When space can't be found in the atlas for a new texture it will now
try to reorganize the atlas to make space. A new CoglAtlas is created
and all of the textures are readded in decreasing size order. If the
textures still don't fit then the size of the atlas is doubled until
either we find a space or we reach the texture size limits. If we
successfully find an organization that fits then all of the textures
will be migrated to a new texture. This involves copying the texture
data into CPU memory and then uploading it again. Potentially it could
eventually use a PBO or an FBO to transfer the image without going
through the CPU.

The algorithm for laying out the textures works a lot better if the
rectangles are added in order so we might eventually want some API for
creating multiple textures in one go to avoid reorganizing the atlas
as far as possible.

14 years agocogl: Add an atlased texture backend
Neil Roberts [Fri, 4 Dec 2009 13:06:32 +0000 (13:06 +0000)]
cogl: Add an atlased texture backend

This adds a CoglAtlas type which is a data structure that keeps track
of unused sub rectangles of a larger rectangle. There is a new atlased
texture backend which uses this to put multiple textures into a single
larger texture.

Currently the atlas is always sized 256x256 and the textures are never
moved once they are put in. Eventually it needs to be able to
reorganise the atlas and grow it if necessary. It also needs to
migrate the textures out of the atlas if mipmaps are required.