1
0
Fork 0
Commit graph

204 commits

Author SHA1 Message Date
Neil Roberts
3ba03feb7d quartz-image: Pass -framework ApplicationServices in the linker flags
The quartz image backend is using functions from the
ApplicationServices framework and I was getting linker errors if I
didn't use this option. I'm not sure how anyone managed to build it
before without this.

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

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 54d9139a929560d6703428371b38b83e7d965f45)
2013-04-04 13:37:51 +01:00
Neil Roberts
69c60f6bf9 Post-release version bump to 1.14.1 2013-03-25 14:07:32 +00:00
Neil Roberts
232d8dc67c Release 1.14.0 (release) 2013-03-25 13:31:19 +00:00
Neil Roberts
13675ab440 configure: Add a minimum required version for the wayland package
Previously Cogl would accept any version of Wayland when building the
Wayland backend. Seeing as there is now a stable API we might as well
specify that we require at least version 1.0.0. This is now also
mentioned in the README. This patch also changes it to use
PKG_CHECK_MODULES instead of PKG_CHECK_EXISTS because it does need to
abort if it fails and it shouldn't be checking it silently.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit d899955b714e5ed50c6c89b9fde4b341bcf80558)
2013-03-22 00:13:36 +00:00
Neil Roberts
5334547c00 cogland: Update to the Wayland 1.0 API
This updates Cogland example compositor to use the stable Wayland 1.0
API.

• When the client attaches a new buffer to a surface it is now added
  to a struct contaning pending the state instead of immediately
  switching to the new buffer. This state is then flushed when the
  surface is committed.

• The frame callbacks are now queued in a pending list and only added
  to the compositor's main list when the surface is committed. Both
  lists are now a wl_list instead of a GQueue because it makes it
  easier to remove the callback without knowing which list it is in.

• When the buffer is destroyed for a surface the resource for the
  buffer is now sent a release event.

• It now flushes the clients in the prepare for the for the Wayland
  event GSource. This is part of the multi-threaded API in this
  Wayland patch:

  http://cgit.freedesktop.org/wayland/wayland/commit/?id=53d24713a31d59

• Implements a dummy wl_region interface. The only interfaces that
  actually use regions (the opaque and input regions) are ignored but
  we need the interface to create a resource.

• Most the of the SHM interface is now implemented directly in
  libwayland-server except that it still needs to copy the data to the
  subregion of the texture when the damage region is committed.

• The callback list for when a resource is destroyed has been unified
  into a generic wl_signal implementation so the signature for the
  functions has been changed.

  http://cgit.freedesktop.org/wayland/wayland/commit/?h=6802eaa68af9022

• The wl_buffer struct no longer has a user_data parameter so we can't
  attach our own CoglandBuffer data to it. Instead the CoglandSurface
  now just keeps track of the wl_buffer directly.

• The Cogland example is now unconditionally built instead of checking
  the Wayland version number in the configure script. It looks like
  this check was broken anyway because it was checking the version of
  the gbm package rather than a Wayland package.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 4cbbc0f8e3de1fd44dee08b487f1c3f97dda8ede)

Conflicts:
	examples/Makefile.am
	examples/cogland.c
2013-03-22 00:13:32 +00:00
Neil Roberts
6cab431f4c Post-release version bump to 1.13.5 2013-02-21 16:07:53 +00:00
Neil Roberts
72847ad8e2 Release 1.13.4 (snapshot) 2013-02-21 15:45:24 +00:00
Owen W. Taylor
88d8bd84f2 Add CoglOutput and track for the GLX backend
The CoglOutput object represents one output such as a monitor or
laptop panel, with information about attributes of the output such as
the position of the output within the global coordinate space, and
the refresh rate.

We don't yet publically export the ability to get output information but
we track it for the GLX backend, where we'll use it to track the refresh
rate.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit d7ef9d8d71488d0e6874f1ffc6e48700d5c82a31)
2013-01-30 19:56:45 +00:00
Robert Bragg
78bea226d4 Post-release version bump to 1.13.3 2013-01-22 18:44:33 +00:00
Robert Bragg
b33b41e7ab Release 1.13.2 (snapshot) 2013-01-22 18:00:12 +00:00
Damien Lespiau
c26d3813c4 doc: Fix cross-referencing with glib and gdk-pixbuf
The libraries prefixes where never set in the configure script and
GDKPIXBUF_PREFIX had a typo.

(cherry picked from commit 5d8c0e13ed0572f806fdff2bff1d5904ed3bf69b)
2013-01-22 17:48:16 +00:00
Damien Lespiau
f51f2459ac build: Use -Wundef when possible
This allows us to catch the use of undefined macros (that default to 0)
in preprocessor conditionals.

(cherry picked from commit 53ddc20fe9cd1400d18274e521932f84a4aecc5b)
2013-01-22 17:48:11 +00:00
Damien Lespiau
3289fe03e8 build: Exclude COGL_DEFINES and COGL_GL_HEADER_INCLUDES from Makefiles
Some variables (notably multiline ones) are not really supposed to be
substituted by automake. Let's take COGL_DEFINES for instance, you get:

  COGL_DEFINES =
  #define COGL_HAS_GLIB_SUPPORT
  #define COGL_HAS_GTYPE_SUPPORT
  #define COGL_HAS_GL
  #define CLUTTER_COGL_HAS_GL
  #define COGL_HAS_GLX_SUPPORT
  #define COGL_HAS_SDL
  ...

This only works because the '#' character makes it look like a comment
and COGL_DEFINES becomes an empty variable

Automake allows to exclude variables from the list of substitutions,
let's use it for those two.

(cherry picked from commit e0a9d8d775c90c60b6e63b52771e896da3641a40)
2013-01-22 17:48:11 +00:00
Neil Roberts
4f6fe6f0e2 Fixes for --disable-glib
This fixes some problems which were stopping --disable-glib from
working properly:

• A lot of the public headers were including glib.h. This shouldn't be
  necessary because the API doesn't expose any glib types. Otherwise
  any apps would require glib in order to get the header.

• The public headers were using G_BEGIN_DECLS. There is now a
  replacement macro called COGL_BEGIN_DECLS which is defined in
  cogl-types.h.

• A similar fix has been done for G_GNUC_NULL_TERMINATED and
  G_GNUC_DEPRECATED.

• The CFLAGS were not including $(builddir)/deps/glib which was
  preventing it finding the generated glibconfig.h when building out
  of tree.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 4138b3141c2f39cddaea3d72bfc04342ed5092d0)
2013-01-22 17:48:05 +00:00
Neil Roberts
5c8eebb3d9 configure: Don't allow --enable-gdk-pixbuf with --disable-glib
The GDK pixbuf support requires being able to propagate errors from
GDKPixbuf as GErrors. This won't work if we are using the builtin
version of GLib because any attempt to call g_error_free from within
Cogl will use the internal version which will free the error using the
wrong slice allocator. It probably doesn't make much sense to build
without glib but with gdk-pixbuf so there's not much point in trying
to work around this situation.

Previously if you specified --enable-gdk-pixbuf but gdk-pixbuf was not
available it would silently disable it. This pach also fixes it so
that it will report an error in that case.

If --enable-gdk-pixbuf is not specified it will now default to
enabling it only if both glib is enabled and gdk-pixbuf is available.

This patch looks slightly longer than it ought to be because it moves
the check for glib up to above the descisions about the image backend.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 8b1eabdc08da89a57792f9eb666e893a6cbb4e26)
2013-01-22 17:48:05 +00:00
Damien Lespiau
1c0c1a126a build: Create the libtool file early as it's used by AS_GLIBCONFIG
glib's configure.ac uses libtool to determine the extension of shared
libraries. So let's generate the libtool file early in configure.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit ae457e0e2463bcec4f5891778e8ada9924f91be7)
2013-01-22 17:47:58 +00:00
Damien Lespiau
41f443971c Build: Add a --enable-standalone option
This option will generate a libcogl2 DSO that depends on the least
possible external libraries.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 6357960e1b91081546adf1bb110067d7db4d7400)
2013-01-22 17:47:58 +00:00
Damien Lespiau
d2c41502a4 build: Allow to build cogl without an external glib dependency
This commit pushes --disable-glib to the extreme of embedding the par of
glib cogl depends on in tree to be able to generate a DSO that does not
depend on an external glib.

To do so, it:
  - keeps a lot of glib's configure.ac in as-glibconfig.m4
  - pulls the code cogl depends on and the necessary dependencies

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2013-01-22 17:47:58 +00:00
Damien Lespiau
6a126f2af3 build: Use the correct variable to indicate of cogl-gles2 will be built
Instead of using the variable to use in Makefile.ams.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 016f2276823a8a8cde33d3e7062c61469921a9f1)
2013-01-22 17:47:24 +00:00
Damien Lespiau
21cf79db9c build: Indicate if cogl is build with i18n support
--disable-nls can be used to compile cogl without i18n support. Let's
indicate the i18n enabling status so curious people can deduce it can be
compiled out.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 1ccaafa31dbc0c9b9184d61079b2deff913d8e25)
2013-01-22 17:47:24 +00:00
Damien Lespiau
a229a06fb8 build: Move the compiler checks and libtool initialization up
It seems logical to first look for the compiler and then run the rest of
configure script (which will use the compiler with small snippets).

Same goes for the libtool initializaton, you might as well do it not too
far from the automake one.

This also happens to be preparatory work to compile cogl with an in-tree
copy of some glib files as the glib's configure script needs those
checks early.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit ba452ea4a48e48324ee7382b7ccb9065c255f55a)
2013-01-22 17:47:24 +00:00
Damien Lespiau
0fdfde51f3 build: Bump the glib dependency to 2.32
As far as I can tell the --symbol-prefix option wasn't there before
glib 2.32's glib-mkenums. So cogl effectively depends on glib 2.32.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 4e952532a29b2566caf658705f815b7aec732265)
2013-01-18 17:28:25 +00:00
Robert Bragg
58bbf8499a Bump version to 1.13.1 2013-01-18 10:53:29 +00:00
Robert Bragg
015a47b77a Post-release version bump to 1.12.3 2013-01-04 17:37:21 +00:00
Robert Bragg
0f2ce5e77c Release 1.12.2 (release) 2013-01-04 17:23:45 +00:00
Robert Bragg
ab00855967 build: only build cogland with wayland-server 0.85
This ensures we only try to build cogland if we have wayland-server
0.85.x since the api is incompatible with later versions.
2013-01-04 17:23:45 +00:00
Robert Bragg
a8fa6c7c4d Post-release version bump to 1.12.1 2012-09-24 14:19:41 +01:00
Robert Bragg
b1aafcc15f Release 1.12.0 (release) 2012-09-24 13:46:40 +01:00
Robert Bragg
f904f2099a Post-release version bump to 1.11.7 2012-09-17 23:47:25 +01:00
Robert Bragg
3aa7bdaf49 Release 1.11.6 (snapshot) 2012-09-17 23:11:34 +01:00
Robert Bragg
6bcee6e9f3 Post-release version bump to 1.11.5 2012-09-03 19:18:17 +01:00
Robert Bragg
32801ad0a4 Release 1.11.4 (snapshot) 2012-09-03 15:55:15 +01:00
Sjoerd Simons
cde0eb3e76 Make the default driver selectable at configure time
When building COGL with multiple backends it can be useful to force a
default driver to be selected. For example while for Debian we do want to
build the GL renderer on ARM, GLESv2 is much more suitable as the
default renderer on that platform.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 8a43aa7167b56784f7b50c557391b990861d594f)
2012-09-03 15:51:45 +01:00
Robert Bragg
74d749eca4 kms: Update to latest gbm api
gbm_bo_get_pitch was renamed to gbm_bo_get_stride to be consistent with
how the terms pitch and stride are used throughout mesa. This updates
the Cogl backend to use the new gbm_bo_get_stride name.

For compatibility with previous version of libgbm we now explicitly
check the version of libgbm in configure.ac and expose
COGL_GBM_{MAJOR,MINOR,MICRO} defines to the code so we can conditionally
use the older gbm_bo_get_pitch() name with older versions.

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit 47c6247095e2f1f8725c4eb08d38c9de15e283cd)
2012-09-03 15:51:44 +01:00
Patrick Welche
4589c6f158 test(1) uses '=' to test if strings are identical
https://bugzilla.gnome.org/show_bug.cgi?id=682340

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit 5cd15e7781466307a27c31e6e3f1e7f5ade5cfee)
2012-08-28 11:28:23 +01:00
Robert Bragg
002671bd3e Post-release version bump to 1.11.3 2012-08-15 17:56:30 +01:00
Robert Bragg
bc305b1150 Release 1.11.2 (snapshot) 2012-08-15 17:32:22 +01:00
Antoine Jacoutot
601abeadca build: remove unneeded check for libdrm
Since fallback for vblank wait via manual drm ioctl was removed in
commit 3bc70687ac there is no need to
check for libdrm anymore.

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

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit b84047a578b7746e421cd553e781788925cff90f)
2012-08-15 17:29:16 +01:00
Robert Bragg
470273db7e configure: use AC_GNU_SOURCE
This adds the AC_GNU_SOURCE macro to configure.ac to ensure _GNU_SOURCE
is defined while compiling Cogl. This is required to use memmem for
example.

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit 1ed717dc12fc4d2cb49010232de93ff46684aa6a)
2012-08-15 14:09:53 +01:00
Neil Roberts
0c66431df3 Add a wrapper for 'memmem'
memmem is a GNU libc extension that works like strstr except that the
size of the needle and the haystack are passed into the function
instead of using null-terminated strings.

This patch adds a wrapper function called 'cogl_util_memmem' so that
we can use this function. There is a configure check and if the
function is not available then a fallback implementation will be used.
Otherwise cogl_util_memmem is just defined to memmem.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 1dd1b0a67f6238e13f7f9253fb03addada0541b7)
2012-08-14 18:55:42 +01:00
Tomeu Vizoso
bb258c1d42 Avoid including the EGL headers from the public Cogl headers
Otherwise, X11 identifiers may leak and cause havoc in big applications

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit ed0cdca0eca815543619fe72fbd42d662d53f92d)
2012-08-06 18:51:32 +01:00
Neil Roberts
17c818a9a7 Add an SDL2 winsys
This adds an alternate version of the SDL winsys using the SDL 2 API.
The two versions are mutually exclusive and share the same
CoglWinsysID. Version 2 of SDL fits a little bit better with Cogl
because it supports multiple windows and the video subsystem can be
initialised entirely independently of the rest of the subsystems.

The SDL2 winsys creates an invisible dummy window in order to bind the
GL context after creating the Cogl display. This is similar to how the
X11 winsys's work.

SDL2 seems to support compiling with support for both GL and GLES.
However there doesn't seem to be a way to select between the two
backends outside of SDL. In fact if you do compile them both in it
seems to break down because it will always try to use the window
system functions from the GLES backend because those are filled in
second in the vtable. However when creating the window it will always
prefer to use the GL function to choose a visual. This function gets
confused because the GL backend has not been initialised at that
point. The Cogl backend therefore just leaves it up to SDL to pick a
sensible backend. It will then verify that it picked a GL library
which matches the Cogl driver by checking the string from
glGetString(GL_VERSION).

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 6cb5ab41355e7bfe28f367cf4afa39a7afcfeec2)
2012-08-06 14:27:44 +01:00
Neil Roberts
b977d75059 Fix disabling debugging
When --disable-debug is passed to the configure script it was actually
still defining COGL_ENABLE_DEBUG so very little would end up being
disabled. If COGL_ENABLE_DEBUG actually got defined it would also fail
to compile because _cogl_debug_instances and COGL_DEBUG_N_LONGS from
cogl-debug.h were only defined if debugging is enabled but they are
used regardless.

This patch also makes it so that the _COGL_RETURN_IF_FAIL family of
macros that are used when glib support is disabled are now disabled if
debugging is disabled. When the glib macros are used they are already
disabled because we additionally define G_DISABLE_CHECKS.

'COGL_HANDLE_DEBUG' has been removed from the list of defines passed
when debugging is enabled because CoglHandle has already been removed
and it is not used anywhere in the code.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 9811a0101c9cbb4ab95c55a2b41fd10ff4c77d9f)
2012-08-06 14:27:43 +01:00
Robert Bragg
10340a5495 Adds libcogl-gles2 frontend GLES2 api
This adds a library that can be used instead of libGLESv2.so to provide
symbols for the GLES 2.0 api. This can be used for convenience when
using the cogl_gles2_context_ api since you don't need to manually go
through a CoglGLES2Vtable when calling the gles2 api so it should be
easier to port existing gles2 code to integrate with Cogl.

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit 80d7599a2acefca7d01d8d7de9df524278ef72c5)
2012-08-06 14:27:42 +01:00
Chun-wei Fan
23becf67a7 Fix Visual C++ build
-Create a pre-defined cogl/cogl-gl-header.h(.win32) that is to be used on
 any Windows builds, and adapt the MSVC build process to set up and use
 that file.
-Fix up glib-mkenums code generation .bat file that is generated during
 "make"/"make dist", like the autotools-based builds.
-Since cogl/cogl-defines.h now contain versionioning info, and it no longer
 directly includes the GL headers, update the pre-configured
 cogl-defines.h[.win32|.win32_SDL] and use autotools to fill in the
 versioning info during "make"/"make dist".
-Fix up cogl/cogl-pango.rc.in so that they reflect the cogl-2.x versioning
 stuff correctly and versioning info can be filled in correctly during
 "make"/"make dist"

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 7ff42bb1c5280b0f53370f8d94ef5f10c9f39e2f)
2012-08-06 14:27:42 +01:00
Neil Roberts
68a6e82828 Add support for the WebOS version of SDL
The stock 1.2.x version of SDL only supports regular OpenGL. The
version on WebOS is specially patched to add some extra API to request
a GLES1 or GLES2 context. This patch adds a configure check to detect
when Cogl is being built with the patched version of SDL. In that case
it will additionally allow the gles1 and gles2 drivers and set the
right video mode attributes to get the corresponding context.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 3726c60deab2bd94617a562abb63f735627a25e4)
2012-08-06 14:27:41 +01:00
Robert Bragg
e16b42a1b9 tests: Adds journal micro benchmark
This makes the test-cogl-perf test from clutter into a standalone Cogl
benchmark.

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit 1684a040b238ebae140e827f4003f2d2867c04f3)
2012-08-06 14:27:39 +01:00
Neil Roberts
a9d1939425 configure: Fix the check for _Static_assert
The check for whether the compiler supports _Static_assert didn't work
properly because the AC_TRY_COMPILE function puts the source
definition in its own main function. The test therefore ends up
declaring a nested main function which GCC allows. If _Static_assert
isn't available then it just looks like an implicit declaration of a
function which only causes a warning in GCC so it would still compile.

This patch changes it to use AC_COMPILE_IFELSE instead. This macro
makes it possible to specify the complete source code so
_Static_assert can be called from the global scope. AC_LANG_PROGRAM is
used to generate the program. For extra aesthetics it now also
generates a 'checking for...' message while the script is running.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 9657938c3083a782234e1e9f05ab5ae88a6bc5ab)
2012-08-06 14:27:39 +01:00
Robert Bragg
097d282b32 Add _COGL_STATIC_ASSERT macro
This adds a _COGL_STATIC_ASSERT macro that can be used for compile time
assertions in C code. If supported by the compiler this macro uses
_Static_assert so that a message can be printed out if the assertion
fails.

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit 465b39a764f2720e77678cafa56acb0e69007ffd)
2012-08-06 14:27:39 +01:00
Neil Roberts
6400b455b8 Don't include any GL header from the public GL headers
This splits the GL header inclusion from cogl-defines.h into a
separate headear called cogl-gl-header.h which we will only include
internally. That way we don't leak GL declarations out of our public
headers. The texture functions that were using GLenum and GLuint in
the public header have now changed to just use unsigned int. Note
however that if an EGL winsys is enabled then it will still publicly
include an EGL header. This is a bit more awkward to fix because we
have public API which returns an EGLDisplay and we can't determine
what type that is.

There is also a conformance test which just verifies that no GL header
has been included while compiling. The test isn't added to
test-conform-main because it doesn't actually test anything at
runtime.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit ef5680d3fda5df929dbd0b420c8f598ded58dfee)
2012-08-06 14:27:38 +01:00
Robert Bragg
763ecdeedd Bump version to 1.11.1 2012-08-06 14:27:38 +01:00
Neil Roberts
c2e8cc699f Post-release version bump to 1.10.1 2012-03-20 17:19:27 +00:00
Neil Roberts
724609f945 Release 1.10.0 (release) 2012-03-20 17:13:16 +00:00
Neil Roberts
a8cc560a42 configure: Fix the pkg-config check for pango
It looks like the then-clause of the AS_IF macro needs to be in square
brackets otherwise the configure script gets generated wrong and you
get this output when you run it:

configure: line 17339: COGL_PANGO_DEP_CFLAGS: command not found
configure: line 17340: C: command not found
configure: line 17341: COGL_PANGO_DEP_LIBS: command not found
configure: line 17342: linker: command not found

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-03-20 17:13:09 +00:00
Neil Roberts
7513aca394 Don't directly link to libGL from the EGL/KMS platform
The KMS platform accesses all of it's GL symbols via the indirection
through the Cogl context so there is no need to link against it
directly. This helps when trying to use Cogl with GLES where pulling
in Xlib via libGL is potentially a problem.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-03-15 18:09:13 +00:00
Neil Roberts
185630085c Add -Wmissing-declarations to maintainer flags and fix problems
This option to GCC makes it give a warning whenever a global function
is defined without a declaration. This should catch cases were we've
defined a function but forgot to put it in a header. In that case it
is either only used within one file so we should make it static or we
should declare it in a header.

The following changes where made to fix problems:

• Some functions were made static

• cogl-path.h (the one containing the 1.0 API) was split into two
  files, one defining the functions and one defining the enums so that
  cogl-path.c can include the enum and function declarations from the
  2.0 API as well as the function declarations from the 1.0 API.

• cogl2-clip-state has been removed. This only had one experimental
  function called cogl_clip_push_from_path but as this is unstable we
  might as well remove it favour of the equivalent cogl_framebuffer_*
  API.

• The GLX, SDL and WGL winsys's now have a private header to define
  their get_vtable function instead of directly declaring in the C
  file where it is called.

• All places that were calling COGL_OBJECT_DEFINE need to have the
  cogl_is_whatever function declared so these have been added either
  as a public function or in a private header.

• Some files that were not including the header containing their
  function declarations have been fixed to do so.

• Any unused error quark functions have been removed. If we later want
  them we should add them back one by one and add a declaration for
  them in a header.

• _cogl_is_framebuffer has been renamed to cogl_is_framebuffer and
  made a public function with a declaration in cogl-framebuffer.h

• Similarly for CoglOnscreen.

• cogl_vdraw_indexed_attributes is called
  cogl_framebuffer_vdraw_indexed_attributes in the header. The
  definition has been changed to match the header.

• cogl_index_buffer_allocate has been removed. This had no declaration
  and I'm not sure what it's supposed to do.

• CoglJournal has been changed to use the internal CoglObject macro so
  that it won't define an exported cogl_is_journal symbol.

• The _cogl_blah_pointer_from_handle functions have been removed.
  CoglHandle isn't used much anymore anyway and in the few places
  where it is used I think it's safe to just use the implicit cast
  from void* to the right type.

• The test-utils.h header for the conformance tests explicitly
  disables the -Wmissing-declaration option using a pragma because all
  of the tests declare their main function without a header. Any
  mistakes relating to missing declarations aren't really important
  for the tests.

• cogl_quaternion_init_from_quaternion and init_from_matrix have been
  given declarations in cogl-quaternion.h

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-03-06 18:45:44 +00:00
Robert Bragg
96bd7037a0 Bump development version to 1.9.9 2012-03-06 00:21:42 +00:00
Robert Bragg
9fb7b18d10 Release 1.9.8 (snapshot) 2012-03-05 23:32:36 +00:00
Robert Bragg
bbcbece6c9 tests: Improve thoroughness and reporting of make test
This patch reworks our conformance testing framework because it seems
that glib's gtesting framework isn't really well suited to our use case.
For example we weren't able to test windows builds given the way we
were using it and also for each test we'd like to repeat the test
with several different environments so we can test important driver and
feature combinations.

This patch instead switches away to a simplified but custom approach for
running our unit tests. We hope that having a more bespoke setup will
enable us to easily extend it to focus on the details important to us.

Notable changes with this new approach are:

We can now run 'make test' for our mingw windows builds.

We've got rid of all the test-*report* make rules and we're just left
with 'make test'

'make test' now runs each test several times with different driver and
feature combinations checking the result for each run. 'make test' will
then output a concise table of all of the results.

The combinations tested are:
- OpenGL Fixed Function
- OpenGL ARBfp
- OpenGL GLSL
- OpenGL No NPOT texture support
- OpenGLES 2.0
- OpenGLES 2.0 No NPOT texture support

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-24 14:42:31 +00:00
Neil Roberts
14932c4f97 Bump development version to 1.9.7 2012-02-21 19:53:12 +00:00
Neil Roberts
d09fcb3367 Release 1.9.6 (snapshot) 2012-02-21 19:20:44 +00:00
Robert Bragg
1a7ed26036 Bump development version to 1.9.5 2012-01-17 00:17:19 +00:00
Robert Bragg
348e99c711 Release 1.9.4 (snapshot) 2012-01-16 23:27:36 +00:00
Robert Bragg
f8c0cb6900 configure: Updates listed glib dependency to 2.28
Cogl depends on glib 2.28 for g_source_get_time() so this updates the
glib dependency listed in configure.ac
2012-01-16 23:27:36 +00:00
Neil Roberts
7497475295 Add support for main loop integration
This adds two new functions:

void
cogl_poll_get_info (CoglContext *context,
                    CoglPollFD **poll_fds,
                    int *n_poll_fds,
                    gint64 *timeout);

void
cogl_poll_dispatch (CoglContext *context,
                    const CoglPollFD *poll_fds,
                    int n_poll_fds);

The application is expected to call the first function whenever it is
about to block to go idle, and the second function whenever it comes
out of idle. This gives Cogl winsys's the ability poll file
descriptors for events. For example when handing swap complete
notifications, it can report that it needs to block on a file
descriptor.

The two functions are backed by winsys virtual functions. There are
currently no implementations. The default handler for get_info just
reports no file descriptors and an infinite timeout.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-01-05 13:40:10 +00:00
Robert Bragg
390bb69fba configure.ac: ignore COGL_PANGO_DEPS if cogl-pango disabled
This skips the pkg-config check for COGL_PANGO_DEPS if
--disable-cogl-pango was explicitly passed to ./configure.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-01-04 19:27:20 +00:00
Chun-wei Fan
330146557d Bug 664827: Autotools changes for Windows .rc files
This will make autotools fill in the versioning info for the COGL/
COGL-Pango .rc files and distribute the resulting .rc files
2011-12-15 20:31:31 +08:00
Neil Roberts
bdcbb8af4d Update the SDL winsys
The SDL winsys was missing a few minor features, such as the
implementation. This patch adds that in.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-14 16:45:17 +00:00
Neil Roberts
ff5bfc4a86 Rename the EGL_X11 winsys to EGL_XLIB
Eventually we might want to have an XCB-based EGL winsys. We already
have xlib-specific API in CoglRenderer (eg, to set a foreign display)
so the application needs to be able to specifically select between XCB
and XLIB.

This also removes the POWERVR part while renaming
COGL_HAS_EGL_PLATFORM_POWERVR_X11_SUPPORT to
COGL_HAS_EGL_PLATFORM_XLIB_SUPPORT because the winsys is equally
applicable to Mesa.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-14 16:40:26 +00:00
Neil Roberts
1e5494c2fb configure: Fix documentation for the --enable-kms-egl-platform option
It looks like the documentation for this option has a copy-and-paste
bug from the wayland documentation.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-12 18:04:46 +00:00
Neil Roberts
93e6e2051f egl: Allow multiple EGL platforms
The #ifdefs in cogl-winsys-egl have been changed so that they
additionally check renderer->winsys_vtable->id for the corresponding
winsys ID so that multiple EGL platforms can be enabled.

The is a stop-gap solution until we can move all of the EGL platforms
into their own winsys files with overrides of the EGL vtable. However
with this approach we can move one platform at a time which will make
it easier.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-08 19:16:41 +00:00
Rob Bradford
1b54c8023e kms: Add first version of "baremetal" backend for EGL on KMS
To start with this backend only supports creating a single CoglOnscreen
framebuffer and will automatically set is up to display fullscreen on
the first suitable crtc it can find.

To compile this backend - get some dribbly black candles, sacrifice a
goat and configure with: --enable-kms-egl-platform

Note: There is currently a problem with using GLES2 with this winsys
so you need to run with EGL_DRIVER=gl
Note: If you have problems with mesa crashing in XCB during
eglInitialize then you may need to explicitly run with EGL_PLATFORM=gbm

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-11-28 17:37:28 +00:00
Chun-wei Fan
2055f6ba91 VS 2008/2010 project files to build Cogl
These are the VS 2008/2010 project files to build Cogl, with a README.txt
to explain the process involved.

Note that the Cogl and Cogl-Pango projects (and filters for VS2010) are
expanded with the correct source file listings during "make dist", which
is done to simplify maintenance of these project files.

-added preconfigured config.h(.win32.in), which is expanded with the
 correct versioining info during autogen
-added preconfigued cogl/cogl-defines.h.win32
-added symbols files for cogl and cogl-pango
-Have configure.ac expand the config.h.win32.in into config.h.win32
 with the correct versioning info, etc, and to include the Visual C++
 project files for distribution
-Added rules in cogl/Makefile.am to expand the cogl VS 2008/2010 projects
 and filters from the templates with up-to-date source file listings, to
 distribute cogl-enum-types.c, cogl-enum-types.h to ease compilation and
 to avoid depending on PERL on Windows installations.
-Added rules in cogl-pango/Makefile.am to expand the cogl-pango VS2008/
 2010 projects and filters from the templates with up-to-date source file
 listings.
-Added/edited various Makefile.am's in build to distribute the VS2008/2010
 project files and associated items required for the build.
-Update .gitignore. There needs to be a pre-configured
 config.h(.win32) and its template, config.h.win32.in for Visual C++
 builds

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

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2011-11-25 13:12:45 +00:00
Robert Bragg
36e4c98bdc Bump development version to 1.9.3 2011-11-22 17:28:05 +00:00
Robert Bragg
9111f49f22 Release 1.9.2 (snapshot) 2011-11-22 17:12:43 +00:00
Robert Bragg
b72f255c0a Start to reduce dependence on glib
Since we've had several developers from admirable projects say they
would like to use Cogl but would really prefer not to pull in
gobject,gmodule and glib as extra dependencies we are investigating if
we can get to the point where glib is only an optional dependency.
Actually we feel like we only make minimal use of glib anyway, so it may
well be quite straightforward to achieve this.

This adds a --disable-glib configure option that can be used to disable
features that depend on glib.

Actually --disable-glib doesn't strictly disable glib at this point
because it's more helpful if cogl continues to build as we make
incremental progress towards this.

The first use of glib that this patch tackles is the use of
g_return_val_if_fail and g_return_if_fail which have been replaced with
equivalent _COGL_RETURN_VAL_IF_FAIL and _COGL_RETURN_IF_FAIL macros.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2011-11-01 12:03:02 +00:00
Robert Bragg
7669fdc827 examples: Allow installing of examples
This namespaces all of the examples and marks them for installation
if --enable-examples-install has been passed to ./configure. This
simplifies packaging the examples which can be quite convenient
for smoke testing Cogl on various platform.

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

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2011-10-14 11:55:28 +01:00
Neil Roberts
5aab8a2310 Add an option to avoid defining G_DISABLE_DEPRECATED
G_DISABLE_DEPRECATED is only intended for developers of Cogl and it
sometimes breaks the build for people just trying to build a
release. This patch adds an option to enable deprecated Glib
features. By default it is enabled for non-git versions of Cogl.

The patch is based on similar code in Clutter except it adds the flags
to COGL_EXTRA_CFLAGS instead of having a separate variable.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-09-27 10:27:19 +01:00
Robert Bragg
d4459e2d42 pipeline: Split more code out from cogl-pipeline.c
This splits out the core CoglPipelineLayer support code from
cogl-pipeline.c into cogl-pipeline-layer.c; it splits out the debugging
code for dumping a pipeline to a .dot file into cogl-pipeline-debug.c
and it splits the CoglPipelineNode support which is shared between
CoglPipeline and CoglPipelineLayer into cogl-node.c.

Note: cogl-pipeline-layer.c only contains the layer code directly
relating to CoglPipelineLayer objects; it does not contain any
_cogl_pipeline API relating to how CoglPipeline tracks and manipulates
layers.
2011-09-21 17:03:10 +01:00
Robert Bragg
c9d1cd4831 Bump development version to 1.9.1 2011-09-19 19:52:13 +01:00
Robert Bragg
805e2e2755 Post-release version bump to 1.8.1 2011-09-19 19:39:34 +01:00
Robert Bragg
f462fda261 Release 1.8.0 (release) 2011-09-19 19:19:35 +01:00
Robert Bragg
b5a7657076 Starts porting Cogl conformance tests from Clutter
This makes a start on porting the Cogl conformance tests that currently
still live in the Clutter repository to be standalone Cogl tests that no
longer require a ClutterStage.

The main thing is that this commit brings in is the basic testing
infrastructure we need, so now we can port more and more tests
incrementally.

Since the test suite wants a way to synchronize X requests/replies and
we can't simply call XSynchronize in the test-utils code before we know
if we are really running on X this adds a check for an environment
variable named "COGL_X11_SYNC" in cogl-xlib-renderer.c and if it's set
it forces XSynchronize (dpy, TRUE) to be called.

By default the conformance tests are run off screen. This makes the
tests run much faster and they also don't interfere with other work you
may want to do by constantly stealing focus. CoglOnscreen framebuffers
obviously don't get tested this way so it's important that the tests
also get run on screen every once in a while, especially if changes are
being made to CoglFramebuffer related code.  On screen testing can be
enabled by setting COGL_TEST_ONSCREEN=1 in your environment.
2011-09-08 15:48:07 +01:00
Robert Bragg
ad4cfaf270 Post-release version bump to 1.7.9 2011-09-05 20:19:03 +01:00
Robert Bragg
99c25f34ef Release 1.7.8 (snapshot) 2011-09-05 19:26:20 +01:00
Emmanuele Bassi
69b0db4cdb build: Require gobject-2.0 and gmodule-no-export-2.0
Cogl requires gobject and gmodule API, so we need to check for these and
add them to the pkg-config files as dependencies, otherwise building
Cogl with --as-needed (like modern distributions now do) will cause
build errors.

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

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-09-05 19:05:27 +01:00
Neil Roberts
6228c9f53c Post-release version bump to 1.7.7 2011-08-12 17:33:07 +01:00
Neil Roberts
e2d307f18d Release 1.7.6 (snapshot) 2011-08-12 17:33:07 +01:00
Robert Bragg
5012bcf1d1 build: only have libcogl-pango depend on pango
Only cogl-pango needs a dependency on pangocairo so we are now careful to
separate the pangocairo pkg-config flags from the others so we can avoid
having libcogl builds refer to them.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2011-08-12 15:28:42 +01:00
Damien Lespiau
ee01fd263a egl-gdl: Don't generate cogl-display.h
It's not necessary to generate cogl-display.h just for the GDL backend
and to change the inclusion of libgdl.h. We can just tweak the include
CFLAGS to put /usr/include/CE4100 in the search path when needed.

Previously this did not work because of a stay ',' at the end of the
COGL_EXTRA_CFLAGS int he configure.ac. This actually simplifies the
code, which is always good.

This also fixes out of tree builds.

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

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2011-08-01 16:36:52 +01:00
Damien Lespiau
303305173b egl-gdl: When compiling the GDL platform, you need to link against -lgdl
https://bugzilla.gnome.org/show_bug.cgi?id=655355
2011-07-29 11:50:15 +01:00
Damien Lespiau
a53af153c3 egl-gdl: Correctly substitute COGL_CEX100_LIBGDL_PREFIX
We weren't defining CLUTTER_CEX100_LIBGDL_PREFIX in the configure.ac and
thus failing to compile when selecting the EGL/GDL winsys. Take the
opportunity to rename that to COGL_CEX100_LIBGDL_PREFIX

https://bugzilla.gnome.org/show_bug.cgi?id=655355
2011-07-29 11:50:15 +01:00
Damien Lespiau
f798e6e0c7 egl: Make sure to have egl.h included when testing for eglext.h
AC_CHECK_HEADER(S) for eglext.h need include egl.h as it may not be done
for you.

The patch tries to integrate with the previous work to check if
GLES/egl.h ir EGL/egl.h should be included for egl.h.
2011-07-29 11:50:14 +01:00
Robert Bragg
7860df92d1 Post-release version bump to 1.7.5 2011-07-20 17:28:56 +01:00
Robert Bragg
5cd3675552 Release 1.7.4 (snapshot) 2011-07-20 16:58:46 +01:00
Neil Roberts
9b6c1eb2cc configure: Add configure options to override the GL library name
This adds 3 configure options to override the library name that gets
dlopened for GL, GLES and GLESv2. This could be useful for distro
maintainers who have an unusual name for the libraries (for example,
on OpenBSD the GL library appears to be called libGL.so.4). This could
at least be simpler than having to create a distro patch.

The configure options would be used like this:

./configure --with-gl-libname=libGL.so \
            --with-gles1-libname=libGLESv1.so \
            --with-gles2-libname=libGLESv2.so

https://bugzilla.gnome.org/show_bug.cgi?id=654593
2011-07-19 15:12:10 +01:00
Neil Roberts
03c4b20931 Specify the full filename when g_module_open'ing the GL library
Instead of using g_module_build_path with the short name of the GL
library (eg, "GL") and relying on glib to add the suffix and prefix,
the configure script now directly encodes the full name including the
version number (eg, "libGL.so.1"). This is necessary because distros
don't always install the non-versioned suffix for the library.

The GLES libraries are left without the version suffix because it's
not clear what should be placed here and I can't find any
documentation from Khronos to clarify this. Mesa seems to install a
file called libGLESv2.so.2 but the IMG SDK doesn't install any
versioned library. There is an example of dynamically loading
libGLESv2 in the Chromium source code and that does not use the
version suffix even though it does use the version suffix for GL. This
implies that it's at least fairly normal to load the unversioned name
for GLES.

https://bugzilla.gnome.org/show_bug.cgi?id=654593
2011-07-19 15:12:10 +01:00
Robert Bragg
27c0da6685 configure: Expose COGL_HAS_GLX_SUPPORT publicly
Instead of only exposing COGL_HAS_GLX_SUPPORT internally in config.h we
now expose it though the public cogl-defines.h header.

Signed-off-by: Neil Roberts <neil@linux.intel.com>
2011-07-13 19:06:19 +01:00
Damien Lespiau
36e977403c build: Fix the help string for --enable-profile
--enable-uprof has been renamed to --enable-profile, make sure the help
string is updated accordingly.

Signed-off-by: Robert Bragg <robert@linux.intel.com>
2011-07-12 10:39:20 +01:00
Damien Lespiau
6b66679a7c build: Correctly quote the help message for --enable-profile
It did not show up in ./configure --help because of that.

Signed-off-by: Robert Bragg <robert@linux.intel.com>
2011-07-12 10:39:20 +01:00