Bastian Winkler [Tue, 24 Feb 2009 19:07:31 +0000 (20:07 +0100)]
Remove redundant declaration in clutter-text.h
clutter-text.h declares clutter_text_get_layout twice.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Thu, 26 Feb 2009 12:46:36 +0000 (12:46 +0000)]
[build] Do not shave typelib generation
Bug 1478 - typelib creation shaved out of existence
Add a 'GEN' output rule for the typelib files created when
introspection is enabled.
Emmanuele Bassi [Thu, 26 Feb 2009 11:55:53 +0000 (11:55 +0000)]
[build] Put the X11 pc dependencies in another variable
If X11 comes with pkg-config files (like it should) we should not add
those dependencies to the generic BACKEND_PC_FILES variable: that
variable is meant only for backend-specific dependencies handled by
pkg-config -- and Clutter supports non-X11 backends as well.
The X11_PC_FILES variable will only contain X11-related dependencies,
and will be set as part of BACKEND_PC_FILES only inside the GLX and
EGLX backends sections.
Owen W. Taylor [Wed, 25 Feb 2009 20:46:09 +0000 (15:46 -0500)]
Fix x/y confusion for GL_TEXTURE_RECTANGLE_ARB
When "denormalizing" for texture rectangles, multiple X coordinates
by the X size and Y coordinates by the Y size.
http://bugzilla.openedhand.com/show_bug.cgi?id=1479
Neil Roberts [Thu, 26 Feb 2009 10:56:42 +0000 (10:56 +0000)]
[cogl-pango-glyph-cache] Fix compiler warning on 64-bit
gcc warns about casting a pointer to a guint because it is a different
size on 64-bit machines. However the pointer is only used as a hash so
it doesn't matter if we lose the most significant bits. The patch
makes it use GPOINTER_TO_UINT instead which first casts it to a gulong
and avoids the warning.
Neil Roberts [Tue, 24 Feb 2009 16:44:30 +0000 (16:44 +0000)]
[tests/tools] Don't install libdisable-npots.so
The libdisable-npots library is just used as a helper as part of
make test so it should not be installed.
If noinst_* is used then automake will generate a static library but
this won't work with LD_PRELOAD so we then need an extra custom rule
to link that into a shared library. The custom rule uses the $(LINK)
Makefile var which gets put in the Makefile because of the static
library. We pass libtool a stub -rpath option which causes it to
generate a shared library.
Emmanuele Bassi [Tue, 24 Feb 2009 16:16:25 +0000 (16:16 +0000)]
[media] Add sub-second resolution for the duration
The duration in ClutterMedia is currently expressed in integer multiples
of a second. This does not offer enough granularity for media playback
that has fractionary durations -- 2.3 seconds; 1 minute, 23.4 seconds;
1 hour, 23 minutes, 4.5 seconds; etc.
The duration value should be expressed in seconds with a sub-second
granularity; for this reason, a double should be used insted of an
unsigned integer.
The semantics haven't changed: the :duration property still exposes
seconds.
Bastian Winkler [Tue, 24 Feb 2009 15:58:40 +0000 (15:58 +0000)]
[media] Fix the interface cast macro
Bug 1474 - ClutterMedia interface
The GET_INTERFACE() macro is still using the old type name of
the ClutterMedia interface structure in the cast.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Jonathan Matthew [Tue, 24 Feb 2009 09:25:53 +0000 (09:25 +0000)]
Declare the EnumValues for PixelFormat static
Bug 1473 - CoglPixelFormat enum data must be declared static
When registering an enumeration GType, the GEnumValue or GFlagsValue
arrays must be declared static; otherwise, you get a segmentation
fault when calling the function again.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Mon, 23 Feb 2009 15:22:08 +0000 (15:22 +0000)]
Use a dynamic array for the actors when delivering events
Instead of using a fixed size array for storing the scenegraph sub-node
during event delivery we should use a GPtrArray. The benefits are:
- a smaller allocation
- no undocumented yet binding constraint on the scenegraph size
Emmanuele Bassi [Mon, 23 Feb 2009 15:19:11 +0000 (15:19 +0000)]
Remove stray fixed point macro usage
The CoglPango renderer is using a CLUTTER_FIXED macro, but the
whole code has been Clutter-free for a while, now.
Robert Bragg [Mon, 23 Feb 2009 16:33:42 +0000 (16:33 +0000)]
[test-vertex-buffer-contiguous] Improves the texturing test
The test now explicitly reads back from the framebuffer to sanity check that
texturing is happening as expected, and it now uses a fixed 2x2 texture instead
of redhand.png since redhand.png doesn't have a power of two size which can
cause the vertex buffer code to complain on hardware not supporting npot
textures.
Emmanuele Bassi [Mon, 23 Feb 2009 13:44:03 +0000 (13:44 +0000)]
[docs] Document envvars and command line switches
Clutter uses checks on various environment variables and installs
various command line switches. The API reference should list them
and document them both.
Emmanuele Bassi [Mon, 23 Feb 2009 13:17:06 +0000 (13:17 +0000)]
Make fuzzy picking a command line switch
The CLUTTER_FUZZY_PICK environment variable is the last one used
by Clutter without a corresponding command line switch.
Emmanuele Bassi [Mon, 23 Feb 2009 13:08:59 +0000 (13:08 +0000)]
Make disable text mipmapping a command line switch
The environment variable to disable mipmapping should also be
a command line switch, and be handled like the rest of Clutter's
environment variables/command line switches.
Emmanuele Bassi [Mon, 23 Feb 2009 12:55:01 +0000 (12:55 +0000)]
[actor] Remove usage of ClutterFixed
The ClutterFixed type and symbols are now equivalent to the native
float type. In order to remove ambiguity and clean up the code, any
usage of ClutterFixed and relative macros has been removed.
Emmanuele Bassi [Mon, 23 Feb 2009 12:47:02 +0000 (12:47 +0000)]
Add runtime debug messages for COGL
Clutter is able to show debug messages written using the CLUTTER_NOTE()
macro at runtime, either by using an environment variable:
CLUTTER_DEBUG=...
or by using a command line switch:
--clutter-debug=...
--clutter-no-debug=...
Both are parsed during the initialization process by using the
GOption API.
COGL would benefit from having the same support.
In order to do this, we need a cogl_get_option_group() function in
COGL that sets up a GOptionGroup for COGL and adds a pre-parse hook
that will check the COGL_DEBUG environment variable. The OptionGroup
will also install two command line switches:
--cogl-debug
--cogl-no-debug
With the same semantics of the Clutter ones.
During Clutter initialization, the COGL option group will be attached
to the GOptionContext used to parse the command line options passed
to a Clutter application.
Every debug message written using:
COGL_NOTE (SECTION, "message format", arguments);
Will then be printed only if SECTION was enabled at runtime.
This whole machinery, like the equivalent one in Clutter, depends on
a compile time switch, COGL_ENABLE_DEBUG, which is enabled at the same
time as CLUTTER_ENABLE_DEBUG. Having two different symbols allows
greater granularity.
Neil Roberts [Mon, 23 Feb 2009 11:36:03 +0000 (11:36 +0000)]
Add an environment variable to disable mipmapped text
Mipmapped text is enabled by default in Clutter but it can cause
problems on some drivers so it is convenient to have an environment
variable to disable it for all apps.
Robert Bragg [Sun, 22 Feb 2009 15:25:00 +0000 (15:25 +0000)]
[Cogl] Remove a debugging assert that was triggering on false positives
An assert to verify there was no error when generating a buffer object
for the vertex buffer API was being hit when running the GLES1 conformance
tests.
Robert Bragg [Thu, 19 Feb 2009 09:20:20 +0000 (09:20 +0000)]
[cogl-material] Always glBindTexture when flushing material state
Bug #1457 - Creating a new texture messes up the cogl material state
cache; reported by Neil Roberts
We still don't have caching of bound texture state so we always have to
re-bind the texture when flushing the GL state of any material layers.
Robert Bragg [Thu, 19 Feb 2009 09:01:18 +0000 (09:01 +0000)]
[Cogl] Fixes automatic handling of the GL blend enable state.
Bug #1460 - Handling of flags in cogl_material_set_color
Cogl automatically enables/disables blending based on whether the source color
has an alhpa < 1.0, or if any textures with an alpha component are in use, but
it wasn't doing it quite right.
At the same time I removed some of the dirty flags which on second thought
are nothing more than micro-optimsations that only helped clutter the code.
thanks to Owen Taylor for reporting the bug
Robert Bragg [Wed, 18 Feb 2009 18:54:54 +0000 (18:54 +0000)]
[Cogl] the cogl_get_*_matrix functions now work with CoglMatrix types
Since the CoglMatrix type was added for supporting texture matrices recently
it made sense to be consistent accross the Cogl API and use the Cogl type
over the GL style GLfloat m[16] arrays.
Emmanuele Bassi [Sat, 21 Feb 2009 13:47:02 +0000 (13:47 +0000)]
[ignore] Update with the introspection files
Emmanuele Bassi [Sat, 21 Feb 2009 13:44:14 +0000 (13:44 +0000)]
[build] Move all the compiler flags to AM_CFLAGS
The INCLUDES directive should only contain pre-processor flags, since
we're passing it also to the introspection scanner.
Using AM_CFLAGS for compiler flags, like debug flags and maintainer
flags, is more indicated.
Emmanuele Bassi [Fri, 20 Feb 2009 15:39:32 +0000 (15:39 +0000)]
[backend] Update the viewport when updating the GL context
Bug 1442 - multistage, same-window resize events invalidate stage
When ensuring that the GL context is attached to the correct
ClutterStage we need to set the SYNC_MATRICES flag on the stage
itself. This is needed in case the size of the new stage does
not match the size of the old -- thus requiring a call to
glViewport() when the paint cycle starts.
Neil Roberts [Fri, 20 Feb 2009 16:37:20 +0000 (16:37 +0000)]
[cogl-gles2-wrapper] Actually call glActiveTexture
cogl_wrap_glActiveTexture needs to call the GL version of
glActiveTexture otherwise the subsequent calls to glBindTexture will
all be using texture unit 0. This fixes test-cogl-multitexture.
Neil Roberts [Fri, 20 Feb 2009 15:56:57 +0000 (15:56 +0000)]
[cogl-gles2-wrapper] Convert texture unit settings to be a static sized array
Previously the texture unit settings were stored in growable GArrays
and every time a new texture unit was encountered it would expand the
arrays. However the array wasn't copied when stored in a
CoglGles2WrapperSettings struct so all settings had the same
array. This meant that it wouldn't detect that a different program is
needed if a texture unit is disabled or enabled.
The texture unit settings arrays are all now a fixed size and the
enabledness of each unit is stored in a bit mask. Therefore the
settings can just be copied around by assignment as before.
This puts a limit on the number of texture units accessible by Cogl
but I think it is worth it to make the code simpler and more
efficient. The material API already poses a limit on the number of
texture units it can use.
Emmanuele Bassi [Fri, 20 Feb 2009 14:39:51 +0000 (14:39 +0000)]
Add build machinery for gobject-introspection data
configure.ac: Check for gobject-introspection
build/introspection.m4: Include the file that defines the
GOBJECT_CHECK_INTROSPECTION m4 macro in case we want to disable
the introspection data generation.
clutter/json/Makefile.am: Build the .gir for "ClutterJson"
(json-glib as part of the Clutter library)
clutter/Makefile.am: Build the .gir for clutter, compile the
Clutter and ClutterJson girs into typelibs, and install them.
Also move GCC_FLAGS from $(INCLUDES) to $(AM_CFLAGS) since it includes
non-preprocessor flag like -Wall.
See also:
http://bugzilla.openedhand.com/show_bug.cgi?id=1450
Based on a patch by: Owen W. Taylor <otaylor@fishsoup.net>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Owen W. Taylor [Tue, 17 Feb 2009 00:25:20 +0000 (19:25 -0500)]
Add gobject-introspection annotations
Add annotations such as (transfer-none) (out) (element-type ClutterActor),
and so forth to the doc comments as appropriate.
The annotations added here are a combination of the annotations previously
in gir-repository for Clutter and annotations found in a review of all
return values with that were being parsed with a transfer of "full".
http://bugzilla.openedhand.com/show_bug.cgi?id=1452
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Fri, 20 Feb 2009 12:01:32 +0000 (12:01 +0000)]
[docs] Rename cogl-docs from sgml to xml
The cogl-docs.sgml file has always been XML, so it's only fitting that
we actually call it cogl-docs.xml.
Emmanuele Bassi [Fri, 20 Feb 2009 12:00:41 +0000 (12:00 +0000)]
[docs] Add the 1.0 symbols index
Add the index of symbols available since 1.0 to the Clutter
API reference.
Emmanuele Bassi [Fri, 20 Feb 2009 11:58:04 +0000 (11:58 +0000)]
[docs] Use the --name-space option
Now that we depend on gtk-doc 1.11 we can use the --name-space
command line option for the mkdb utility.
Emmanuele Bassi [Fri, 20 Feb 2009 11:55:54 +0000 (11:55 +0000)]
[docs] Require gtk-doc 1.11
The new stable release of gtk-doc provides the --name-space
option for the mkdb utility. This option allows to specify a
namespace for the symbols that will get stripped, so that we
don't get a symbols index containing only "C".
Emmanuele Bassi [Fri, 20 Feb 2009 11:39:47 +0000 (11:39 +0000)]
Do not use GL types in Clutter headers
Bug 1451 - clutter_value_get_shader_matrix() return value
The return value of the get_shader_matrix() function should be
gfloat, not GLfloat.
Emmanuele Bassi [Fri, 20 Feb 2009 11:36:54 +0000 (11:36 +0000)]
[timeline] Set the n_markers out paramater
Bug 1464 - clutter_timeline_list_markers should set n_markers=0 when
there are no markers
If no markers are registered and we bail out we should also set the
n_markers out parameter to 0 so that code checking the number of
markers will still work.
Emmanuele Bassi [Fri, 20 Feb 2009 11:17:52 +0000 (11:17 +0000)]
[path] Do not accept NULL descriptions
Bug 1465 - clutter_path_parse_description should check p==NULL
When accepting a stringified path description, ClutterPath methods
and the parser should not accept NULL or empty strings.
Emmanuele Bassi [Tue, 10 Feb 2009 18:05:21 +0000 (18:05 +0000)]
[behaviour] Do not notify empty behaviours
If a behaviour does not have actors associated to it then it should
not invoke the ::alpha_notify() implementation.
Neil Roberts [Fri, 20 Feb 2009 11:07:23 +0000 (11:07 +0000)]
Replaced ClutterFixed constants in color_{darken,lighten} with float
Bug 1463 - clutter_color_lighten(darken) unexpected because of
ClutterFixed=>float
These two functions contained ClutterFixed constants represented as
integers which are no longer valid since the cogl-float branch
merge. They are now converted to ClutterFixed from float constants
using CLUTTER_FLOAT_TO_FIXED (which is now a no-op).
Thanks to Zhang Wei for reporting.
Emmanuele Bassi [Thu, 19 Feb 2009 17:24:06 +0000 (17:24 +0000)]
[build] Do not overwrite BUILT_SOURCES
The conformance test suite Makefile template already defines the
BUILT_SOURCES variable, so we need to append redhand.png to it.
Emmanuele Bassi [Thu, 19 Feb 2009 17:15:04 +0000 (17:15 +0000)]
[build] Fix the ChangeLog generation rule
The ChangeLog should only be generated by dist-hook and as a temporary
file to avoid overwriting the stub we use to direct people to the
commit log when cloning the repository.
When generated, the ChangeLog should be copied inside the distdir so
that the autotools will not freak out.
Emmanuele Bassi [Thu, 19 Feb 2009 17:07:09 +0000 (17:07 +0000)]
[build] Update the EXTRA_DIST list
Remove the files we don't ship or have, to avoid distcheck failing.
Emmanuele Bassi [Thu, 19 Feb 2009 17:06:25 +0000 (17:06 +0000)]
[docs] Update build for COGL API reference
We need to initialize the type system for gtk-doc-scan, now that
COGL exposes GTypes.
Emmanuele Bassi [Thu, 19 Feb 2009 17:02:12 +0000 (17:02 +0000)]
[build] Reference the headers with their full path
Do not assume locality of the files, but use their whole path.
Emmanuele Bassi [Thu, 19 Feb 2009 17:00:22 +0000 (17:00 +0000)]
[build] Show pkg-config file being generated
The current Makefile hides the console messages for the pkg-config
files generated from the clutter.pc file. We should show them,
instead.
Emmanuele Bassi [Thu, 19 Feb 2009 16:51:37 +0000 (16:51 +0000)]
[tests] Add TEST_CONFORM_TODO macro
The TEST_CONFORM_TODO macro is a simple placeholder macro that
adds the test function to the "/todo" namespace and skips the
test.
It can be used for tests that are known to fail because of bugs
that haven't been fixed yet, or because of features not yet
implemented.
Neil Roberts [Thu, 19 Feb 2009 17:14:00 +0000 (17:14 +0000)]
[tests/conform] Copy in redhand.png
test-vertex-buffer-configuous now needs redhand.png so it should be
copied in to the build directory. This is copied from similar code in
the tests/interactive Makefile.
Øyvind Kolås [Thu, 19 Feb 2009 15:44:16 +0000 (15:44 +0000)]
Bail early in clutter_texture_paint if opacity == 0
This causes clutter to skip all the GL work of state changes and
texturing if the opacity was 0. This is done in ClutterTexture and not
ClutterActor to ensure that pre and post paint signals work correctly.
Other expensive actors should be doing the same thing.
Emmanuele Bassi [Thu, 19 Feb 2009 15:01:33 +0000 (15:01 +0000)]
[docs] Update the sections file
The newly added symbols should also be added to the section file.
The CairoTexture section was referenced twice.
Emmanuele Bassi [Thu, 19 Feb 2009 15:00:23 +0000 (15:00 +0000)]
Remove type functions for removed types
The CoglHandle wrapper GTypes have been removed in commit
a0800b44
so we can safely remove the declarations.
Emmanuele Bassi [Thu, 19 Feb 2009 14:57:43 +0000 (14:57 +0000)]
[build] Pass the -s switch to cmp
The call to "cmp" to compare a built file with its current version
should use the -s (silent) command line switch. This avoids a ugly
message on the console when building Clutter the first time.
Emmanuele Bassi [Thu, 19 Feb 2009 14:56:07 +0000 (14:56 +0000)]
[docs] Add a missing "return" annotation
The documentation for the get_anchor_point_gravity() method is
missing the "Return value:" section.
Emmanuele Bassi [Thu, 19 Feb 2009 14:42:40 +0000 (14:42 +0000)]
Merge branch 'build-enhancements'
* build-enhancements:
[build] Fix dist for the newly introduced m4 macro directory
[build] Fix interaction between shave, gtk-doc and libtool 1.x
[build] Add dolt
[build] Beautify autotools' output
[gitignore] update gitignore files for tests/
Emmanuele Bassi [Thu, 19 Feb 2009 13:44:29 +0000 (13:44 +0000)]
[docs] Clarify the set_cogl_texture() documentation
When setting the COGL texture handle for a ClutterTexture the
texture will be set as the first layer of the material used
by the ClutterTexture. The documentation should clarify this
point.
Emmanuele Bassi [Thu, 19 Feb 2009 12:05:20 +0000 (12:05 +0000)]
[texture] Use COGL_TYPE_HANDLE for the handle properties
The :texture and :material properties of ClutterTexture use a
Clutter-provided GType shielding from CoglHandle. Since CoglHandle
now has a GType we can use COGL_TYPE_HANDLE instead.
This commit also removes the conditional compilation of the
:material property, as it makes little sense now that the
Materials API has landed.
Emmanuele Bassi [Thu, 19 Feb 2009 12:02:42 +0000 (12:02 +0000)]
[cogl] Provide GTypes for COGL types
COGL types should be registered inside the GType system, for
bindings and type checking inside properties and signals.
CoglHandle is a boxed type with a ref+unref semantics; slightly evil
from a bindings perspective (we cannot associate custom data to it),
but better than nothing.
The rest of the exposed types are enumerations or bitmasks.
Emmanuele Bassi [Thu, 19 Feb 2009 11:55:54 +0000 (11:55 +0000)]
[cogl] Add cogl_is_material to cogl-material.h
The COGL_DEFINE_HANDLE macro generates a cogl_is_<type> function
as well, to check whether a CoglHandle opaque pointer is of type
<type>.
The handle for CoglMaterial does not export cogl_is_material() in
its installed header.
Damien Lespiau [Thu, 19 Feb 2009 10:59:50 +0000 (10:59 +0000)]
[build] Fix dist for the newly introduced m4 macro directory
Damien Lespiau [Thu, 19 Feb 2009 10:47:38 +0000 (10:47 +0000)]
[build] Fix interaction between shave, gtk-doc and libtool 1.x
gtk-doc.make does not specify --tag=CC when invoking libtool, letting
it decide which tag to use. Something that fails with libtool 1.x and
when having CC set to funny things.
Emmanuele Bassi [Wed, 18 Feb 2009 18:45:58 +0000 (18:45 +0000)]
Initialize a variable to avoid warnings
The gl_mode variable was not initialized, and the compiler complained
when using the anal-retentive compiler flags.
Neil Roberts [Wed, 18 Feb 2009 17:57:17 +0000 (17:57 +0000)]
[ClutterBehaviourRotate] Fix up some breakage from the cogl-float branch merge
The rotation angle calculated in clutter_behaviour_rotate_alpha_notify
gets applied to each actor using clutter_behaviour_actors_foreach. The
angle is a ClutterFixed value. Before the cogl float branch merge it
was stuffed into a gpointer using GPOINTER_TO_UINT. The pointer was
then converted back to a uint and cast to a ClutterFixed which worked
out fine even for negative numbers.
After the cogl-float merge the angle is effectively a gfloat. This
gets cast to a uint and stored in a pointer and converted back to a
float via a uint at the other end. However this fails for negative
numbers because a uint -> float conversion can't take advantage of
overflow to preserve the sign so you end up with a large number.
It also had the side effect that it only rotated in whole degrees.
This commit fixes the problem by just passing the ClutterFixed value
inside a closure struct instead of trying to stuff it into a pointer.
Damien Lespiau [Tue, 17 Feb 2009 15:05:03 +0000 (15:05 +0000)]
[build] Add dolt
From the homepage (http://dolt.freedesktop.org): Dolt provides a drop-in
replacement for libtool that significantly decreases compile times on
the platforms it supports.
Damien Lespiau [Tue, 17 Feb 2009 14:56:35 +0000 (14:56 +0000)]
[build] Beautify autotools' output
Use shave (http://git.lespiau.name/cgit/shave) to make compilation more
human friendly.
Damien Lespiau [Tue, 17 Feb 2009 14:02:55 +0000 (14:02 +0000)]
[gitignore] update gitignore files for tests/
Neil Roberts [Wed, 18 Feb 2009 17:26:10 +0000 (17:26 +0000)]
Allow rotation angle properties to be negative
Bug 1167 - clutter_effect_rotate improperly clamps negative angles
The rotation angle properties had a minimum value of 0.0 but the
rotation works fine with a negative value so the limitation is
unnecessary. This makes rotation using the ClutterAnimation API more
flexible because it was previously not possible to rotate
counter-clockwise from the 0.0 position.
Neil Roberts [Wed, 18 Feb 2009 16:41:01 +0000 (16:41 +0000)]
Override the opacity when painting a clone instead of combining
When rendering a clone before this commit the clone's opacity was
combined with the opacity of the source but this is not usually the
desired effect. Instead the clone's opacity (combined with its
parents) should completely override the opacity of the source.
Tomas Frydrych [Wed, 18 Feb 2009 16:54:18 +0000 (16:54 +0000)]
[x11] Only update cached last event time if we have a real timestamp.
Ignore the timestamp if it is set to CurrentTime (e.g., when the last event
did not carry a timestamp).
Robert Bragg [Wed, 18 Feb 2009 16:06:11 +0000 (16:06 +0000)]
[cogl-color.c] #include fix for the cogl_set_source_color prototype
cogl.h wasn't being included so we got a compiler warning
Robert Bragg [Thu, 12 Feb 2009 13:23:20 +0000 (13:23 +0000)]
[Cogl] Renames cogl_paint_init to cogl_clear and adds a cogl_disable_fog function
cogl_paint_init was a bit too miscellaneous; it mainly cleared the color, depth
and stencil buffers but arbitrarily it also disabled fogging and lighting.
It no longer disables lighting, since we know Cogl never enables lighting and
disabling of fog is now handled with a seperate function.
Since I noticed cogl_set_fog was taking a density argument documented as
"Ignored" I've also added a mode argument to cogl_set_fog which exposes the
exponential fog modes which can make use of the density.
Robert Bragg [Thu, 12 Feb 2009 11:08:00 +0000 (11:08 +0000)]
[Cogl] cogl_clip_{set*,unset} renamed to cogl_clip_{push*,pop}
This is so they self document the stacking semantics of the cogl clip API
Øyvind Kolås [Tue, 17 Feb 2009 12:00:08 +0000 (12:00 +0000)]
Added a mutex for clutter asynchronous textures threads.
Bug #1453 - Asynchronous texture loading can starve cpu.
Add a mutex that is held in the loader threads during the image
decoding. We were spawning and starting a thread for each asynchronously
loaded texture. This can cause cpu / memory starvation when many pixbuf
loaders allocate their temporary memory at the same time.
Also added -fno-strict-aliasing to MAINTAINER_CFLAGS in configure.ac
to avoid incorrect warnings caused by the static mutex code.
Emmanuele Bassi [Wed, 18 Feb 2009 09:45:26 +0000 (09:45 +0000)]
[x11] Add backend-specific get_current_event_time()
The clutter_get_current_event_time() function will return the event
timestamp coming from a Clutter event. Clutter might synthesize or
throttle events, so the function cannot be used when dealing with
backend-specific use cases.
The X11 backend is the only backend supported by Clutter that makes
use of timestamps, so it's altogether fitting that it should come
with a specific function to deal with the timestamps of the X events.
Neil Roberts [Mon, 16 Feb 2009 16:34:31 +0000 (16:34 +0000)]
[clutter-main] Fix the input device passed to set_motion_last_actor
In generate_enter_leave_events it passes the device pointer from the
event to set_motion_last_actor but it was reading it directly from
event->motion.device. However the function is also used to process
button events so it would read from the wrong location in this case.
The device location in the union happened to be in the same place as
the click_count field of ClutterButtonEvent so it only mattered if the
click_count is non-zero. The X11 backend doesn't set this but
Clutter-GTK does so it was causing a crash.
Neil Roberts [Mon, 16 Feb 2009 12:46:00 +0000 (12:46 +0000)]
[win32] Track mouse leave messages
Bug 1178 - No enter / leave events on actors when pointer leaves the
stage window
This patch causes the Win32 backend to emit CLUTTER_LEAVE events when
a WM_MOUSELEAVE event is received in the same way that f505536 does
for the X11 backend.
Windows will only send WM_MOUSELEAVE events if they are previously
requested using TrackMouseEvent so this needs to be called whenever
the mouse enters the window. There is no WM_MOUSELEAVE event but we
can detect when the mouse enters because we get a WM_MOUSEMOVE event.
Neil Roberts [Mon, 16 Feb 2009 12:42:08 +0000 (12:42 +0000)]
Call glActiveTexture and glClientActiveTexture through cogl_get_proc_address
All GL functions that are defined in a version later than 1.1 need to
be called through cogl_get_proc_address because the Windows GL DLL
does not export them to directly link against.
Neil Roberts [Thu, 12 Feb 2009 17:21:18 +0000 (17:21 +0000)]
Emit CLUTTER_LEAVE events when the pointer leaves the stage
Bug 1178 - No enter / leave events on actors when pointer leaves the
stage window
The patch is mostly thanks to Johan Bilien with small modifications
based on suggestions by Owen Taylor.
The X11 backend now listens for enter and leave notifications. Leave
notifications get translated directly to a CLUTTER_LEAVE
event. Clutter can detect these special events because the source
actor is NULL in which case it sets the source actor to the last known
actor and then sets the last known actor to NULL.
Enter notifications just get translated to CLUTTER_MOTION events which
will cause Clutter to generate an enter event through the usual code
path.
Emmanuele Bassi [Mon, 16 Feb 2009 11:02:20 +0000 (11:02 +0000)]
[animation] Do not bind construct-only properties
ClutterAnimation should not try to bind construct-only properties,
since it only manipulates existing instances.
Emmanuele Bassi [Sat, 14 Feb 2009 13:11:13 +0000 (13:11 +0000)]
[actor] Revert part of commit
402e022c
An unintended chunk of commit
402e022c got committed before I looked
at the diff.
Christian Persch [Sat, 14 Feb 2009 12:55:20 +0000 (12:55 +0000)]
Bug 1429 - Redundant declaration in clutter-x11.h
clutter-x11.h declares clutter_x11_set_display twice, which means code using
clutter doesn't compile cleanly with -Wredundant-decls.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Owen W. Taylor [Fri, 13 Feb 2009 19:14:43 +0000 (14:14 -0500)]
Honor ACLOCAL_FLAGS in autogen.sh
autoreconf doesn't pay attention to the ACLOCAL_FLAGS variable that
jhbuild (for example) sets. Pass those flags into autoreconf by
setting ACLOCAL appropriately.
Shane Bryan [Wed, 4 Feb 2009 01:04:58 +0000 (17:04 -0800)]
Bug 1434 - _NET_WM_NAME not set before realize
Moved clutter_stage_set_title() before call to clutter_actor_realize()
to ensure _NET_WM_NAME is set early enough for use by interested WM's,
Signed-off-by: Shane Bryan <shane.bryan@linux.intel.com>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Emmanuele Bassi [Sat, 14 Feb 2009 11:47:53 +0000 (11:47 +0000)]
[ignore] Add the newly created conformance units
Emmanuele Bassi [Sat, 14 Feb 2009 11:45:27 +0000 (11:45 +0000)]
[tests] Add conformance tests for ClutterModel
ClutterModel has an interactive test but lacks a conformance
unit for automatic testing.
This is the beginning of that unit, which covers the population
and iteration over a ListModel.
Emmanuele Bassi [Sat, 14 Feb 2009 11:41:55 +0000 (11:41 +0000)]
[tests] Add TEST_CONFORM_SKIP() macro
Sometimes a test unit should not be executed depending on a
condition. It would be good to have a macro doing this, along
with TEST_CONFORM_SIMPLE().
Additionally, the skipped unit should be added to a specific
namespace, so that any coverage report will be able to catch it.
For this reason, here's TEST_CONFORM_SKIP() which follows the
syntax:
TEST_CONFORM_SKIP (condition, namespace, function);
If condition evaluates to FALSE the test is skipped and the
unit added to the "/skipped" namespace.
Emmanuele Bassi [Sat, 14 Feb 2009 11:38:16 +0000 (11:38 +0000)]
Bug 1440 - Add clutter_get_current_event_time()
The clutter_get_current_event_time() is a global function for
retrieving the timestamp of the current event being propagated
by Clutter. Such function avoids the need to propagate the
timestamp from within user code.
Emmanuele Bassi [Sat, 14 Feb 2009 11:31:00 +0000 (11:31 +0000)]
[list-model] Make ClutterListModel subclassable
ClutterListModel has been added as a terminal class in case we
decided to change API or implementation.
Apparently, it's a lot more resilient than we expected -- or far
too few are using it and reporting bugs. Once common issue, though,
is that it cannot be subclassed, hence it's fairly limited in its
usage.
In the hope that more developers will start using it, here's a
patch that makes ListModel a fully subclassable object.
May whatever god you believe in have mercy on your eventual soul.
Robert Staudinger [Thu, 12 Feb 2009 12:42:58 +0000 (12:42 +0000)]
[build] Add cogl.h to the built sources list
The main COGL header file is generated at configure time. If something
changes in the template, though, the file will not be regenerated.
Adding cogl.h to the BUILT_SOURCES list will allow the regeneration to
happen.
Emmanuele Bassi [Wed, 11 Feb 2009 17:56:22 +0000 (17:56 +0000)]
[actor] Check out parameters before setting them
The clutter_actor_get_rotation() out parameters may be NULL, so
we need to check before dereferencing them.
Emmanuele Bassi [Wed, 11 Feb 2009 17:54:52 +0000 (17:54 +0000)]
[event] Extend KeyEvent for multi-input support
Key events can come from different input devices, so they need a
ClutterInputDevice member like the pointer-related events. This
field is reserved for future use.
Emmanuele Bassi [Wed, 11 Feb 2009 17:52:50 +0000 (17:52 +0000)]
[texture] Check if the material is valid
The CoglMaterial handle might be invalid when we are disposing
the ClutterTexture, so we need to check before calling any
cogl_material_* API on it.
Emmanuele Bassi [Fri, 6 Feb 2009 13:50:16 +0000 (13:50 +0000)]
[texture] Consolidate the quality to filter conversions
To convert from a TextureQuality to a COGL filter enumeration
we need to perform two function calls. Since we need both filters
when calling cogl_texture_set_filters() we can safely consolidate
the two conversion functions into one. This also allows using a
shorter function name, thus reducing the lenght of the lines
involved and, more importantly preventing Emmanuele from crying.
Robert Bragg [Wed, 11 Feb 2009 12:58:18 +0000 (12:58 +0000)]
[tests] Some improvements for test-pixmap
The test no longer requires an XID argument to run; instead it creates its
own X Window. The test now also aims to demonstrate whether mipmapping is
working, and clearly informs you if fallbacks are being used for GLX tfp.
Robert Bragg [Fri, 6 Feb 2009 11:16:42 +0000 (11:16 +0000)]
[docs] Various gtk-doc updates for Cogl
This hides a number of internal structs and enums from the docs, and moves
some functions to more appropriate sections as well as misc description
updates (mostly for the vertex buffer api)
Robert Bragg [Fri, 6 Feb 2009 16:10:28 +0000 (16:10 +0000)]
[cogl-vertex-buffer] Some fixes for texturing and color arrays
Fixes some blending issues when using color arrays since we were
conflicting with the cogl_enable state + fixes a texture layer
validation bug.
Adds a basic textured triangle to test-vertex-buffer-contiguous.
Robert Bragg [Fri, 6 Feb 2009 16:05:08 +0000 (16:05 +0000)]
[cogl-material] Fixes some dirty flag checks
Flushing material layers wasn't clearing the right dirty flag and
some of the tests used to avoid re-submitting GL state weren't
complete.
Robert Bragg [Wed, 4 Feb 2009 09:21:37 +0000 (09:21 +0000)]
[Cogl] Renames cogl_fog_set to cogl_set_fog for consistency
More things follow the <object>_set_<property> convention.
Neil Roberts [Mon, 9 Feb 2009 12:47:41 +0000 (12:47 +0000)]
Added a test for non-power-of-two sized textures
The test simply creates an odd sized texture with different colors at
each of the four corners. It then renders the texture and verifies
that the colors are the expected values. This should help ensure that
the sliced texture rendering code is working properly.
Neil Roberts [Thu, 5 Feb 2009 23:01:59 +0000 (23:01 +0000)]
[cogl-texture] Fix uninitialised priv var in texture_finalize
Fix my failure to initialise the priv var which was some causing
crashes.
Neil Roberts [Thu, 5 Feb 2009 20:24:18 +0000 (20:24 +0000)]
[cogl-texture] Move the destruction of the material to _finalize
Otherwise if the dipose method is called twice the material will
already be destroyed when texture_free_gl_resources is called so it
will issue a warning about an invalid handle.
Neil Roberts [Thu, 5 Feb 2009 19:48:00 +0000 (19:48 +0000)]
[cogl-texture] Fix offset to next quad when flushing the log
When the quad log contains multiple textures (such as when a sliced
texture is drawn) it dispatches the log with multiple calls to
flush_quad_batch and walks a pointer along the list of vertices.
However this pointer was being incremented by only one vertex so the
next quad would be drawn with three of the vertices from the last
quad.
Neil Roberts [Thu, 5 Feb 2009 20:00:05 +0000 (20:00 +0000)]
[clutter-texture] Fix the no_slice property
The 'no_slice' property means the texture should never be sliced. We
want cogl to create a texture with any amount of waste so we pass
max_waste as -1. However this got broken in commit 168d55 so that the
meaning got negated (no_slice enabled slicing).