summaryrefslogtreecommitdiff
path: root/cogl
Commit message (Collapse)AuthorAgeFilesLines
* cogl-auto-texture: Avoid a double-free crashDaniel van Vugt2018-11-081-0/+1
| | | | | | | | | | 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
* build: Fix include and lib paths in autotools .pc filesJonas Ådahl2018-11-074-7/+7
| | | | | | Some hadn't been updated after lib/mutter/ changed to lib/mutter-N/. Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/382
* build: Add soversion to shared librariesJonas Ådahl2018-11-074-0/+4
| | | | It's easier to add it now, then adding it later would so be needed.
* cogl: Expose more headers for introspectionGeorges Basile Stavracas Neto2018-11-072-12/+12
| | | | | | 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.
* cogl/framebuffer: Mark CoglOffscreen as a CoglFramebuffer implementationGeorges Basile Stavracas Neto2018-11-071-1/+2
| | | | | | | | | 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.
* build: Make libmutter-cogl-path a dependency for test-journalGeorges Basile Stavracas Neto2018-11-061-0/+1
| | | | | | Otherwise, it might trigger the actual race condition that Continuous is running into, and access the generated enum headers before they're created.
* build: Prefer dependencies instead of link_withGeorges Basile Stavracas Neto2018-11-066-14/+28
| | | | | | | | | | 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'.
* Add meson build supportJonas Ådahl2018-11-0618-0/+1190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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'.
* Make it possible to build without EGL supportJonas Ådahl2018-11-063-0/+8
| | | | | | 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.
* autotools: Make install directories paths more consistentJonas Ådahl2018-11-068-16/+16
| | | | | | | | 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.
* cogl: Pass unit-tests file to run-tests.shJonas Ådahl2018-11-063-4/+12
| | | | | | 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.
* cogl: Fix HAVE_COGL_GL guardJonas Ådahl2018-11-061-1/+1
| | | | Macro was only defined when defined to 1.
* cogl: Make cogl-config.h include check explicitJonas Ådahl2018-11-063-3/+5
| | | | | Don't rely on some combination of macros, but an explicit definition to check whether cogl-config.h was included.
* cogl: Require relative full paths when includingJonas Ådahl2018-11-0662-157/+153
| | | | | I.e. including a OpenGL driver file, the path "driver/gl/..." must be specified when including.
* cogl: Remove left-over WebGL pathsJonas Ådahl2018-11-064-20/+0
|
* cogl: Unconditionally include cogl-config.hJonas Ådahl2018-11-06109-219/+0
|
* cogl: Unconditionally depend on cairoJonas Ådahl2018-11-062-27/+5
|
* cogl: Unconditionally include "strings.h"Jonas Ådahl2018-11-061-2/+0
|
* cogl/tests: Mark failing test as known failureJonas Ådahl2018-11-062-4/+4
| | | | | This allows us to enable running the tests again. Not fixing the failure is at least better than not running the tests at all.
* cogl: Remove ARBfp pipeline supportJonas Ådahl2018-11-0620-1352/+65
| | | | | As with fixed pipelines, we require the use of the GLSL pipeline in mutter, and no point in supporting ARBfp anyway.
* cogl: Remove fixed pipeline supportJonas Ådahl2018-11-0618-1020/+9
| | | | | We require being able to use shaders so stop supporting a pipeline that wouldn't work to begin with.
* cogl: Remove notion of a "cogl" versionJonas Ådahl2018-11-0622-763/+166
| | | | | Mutters copy of cogl isn't a separate library with its own version, so remove the old version macros.
* cogl: Remove support for GLESv1Jonas Ådahl2018-11-0628-393/+78
| | | | We have no need for it in mutters cogl variant.
* cogl: Remove some left over KMS backend stuffJonas Ådahl2018-11-062-39/+0
|
* cogl: Always build CoglPango supportJonas Ådahl2018-11-062-21/+2
|
* cogl: Always build CoglPath supportJonas Ådahl2018-11-065-29/+1
|
* cogl: Make various functions non-optionalJonas Ådahl2018-11-063-158/+0
| | | | | Remove fallback implementations of some functions available in gcc/clang and Linux/BSDs.
* cogl: Make _Static_assert non-optionalJonas Ådahl2018-11-063-14/+2
|
* cogl-gles2/Makefile.am: Add cogl/ includedirJonas Ådahl2018-11-061-1/+3
| | | | Otherwise cogl-egl-defines.h isn't found when building out-of-tree.
* cogl: Fix cogl_frame_info_get_frame_counter docsDaniel van Vugt2018-07-201-5/+2
| | | | | | | | | 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
* native: Restore previous EGL state after blitting onto secondary GPUJonas Ådahl2018-04-253-1/+16
| | | | | | | | 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
* cogl: Do not unref a NULL objectMarco Trevisan (Treviño)2018-04-251-1/+5
| | | | Add return-if-fail statement to avoid deferencing NULL object
* cogl: Read pixels as per the stored formatCarlos Garnacho2018-03-211-16/+6
| | | | | | | | | | | | | | | | | | 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
* Fix some spelling errorshandsome-feng2018-03-211-1/+1
| | | | https://gitlab.gnome.org/GNOME/mutter/merge_requests/45
* renderer/native: Force EGL config pixel formatJonas Ådahl2018-03-053-9/+43
| | | | | | | | | 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
* cogl-texture: Remove unused functionFlorian Müllner2018-02-091-279/+0
| | | | Commit d8f2f583e69f removed the only caller.
* cogl/x11/renderer: Silence introspection warningJonas Ådahl2018-02-071-1/+1
| | | | | | | We don't introspect CoglRenderer, so we shouldn't introspect API using it either. https://bugzilla.gnome.org/show_bug.cgi?id=739178
* cogl-texture: refuse downloading textures in cogl_texture_get_data() on GLESGeorge Kiagiadakis2018-02-051-17/+5
| | | | | | | | | | | | | | | | | | | 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
* cogl: Add way to pass user data when setting custom renderer winsysJonas Ådahl2017-10-053-2/+6
| | | | | | | | 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
* cogl: Only do the swizzling hack for GL contextsMario Sanchez Prada2017-08-211-2/+4
| | | | | | | | | | | 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
* cogl: Mark vertex buffers as dynamicCarlos Garnacho2017-05-221-1/+1
| | | | | | | | | 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
* cogl: Use pixel_format_to_gl_with_target in find_best_gl_get_data_formatCarlos Garnacho2017-05-184-5/+10
| | | | | | | | | 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
* Consider the right CONTEXT_LOST token on OpenGL ES contextsMario Sanchez Prada2017-04-171-0/+5
| | | | | | | | | | | | | | | 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
* Define new tokens from the ARB_robustness extension if neededMario Sanchez Prada2017-04-171-0/+13
| | | | | | | | | | | | | | | | | 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
* x11: Use EGL instead of GLX when drawing using GLESJonas Ådahl2017-03-253-7/+9
| | | | | | | 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
* cogl: Use pixel_format_to_gl_with_target on bitmap uploading pathsCarlos Garnacho2017-03-071-5/+6
| | | | | | | | | | | | 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
* cogl: Add pixel_format_to_gl_with_target driver vfuncCarlos Garnacho2017-03-074-11/+52
| | | | | | | | 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
* cogl: Read pixels in the correct 32bit format as per the given bitmapCarlos Garnacho2017-03-011-0/+9
| | | | | | | Fixes the gnome-shell screenshot tool from getting colors with the wrong byte order. https://bugzilla.gnome.org/show_bug.cgi?id=779234
* cogl: Prefer swizzling to convert BGRA buffersCarlos Garnacho2017-02-282-1/+21
| | | | | | | | | | | | | | | | 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
* Add cogl_xlib_renderer_set_threaded_swap_wait_enabled()Owen W. Taylor2017-02-214-0/+43
| | | | | | | | | | | 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