1
0
Fork 0
Commit graph

2170 commits

Author SHA1 Message Date
Ting-Wei Lan
b2e75b5da0 build: Don't hardcode the path of bash
Bash is not always installed in /bin and we should not hardcode the path
of it in source code which is expected to be built on many operating
systems and distributions.

Since most scripts using #!/bin/bash here doesn't have any bashism,
they can be converted to #!/bin/sh instead of using /usr/bin/env trick.
2018-12-01 12:56:12 +00:00
Niels De Graef
6834bedb95 cogl: remove COGL_GNUC_NULL_TERMINATED
This is already defined for us in GLib, so prefer that instead.
2018-11-23 08:55:43 +01:00
Niels De Graef
bf8a3b1c1c cogl: Remove unused macro COGL_GNUC_DEPRECATED
This is also already defined in GLib as G_GNUC_DEPRECATED.

(Note that it is also something different than COGL_DEPRECATED)
2018-11-23 08:55:43 +01:00
Niels De Graef
3a4a858ce3 cogl: use G_BEGIN_DECLS instead of COGL_BEGIN_DECLS
This macro was introduced so as to be able to be built without GLib.
However, this feature was long ago removed, and in Mutter we depend on
it anyway, so let's get rid of it in favor of more consistency.
2018-11-23 08:55:43 +01:00
Niels De Graef
081842bac6 cogl/object: add cogl_clear_object utility function
This is based on `g_clear_object`, so it will be a bit more consistent
to write (and prevents the headaches from accidentally forgetting a NULL
check).
2018-11-20 15:25:24 +01:00
Jonas Ådahl
5b3e439c5d cogl/tests: Increase the conform test timeout to 120 s
Running it on CI runners can take bit more time, so let it be for a bit
more until bailing out.
2018-11-14 15:55:45 +01:00
Jonas Ådahl
996949806a
cogl: Silence some introspection warnings
Mostly skipping functions of non-introspected types, but also added a
missing callback scope.
2018-11-08 16:20:19 -02:00
Daniel van Vugt
d21478b0f0 cogl-auto-texture: Avoid a double-free crash
If texture allocation fails (e.g. on an old GPU with size limit 2048)
then `cogl_texture_new_with_size` was trying to use the same CoglError
twice. The second time was after it had already been freed.

Bug reported and fix provided by Gert van de Kraats.

https://launchpad.net/bugs/1790525
2018-11-08 10:18:25 +00:00
Jonas Ådahl
b86d87453d build: Fix include and lib paths in autotools .pc files
Some hadn't been updated after lib/mutter/ changed to lib/mutter-N/.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/382
2018-11-07 14:29:30 +01:00
Jonas Ådahl
cf7c39e2c1 build: Add soversion to shared libraries
It's easier to add it now, then adding it later would so be needed.
2018-11-07 13:00:47 +00:00
Georges Basile Stavracas Neto
4ce4a2b134 cogl: Expose more headers for introspection
This will allow CoglFramebuffer and its implementations to be exposed
to GJS and other language bindings. This is a necessary part of the
bigger work to make framebuffer management explicit.
2018-11-07 11:27:51 +00:00
Georges Basile Stavracas Neto
93e20cf21c cogl/framebuffer: Mark CoglOffscreen as a CoglFramebuffer implementation
CoglOffscreen is effectively a CoglFramebuffer, but it isn't being marked as
such by the GType machinery. This makes it impossible for introspection to
correctly set this class up.

Fix that by adding a COGL_GTYPE_IMPLEMENT_INTERFACE() code into the declaration
of CoglOffscreen. This does not have any functional changes though.
2018-11-07 11:27:51 +00:00
Georges Basile Stavracas Neto
fe78467815
build: Make libmutter-cogl-path a dependency for test-journal
Otherwise, it might trigger the actual race condition that Continuous
is running into, and access the generated enum headers before they're
created.
2018-11-06 19:15:24 -02:00
Georges Basile Stavracas Neto
d1c4c46281
build: Prefer dependencies instead of link_with
Meson uses the 'dependencies' field to determine and
parallelize build steps, but that isn't entirely true
with 'link_with'; this might cause a race condition
when generating header files while trying to build
them.

Fix that by only using 'dependencies' instead of 'link_with'.
2018-11-06 17:50:24 -02:00
Jonas Ådahl
ef85d1a643 Add meson build support
This commit adds meson build support to mutter. It takes a step away
from the three separate code bases with three different autotools setups
into a single meson build system. There are still places that can be
unified better, for example by removing various "config.h" style files
from cogl and clutter, centralizing debug C flags and other configurable
macros, and similar artifacts that are there only because they were once
separate code bases.

There are some differences between the autotools setup and the new
meson. Here are a few:

The meson setup doesn't generate wrapper scripts for various cogl and
clutter test cases. What these tests did was more or less generate a
tiny script that called an executable with a test name as the argument.
To run particular tests, just run the test executable with the name of
the test as the argument.

The meson setup doesn't install test files anymore. The autotools test
suite was designed towards working with installed tests, but it didn't
really still, and now with meson, it doesn't install anything at all,
but instead makes sure that everything runs with the uninstalled input
files, binaries and libraries when running the test suite. Installable
tests may come later.

Tests from cogl, clutter and mutter are run on 'meson test'. In
autotools, only cogl and clutter tests were run on 'make check'.
2018-11-06 18:51:44 +01:00
Jonas Ådahl
bf42b54faa Make it possible to build without EGL support
This will avoid building anything related to EGL. For meson, this will
mean that both the native backend an the Wayland support must also be
disabled.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
d48d56f831 autotools: Make install directories paths more consistent
Install include files in
$prefix/include/mutter-$apiversion/[clutter,cogl,...,meta]/, and
datafiles in /usr/share/mutter-$apiversion/.... We still would conflict
e.g. given that our gettext name is "mutter", and how keybindings are
installed, but it's a step in the right direction.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
8894ec462a cogl: Pass unit-tests file to run-tests.sh
There are different unit-tests file generated containing lists of tests
the test-runner.sh should run. Running run-tests.sh read the unit-tests
in the current directory, which is inconvenient to do when using meson.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
331e830cf6 cogl: Fix HAVE_COGL_GL guard
Macro was only defined when defined to 1.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
d68fcbc887 cogl: Make cogl-config.h include check explicit
Don't rely on some combination of macros, but an explicit definition to
check whether cogl-config.h was included.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
9dbdf6b724 cogl: Require relative full paths when including
I.e. including a OpenGL driver file, the path "driver/gl/..." must be
specified when including.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
530861b24d cogl: Remove left-over WebGL paths 2018-11-06 17:17:36 +01:00
Jonas Ådahl
0163a0b0cd cogl: Unconditionally include cogl-config.h 2018-11-06 17:17:36 +01:00
Jonas Ådahl
12171e413b cogl: Unconditionally depend on cairo 2018-11-06 17:17:36 +01:00
Jonas Ådahl
99fb79f4cb cogl: Unconditionally include "strings.h" 2018-11-06 17:17:36 +01:00
Jonas Ådahl
24d8d40deb cogl/tests: Mark failing test as known failure
This allows us to enable running the tests again. Not fixing the
failure is at least better than not running the tests at all.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
97004e6114 cogl: Remove ARBfp pipeline support
As with fixed pipelines, we require the use of the GLSL pipeline in
mutter, and no point in supporting ARBfp anyway.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
8f58ad02fb cogl: Remove fixed pipeline support
We require being able to use shaders so stop supporting a pipeline that
wouldn't work to begin with.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
98af9bb251 cogl: Remove notion of a "cogl" version
Mutters copy of cogl isn't a separate library with its own version, so
remove the old version macros.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
7b2eaa76a4 cogl: Remove support for GLESv1
We have no need for it in mutters cogl variant.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
00a5523667 cogl: Remove some left over KMS backend stuff 2018-11-06 17:17:36 +01:00
Jonas Ådahl
f30cef3046 cogl: Always build CoglPango support 2018-11-06 17:17:36 +01:00
Jonas Ådahl
fba7d8c79c cogl: Always build CoglPath support 2018-11-06 17:17:36 +01:00
Jonas Ådahl
46942c24a3 cogl: Make various functions non-optional
Remove fallback implementations of some functions available in
gcc/clang and Linux/BSDs.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
9846a4d812 cogl: Make _Static_assert non-optional 2018-11-06 17:17:36 +01:00
Jonas Ådahl
da741ead25 cogl-gles2/Makefile.am: Add cogl/ includedir
Otherwise cogl-egl-defines.h isn't found when building out-of-tree.
2018-11-06 17:17:36 +01:00
Daniel van Vugt
c6691afa38 cogl: Fix cogl_frame_info_get_frame_counter docs
The docs previously suggested that `cogl_frame_info_get_frame_counter`
returned a timestamp of an unknown clock ID. That's not correct. The
cogl source code shows that it does and must use the same clock as
`cogl_get_clock_time`.

Related to https://gitlab.gnome.org/GNOME/mutter/issues/131
2018-07-20 15:48:56 +08:00
Jonas Ådahl
ae26cd0774 native: Restore previous EGL state after blitting onto secondary GPU
Before we just set it to "none", but this was not enough since various
calls will depend on not just the context being active, but the main
rendering surface.

Fixes https://gitlab.gnome.org/GNOME/mutter/issues/21
2018-04-25 17:22:24 +02:00
Marco Trevisan (Treviño)
3104d697c0 cogl: Do not unref a NULL object
Add return-if-fail statement to avoid deferencing NULL object
2018-04-25 09:03:58 +00:00
Carlos Garnacho
2f260edf19 cogl: Read pixels as per the stored format
By the looks of it, commit 95e9fa10ef was taping over an Intel DRI bug
that would make it return post-swizzling pixel data on glReadPixels().
There's been reports over time of that commit resulting in wrong colors
on other drivers, and lately Mesa >17.3 started showing the same symptoms
on Intel.

But texture swizzling works by changing parameters before fragment shaders
and reading pixels from an already drawn FBO/texture doesn't involve those.
This should thus use pixel_format_to_gl_with_target(), which will result in
correctly requesting the same pixel format than the underlying texture,
while still considering it BGRA for the upper layers in the swizzling case.

https://gitlab.gnome.org/GNOME/mutter/issues/72

Closes: #72
2018-03-21 18:45:20 +00:00
handsome-feng
b8a81128e0 Fix some spelling errors
https://gitlab.gnome.org/GNOME/mutter/merge_requests/45
2018-03-21 13:22:35 +08:00
Jonas Ådahl
712ec30cd9 renderer/native: Force EGL config pixel format
We just arbitrarily chose the first EGL config matching the passed
attributes, but we then assumed we always got GBM_FORMAT_XRGB8888. That
was not a correct assumption. Instead, make sure we always pick the
format we expect.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/2
2018-03-05 15:42:27 +00:00
Florian Müllner
748223b896 cogl-texture: Remove unused function
Commit d8f2f583e6 removed the only caller.
2018-02-09 14:01:12 +01:00
Jonas Ådahl
f2d0e5021a cogl/x11/renderer: Silence introspection warning
We don't introspect CoglRenderer, so we shouldn't introspect API using it
either.

https://bugzilla.gnome.org/show_bug.cgi?id=739178
2018-02-07 11:03:42 +08:00
George Kiagiadakis
d8f2f583e6 cogl-texture: refuse downloading textures in cogl_texture_get_data() on GLES
On drivers that do not support glGetTexImage2D (i.e. on GLES),
cogl_texture_get_data() has a "feature" that allows it to download
texture data by rendering the texture on an intermediate framebuffer
object and then reading back the data from there. However, this
feature requires the user to have previously set an "active"
framebuffer object in the context, which makes this very tricky
because it is not clear to the developer that he needs to do that
in order for some code to work on GLES (of course it works on
desktop GL, so nobody notices...) and additionally the code actually
crashes if an active fbo is not set!

This patch basically removes this feature in order to prevent
the crash and is in line with how this code has evolved in cogl-2.0:
https://git.gnome.org/browse/cogl/commit/?id=6d6a277b8e9a63a8268046e5258877ba94a1da5b

https://bugzilla.gnome.org/show_bug.cgi?id=789961
2018-02-05 11:22:36 +00:00
Jonas Ådahl
18eb66de06 cogl: Add way to pass user data when setting custom renderer winsys
When creating a renderer with a custom winsys (which is always how
mutter uses cogl) make it possible to pass a user data with the winsys.
Still unused.

https://bugzilla.gnome.org/show_bug.cgi?id=785381
2017-10-05 18:10:30 -04:00
Mario Sanchez Prada
483ed98777 cogl: Only do the swizzling hack for GL contexts
The GL_BGRA definition is not available for GLES2 contexts, which use
the EXT_texture_format_BGRA8888 instead, causing a build failure when
trying to use it in those contexts.

Fortunately, this hack is only relevant for GL, so let's guard it to
prevent the failure in GLES2, where that extension is used instead.

https://bugzilla.gnome.org/show_bug.cgi?id=786568
2017-08-21 16:29:39 +02:00
Carlos Garnacho
bc041e02b3 cogl: Mark vertex buffers as dynamic
Those are cached and reused across runs, which doesn't qualify to mesa
as "static" indeed. Properly marking those as dynamic is more true, and
brings in slight performance benefits just by avoiding the resulting
(and later silenced) mesa warning.

https://bugzilla.gnome.org/show_bug.cgi?id=782344
2017-05-22 17:27:11 +02:00
Carlos Garnacho
374bb630f0 cogl: Use pixel_format_to_gl_with_target in find_best_gl_get_data_format
Fixes cogl_texture_get_data() resorting to the wrong conversions when
extracting the texture data. This notably resulted in RGB/RGBA buffers
copied as-is into BGRA buffers, for instance for the fullscreen animation,
or single-window screenshots of such buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=779234
2017-05-18 23:32:39 +02:00
Mario Sanchez Prada
229ac9c9dc Consider the right CONTEXT_LOST token on OpenGL ES contexts
The KHR_robustness extension defined the following token as
returned by GetError (see spec at [1]):

  CONTEXT_LOST  0x0507

As noted in the spec, this token must have a "_KHR" suffix in
an OpenGL ES context, which is not being considered here, thus
making this type of builds fail.

[1] https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_robustness.txt

https://bugzilla.gnome.org/show_bug.cgi?id=781398
2017-04-17 12:58:52 +01:00
Mario Sanchez Prada
e435cf301f Define new tokens from the ARB_robustness extension if needed
The ARB_robustness extension defined the following tokens as
returned by GetGraphicsResetStatusARB (see spec at [1]):

  GUILTY_CONTEXT_RESET_ARB    0x8253
  INNOCENT_CONTEXT_RESET_ARB  0x8254
  UNKNOWN_CONTEXT_RESET_ARB   0x8255

These tokens might not be defined in some GL implementations,
such as Mesa 13's implementation of GLES 2.0, so we need to
define them ourselves not to break those builds.

[1] https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_robustness.txt

https://bugzilla.gnome.org/show_bug.cgi?id=781398
2017-04-17 12:58:52 +01:00
Jonas Ådahl
ac813d5285 x11: Use EGL instead of GLX when drawing using GLES
When running as a X11 CM we shouldn't use the GLX winsys when the
driver doesn't support it, i.e. OpenGL ES drivers.

https://bugzilla.gnome.org/show_bug.cgi?id=771636
2017-03-25 00:17:18 +08:00
Carlos Garnacho
35388fb33c cogl: Use pixel_format_to_gl_with_target on bitmap uploading paths
We already do have a texture with an internal format in these paths,
so we should check the required format according to it.

This fixes CoglAtlasTexture (and CoglPangoRenderer indirectly), as
it forces a RGBA format on its texture, but pixel_format_to_gl()
anyway assumed swizzling is performed on the texture, while it is
not the case.

https://bugzilla.gnome.org/show_bug.cgi?id=779234
2017-03-07 13:40:06 +01:00
Carlos Garnacho
aa5738c777 cogl: Add pixel_format_to_gl_with_target driver vfunc
This is used by the GL driver in order to determine whether swizzling
actually applies given the bitmap and target texture internal format.
If both agree that they store BGRA, then swizzling may apply.

https://bugzilla.gnome.org/show_bug.cgi?id=779234
2017-03-07 13:40:06 +01:00
Carlos Garnacho
95e9fa10ef cogl: Read pixels in the correct 32bit format as per the given bitmap
Fixes the gnome-shell screenshot tool from getting colors with the
wrong byte order.

https://bugzilla.gnome.org/show_bug.cgi?id=779234
2017-03-01 22:05:19 +01:00
Carlos Garnacho
1705a26fc7 cogl: Prefer swizzling to convert BGRA buffers
If the GL implementation/hw supports the GL_*_texture_swizzle extension,
pretend that BGRA textures shall contain RGBA data, and let the flipping
happen when the texture will be used in the rendering pipeline.

This avoids rather expensive format conversions when forcing BGRA buffers
into RGBA textures, which happens rather often with WL_SHM_FORMAT_ARGB8888
buffers (like gtk+ uses) in little-endian machines.

In intel/mesa/wayland, the performance improvement is rather noticeable,
CPU% as seen by top decreases from 45-50% to 25-30% when running
gtk+/tests/scrolling-performance with a cairo renderer.

https://bugzilla.gnome.org/show_bug.cgi?id=779234
2017-02-28 18:48:21 +01:00
Owen W. Taylor
d200868459 Add cogl_xlib_renderer_set_threaded_swap_wait_enabled()
Because the threaded-swap-wait functionality requires XInitThreads(),
and because it isn't clear that it is a win for all applications,
add a API function to conditionally enable it.

Fix the cogl-crate example not to just have a hard-coded dependency
on libX11.

https://bugzilla.gnome.org/show_bug.cgi?id=779039
2017-02-21 16:25:01 -05:00
Owen W. Taylor
690b232258 For NVIDIA proprietary drivers, implement sync events with a thread
It's a good guess that the buffer swap will occur at the next vblank,
so use glXWaitVideoSync in a separate thread to deliver a sync event
rather than just letting the client block when frame drawing, which
can signficantly change app logic as compared to the INTEL_swap_event
case.

https://bugzilla.gnome.org/show_bug.cgi?id=779039
2017-02-21 16:25:01 -05:00
Owen W. Taylor
e078838774 Fix the get_clock_time() without GLX_OML_sync_control
When we don't have GLX_OML_sync_control, we still can set the
frame presentation time, but we always use the system monotonic time,
so return that from get_clock_time().

https://bugzilla.gnome.org/show_bug.cgi?id=779039
2017-02-21 16:25:01 -05:00
Owen W. Taylor
1b03dd6704 Usability of SGI_video_sync is per-display not per-renderer
As previously commented in the code, SGI_video_sync is per-display, rather
than per-renderer. The is_direct flag for the renderer was tested before
it was initialized (per-display) and that resulted in SGI_video_sync
never being used.

https://bugzilla.gnome.org/show_bug.cgi?id=779039
2017-02-21 16:25:01 -05:00
Owen W. Taylor
1171c4f16d CoglWinsysGLX: factor out some duplicated code
Add a helper function for repeated calls to clock_gettime(CLOCK_MONOTONIC)

https://bugzilla.gnome.org/show_bug.cgi?id=779039
2017-02-21 16:25:01 -05:00
Owen W. Taylor
a9f139cab6 CoglGPUInfo - fix check for NVIDIA
NVIDIA drivers have a vendor of "NVIDIA Corporation" not "NVIDIA".
Check for both in case older drivers did use "NVIDIA"

https://bugzilla.gnome.org/show_bug.cgi?id=779039
2017-02-21 16:25:01 -05:00
Florian Müllner
827db6f7c7 build: Clean up .pc files 2017-02-15 23:54:07 +01:00
Lionel Landwerlin
1372690c7f cogl: fix get-value-func annotation
Found while trying to enable Cogl 2.0 APIs access from JS.

https://bugzilla.gnome.org/show_bug.cgi?id=778684
2017-02-15 14:53:43 +00:00
Jonas Ådahl
4ebc55f2b3 Make libmutter and friends parallel installable
In order to minimize the amount of breakage, while at the same time
making it easier to make backward incompatible changes needed to
continue turning libmutter into a capable Wayland compositor, make the
libmutter and friends (libmutter-clutter, libmutter-cogl*) parallel
installable by adding a version number to the name. This changes
various filenames, for example what previously was libmutter.so is now
libmutter-0.so (assuming the version for now is 0), and
libmutter-clutter-1.0.so is now libmutter-clutter-0.so. The pkg-config
filenames and GObject introspection has been renamed to reflect this as
well.

This enables a downstream compositor rely on a specific version of the
libmutter API, while gracefully handling API/ABI changes by having to
update to the new version at their own pace.

https://bugzilla.gnome.org/show_bug.cgi?id=777317
2017-02-14 11:16:45 +08:00
Adam Jackson
1f0659d516 Use eglGetPlatformDisplay
Different libEGL will do different things for eglGetDisplay since it has
to guess what kind of display it's been handed. Better to just use the
API that makes it explicit.

Signed-off-by: Adam Jackson <ajax@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=772422
2017-02-07 14:16:33 +01:00
Jonas Ådahl
5a43cc5cf9 cogl: Just define the needed GLES2 extension ourself
We need a GLES2 extension macro in cogl-texture-2d-gl.c, but we can't
include GLES2/gl2ext.h because it will conflict with things in
GL/glext.h. We can't rely on cogl including anything for us since it'd
only include GLES2/gl2ext.h if OpenGL support was explicitly disabled.

https://bugzilla.gnome.org/show_bug.cgi?id=774891
2017-01-03 17:50:03 +08:00
Florian Müllner
71077d582b cogl: Do not include both GLES2 and GL headers
EGLDevice requires a define from GLES2, even when GL is used instead.
As type definitions may conflict between the two, we shouldn't include
both at the same time. Instead, provide the missing define explicitly
when not using GLES2.

https://bugzilla.gnome.org/show_bug.cgi?id=774891
2016-12-02 18:15:39 +01:00
Florian Müllner
0aa6d9782c build: Fix cogl include paths
cogl-egl-defines.h is now referenced from a public header, so we need
to include its location whenever the header is used (directly or via
cogl.h).
2016-11-23 18:03:59 +01:00
Jonas Ådahl
1f0ce80fb4 cogl: Add support for creating custom EGL based textures
Add API to enable the caller to have a custom method for allocating an
external texture. This will enable the possibility for mutter to
generate a texture from for example an EGLStream without having to add
support for that in Cogl.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
23455985cd wayland: Make MetaWaylandBuffer handle texture generation itself
Don't rely on the Cogl layer having Wayland specific paths by
determining the buffer type and creating the EGLImage ourself, while
using the newly exposed CoglTexture from EGLImage API. This changes the
API used by MetaWaylandSurface to make the MetaWaylandBuffer API be
aware when the buffer is being attached. For SHM and EGL buffers, only
the first time it is attached will result in a new texture being
allocated, but later for EGLStream's, more logic on every attach is
needed.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
ecc1f56009 cogl: Expose API for creating texture from EGLImage
Later to be used by mutter to create EGLImage's from Wayland buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
8f716772c2 cogl: Make platforms set the EGL_SURFACE_TYPE
Cogl has no way to know how to properly set the surface type, so lets
outsource that to the platform layer.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
ce7573e2b7 cogl/egl: Fix non-Wayland build
Use #ifdef instead of #if, otherwise it won't compile when Wayland is
not available.

https://bugzilla.gnome.org/show_bug.cgi?id=770647
2016-09-02 17:04:11 +08:00
Sjoerd Simons
7d9af9585d Use _NO_CONTEXT when creating images for EGL_WAYLAND_BUFFER_WL
The WL_bind_wayland_display spec says that EGL images should be created
using EGL_WAYLAND_BUFFER_WL as the target and a NULL context. Mesa
seems to be lenient and accept any context, however some other stacks
aren't so forgiving and fail if anything apart from EGL_NO_CONTEXT is
used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

https://bugzilla.gnome.org/show_bug.cgi?id=769731
2016-08-29 16:31:36 +02:00
Jonas Ådahl
c55943d753 cogl: Fix a few GISCAN warnings
We tried to resolve non-introspected types; lets skip those. We didn't
have a vfunc scope on a for-each loop; declared it synchronous.

https://bugzilla.gnome.org/show_bug.cgi?id=769800
2016-08-18 11:32:33 +08:00
Thomas Hindoe Paaboel Andersen
720cbc5e5f cogl: fix indentation
https://bugzilla.gnome.org/show_bug.cgi?id=769054
2016-07-22 10:44:19 +08:00
Florian Müllner
991f2d696a cogl-gles2: Don't leak gles2 types into mutter
On i686, the GLsizeiptr typedef in cogl-gles2.h conflicts with the
system GL headers, so make sure we don't include both.

https://bugzilla.gnome.org/show_bug.cgi?id=769014
2016-07-21 00:02:53 +02:00
Florian Müllner
a310ba7649 build: Dist cogl-mutter/cogl-clutter headers 2016-07-20 14:30:57 +02:00
Jonas Ådahl
cd0f8e5cd1 cogl: Let the g-ir-scanner see the type structs typedefs
By only showing the g-ir-scanner void typedefs it will make it print
warnings. Lets please it by showing the actual typedef.

https://bugzilla.gnome.org/show_bug.cgi?id=768977
2016-07-20 14:23:48 +08:00
Jonas Ådahl
75c3cf0589 cogl: Remove support for not building with glib/gtype support
https://bugzilla.gnome.org/show_bug.cgi?id=768977
2016-07-20 14:23:48 +08:00
Jonas Ådahl
d62d780a95 Remove cogl-1.0 vs cogl-2.0 vs cogl experimental API split
Mutter (and libmutter users) are the only users of this version of
cogl, and will more or less only use the cogl-1.0, cogl-2.0 and cogl
experimental API variants, and having the possibility of having
different API versions of the same API depending on what file includes
it is error prone and confusing. Lets just remove the possibility of
having different versions of the same API.

https://bugzilla.gnome.org/show_bug.cgi?id=768977
2016-07-20 14:23:48 +08:00
Jonas Ådahl
eed71654ba Don't pretend we don't have CoglShader
We bypass our build configuration to fetch API from a version which
isn't the one we actually use. Stop bypassing and just admit that the
1.0 API is still there, but still deprecated.

https://bugzilla.gnome.org/show_bug.cgi?id=768977
2016-07-20 14:23:48 +08:00
Jonas Ådahl
835ded3f02 cogl: Remove deprecated CoglTexture functions
None were used; no reason to keep them.

https://bugzilla.gnome.org/show_bug.cgi?id=768977
2016-07-20 14:23:48 +08:00
Jonas Ådahl
3450b51da1 cogl: Remove CoglClipState
We were not using it anywhere; lets get rid of it.

https://bugzilla.gnome.org/show_bug.cgi?id=768977
2016-07-20 14:23:48 +08:00
Jonas Ådahl
1ca9d8ac02 cogl: Remove CoglFixed
We were no longer using anything from it; lets remove it.

https://bugzilla.gnome.org/show_bug.cgi?id=768977
2016-07-20 14:23:48 +08:00
Jonas Ådahl
ea64e0abfa cogl: Fix a bunch of GISCAN warnings
https://bugzilla.gnome.org/show_bug.cgi?id=768977
2016-07-20 14:23:48 +08:00
Jonas Ådahl
28a898a22f Use signals instead of onscreen framebuffer frame callbacks
CoglFrameInfo is a frame info container associated with a single
onscreen framebuffer. The clutter stage will eventually support drawing
a stage frame with multiple onscreen framebuffers, thus needs its own
frame info container.

This patch introduces a new stage signal 'presented' and a accompaning
ClutterFrameInfo and adapts the stage windows and past onscreen frame
callbacks users to use the signal and new info container.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
c498bce9e4 cogl: Add API to get the texture from an offscreen
https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
e420f386d2 Move cogl KMS winsys into the native backend
Move the KMS interaction from cogl into mutter, where most of the other
KMS interaction already takes place. This also removes dead code which
were only excercised when non-mutter callers used the cogl KMS backend.

The cogl KMS API was updated to pass via MetaRendererNative instead of
via the different cogl objects.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
e05f48fc53 Make it possible to include private cogl API from mutter
If we want to put a cogl winsys backend in mutter, that backend need to
have access to the internal workings of cogl.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
d63e9452d9 cogl: Remove some now dead code
We require glib and don't support building on win32 any more.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
f1b7b41b8d Update .gitignore
The cogl/clutter merge made the .gitignore files in the respective
directories incorrect, due to the using absolute paths.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
bdc68efe45 cogl: Fix signage miss match warnings
https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
bf71cb2e3c Don't use config.h in clutter and cogl
In cogl use cogl-config.h and in clutter use clutter-build-config.h. We
can't use clutter-config.h in clutter because its already used and
installed.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
4d13f6e2d0 cogl: Expose winsys vtable getters
This is so we can use as base in mutter's future winsys backends.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
d6cde4b043 cogl: Add API for setting custom winsys
https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
e2f5579391 cogl: Don't undef __INSIDE_COGL_H__ in file not defining it
If you include a file that might define __INSIDE_COGL_H__, don't
undefine it if it wasn't defined in that file. This makes it possible
to include for example cogl-gles2.h from some other file which defines
__INSIDE_COGL_H__.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Rui Matos
d4d2bf0f6c cogl: Ignore GL_CONTEXT_LOST when checking for GL errors
When using a context with robustness, glGetError() may return
GL_CONTEXT_LOST at any time and this error doesn't get cleared until
the application calls glGetGraphicsResetStatus() . This means that our
error checking can't call glGetError() in a loop without checking for
that return value and returning in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=739178
2016-06-27 20:23:49 +02:00
Rui Matos
0f2be43af4 cogl-context: Add a cogl_get_graphics_reset_status API
If the driver supports the GL_ARB_robustness extension we can expose
the graphics reset status this way.

https://bugzilla.gnome.org/show_bug.cgi?id=739178
2016-06-27 20:23:49 +02:00