Commit Graph

2626 Commits

Author SHA1 Message Date
Johan Bilien
f87e10c024 Fix the leak of the GList of layers in CoglMaterial
http://bugzilla.openedhand.com/show_bug.cgi?id=1624

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-06-06 12:59:31 +01:00
Bastian Winkler
6f7afdf553 Broken fixed:: arguments
The commit 2c95b378 prevents clutter_animation_setup_property from being
called with fixed:: property names. This patch adds a additional
parameter "is_fixed" to clutter_animation_setup_property instead of
searching for "fixed::" in property_name.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-06-06 12:58:00 +01:00
Emmanuele Bassi
ca5473836b [build] Check for libXext
It seems GNU Gold (the new linker) either behaves as if with
--no-undefined by default, or has some issue preventing it from not
doing that when instructed to (I'm not sure if this actually
happens). In any case, clutter uses the Xshm extensions, but does not
link to libXext, which makes gold unhappy.

Based on a patch by: Xan Lopez <xan@gnome.org>

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-06-06 12:34:00 +01:00
Neil Roberts
ea15e4c7f0 [CoglPangoDisplayList] Don't store the base color in the display list
It should be possible render a single PangoLayout with different
colors without recalculating the layout. This was not working because
the color used at the first edit was being stored in the display
list. This broke changing the opacity on a ClutterText.

Now each node in the display list has a 'color override' flag which
marks whether it should use the base color or not. The base color is
now passed in from _cogl_pango_display_list_render_texture. The alpha
value is always taken from the base color.
2009-06-05 18:28:27 +01:00
Emmanuele Bassi
6fe22ac850 [repaint] Run the repaint functions in clutter_redraw()
The clutter_redraw() function is used by libraries embedding
Clutter inside another toolkit, instead of queueing a redraw
on the embedded stage. This means that clutter_redraw() should
perform the same sequence of actions done by the redraw idle
callback.
2009-06-05 17:57:05 +01:00
Emmanuele Bassi
f66021825c [docs] Update README
* Remove mentions of Subversion

* Update the configure command line switches
2009-06-05 17:57:05 +01:00
Robert Bragg
01e1aae7dd [cogl] cogl_material_set_layer does nothing if resetting the same texture
This avoids dirtying the layer, and should avoid some uneeded state changes
2009-06-05 17:18:32 +01:00
Robert Bragg
dea7f9b7d3 [test-conformance] we were calling clutter_init with un-initialized arguments
This ensure we initialize shared_state->arg{c,v}_addr before calling
clutter_init
2009-06-05 17:18:32 +01:00
Emmanuele Bassi
6b92296e7f [build] Fix compiler warnings
Silence GCC
2009-06-05 16:46:12 +01:00
Emmanuele Bassi
02fa34f65b Fix a compiler warning 2009-06-05 16:39:18 +01:00
Neil Roberts
b061a00f4c [ClutterActor] Fix check for zero opacity when being painted from a clone
Clutter short-circuits painting when an actor's opacity is
zero. However if the actor is being painted from a ClutterClone then
it will be painted using the clone's opacity instead so the test was
broken.
2009-06-05 16:25:39 +01:00
Emmanuele Bassi
03471daf50 [build] Add all dependencies for pkg-config
A merge conflict gone bad: the IMAGE_PC_FILES variable was not appended
to the CLUTTER_REQUIRES one, thus leading to Clutter depending on
GdkPixbuf but never actually checking for it.
2009-06-05 12:46:37 +01:00
Emmanuele Bassi
7e33fe3175 Merge branch '1.0-integration'
* 1.0-integration: (138 commits)
  [x11] Disable XInput by default
  [xinput] Invert the XI extension version check
  [cogl-primitives] Fix an unused variable warning when building GLES
  [clutter-stage-egl] Pass -1,-1 to clutter_stage_x11_fix_window_size
  Update the GLES backend to have the layer filters in the material
  [gles/cogl-shader] Add a missing semicolon
  [cogl] Move the texture filters to be a property of the material layer
  [text] Fix Pango unit to pixels conversion
  [actor] Force unrealization on destroy only for non-toplevels
  [x11] Rework map/unmap and resizing
  [xinput] Check for the XInput entry points
  [units] Validate units against the ParamSpec
  [actor] Add the ::allocation-changed signal
  [actor] Use flags to control allocations
  [units] Rework Units into logical distance value
  Remove a stray g_value_get_int()
  Remove usage of Units and macros
  [cogl-material] Allow setting a layer with an invalid texture handle
  [timeline] Remove the concept of frames from timelines
  [gles/cogl-shader] Fix parameter spec for cogl_shader_get_info_log
  ...

Conflicts:
	configure.ac
2009-06-05 12:41:42 +01:00
Emmanuele Bassi
cbb748f7c0 [x11] Disable XInput by default
The XInput support in Clutter is still using XI 1.x. This will never
work correctly, and we are all waiting for XInput 2 anyway. The changes
internally should be minimal, so we can leave everything in place, but
it's better to disable XInput support by default -- at least for the
time being.
2009-06-05 12:30:08 +01:00
Neil Roberts
3ee093e356 Merge branch 'timeline-no-fps' into 1.0-integration 2009-06-05 12:20:41 +01:00
Emmanuele Bassi
745ca8a62c [xinput] Invert the XI extension version check
Since having XQueryInputVersion means also having XGetExtensionVersion
we need to check the former first to avoid the deprecation warning.
2009-06-05 12:08:41 +01:00
Neil Roberts
fa3ed19db5 [cogl-primitives] Fix an unused variable warning when building GLES
The 'tex' variable is only used if #ifdef'd GL code so it was throwing
an error under GLES. The variable is now moved into a block inside the
#ifdef.
2009-06-04 22:20:18 +01:00
Neil Roberts
810e936164 [clutter-stage-egl] Pass -1,-1 to clutter_stage_x11_fix_window_size
This reflects the changes made to e4ff24bc for the egl stage.
2009-06-04 22:15:41 +01:00
Neil Roberts
6efbb92c58 Update the GLES backend to have the layer filters in the material
This reflects the changes made in 54d8aadf1d for the GLES backend.
2009-06-04 22:12:33 +01:00
Neil Roberts
eff82a546d [gles/cogl-shader] Add a missing semicolon
cogl_shader_get_info_log was missing a semicolon which broke the build
on GLES 2.
2009-06-04 22:10:33 +01:00
Neil Roberts
54d8aadf1d [cogl] Move the texture filters to be a property of the material layer
The texture filters are now a property of the material layer rather
than the texture object. Whenever a texture is painted with a material
it sets the filters on all of the GL textures in the Cogl texture. The
filter is cached so that it won't be changed unnecessarily.

The automatic mipmap generation has changed so that the mipmaps are
only generated when the texture is painted instead of every time the
data changes. Changing the texture sets a flag to mark that the
mipmaps are dirty. This works better if the FBO extension is available
because we can use glGenerateMipmap. If the extension is not available
it will temporarily enable automatic mipmap generation and reupload
the first pixel of each slice. This requires tracking the data for the
first pixel.

The COGL_TEXTURE_AUTO_MIPMAP flag has been replaced with
COGL_TEXTURE_NO_AUTO_MIPMAP so that it will default to
auto-mipmapping. The mipmap generation is now effectively free if you
are not using a mipmap filter mode so you would only want to disable
it if you had some special reason to generate your own mipmaps.

ClutterTexture no longer has to store its own copy of the filter
mode. Instead it stores it in the material and the property is
directly set and read from that. This fixes problems with the filters
getting out of sync when a cogl handle is set on the texture
directly. It also avoids the mess of having to rerealize the texture
if the filter quality changes to HIGH because Cogl will take of
generating the mipmaps if needed.
2009-06-04 19:03:40 +01:00
Emmanuele Bassi
c27f429819 [text] Fix Pango unit to pixels conversion
When going from Pango units to pixels we need to divide by 1024,
and not multiply by 1024.
2009-06-04 17:28:35 +01:00
Emmanuele Bassi
5ea3b47144 [actor] Force unrealization on destroy only for non-toplevels
We cannot force unrealization on toplevels ourselves, so we need
to check inside clutter_actor_destroy() if we want to avoid a
warning.
2009-06-04 16:50:19 +01:00
Emmanuele Bassi
e4ff24bcff [x11] Rework map/unmap and resizing
The mapping and unmapping of the X11 stage implementation is
a bit bong. It's asynchronous, for starters, when it really
can avoid it by tracking the state internally.

The ordering of the map/unmap sequence is also broken with
respect to the resizing.

By tracking the state internally into StageX11 we can safely
remove the MapNotify and UnmapNotify X event handling.

In theory, we should use _NET_WM_STATE a lot more, and reuse
the X11 state flags for fullscreening as well.
2009-06-04 16:30:32 +01:00
Emmanuele Bassi
0a4a28a950 [xinput] Check for the XInput entry points
Apparently, the XInput extension is using the same pkg-config
file ('xi') for both the 1.x and the 2.x API, so we need to
check for both the 1.x XGetExtensionVersion and the 2.x
XQueryInputVersion.
2009-06-04 16:30:31 +01:00
Emmanuele Bassi
876dc22633 [units] Validate units against the ParamSpec
When declaring a property using ClutterParamSpecUnits we pass a
default type to limit the type of units we accept as valid values
for the property.

This means that we need to add the unit type check as part of the
validation process.
2009-06-04 16:30:31 +01:00
Emmanuele Bassi
5ebb59e6b0 [actor] Add the ::allocation-changed signal
Sometimes it is useful to be able to track changes in the allocation
flags, like the absolute origin, inside children of a container.

Using the notify::allocation signal is not enough, in these cases, so
we need a specific signal that gives us both the allocation box and the
allocation flags.
2009-06-04 16:30:31 +01:00
Emmanuele Bassi
0187bb3965 [actor] Use flags to control allocations
Instead of passing a boolean value, the ::allocate virtual function
should use a bitmask and flags. This gives us room for expansion
without breaking API/ABI, and allows to encode more information to
the allocation process instead of just changes of absolute origin.
2009-06-04 16:30:31 +01:00
Emmanuele Bassi
0d5e17ecd1 [units] Rework Units into logical distance value
Units as they have been implemented since Clutter 0.4 have always been
misdefined as "logical distance unit", while they were just pixels with
fractionary bits.

Units should be reworked to be opaque structures to hold a value and
its unit type, that can be then converted into pixels when Clutter needs
to paint or compute size requisitions and perform allocations.

The previous API should be completely removed to avoid collisions, and
a new type:

        ClutterUnits

should be added; the ability to install GObject properties using
ClutterUnits should be maintained.
2009-06-04 16:30:31 +01:00
Emmanuele Bassi
1580ffb884 Remove a stray g_value_get_int()
Now that all properties are float, using g_value_get_int() to
retrieve the value of the :anchor-x property is going to print
out a warning.
2009-06-04 16:30:30 +01:00
Emmanuele Bassi
046e571bae Remove usage of Units and macros
The ClutterUnit and relative macros should not be used when dealing
with pixels -- which is to say, all the time when inside Clutter.
2009-06-04 16:30:30 +01:00
Neil Roberts
26f07abc65 [cogl-material] Allow setting a layer with an invalid texture handle
It was previously possible to create a material layer with no texture
by setting some property on it such as the matrix. However it was not
possible to get back to that state without removing the layer and
recreating it. It is useful to be able to remove the texture to free
resources without forgetting the state of the layer so we can put a
different texture in later.
2009-06-04 14:04:32 +01:00
Neil Roberts
9c7afe0c5b [timeline] Remove the concept of frames from timelines
Timelines no longer work in terms of a frame rate and a number of
frames but instead just have a duration in milliseconds. This better
matches the working of the master clock where if any timelines are
running it will redraw as fast as possible rather than limiting to the
lowest rated timeline.

Most applications will just create animations and expect them to
finish in a certain amount of time without caring about how many
frames are drawn. If a frame is going to be drawn it might as well
update all of the animations to some fraction of the total animation
rather than rounding to the nearest whole frame.

The 'frame_num' parameter of the new-frame signal is now 'msecs' which
is a number of milliseconds progressed along the
timeline. Applications should use clutter_timeline_get_progress
instead of the frame number.

Markers can now only be attached at a time value. The position is
stored in milliseconds rather than at a frame number.

test-timeline-smoothness and test-timeline-dup-frames have been
removed because they no longer make sense.
2009-06-04 13:21:57 +01:00
Neil Roberts
c20886c5e3 [gles/cogl-shader] Fix parameter spec for cogl_shader_get_info_log
The stub version of cogl_shader_get_info_log needed to be updated to
match the changes to the function signature in 61deeafa.
2009-06-04 12:04:47 +01:00
Neil Roberts
fa0b33ec30 [clutter-stage-win32] Call clutter_actor_map instead of setting the flags
The clutter_actor_map and unmap functions need to be called to
properly update the mapped state. This matches the changes to the X11
stage in 125bded8.
2009-06-04 11:59:17 +01:00
Neil Roberts
af68945486 [clutter-event-win32] Fix the argument types to clutter_actor_get_size
clutter_actor_get_size now takes float pointers so it was issuing a
warning.
2009-06-04 11:50:52 +01:00
Neil Roberts
f89ff7f383 Load glBlendEquation and glBlendColor using cogl_get_proc_address
These are defined since OpenGL 1.2 and since Windows doesn't export
any functions defined after 1.1 we need to load them dynamically.
2009-06-04 11:50:06 +01:00
Neil Roberts
daa95b561e Rename 'near' and 'far' variables to 'z_near' and 'z_far'
The Windows headers define near and far to be empty so it breaks the
build.
2009-06-04 11:48:51 +01:00
Neil Roberts
b5a7b3a004 [configure] Require pango 1.20 instead of 1.18
Clutter now calls pango_layout_set_height which is only available
since Pango 1.20.
2009-06-04 11:05:36 +01:00
Emmanuele Bassi
6825b9db1c [actor] Unrealize on destroy
If the application code calls for destruction of an actor we need
to make sure that the actor is unrealized before running the dispose
sequence; otherwise, we might trigger an assertion failure on composite
actors.
2009-06-03 14:05:06 +01:00
Emmanuele Bassi
181ba67114 Revert commit 762873e7
The commit 762873e79e is completely
and utterly wrong and I should have never pushed it.

Serves me well for trying to work on three different branches and
on three different things.
2009-06-03 14:05:05 +01:00
Emmanuele Bassi
762873e79e [master clock] Avoid excessive redraws
Currently, the clock source spins a redraw every time there is at
least a timeline running. If the timelines were not advanced in
the previous frame, though, because their interval is larger than
the vblanking interval then this will lead to excessive redraws of
the scenegraph even if nothing has changed.

To avoid this a simple guard should be set by the MasterClock::advance
method in case no timeline was effectively advanced, and checked
before dispatching the stage redraws.
2009-06-03 12:02:56 +01:00
Neil Roberts
f4a431a947 [cogl-texture] Don't take ownership of the data in cogl_texture_new_from_bitmap
When creating a Cogl texture from a Cogl bitmap it would steal the
data by setting the bitmap_owner flag and clearing the data pointer
from the bitmap. The data would be freed by the time the
new_from_bitmap is finished. There is no reason to do this because the
data will be freed when the Cogl bitmap is unref'd and it is confusing
not to be able to reuse the bitmap for creating multiple textures.
2009-06-02 18:01:41 +01:00
Emmanuele Bassi
b6f1322e07 [tests] Add ClutterColor conformance tests
Add a conformance test unit for the to_string() and from_string()
methods.
2009-06-01 18:43:47 +01:00
Robert Staudinger
bd13a4ddc4 [color] Add support for the "#rgba" color format
clutter_color_from_string() only supported the "#rrggbbaa" format with
alpha channel, this patch adds support for "#rgba".

Colors in "#rrggbb" format were parsed manually, this is now left to
the pango color parsing fallback, since that's handling it just fine.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-06-01 18:42:28 +01:00
Emmanuele Bassi
ffd5fb172b [docs] Rework the API reference version generation
Clutter copies the gtk-doc from the usual gtk+ template, and
has a version.xml.in containing only:

  @VERSION@

Without a newline at the end. Unfortunately, it appears that
autoconf has started adding a newline to the generated version.xml
which then is used as the payload for the "version" XML entity.

Instead of using a secondary file we can make configure generate
the whole clutter-docs.xml and cogl-docs.xml files from a template;
this way we also get the ability to substitute more autoconf variables
into the documentation -- if needs be.
2009-06-01 17:40:23 +01:00
Emmanuele Bassi
61deeafa71 [cogl-shader] Make get_info_log() slightly nicer
The cogl_shader_get_info_log() function is very inconvenient for
language bindings and for regular use, as it requires a static
buffer to be filled -- basically just providing a wrapper around
glGetInfoLogARB().

Since COGL aims to be a more convenient API than raw GL we should
just make cogl_shader_get_info_log() return an allocated string
with the GLSL compiler log.
2009-06-01 17:40:23 +01:00
Neil Roberts
5c26cc6ba7 Use GL_QUADS for flushing a quad batch
Instead of using GL_TRIANGLES and uploading the indices every time, it
now uses GL_QUADS instead on OpenGL. Under GLES it still uses indices
but it uses the new cogl_vertex_buffer_indices_get_for_quads function
to avoid uploading the vertices every time.

This requires the _cogl_vertex_buffer_indices_pointer_from_handle
function to be exposed privately to the rest of Cogl.

The static_indices array has been removed from the Cogl context.
2009-06-01 17:29:01 +01:00
Emmanuele Bassi
6cd1cb21cc [introspection] Remove Cogl symbols from Clutter GIR
The GIR file for Clutter still contains symbols from COGL, even
though we provide a Cogl GIR as well. The Clutter GIR should
depend on the Cogl GIR instead.
2009-06-01 15:51:59 +01:00
Marc-André Lureau
86230eb9fa build: don't double install clutter-version.h
Automake 1.11 installs several files in one command, and it fails if
the same file is installed two times.

See NEWS for details:
http://lists.gnu.org/archive/html/automake/2009-05/msg00093.html

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-06-01 15:49:11 +01:00