Commit Graph

1558 Commits

Author SHA1 Message Date
Robert Bragg
b3a105c576 renderer: Expose winsys ID setter/getters
This adds API to let you override the choice of Cogl's winsys backend.
Previously it was only possible to override the winsys using the
COGL_RENDERER environment variable, but it's useful for something like
Clutter to be able to control the winsys via API without needing
environment variable tricks. This also adds API to query back the
winsys chosen by Cogl, in case you don't set an explicit override.

Signed-off-by: Neil Roberts <neil@linux.intel.com>
2011-06-30 14:33:11 +01:00
Robert Bragg
c4eb869bd7 framebuffer: expose viewport getters/setters
This exposes experimental cogl_framebuffer APIs for getting and setting
a viewport without having to refer to the implicit CoglContext. It adds
the following experimental API:

  cogl_framebuffer_set_viewport
  cogl_framebuffer_get_viewport4fv
  cogl_framebuffer_get_viewport_x
  cogl_framebuffer_get_viewport_y
  cogl_framebuffer_get_viewport_width
  cogl_framebuffer_get_viewport_height

Signed-off-by: Neil Roberts <neil@linux.intel.com>
2011-06-30 14:33:11 +01:00
Robert Bragg
716b88b0c8 Adds another example that draws a 3D crate
Based on the Cogl example we had on wiki.clutter-project.org this shows
how to use the primitive API to draw a simple spinning crate.

Signed-off-by: Neil Roberts <neil@linux.intel.com>
2011-06-30 14:33:11 +01:00
Robert Bragg
a1234ee8d1 Add internal _cogl_init() function
This adds a _cogl_init function for Cogl that we expect to be the first
thing called before anything else is done with Cogl. It's not a public
API so it's expected that all entry points for Cogl that might be the
first function used should call _cogl_init().

We currently call _cogl_init() in these functions:
  cogl_renderer_new
  cogl_display_new
  cogl_context_new
  cogl_android_set_native_window

_cogl_init() can be called multiple times, and only the first call has
any affect.

For example _cogl_init() gives us a place check and parse the COGL_DEBUG
environment variable.

Since we don't have any need to parse command line arguments (we can
always get user configuration options from the environment) our init
function doesn't require argc/argv pointers.

By saying up front that we aren't interested in command line arguments
that means we can avoid the mess that is GOption based library
initialization which is extremely fragile due to its lack of dependency
tracking between modules.

Signed-off-by: Neil Roberts <neil@linux.intel.com>
2011-06-30 14:33:11 +01:00
Neil Roberts
e5c4c1ce7c doc/RELEASING: Fix the check for diffs from origin/master
The recommended command to check for differences from master to the
remote master was using git log with a range from the local master to
the remote master but this wouldn't work if the local master is ahead
of the remote master because the range is backwards. This patch
changes it to recommend git diff --stat instead because then the
command would work even if the two branches have diverged.
2011-06-29 16:14:43 +01:00
Emmanuele Bassi
38a728b45a build: Do not define "default" in m4
The "default" m4 conflicts with one of libtool's internal symbols, one
that is used to determine whether the -fPIC argument should be used;
this breaks compilation onf 64bit platforms.

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>
2011-06-29 12:13:59 +01:00
Adam Jackson
5496a6464d Typo fix in cogl-framebuffer
Signed-off-by: Adam Jackson <ajax@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=652672
2011-06-16 00:27:13 +01:00
Robert Bragg
c2bbf90c2e examples: pass COGL_DEP_LIBS as ldflags when linking
To be sure our examples link with all the libraries required, we now
simply pass the $(COGL_DEP_LIBS) as ldflags when linking them.
2011-06-15 14:52:21 +01:00
Robert Bragg
2f000c3c12 Post-release version bump to 1.7.1 2011-06-14 20:17:57 +01:00
Robert Bragg
5b0661ccd5 Release 1.7.0 (snapshot) 2011-06-14 17:09:56 +01:00
Robert Bragg
4c0f813608 README: Updates in preparation for 1.7.0 release 2011-06-14 17:09:56 +01:00
Robert Bragg
5f3173e2d1 Adds NEWS in preparation for 1.7.0 release 2011-06-14 17:09:56 +01:00
Robert Bragg
ec62acfd6a configure: pass tar-ustar as automake init option
So that our released tarballs can contain filenames longer than 99
characters we tell automake to create tarballs using the ustar format.
This is newer than the default v7 format but still old enough to be
considered widely portable.
2011-06-14 17:09:56 +01:00
Robert Bragg
5a6fbf7e52 Ensure we use --enable-profile during make distcheck 2011-06-14 17:09:56 +01:00
Robert Bragg
0e5df17761 doc: Fix EXTRA_DIST variable setup
Since gtk-doc is an optional dependency for Cogl then we need to special
case how EXTRA_DIST is initialized. It shouldn't be set when using
gtk-doc since gtk-doc.make expects to initialize EXTRA_DIST.  If we
aren't using gtk-doc then it should be initialized to an empty value
instead of including gtk-doc.make so that the later lines that append
various extra png files to EXTRA_DIST won't fail.
2011-06-14 17:09:56 +01:00
Robert Bragg
57d76e315f Fixes for make distcheck 2011-06-14 17:09:55 +01:00
Robert Bragg
036c5bf572 include required cogl-context.h in cogl-texture-2d.h 2011-06-14 17:09:55 +01:00
Robert Bragg
7a0a4de691 Fix some gtk-doc annotations in cogl-depth-state.h 2011-06-14 17:09:55 +01:00
Robert Bragg
6396006bb8 doc: Adds doc/RELEASING
This adds some notes for maintainers about how to make a Cogl release.
2011-06-14 17:09:55 +01:00
Robert Bragg
800f5e6d6e profile: Adds a --enable-profile option
This adds a --enable-profile option which enables uprof based profiling.
It was also necessary to fixup a CLUTTER_ENABLE_PROFILING #ifdef in
cogl-context.c to renamed COGL_ENABLE_PROFILING instead. By default Cogl
doesn't output uprof reports directly, instead it assumes a higher level
toolkit will output a report. If you want a report from Cogl you can
export COGL_PROFILE_OUTPUT_REPORT=1 before running your app.

The latest version of uprof can be fetched from:
git://github.com/rib/UProf.git
2011-06-14 17:09:55 +01:00
Robert Bragg
44e4b13324 x11-foreign: Updates to forward X Events to Cogl
This update the x11-foreign test so that it checks for events on its X
display and forwards them on to Cogl. It will now also quit if any key
of button is pressed.
2011-06-14 17:09:55 +01:00
Robert Bragg
3729bf2769 Make it clearer that the 2.0 API is experimental
This explicitly renames the cogl-2.0 reference manual to
cogl-2.0-experimental and renames the cogl-2.0 pkg-config file to
cogl-2.0-experimental.pc. Hopefully this should avoid
miss-understandings.
2011-06-14 17:09:55 +01:00
Robert Bragg
250373a0f1 Adds build/autotools/Makefile.am.changelog/release
This adds some convenience rules to help manage releases
2011-06-14 17:09:55 +01:00
Robert Bragg
a9643f38e6 x11-foreign: explicitly pass -lX11 ldflag
The x11-foreign example directly uses the X11 API at it seems that more
recent versions of binutils complain if we don't directly link the test
with libX11 as opposed to relying on indirect linkage via cogl.
2011-06-14 17:08:33 +01:00
Neil Roberts
e86543cd7d Revert "Do not use "near" and "far" variables"
This reverts commit 3d2564df8f.

Since 01e1260aa the 'near' and 'far' defines are now undef'd on
Windows so we no longer have to remember not to use them in Cogl code.
2011-06-14 14:40:27 +01:00
Neil Roberts
01e1260aa0 configure: Force #undef of 'near' and 'far' on Windows
This adds an extra header that gets included from config.h where we
can add configuration defines. This is used to #undef 'near' and 'far'
when building for Windows so that we don't have to avoid using them as
variable names in the Cogl code.
2011-06-14 12:14:02 +01:00
Lionel Landwerlin
5dc42284a5 cogl-debug: add instrumentation to track the number of objects
This allows to track the number of objects allocated by Cogl. The
results are displayed on the standard output by calling :

cogl_debug_print_instances ();

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@linux.intel.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>
2011-06-14 12:14:02 +01:00
Robert Bragg
c603dc67ca cogl-vertex-buffer: make sure to unref weak pipelines
When validating a user pipeline before drawing with a CoglVertexBuffer
we sometimes find we have to make some overrides and we handle that by
creating a pipeline which is a weak copy of the user pipeline. The weak
pipeline gets associated with the original pipeline so if that pipeline
is used multiple times then we can re-use the same override pipeline and
skip validation. Because it's a weak pipeline we get notified when the
original material is destroyed or changed so we know our weak pipeline
is now invalid.

When we get notified that the weak material is invalid we should unref
it, but instead we were just discarding our reference to it. This was
resulting in leaking weak materials and in some cases those materials
referenced textures which would then also be leaked.
2011-06-13 17:48:23 +01:00
Emmanuele Bassi
3d2564df8f Do not use "near" and "far" variables
They collide with existing symbols when compiling on Windows.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2667
2011-06-13 12:05:41 +01:00
Neil Roberts
6d1371e0e9 cogl-texture-pixmap-x11: Fix the can_hardware_repeat wrapper
The wrapper for the can_hardware_repeat had a cut and paste error so
it would call the wrong function on the child texture.

Many thanks to Owen Taylor for finding this bug.
2011-06-10 18:43:56 +01:00
Neil Roberts
db954565d4 cogl-pango-render: Use the glyph size for unknown glyphs
When rendering a box for an unknown glyph it would previously just use
the average glyph size for the font. This causes problems because the
size calculations for the layout assume a different size so it can end
up rendering outside of the expected ink rectangle. This patch changes
it to query the size of the glyph in the font. Pango should end up
reporting the size of what would be the hex box which should be the
same as the sized used for the extents calculation.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2599
2011-06-10 14:03:50 +01:00
Emmanuele Bassi
abb3631e71 po: Fix up pl.po 2011-06-09 16:23:58 +01:00
Emmanuele Bassi
552761f3a8 Remove G_CONST_RETURN
It is going to be deprecated by GLib, see bug:

  https://bugzilla.gnome.org/show_bug.cgi?id=644611
2011-06-09 16:21:15 +01:00
Emmanuele Bassi
c56d5436d0 Fix introspection annotations for CoglPango 2011-06-09 16:19:44 +01:00
Neil Roberts
c3c0804819 Implement COGL_DEBUG=disable-texturing for ARBFp and GLSL fragends
The COGL_DEBUG=disable-texturing debug variable disables texturing in
the fixed function fragend by not bothering to enable the texture
targets. This wasn't working for the programmable fragends because the
texture targets don't need to be enabled to use them. This patch
modifies the two programmable backends to generate a constant value
for the texture lookups in the shader when the debug variable is
given.
2011-06-08 18:03:58 +01:00
Robert Bragg
bbfe8b8ec4 gir: pass dep cflags to gobject introspection scanner
The gobject introspection scanner was failing to find EGL headers so we
now pass the COGL_DEP_CFLAGS to Cogl_1_0_gir_CFLAGS.
2011-06-01 20:44:43 +01:00
Robert Bragg
5022ec54d2 replace _xlib_add_filter use with _cogl_renderer API
Instead of using _cogl_xlib_add/remove_filter we now use
_cogl_renderer_add/remove_native_filter. The _cogl_xlib_add_filter API
was only required as a stop gap while EGL support was still in Clutter
because in that case we were using the stub winsys and didn't have a
CoglRenderer.
2011-06-01 20:44:42 +01:00
Robert Bragg
8c35a6bb7c remove _cogl_xlib_trap/untrap_errors wrappers
This removes the redundant _cogl_xlib_trap/untrap_errors functions that
simply wrap equivalent functions in the _cogl_renderer_xlib namespace.
These were originally only required while the EGL winsys was being
handled in clutter and so there wasn't a CoglRenderer in all cases.
2011-06-01 20:44:42 +01:00
Robert Bragg
43c4b21a1d Adds an example cogl wayland compositor
This adds an example cogl compositor to test the
_cogl_wayland_texture_2d_new_from_buffer API. The compositor emulates 4
output displays but doesn't support input since Cogl doesn't deal with
input. It's quite a minimal example of what it takes to write a wayland
compositor so could be interesting to anyone learning about wayland.
2011-06-01 20:44:42 +01:00
Robert Bragg
4a97fc0a1e egl: fix some #ifdef guards
In the winsys vtable .xlib_get_visual_info and
.onscreen_x11_get_window_xid should be guarded by the
COGL_HAS_EGL_PLATFORM_POWERVR_X11_SUPPORT because they need to be there
if cogl is configured with --enable-xlib-egl-platform but not if just
configured with --enable-xlib.
2011-06-01 20:44:42 +01:00
Robert Bragg
b934859dde renderer: set winsys on renderer before ->renderer_connect
When iterating through all the possible window systems trying to find
one we can successfully connect we now associated the current winsys
vtable with the renderer before calling winsys->renderer_connect in case
the implementation calls some other Cogl API that expects to be able to
determine the current winsys. For example calling _cogl_get_proc_address
when querying winsys extensions as part of a successful connect will
need to get at the current winsys vtable.
2011-06-01 20:44:42 +01:00
Robert Bragg
656f28de2f glx: make sure _cogl_winsys_get_proc_address is static
Make sure not to export _cogl_winsys_get_proc_address outside of
cogl-winsys-glx.c
2011-06-01 20:44:42 +01:00
Robert Bragg
a29a76dbab Adds _cogl_wayland_texture_2d_new_from_buffer API
This adds internal API to be able to wrap a wayland buffer as a
CoglTexture2D. There is a --enable-wayland-egl-server option to decide
if Cogl should support this feature and potentially any EGL based winsys
could support this through the EGL_KHR_image_base and
EGL_WL_bind_display extensions.
2011-06-01 20:44:42 +01:00
Robert Bragg
8714d99300 egl: Add x11 texture-from-pixmap support
By using the EGL_KHR_image_base/pixmap extensions this adds support for
wrapping X11 pixmaps as CoglTexture2D textures. Clutter will
automatically take advantage of this if using the
ClutterX11TexturePixmap actor.
2011-06-01 20:44:42 +01:00
Robert Bragg
60b25615fd Add _cogl_egl_texture_2d_new_from_image API
This adds an internal texture_2d constructor that can wrap an EGLImage
as a CoglTexture2D. The plan is to utilize this for texture-from-pixmap
support with EGL as well as creating textures from wayland buffers.
2011-06-01 20:44:42 +01:00
Robert Bragg
c9f1541de0 egl: check or EGL/eglext.h
While running configure we now check for EGL/eglext.h and if found we
will substitute an inclusion in cogl-defines.h.
2011-06-01 20:44:41 +01:00
Robert Bragg
52aada8442 egl: Check EGL extension as early as possible
Instead of waiting until initializing a CoglContext we now check EGL
extensions after calling eglInitialize.
2011-06-01 20:44:41 +01:00
Robert Bragg
be15bf75e4 Add internal _cogl_get_proc_address
This adds an internal _cogl_get_proc_address that doesn't need a
CoglContext. This will enable us to check driver features earlier.
2011-06-01 20:44:41 +01:00
Robert Bragg
32e7c93aff configure.ac: move the --enable-cairo check
This moves the --enable-cairo check because it was put in the middle of
the logic that handles the --enable-debug option. This moves the
--enable-cairo check down after the --enable-debug logic and adds a
comment header to delimit the option like we have for other options.
2011-06-01 20:44:41 +01:00
Robert Bragg
b380fed23d Make stub winsys into a proper winsys backend
Instead of the stub winsys being a special case set of #ifdef'd code
used when COGL_HAS_FULL_WINSYS wasn't defined, the stub winsys now
implements a CoglWinsysVtable like all other winsys backends (it's just
that everything is a NOP). This way we can get rid of the
COGL_HAS_FULL_WINSYS define and also the stub winsys can be runtime
selected whereas before it was incompatible with all other winsys
backends.
2011-06-01 20:44:41 +01:00