profile/ivi/clutter.git
13 years agoRemoves Cogl from the repository
Robert Bragg [Thu, 5 May 2011 19:56:44 +0000 (20:56 +0100)]
Removes Cogl from the repository

Cogl has now been split out into a standalone project with a separate
repository at git://git.gnome.org/cogl. From now on the Clutter build
will now simply look for a cogl-1.0 pkg-config file to find a suitable
Cogl library to link against at build time.

13 years agostage: Use Cairo to dump the pick buffer
Emmanuele Bassi [Tue, 12 Apr 2011 16:01:51 +0000 (17:01 +0100)]
stage: Use Cairo to dump the pick buffer

Do not use GdkPixbuf just for getting image data down into a PNG; Cairo
is perfectly capable of doing the same, at least just for debugging
purposes.

https://bugzilla.gnome.org/show_bug.cgi?id=647875

13 years agocairo-texture: Make the pixel order macro public
Emmanuele Bassi [Tue, 12 Apr 2011 16:00:46 +0000 (17:00 +0100)]
cairo-texture: Make the pixel order macro public

It stands to reason that any piece of code using Cairo and Cogl at the
same time, and dealing with texture data, will want to use the same
logic Clutter uses to determine the compatible pixel format between the
two.

https://bugzilla.gnome.org/show_bug.cgi?id=647875

13 years agoUpdated Spanish translation
Daniel Mustieles [Thu, 5 May 2011 17:26:47 +0000 (19:26 +0200)]
Updated Spanish translation

13 years agocogl-debug: Add an option to disable atlasing sharing
Neil Roberts [Wed, 30 Mar 2011 15:39:38 +0000 (16:39 +0100)]
cogl-debug: Add an option to disable atlasing sharing

If COGL_DEBUG contains disable-shared-atlas Cogl will not try to share
the atlas between glyphs and images.

13 years agocogl_pipeline_equal: Handle COGL_WRAP_MODE_AUTOMATIC better
Neil Roberts [Wed, 30 Mar 2011 15:33:04 +0000 (16:33 +0100)]
cogl_pipeline_equal: Handle COGL_WRAP_MODE_AUTOMATIC better

When comparing the wrap modes of two pipeline layers it now considers
COGL_WRAP_MODE_AUTOMATIC to be equivalent to CLAMP_TO_EDGE. By the
time the pipeline is in the journal, the upper primitive code is
expected to have overridden this wrap mode with something else if it
wants any other behaviour. This is important for getting text to batch
together with textures because the text explicitly sets the wrap mode
to CLAMP_TO_EDGE on its pipeline.

13 years agocogl-pango: Don't set the special combine function for atlased textures
Neil Roberts [Fri, 26 Feb 2010 13:01:54 +0000 (13:01 +0000)]
cogl-pango: Don't set the special combine function for atlased textures

The material cache will now only set the special combine mode if the
texture only has an alpha component. The atlased textures will have
all four components so it will leave the combine functions at the
default. This increases the chances of batching between glyphs and
images.

When using the global atlas, the glyph from cairo is now rendered into
an ARGB surface rather than an alpha-only surface.

13 years agocogl-pango: Use a seperate cache of pipelines
Neil Roberts [Fri, 26 Feb 2010 12:38:22 +0000 (12:38 +0000)]
cogl-pango: Use a seperate cache of pipelines

Instead of creating just two materials (one for texturing and one for
solid primitives) the pango renderer now maintains a cache of
pipelines. The display list can request a pipeline for a texture from
the cache. The same pipeline cache is used by all display lists so
that the pipelines can be shared. This avoids changing the texture on
the material during a paint run.

13 years agocogl-pango-glyph-cache: Don't put zero-sized glyphs in the cache
Neil Roberts [Mon, 22 Feb 2010 16:40:49 +0000 (16:40 +0000)]
cogl-pango-glyph-cache: Don't put zero-sized glyphs in the cache

It now avoids trying to reserve space for zero-sized glyphs. That
happens for example when the layout contains a space. This was causing
the regular glyph cache to be used because the global atlas does not
support zero-sized images. That would then break up the
batching. Instead it now still reserves an entry in the cache but
leaves the texture as COGL_INVALID_HANDLE.

13 years agoRevert "cogl-pango-display-list: Don't use VBOs if the texture can't handle it"
Neil Roberts [Thu, 5 May 2011 15:09:22 +0000 (16:09 +0100)]
Revert "cogl-pango-display-list: Don't use VBOs if the texture can't handle it"

This reverts commit 32c91793e46e0625a19c0d2bc98d6cd147dff702.

This commit is no longer needed since the display list will now only
have primitive textures in it.

13 years agocogl-pango-render: Add the base texture to the display list
Neil Roberts [Wed, 30 Mar 2011 12:48:34 +0000 (13:48 +0100)]
cogl-pango-render: Add the base texture to the display list

When rendering a glyph from a texture, instead of adding the glyph's
texture handle to the display list it now retrieves the base texture
using _cogl_texture_foreach_subtexture_in_region and adds that
instead. That way the display can recognise that glyphs in the global
atlas are sharing the same texture and combine them into one VBO.

13 years agocogl-bitmap-private.h: Include cogl-bitmap.h
Neil Roberts [Wed, 30 Mar 2011 12:46:46 +0000 (13:46 +0100)]
cogl-bitmap-private.h: Include cogl-bitmap.h

There was a header dependency problem which meant that
cogl-texture-private.h couldn't be included without first including
cogl-bitmap.h

13 years agocogl-pango-glyph-cache: Notify of reorg for global atlased glyphs
Neil Roberts [Wed, 30 Mar 2011 11:56:09 +0000 (12:56 +0100)]
cogl-pango-glyph-cache: Notify of reorg for global atlased glyphs

Whenever the glyph cache puts a glyph in the global atlas it will now
register for notifications of reorganisation of the global
atlases. When this happens it will forward this on as a notification
of reorganisation of the glyph cache.

13 years agocogl-atlas-texture: Add a callback for when any atlas reorganizes
Neil Roberts [Wed, 30 Mar 2011 11:53:50 +0000 (12:53 +0100)]
cogl-atlas-texture: Add a callback for when any atlas reorganizes

This adds cogl_atlas_texture_* functions to register a callback that
will get invoked whenever any of the CoglAtlas's the textures use get
reorganized. The callback is global and is not tied to any particular
atlas texture.

13 years agopango-glyph-cache: Try to put glyphs in the global atlas
Neil Roberts [Thu, 18 Feb 2010 17:35:14 +0000 (17:35 +0000)]
pango-glyph-cache: Try to put glyphs in the global atlas

If mipmapping is disabled, it will now try to create a standalone
atlas texture for a glyph rather than putting it in the atlas.

If the atlas texture can't be created then it will fallback to the
glyph cache.

13 years agocogl-atlas-texture: Split out new_from_bitmap to new_with_size
Neil Roberts [Thu, 18 Feb 2010 16:33:12 +0000 (16:33 +0000)]
cogl-atlas-texture: Split out new_from_bitmap to new_with_size

This adds a new function called _cogl_atlas_texture_new_with_size. The
old new_from_bitmap function now just calls this and updates the
texture with the data.

13 years agocogl-pango-display-list: Don't use VBOs if the texture can't handle it
Neil Roberts [Thu, 18 Feb 2010 15:04:06 +0000 (15:04 +0000)]
cogl-pango-display-list: Don't use VBOs if the texture can't handle it

If the texture can't be hardware repeated (ie, if it is sliced or it
has waste) then Cogl will reject the layer when rendering with a
VBO. In this case we should always fall back to rendering with
cogl_rectangle.

This commit is only needed temporarily because Cogl will end up
putting atlas textures in the display list. A later commit in the
series will make it so that the display list always has primitive
textures in it so this commit can be reverted.

13 years agocogl-pango: Use a separate glyph cache for mipmapped rendering
Neil Roberts [Thu, 18 Feb 2010 14:30:44 +0000 (14:30 +0000)]
cogl-pango: Use a separate glyph cache for mipmapped rendering

This reverts the changes in 54d8aadf which combined the two glyph
caches into one. We want to start using separate caches again so that
we can non-mipmapped textures into the global atlas.

13 years agoAdds a way for Cogl to control event_mask of foreign wins
Robert Bragg [Wed, 4 May 2011 16:02:04 +0000 (17:02 +0100)]
Adds a way for Cogl to control event_mask of foreign wins

This extends cogl_onscreen_x11_set_foreign_xid to take a callback to a
function that details the event mask the Cogl requires the application
to select on foreign windows. This is required because Cogl, for
example, needs to track size changes of a window and may also in the
future want other notifications such as map/unmap.

Most applications wont need to use the foreign xwindow apis, but those
that do are required to pass a valid callback and update the event mask
of their window according to Cogl's requirements.

13 years agoAdds cogl_onscreen_show/hide functions
Robert Bragg [Wed, 4 May 2011 10:10:54 +0000 (11:10 +0100)]
Adds cogl_onscreen_show/hide functions

This adds Cogl API to show and hide onscreen framebuffers. We don't want
to go too far down the road of abstracting window system APIs with Cogl
since that would be out of its scope but the previous idea that we would
automatically map framebuffers on allocation except for those made from
foreign windows wasn't good enough. The problem is that we don't want to
make Clutter always create stages from foreign windows but with the
automatic map semantics then Clutter doesn't get an opportunity to
select for all the events it requires before mapping. This meant that we
wouldn't be delivered a mouse enter event for windows mapped underneath
the cursor which would break Clutters handling of button press events.

13 years agoadd missing name mangle for cogl_onscreen_set_swap_throttled
Robert Bragg [Tue, 3 May 2011 23:16:50 +0000 (00:16 +0100)]
add missing name mangle for cogl_onscreen_set_swap_throttled

We weren't mangling cogl_onscreen_set_swap_throttled to give it an _EXP
postfix to clarify that it is an experimental symbol.

13 years agoAdd missing _cogl_winsys_has_feature prototype
Robert Bragg [Tue, 3 May 2011 20:00:00 +0000 (21:00 +0100)]
Add missing _cogl_winsys_has_feature prototype

This adds a private prototype for _cogl_winsys_has_feature in
cogl-winsys-private.h to avoid compilation warnings.

13 years agocogl/pango/Makefile.am pass EXTRA_LDFLAGS for linking
Robert Bragg [Tue, 19 Apr 2011 16:48:40 +0000 (17:48 +0100)]
cogl/pango/Makefile.am pass EXTRA_LDFLAGS for linking

When building on windows for example we need to ensure we pass
-no-undefined to the linker. Although we were substituting a
COGL_EXTRA_LDFLAGS variable from our configure.ac we forgot to
reference that when linking cogl-pango.

13 years agocogl/configure.ac: AC_SUBST an empty MAINTAINER_CFLAGS
Robert Bragg [Tue, 19 Apr 2011 16:47:57 +0000 (17:47 +0100)]
cogl/configure.ac: AC_SUBST an empty MAINTAINER_CFLAGS

For compatibility with the way we build Cogl as part of Clutter we now
substitute an empty MAINTAINER_CFLAGS variable. When building Cogl
standalone all our extra CFLAGS go through COGL_EXTRA_CFLAGS so the
separate MAINTAINER_CFLAGS aren't used, but automake will get confused
if a substitution isn't made.

13 years agocogl/configure.ac: check when building for win32
Robert Bragg [Tue, 19 Apr 2011 16:45:26 +0000 (17:45 +0100)]
cogl/configure.ac: check when building for win32

This adds a check for when building on win32 so we can skip pkg-config
checks for opengl and can add appropriate flags to
COGL_EXTRA_{LD,C}FLAGS.

13 years agocogl/configure.ac: fix pkg-config checks
Robert Bragg [Tue, 19 Apr 2011 16:42:48 +0000 (17:42 +0100)]
cogl/configure.ac: fix pkg-config checks

This fixes the gdk-pixbuf check to not mistakenly check for the "xi"
package instead of gdk-pixbuf and remove a spurious listing "gl" in
COGL_PKG_REQUIRES which should only be there when we are using using
opengl not if we are using gles.

13 years agocogl/Makefile.am: pass EXTRA_LDFLAGS for linking
Robert Bragg [Tue, 19 Apr 2011 16:40:57 +0000 (17:40 +0100)]
cogl/Makefile.am: pass EXTRA_LDFLAGS for linking

When building on windows for example we need to ensure we pass
-no-undefined to the linker. Although we were substituting a
COGL_EXTRA_LDFLAGS variable from our configure.ac we forgot to
reference that when linking cogl.

13 years agocogl: remove OSX/WIN32 specific bits in favour of a stub winsys
Robert Bragg [Mon, 18 Apr 2011 16:45:36 +0000 (17:45 +0100)]
cogl: remove OSX/WIN32 specific bits in favour of a stub winsys

Until Cogl gains native win32/OSX support this remove the osx and win32
winsys files and instead we'll just rely on the stub-winsys.c to handle
these platforms. Since the only thing the platform specific files were
providing anyway was a get_proc_address function; it was trivial to
simply update the clutter backend code to handle this directly for now.

13 years agocogl-gl.c: remove really_enable_npot hack for OSX
Robert Bragg [Mon, 18 Apr 2011 16:35:15 +0000 (17:35 +0100)]
cogl-gl.c: remove really_enable_npot hack for OSX

This is a workaround for a bug on OSX for some radeon hardware that
we can't verify and the referenced bug link is no longer valid.

If this is really still a problem then a new bug should be opened and we
can look at putting the fix in some more appropriate place than
cogl-gl.c

13 years agocogl/configure.ac: Adds --enable-stub-winsys option
Robert Bragg [Mon, 18 Apr 2011 16:17:21 +0000 (17:17 +0100)]
cogl/configure.ac: Adds --enable-stub-winsys option

We want to be able to split Cogl out as a standalone project but there
are still some window systems that aren't natively supported by Cogl.
This allows Clutter to support those window systems directly but still
work with a standalone Cogl library.

This also ensures we set the SUPPORT_STUB conditional in clutter's
configure.ac when building for win32/osx and wayland.

13 years agowinsys-glx: map X window automatically if not foreign
Robert Bragg [Mon, 18 Apr 2011 15:26:17 +0000 (16:26 +0100)]
winsys-glx: map X window automatically if not foreign

For now we are going for the semantics that when a CoglOnscreen is first
allocated then it will automatically be mapped. This is for convenience
and if you don't want that behaviour then it is possible to instead
create an Onscreen from a foreign X window and in that case it wont be
mapped automatically.

This approach means that Cogl doesn't need onscreen_map/unmap functions
but it's possible we'll decide later that we can't avoid adding such
functions and we'll have to change these semantics.

13 years agocogl/configure.ac: make COGL_HAS_xyz defines public
Robert Bragg [Mon, 18 Apr 2011 14:57:32 +0000 (15:57 +0100)]
cogl/configure.ac: make COGL_HAS_xyz defines public

Instead of using AC_DEFINE for the various COGL_HAS_PLATFORM defines
this now adds them to the COGL_DEFINES_SYMBOLS variable which gets
substituted into the public cogl-defines.h header.

13 years agoadd missing Cogl bits to .gitignore
Robert Bragg [Tue, 12 Apr 2011 17:50:54 +0000 (18:50 +0100)]
add missing Cogl bits to .gitignore

13 years agoclutter/Makefile.am: mark clutter-cex100.h as BUILT_SOURCES
Robert Bragg [Mon, 18 Apr 2011 12:07:21 +0000 (13:07 +0100)]
clutter/Makefile.am: mark clutter-cex100.h as BUILT_SOURCES

clutter-xcex100.h is generated from clutter-cex100.h.in when running
./configure so it should be added to automake's BUILT_SOURCES variable.

13 years agoAdds Cogl Hello World and "X11 foreign" example applications
Robert Bragg [Thu, 17 Mar 2011 19:32:54 +0000 (19:32 +0000)]
Adds Cogl Hello World and "X11 foreign" example applications

This adds a simple standalone Cogl application that can be used to
smoke test a standalone build of Cogl without Clutter.

This also adds an x11-foreign app that shows how a toolkit can ask Cogl
to draw to an X Window that it owns instead of Cogl being responsible
for automatically creating and mapping an X Window for CoglOnscreen.

13 years agocogl/configure.ac: add options to control driver/egl platform
Robert Bragg [Thu, 10 Mar 2011 15:15:08 +0000 (15:15 +0000)]
cogl/configure.ac: add options to control driver/egl platform

This allows more detailed control over the driver and winsys features
that Cogl should have. Cogl is designed so it can support multiple
window systems simultaneously so we have enable/disable options for
the drivers (gl vs gles1 vs gles2) and options for the individual window
systems; currently glx and egl. Egl is broken down into an option
for each platform.

13 years agoEGL: Updates GDL platform support
Robert Bragg [Fri, 4 Mar 2011 12:50:39 +0000 (12:50 +0000)]
EGL: Updates GDL platform support

The GDL API is used for example on intel ce4100 (aka Sodaville) based
systems as a way to allocate memory that can be composited using the
platforms overlay hardware. This updates the Cogl EGL winsys and the
support in Clutter so we can continue to support these platforms.

13 years agoDon't reference GL_STACK_OVERFLOW/UNDERFLOW for GLES
Robert Bragg [Wed, 2 Mar 2011 11:02:50 +0000 (11:02 +0000)]
Don't reference GL_STACK_OVERFLOW/UNDERFLOW for GLES

These symbols aren't available when building with GLES so only reference
them when building with OpenGL.

13 years agowinsys: Expose environment variable to choose winsys
Robert Bragg [Mon, 18 Apr 2011 15:24:51 +0000 (16:24 +0100)]
winsys: Expose environment variable to choose winsys

This makes it possible to override the winsys that cogl uses by setting
the COGL_RENDERER environment variable e.g. to "GLX" or "EGL"

13 years agoAdd a vtable of indirection to the winsys code
Robert Bragg [Fri, 25 Feb 2011 11:29:08 +0000 (11:29 +0000)]
Add a vtable of indirection to the winsys code

So that we can dynamically select what winsys backend to use at runtime
we need to have some indirection to how code accesses the winsys instead
of simply calling _cogl_winsys* functions that would collide if we
wanted to compile more than one backend into Cogl.

13 years agotexture-pixmap-x11: Move GLX code to cogl-winsys-glx.c
Robert Bragg [Tue, 1 Mar 2011 14:43:43 +0000 (14:43 +0000)]
texture-pixmap-x11: Move GLX code to cogl-winsys-glx.c

This moves the GLX specific code from cogl-texture-pixmap-x11.c into
cogl-winsys-glx.c. If we want the winsys components to by dynamically
loadable then we can't have GLX code scattered outside of
cogl-winsys-glx.c. This also sets us up for supporting the
EGL_texture_from_pixmap extension which is almost identical to the
GLX_texture_from_pixmap extension.

13 years agoMoves all EGL code down from Clutter to Cogl
Robert Bragg [Fri, 25 Feb 2011 00:31:41 +0000 (00:31 +0000)]
Moves all EGL code down from Clutter to Cogl

As was recently done for the GLX window system code, this commit moves
the EGL window system code down from the Clutter backend code into a
Cogl winsys.

Note: currently the cogl/configure.ac is hard coded to only build the GLX
winsys so currently this is only available when building Cogl as part
of Clutter.

13 years agoremove references to unused DRM_SURFACELESS EGL platform
Robert Bragg [Fri, 25 Feb 2011 00:49:07 +0000 (00:49 +0000)]
remove references to unused DRM_SURFACELESS EGL platform

The "DRM_SURFACELESS" EGL platform was invented when we were adding the
wayland backend to Clutter but in the end we added a dedicated backend
instead of extending the EGL backend so actually the platform name isn't
used.

13 years agoUpdated Spanish translation
Daniel Mustieles [Wed, 4 May 2011 20:41:43 +0000 (22:41 +0200)]
Updated Spanish translation

13 years agoUpdated Spanish translation
Daniel Mustieles [Wed, 4 May 2011 20:41:04 +0000 (22:41 +0200)]
Updated Spanish translation

13 years agoUpdated Spanish translation
Daniel Mustieles [Tue, 3 May 2011 21:00:04 +0000 (23:00 +0200)]
Updated Spanish translation

13 years agoUpdated Spanish translation
Daniel Mustieles [Mon, 2 May 2011 10:10:34 +0000 (12:10 +0200)]
Updated Spanish translation

13 years agoUpdated Spanish translation
Daniel Mustieles [Fri, 29 Apr 2011 17:48:28 +0000 (19:48 +0200)]
Updated Spanish translation

13 years agoUpdated Spanish translation
Daniel Mustieles [Thu, 28 Apr 2011 18:40:46 +0000 (20:40 +0200)]
Updated Spanish translation

13 years agoUpdated Spanish translation
Daniel Mustieles [Mon, 25 Apr 2011 20:49:42 +0000 (22:49 +0200)]
Updated Spanish translation

13 years agocogl-context: Initialize context->stub_winsys
Neil Roberts [Thu, 21 Apr 2011 15:44:15 +0000 (16:44 +0100)]
cogl-context: Initialize context->stub_winsys

If Cogl is built using a full Winsys then it wasn't initialising
context->stub_winsys which sometimes made it crash later on.

13 years ago[l10n] Updated German translation
Mario Blättermann [Wed, 20 Apr 2011 21:13:26 +0000 (23:13 +0200)]
[l10n] Updated German translation

13 years agocogl-winsys-stub: Remove _cogl_winsys_has_feature
Neil Roberts [Wed, 20 Apr 2011 17:43:02 +0000 (18:43 +0100)]
cogl-winsys-stub: Remove _cogl_winsys_has_feature

Commit b061f737 moved _cogl_winsys_has_feature to the common winsys
code so there's no need to define it in the stub winsys any more. This
was breaking builds for backends using the stub winsys.

13 years agocogl-winsys-glx: Fix the comparison in find_onscreen_for_xid
Neil Roberts [Wed, 20 Apr 2011 16:50:38 +0000 (17:50 +0100)]
cogl-winsys-glx: Fix the comparison in find_onscreen_for_xid

The comparison for finding onscreen framebuffers in
find_onscreen_for_xid had a small thinko so that it would ignore
framebuffers when the negation of the type is onscreen. This ends up
doing the right thing anyway because the onscreen type has the value 0
and the offscreen type has the value 1 but presumably it would fail if
we ever added any other framebuffer types.

13 years agoclutter-backend-glx: Protect against unrefing the Cogl context twice
Neil Roberts [Wed, 20 Apr 2011 10:10:54 +0000 (11:10 +0100)]
clutter-backend-glx: Protect against unrefing the Cogl context twice

The dispose function may be called multiple times during destruction
so it needs to be resilient against destroying any resources
twice. This wasn't the case for the reference to the Cogl context.

13 years agocogl-winsys: Move _cogl_winsys_has_feature to cogl-winsys.c
Neil Roberts [Fri, 15 Apr 2011 15:03:19 +0000 (16:03 +0100)]
cogl-winsys: Move _cogl_winsys_has_feature to cogl-winsys.c

The code for _cogl_winsys_has_feature will be identical in all of the
winsys backends for the time being, so it seems to make sense to have
it in the common cogl-winsys.c file.

13 years agocogl-context: Store winsys features in an array of unsigned ints
Neil Roberts [Fri, 15 Apr 2011 14:39:14 +0000 (15:39 +0100)]
cogl-context: Store winsys features in an array of unsigned ints

Previously the mask of available winsys features was stored in a
CoglBitmask. That isn't the ideal type to use for this because it is
intended for a growable array of bits so it can allocate extra memory
if there are more than 31 flags set. For the winsys feature flags the
highest used bit is known at compile time so it makes sense to
allocate a fixed array instead. This is conceptually similar to the
CoglDebugFlags which are stored in an array of integers with macros to
test a bit in the array. This moves the macros used for CoglDebugFlags
to cogl-flags.h and makes them more generic so they can be shared with
CoglContext.

13 years agocogl-renderer: Move the XEvent filters to be generic for all renderers
Neil Roberts [Wed, 13 Apr 2011 15:41:41 +0000 (16:41 +0100)]
cogl-renderer: Move the XEvent filters to be generic for all renderers

Instead of having cogl_renderer_xlib_add_filter and friends there is
now cogl_renderer_add_native_filter which can be used regardless of
the backend. The callback function for the filter now just takes a
void pointer instead of an XEvent pointer which should be interpreted
differently depending on the backend. For example, on Xlib it would
still be an XEvent but on Windows it could be a MSG. This simplifies
the code somewhat because the _cogl_xlib_add_filter no longer needs to
have its own filter list when a stub renderer is used because there is
always a renderer available.

cogl_renderer_xlib_handle_event has also been renamed to
cogl_renderer_handle_native_event. This just forwards the event on to
all of the listeners. The backend renderer is expected to register its
own event filter if it wants to process the events in some way.

13 years agoevdev: Remove unused variable
Emmanuele Bassi [Mon, 18 Apr 2011 15:24:27 +0000 (16:24 +0100)]
evdev: Remove unused variable

13 years agocogl/glx: Silence a compiler warning
Emmanuele Bassi [Mon, 18 Apr 2011 14:53:25 +0000 (15:53 +0100)]
cogl/glx: Silence a compiler warning

13 years agoanimation: Use ::destroy with animate()
Emmanuele Bassi [Sat, 16 Apr 2011 09:22:01 +0000 (10:22 +0100)]
animation: Use ::destroy with animate()

ClutterAnimation uses the weak ref machinery of GObject when associated
to ClutterActor by clutter_actor_animate() and friends - all the while
taking a reference on the actor itself. In order to trigger the weak ref
callback, external code would need to unref the Actor at least twice,
which has slim chance of happening. Plus, the way to destroy an Actor is
to call destroy(), not call unref().

The destruction sequence of ClutterActor emits the ::destroy signal, which
should be used by classes to release external references the might be
holding. My oh my, this sounds *exactly* the case!

So, let's switch to using the ::destroy signal for clutter_actor_animate()
and friends, since we know that the object bound to the Animation is
an Actor, and has a ::destroy signal.

This change has the added benefit of allowing destroying an actor as the
result of the Animation::completed signal without getting a segfault or
other bad things to happen.

Obviously, the change does not affect other GObject classes, or Animation
instances created using clutter_animation_new(); for those, the current
"let's take a reference on the object to avoid it going away in-flight"
mechanism should still suffice.

Side note: it would be interesting if GObject had an interface for
"destructible" objects, so that we could do a safe type check. I guess
it's a Rainy Day Project(tm)...

13 years agoactor: Use _clutter_actor_meta_get_debug_name()
Emmanuele Bassi [Fri, 15 Apr 2011 12:43:15 +0000 (13:43 +0100)]
actor: Use _clutter_actor_meta_get_debug_name()

The ActorMeta name can be more informative than just the GType class
name.

13 years agoactor-meta: Add a get_debug_name() private method
Emmanuele Bassi [Fri, 15 Apr 2011 12:42:45 +0000 (13:42 +0100)]
actor-meta: Add a get_debug_name() private method

Similar to ClutterActor's own get_debug_name().

13 years agoUpdated Spanish translation
Daniel Mustieles [Thu, 14 Apr 2011 17:19:14 +0000 (19:19 +0200)]
Updated Spanish translation

13 years agoUse the actor's debug name consistently
Emmanuele Bassi [Thu, 14 Apr 2011 16:58:15 +0000 (17:58 +0100)]
Use the actor's debug name consistently

Do not use the generic GType class name: we have a :name property on
ClutterActor that is generally used for debugging purposes — so we
should use it when creating debugging spew in a consistent way.

13 years agoglx: Chain up in ::unrealize()
Emmanuele Bassi [Thu, 14 Apr 2011 14:44:22 +0000 (15:44 +0100)]
glx: Chain up in ::unrealize()

And avoid a segmentation fault on stage destruction if the main loop
keeps running.

13 years agox11: Provide a StageWindow::unrealize implementation
Emmanuele Bassi [Thu, 14 Apr 2011 14:43:19 +0000 (15:43 +0100)]
x11: Provide a StageWindow::unrealize implementation

The Cogl rework removed the Window creation from realize and its
relative destruction from unrealize; the two vfuncs also managed
the mapping between Window and Stage implementation that we use
when dealing with event handling. Sadly, the missing unrealization
left entries in the mapping dangling.

Since ClutterStageX11 already provides a ::realize implementation
that sub-classes are supposed to chain up to, and the Window ↔ Stage
mapping is private to clutter-stage-x11.c, it seems only fair that
the ClutterStageX11 should also provide an ::unrealize implementation
matching the ::realize.

This implementation just removes the StageX11 pointer from the X11
Window ↔ ClutterStageX11 mapping we set up in ::realize, since the
X11 Window is managed by Cogl, now.

13 years agoGL_IMG_TEXTURE_NPOT extension enables TEXTURE_NPOT features on GLES
James Athey [Mon, 11 Apr 2011 18:26:45 +0000 (14:26 -0400)]
GL_IMG_TEXTURE_NPOT extension enables TEXTURE_NPOT features on GLES

Older drivers for PowerVR SGX hardware have the vendor-specific
GL_IMG_TEXTURE_NPOT extension instead of the
functionally-equivalent GL_OES_TEXTURE_NPOT extension.

13 years agodetermine evdev device type using g_udev_device_has_property
James Athey [Tue, 12 Apr 2011 15:33:58 +0000 (11:33 -0400)]
determine evdev device type using g_udev_device_has_property

http://bugzilla.clutter-project.org/show_bug.cgi?id=2631

13 years agouniquely name and enable evdev ClutterInputDevice objects on creation
James Athey [Tue, 12 Apr 2011 15:32:43 +0000 (11:32 -0400)]
uniquely name and enable evdev ClutterInputDevice objects on creation

http://bugzilla.clutter-project.org/show_bug.cgi?id=2631

13 years agoSilence another compiler warning
Emmanuele Bassi [Tue, 12 Apr 2011 20:02:14 +0000 (21:02 +0100)]
Silence another compiler warning

13 years agoSilence the compiler by removing unused variables
Emmanuele Bassi [Tue, 12 Apr 2011 19:35:31 +0000 (20:35 +0100)]
Silence the compiler by removing unused variables

13 years agoglx: Protect GLX SwapEvent symbols
Emmanuele Bassi [Tue, 12 Apr 2011 19:28:36 +0000 (20:28 +0100)]
glx: Protect GLX SwapEvent symbols

We need to guard the usage of symbols related to the
GLX_INTEL_swap_event extension, to avoid breaking on platforms and/or
versions of Mesa that do not expose that extension.

13 years agoUpdated Slovenian translation
Matej Urbančič [Tue, 12 Apr 2011 19:17:29 +0000 (21:17 +0200)]
Updated Slovenian translation

13 years agoUpdated Slovenian translation
Matej Urbančič [Tue, 12 Apr 2011 19:10:23 +0000 (21:10 +0200)]
Updated Slovenian translation

13 years agoUpdated Spanish translation
Daniel Mustieles [Tue, 12 Apr 2011 19:05:10 +0000 (21:05 +0200)]
Updated Spanish translation

13 years agoREADME.md: Fix all the links to Bugzilla
Emmanuele Bassi [Tue, 12 Apr 2011 16:53:24 +0000 (17:53 +0100)]
README.md: Fix all the links to Bugzilla

13 years agoPoint to GNOME for filing bugs
Emmanuele Bassi [Tue, 12 Apr 2011 16:32:01 +0000 (17:32 +0100)]
Point to GNOME for filing bugs

The canonical bug tracker for Clutter has been moved to
bugzilla.gnome.org.

13 years agoglx: Remove unused variable
Emmanuele Bassi [Tue, 12 Apr 2011 16:00:08 +0000 (17:00 +0100)]
glx: Remove unused variable

Make gcc not complain about it.

13 years agoUpdated Czech translation
Marek Černocký [Mon, 11 Apr 2011 21:38:49 +0000 (23:38 +0200)]
Updated Czech translation

13 years agoUpdated Spanish translation
Daniel Mustieles [Mon, 11 Apr 2011 18:58:43 +0000 (20:58 +0200)]
Updated Spanish translation

13 years agoMake cogl_framebuffer_get_width/height experimental public API
Robert Bragg [Tue, 1 Mar 2011 23:12:18 +0000 (23:12 +0000)]
Make cogl_framebuffer_get_width/height experimental public API

It's generally useful to be able to query the width and height of a
framebuffer and we expect to need this in Clutter when we move the
eglnative backend code into Cogl since Clutter will need to read back
the fixed size of the framebuffer when realizing the stage.

13 years agobackend: remove untested fruity backend
Robert Bragg [Thu, 24 Feb 2011 12:05:15 +0000 (12:05 +0000)]
backend: remove untested fruity backend

This backend hasn't been used for years now and so because it is
untested code and almost certainly doesn't work any more it would be a
burdon to continue trying to maintain it. Considering that we are now
looking at moving OpenGL window system integration code down from
Clutter backends into Cogl that will be easier if we don't have to
consider this backend.

13 years agoAdds a --with-system-cogl config option for Clutter
Robert Bragg [Tue, 22 Feb 2011 15:51:13 +0000 (15:51 +0000)]
Adds a --with-system-cogl config option for Clutter

This makes it possible to build Clutter against a standalone build of
Cogl instead of having the Clutter build traverse into the clutter/cogl
subdirectory.

13 years agoAdds the ability to build Cogl standalone
Robert Bragg [Thu, 10 Feb 2011 02:32:11 +0000 (02:32 +0000)]
Adds the ability to build Cogl standalone

This adds an autogen.sh, configure.ac and build/autotool files etc under
clutter/cogl and makes some corresponding Makefile.am changes that make
it possible to build and install Cogl as a standalone library.

Some notable things about this are:
A standalone installation of Cogl installs 3 pkg-config files;
cogl-1.0.pc, cogl-gl-1.0.pc and cogl-2.0.pc. The second is only for
compatibility with what clutter installed though I'm not sure that
anything uses it so maybe we could remove it. cogl-1.0.pc is what
Clutter would use if it were updated to build against a standalone cogl
library. cogl-2.0.pc is what you would use if you were writing a
standalone Cogl application.

A standalone installation results in two libraries currently, libcogl.so
and libcogl-pango.so. Notably we don't include a major number in the
sonames because libcogl supports two major API versions; 1.x as used by
Clutter and the experimental 2.x API for standalone applications.
Parallel installation of later versions e.g. 3.x and beyond will be
supportable either with new sonames or if we can maintain ABI then we'll
continue to share libcogl.so.

The headers are similarly not installed into a directory with a major
version number since the same headers are shared to export the 1.x and
2.x APIs (The only difference is that cogl-2.0.pc ensures that
-DCOGL_ENABLE_EXPERIMENTAL_2_0_API is used). Parallel installation of
later versions is not precluded though since we can either continue
sharing or later add a major version suffix.

13 years agoMoves all GLX code down from Clutter to Cogl
Robert Bragg [Fri, 5 Nov 2010 12:28:33 +0000 (12:28 +0000)]
Moves all GLX code down from Clutter to Cogl

This migrates all the GLX window system code down from the Clutter
backend code into a Cogl winsys. Moving OpenGL window system binding
code down from Clutter into Cogl is the biggest blocker to having Cogl
become a standalone 3D graphics library, so this is an important step in
that direction.

13 years agoAdds renderer,display,onscreen-template and swap-chain stubs
Robert Bragg [Fri, 25 Feb 2011 17:06:50 +0000 (17:06 +0000)]
Adds renderer,display,onscreen-template and swap-chain stubs

As part of the process of splitting Cogl out as a standalone graphics
API we need to introduce some API concepts that will allow us to
initialize a new CoglContext when Clutter isn't there to handle that for
us...

The new objects roughly in the order that they are (optionally) involved
in constructing a context are: CoglRenderer, CoglOnscreenTemplate,
CoglSwapChain and CoglDisplay.

Conceptually a CoglRenderer represents a means for rendering.  Cogl
supports rendering via OpenGL or OpenGL ES 1/2.0 and those APIs are
accessed through a number of different windowing APIs such as GLX, EGL,
SDL or WGL and more. Potentially in the future Cogl could render using
D3D or even by using libdrm and directly banging the hardware. All these
choices are wrapped up in the configuration of a CoglRenderer.

Conceptually a CoglDisplay represents a display pipeline for a renderer.
Although Cogl doesn't aim to provide a detailed abstraction of display
hardware, on some platforms we can give control over multiple display
planes (On TV platforms for instance video content may be on one plane
and 3D would be on another so a CoglDisplay lets you select the plane
up-front.)

Another aspect of CoglDisplay is that it lets us negotiate a display
pipeline that best supports the type of CoglOnscreen framebuffers we are
planning to create. For instance if you want transparent CoglOnscreen
framebuffers then we have to be sure the display pipeline wont discard
the alpha component of your framebuffers. Or if you want to use
double/tripple buffering that requires support from the display
pipeline.

CoglOnscreenTemplate and CoglSwapChain are how we describe our default
CoglOnscreen framebuffer configuration which can affect the
configuration of the display pipeline.

The default/simple way we expect most CoglContexts to be constructed
will be via something like:

 if (!cogl_context_new (NULL, &error))
   g_error ("Failed to construct a CoglContext: %s", error->message);

Where that NULL is for an optional "display" parameter and NULL says to
Cogl "please just try to do something sensible".

If you want some more control though you can manually construct a
CoglDisplay something like:

 display = cogl_display_new (NULL, NULL);
 cogl_gdl_display_set_plane (display, plane);
 if (!cogl_display_setup (display, &error))
   g_error ("Failed to setup a CoglDisplay: %s", error->message);

And in a similar fashion to cogl_context_new() you can optionally pass
a NULL "renderer" and/or a NULL "onscreen template" so Cogl will try to
just do something sensible.

If you need to change the CoglOnscreen defaults you can provide a
template something like:
  chain = cogl_swap_chain_new ();
  cogl_swap_chain_set_has_alpha (chain, TRUE);
  cogl_swap_chain_set_length (chain, 3);

  onscreen_template = cogl_onscreen_template_new (chain);
  cogl_onscreen_template_set_pixel_format (onscreen_template,
                                           COGL_PIXEL_FORMAT_RGB565);

  display = cogl_display_new (NULL, onscreen_template);
  if (!cogl_display_setup (display, &error))
    g_error ("Failed to setup a CoglDisplay: %s", error->message);

13 years agorename winsys files to be more consistent
Robert Bragg [Tue, 22 Feb 2011 20:08:16 +0000 (20:08 +0000)]
rename winsys files to be more consistent

This tries to make the naming style of files under cogl/winsys/
consistent with other cogl source files. In particular private header
files didn't have a '-private' infix.

13 years agoAdd temporary cogl-clutter.h to aid splitting out Cogl
Robert Bragg [Tue, 22 Feb 2011 18:25:29 +0000 (18:25 +0000)]
Add temporary cogl-clutter.h to aid splitting out Cogl

This gives us a way to clearly track the internal Cogl API that Clutter
depends on. The aim is to split Cogl out from Clutter into a standalone
3D graphics API and eventually we want to get rid of any private
interfaces for Clutter so its useful to have a handle on that task.
Actually it's not as bad as I was expecting though.

13 years agoactor: visualize culling with CLUTTER_PAINT=redraws
Robert Bragg [Tue, 15 Mar 2011 12:08:46 +0000 (12:08 +0000)]
actor: visualize culling with CLUTTER_PAINT=redraws

This extends visualization for CLUTTER_PAINT=redraws so it now also
draws outlines for actors to show how they are being culled. Actors get
a green outline if they are fully inside the clip region, blue if fully
outside and greeny-blue if only partially inside.

13 years agostage: adds internal_get_active_framebuffer API
Robert Bragg [Thu, 10 Mar 2011 22:05:03 +0000 (22:05 +0000)]
stage: adds internal_get_active_framebuffer API

This adds an internal _clutter_stage_get_active_framebuffer function
that can be used to get a pointer to the current CoglFramebuffer pointer
that is in use, in association with a given stage.

The "active" infix in the function name is there because we shouldn't
assume that a stage will always correspond to only a single framebuffer
so we aren't getting a pointer to a sole framebuffer, we are getting
a pointer to the framebuffer that is currently in use/being painted.

This API is now used for culling purposes where we need to check if we
are currently painting an actor to a framebuffer that is offscreen, that
doesn't correspond to the stage.

13 years agoframebuffer: expose experimental cogl_get_draw_framebuffer
Robert Bragg [Thu, 10 Mar 2011 21:33:31 +0000 (21:33 +0000)]
framebuffer: expose experimental cogl_get_draw_framebuffer

This renames the two internal functions _cogl_get_draw/read_buffer
as cogl_get_draw_framebuffer and _cogl_get_read_framebuffer. The
former is now also exposed as experimental API.

13 years agoframebuffer: track context as CoglFramebuffer member
Robert Bragg [Tue, 22 Feb 2011 17:58:47 +0000 (17:58 +0000)]
framebuffer: track context as CoglFramebuffer member

The long term goal with the Cogl API is that we will get rid of the
default global context. As a step towards this, this patch tracks a
reference back to the context in each CoglFramebuffer so in a lot of
cases we can avoid using the _COGL_GET_CONTEXT macro.

13 years agoremove unused _cogl_features_init prototype
Robert Bragg [Tue, 22 Feb 2011 17:30:54 +0000 (17:30 +0000)]
remove unused _cogl_features_init prototype

There is no corresponding implementation of _cogl_features_init any more
so it was simply an oversight that the prototype wasn't removed when the
implementation was removed.

13 years agoRemove unused _cogl_swap_buffers_notify
Robert Bragg [Tue, 22 Feb 2011 17:13:56 +0000 (17:13 +0000)]
Remove unused _cogl_swap_buffers_notify

Recently _cogl_swap_buffers_notify was added (in 142b229c5c26) so that
Cogl would be notified when Clutter performs a swap buffers request for
a given onscreen framebuffer. It was expected this would be required for
the recent cogl_read_pixel optimization that was implemented (ref
1bdb0e6e98db) but in the end it wasn't used.

Since it wasn't used in the end this patch removes the API.

13 years agocogl: consolidate _create_context_driver + _features_init
Robert Bragg [Fri, 5 Nov 2010 00:34:37 +0000 (00:34 +0000)]
cogl: consolidate _create_context_driver + _features_init

This moves the functionality of _cogl_create_context_driver from
driver/{gl,gles}/cogl-context-driver-{gl,gles}.c into
driver/{gl,gles}/cogl-{gl,gles}.c as a static function called
initialize_context_driver.

cogl-context-driver-{gl,gles}.[ch] have now been removed.

13 years agocogl: Adds experimental cogl_context_new() API
Robert Bragg [Fri, 5 Nov 2010 00:00:25 +0000 (00:00 +0000)]
cogl: Adds experimental cogl_context_new() API

This adds a new experimental function (you need to define
COGL_ENABLE_EXPERIMENTAL_API to access it) which takes us towards being
able to have a standalone Cogl API. This is really a minor aesthetic
change for now since all the GL context creation code still lives in
Clutter but it's a step forward none the less.

Since our current designs introduce a CoglDisplay object as something
that would be passed to the context constructor this provides a stub
cogl-display.h with CoglDisplay typedef.

_cogl_context_get_default() which Clutter uses to access the Cogl
context has been modified to use cogl_context_new() to initialize
the default context.

There is one rather nasty hack used in this patch which is that the
implementation of cogl_context_new() has to forcibly make the allocated
context become the default context because currently all the code in
Cogl assumes it can access the context using _COGL_GET_CONTEXT including
code used to initialize the context.

13 years agocogl: rename cogl-context.h cogl-context-private.h
Robert Bragg [Thu, 4 Nov 2010 22:25:52 +0000 (22:25 +0000)]
cogl: rename cogl-context.h cogl-context-private.h

Since we plan to add public cogl_context_* API we need to rename the
current cogl-context.h which contains private member details.

13 years agostage: Move _clutter_do_pick to clutter-stage.c
Robert Bragg [Tue, 15 Mar 2011 13:17:04 +0000 (13:17 +0000)]
stage: Move _clutter_do_pick to clutter-stage.c

This moves the implementation of _clutter_do_pick to clutter-stage.c and
renames it _clutter_stage_do_pick. This function can be compared to
_clutter_stage_do_update/redraw in that it prepares for and starts a
traversal of a scenegraph descending from a given stage. Since it is
desirable that this function should have access to the private state of
the stage it is awkward to maintain outside of clutter-stage.c.

Besides moving _clutter_do_pick this patch is also able to remove the
following private state accessors from clutter-stage-private.h:
_clutter_stage_set_pick_buffer_valid,
_clutter_stage_get_pick_buffer_valid,
_clutter_stage_increment_picks_per_frame_counter,
_clutter_stage_reset_picks_per_frame_counter and
_clutter_stage_get_picks_per_frame_counter.

13 years agopaint-volume: Fix culling bug to handle partial culls
Robert Bragg [Tue, 15 Mar 2011 10:23:41 +0000 (10:23 +0000)]
paint-volume: Fix culling bug to handle partial culls

This updates the inner loops of the cull function so now the vertices of
the polygon being culled are iterated in the inner loop instead of the
clip planes and we count how many vertices are outside the current
plane so we can bail out immediately if all the vertices are outside of
any plane and so we can correctly track partial intersections with the
clip region.

The previous approach could catch some partial intersections but for
example a rectangle that was larger than the clip region centred over
the clip region with all corners outside would be reported as outside,
not as a partial intersection.