Commit Graph

58 Commits

Author SHA1 Message Date
Robert Mader
8e172aeecb cleanup: Use g_clear_handle_id() for g_source_remove()
It makes sure we do not forget to zero the id and lets us avoid
zero checks before. We use it for all new code, lets clean up the
existing code base.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/947
2019-11-22 01:27:40 +01:00
Robert Mader
92375c75f8 cleanup: Use g_clear_signal_handler() where possible
This is inspired by 98892391d7 where the usage of
`g_signal_handler_disconnect()` without resetting the corresponding
handler id later resulted in a bug. Using `g_clear_signal_handler()`
makes sure we avoid similar bugs and is almost always the better
alternative. We use it for new code, let's clean up the old code to
also use it.

A further benefit is that it can get called even if the passed id is
0, allowing us to remove a lot of now unnessecary checks, and the fact
that `g_clear_signal_handler()` checks for the right type size, forcing us
to clean up all places where we used `guint` instead of `gulong`.

No functional changes intended here and all changes should be trivial,
thus bundled in one big commit.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/940
2019-11-21 15:02:27 +00:00
Adam Jackson
13fd213064 cogl: Remove unported test-vertex-buffer-mutability
https://gitlab.gnome.org/GNOME/mutter/merge_requests/933
2019-11-20 11:59:15 -05:00
Adam Jackson
794d3239c7 cogl: Remove deprecated cogl_color_set_from_*
https://gitlab.gnome.org/GNOME/mutter/merge_requests/933
2019-11-20 11:59:15 -05:00
Thomas Hindoe Paaboel Andersen
d3afe4308a test: use correct enum
The function create_texture() in test-wrap-modes.c takes a
TestUtilsTextureFlags. However a CoglTextureFlags is passed instead
in two calls. As the enums are identical this patch changes it to
use the TestUtils type.

The enum definitions:

typedef enum
{
  COGL_TEXTURE_NONE           = 0,
  COGL_TEXTURE_NO_AUTO_MIPMAP = 1 << 0,
  COGL_TEXTURE_NO_SLICING     = 1 << 1,
  COGL_TEXTURE_NO_ATLAS       = 1 << 2
} CoglTextureFlags;

typedef enum
{
  TEST_UTILS_TEXTURE_NONE           = 0,
  TEST_UTILS_TEXTURE_NO_AUTO_MIPMAP = 1 << 0,
  TEST_UTILS_TEXTURE_NO_SLICING     = 1 << 1,
  TEST_UTILS_TEXTURE_NO_ATLAS       = 1 << 2
} TestUtilsTextureFlags;

https://gitlab.gnome.org/GNOME/mutter/merge_requests/938
2019-11-16 00:14:20 +01:00
Adam Jackson
54ac1f6b59 test: Remove unreferenced test-texture-rectangle
This isn't even built, and it's testing GL_TEXTURE_RECTANGLE_ARB, which
is not even a code path we support anymore since we require real NPOT.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/883
2019-11-07 12:47:23 +00:00
Adam Jackson
bd1630a12c cogl: Remove unused CoglFeatureFlags
https://gitlab.gnome.org/GNOME/mutter/merge_requests/866
2019-10-21 21:43:08 +00:00
Georges Basile Stavracas Neto
16875340cb Remove CoglQuaternion
This is unused API, and there are no plans to actually
use it. Even if we want to use it in the future, we'll
be fully Graphene and won't need this API anyway.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-10-16 11:38:13 +00:00
Georges Basile Stavracas Neto
959a418cc3 Replace CoglEuler by graphene_euler_t
As the first step into removing Cogl types that are covered by
Graphene, remove CoglEuler and replace it by graphene_euler_t.

This is a mostly straightforward replacement, except that the
naming conventions changed a bit. Cogl uses "heading" for the
Y axis, "pitch" for the X axis, and "roll" for the Z axis, and
graphene uses the axis themselves. That means the 1st and 2nd
arguments need to be swapped.

Also adapt the matrix stack to store a graphene_euler_t in the
rotation node -- that simplifies the code a bit as well.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-10-16 11:38:13 +00:00
Marco Trevisan (Treviño)
22c8f179d2 cogl/test-readpixel: Remove unused variables
These were added as part of commit d4ff5e2d but they're not needed.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/857
2019-10-15 11:55:53 +02:00
Marco Trevisan (Treviño)
d4ff5e2d31 clutter/actor: Remove deprecated clutter container foreach
This is deprecated, so replace it with ClutterActorIter or alternative funcs

https://gitlab.gnome.org/GNOME/mutter/merge_requests/816
2019-10-15 08:51:45 +00:00
Niels De Graef
0d0286d59e cogl: Remove COGL_INVALID_HANDLE
Just use `NULL`, which is the normal C convention

https://gitlab.gnome.org/GNOME/mutter/merge_requests/451
2019-10-14 17:05:28 +00:00
Niels De Graef
23f77a1b63 cogl: Remove cogl_handle_ref/unref
This is for all intents and purposes the same as
`cogl_object_ref/unref`, but still refers to handles rather than
objects (while we're trying to get rid of the former) so it's a bit of
unnecessary redundant API.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/451
2019-10-14 17:05:28 +00:00
Adam Jackson
7e8a864992 cogl: Remove unused cogl-gles2 API
This was introduced in:

    commit 010d16f647
    Author: Robert Bragg <robert@linux.intel.com>
    Date:   Tue Mar 6 03:21:30 2012 +0000

        Adds initial GLES2 integration support

        This makes it possible to integrate existing GLES2 code with
        applications using Cogl as the rendering api.

That's maybe a reasonable thing for a standalone cogl to want, but our
cogl has only one consumer. So if we want additional rendering out of
our cogl layer, it makes more sense to just add that to cogl rather than
support clutter or mutter or the javascript bindings creating their own
GLES contexts.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/500
2019-08-16 06:35:35 +00:00
Iain Lane
59fb26cb00
cogl/tests: Only install run-tests.sh when building installed tests
This is a script for installed tests; leave it out otherwise.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/694
2019-07-22 22:07:39 +01:00
Niels De Graef
70bacb9402 cogl: Remove CoglError wrapper
CoglError was added at a certain point to remove the hard dependency on
GLib, but since this can't be avoided inside mutter, let's remove this
whole abstraction.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/631
2019-06-20 18:25:04 +02:00
Marco Trevisan (Treviño)
9305b6d8ee cogl/tests: Remove configure_file workaround for installed tests
Since starting meson 0.50 `install: false` is honored when the install_dir is
set to a non-empty value, we can now remove the workaround we added in commit
dbe73c329

https://gitlab.gnome.org/GNOME/mutter/merge_requests/585
2019-05-21 12:36:15 -05:00
Marco Trevisan (Treviño)
81ae886dda cogl/tests: Use less verbose run-tests.sh on single tests run by meson
Use less verbose output when run-tests.sh is running only a test and we're
requested for less verbose output.

Also write the test name first of running it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/442
2019-05-02 19:56:23 +00:00
Marco Trevisan (Treviño)
8374be46d2 cogl/tests: Export and run unit tests if they are enabled
Cogl unit tests are just functions inside normal code files that needs to be
dload'ed by the test binary.

So in case unit-tests are enabled, we need to export those symbols.
Since map file can't be overridden, use a configure_file to generate the map
file when tests are enabled, in order to export the needed symbols.

Then goes through the source files to look unit tests checking for their macro
definition and load them with the runner script.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/442
2019-05-02 19:56:23 +00:00
Marco Trevisan (Treviño)
34312c272b cogl/tests: Run conform tests as single meson tests
Use find-conform-unit-tests.sh to create a meson list of tests to run.
This allows to run each test as single test with meson and to remove the timeout
for all the tests.

Instead of changing 'run-tests.sh' to take test-names as arguments we can just
generate simple dummy test-files for each test, without having to change the
tooling.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/442
2019-05-02 19:56:23 +00:00
Marco Trevisan (Treviño)
2b8f5e65b6 cogl/tests: Run tests supports both test names and files as parameter
Make run-tests.sh to support as arguments both an unit-tests file or test names

This allows to run a test with this script without having to create fake files.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/442
2019-05-02 19:56:23 +00:00
Marco Trevisan (Treviño)
a934fa07b8 tests: Use suites for test cases
They allows to filter tests better and so we can just launch tests with:
  meson test --suite [core|cogl|clutter] [single-test-name]

https://gitlab.gnome.org/GNOME/mutter/merge_requests/442
2019-05-02 19:56:23 +00:00
Adam Jackson
ce6acf9dca cogl: Remove rectangle-texture tests
https://gitlab.gnome.org/GNOME/mutter/merge_requests/546
2019-04-18 12:53:12 -04:00
Adam Jackson
fc09fa50a5 cogl: NPOT textures are always available
https://gitlab.gnome.org/GNOME/mutter/merge_requests/546
2019-04-18 12:53:07 -04:00
Adam Jackson
249f9a4a2e cogl: Stop running non-NPOT tests
The minimum GL/GLES versions require working NPOT textures.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/546
2019-04-18 12:52:54 -04:00
Adam Jackson
28954e8271 cogl: Remove unused 3D texture support
We're not using this, and it's difficult to imagine we ever would.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/487
2019-04-18 01:26:32 +00:00
Adam Jackson
a94841abf1 cogl: Remove color write masks from the framebuffer and pipeline API
The only thing using this is its own tests, and it's difficult to
imagine a real use for it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/468
2019-04-17 19:57:14 +00:00
Niels De Graef
a81435ab5f cogl: Remove CoglBool, use gboolean instead
This basically reverts commit 54735dec, which tried to avoid the
GLib-defined types in favor the standard C ones. One exception to this
is the bool type, for which the commit introduces a new type CoglBool.

Let's just get rid of this type in favor of having consistency with the
GLib types. Note by the way that neither CoglBool nor gboolean (which
has a size of `int`) are completely compatible with bool (size `char`).

https://gitlab.gnome.org/GNOME/mutter/merge_requests/321
2019-02-15 16:35:46 +01:00
Marco Trevisan (Treviño)
dbe73c3296 meson: Do not install cogl config.env if installed tests are disabled
Until meson 0.50, setting the install parameter in 'configure_file' is ignored
if 'install_dir' is set. Then until mutter doesn't depend on such meson version
cogl_installed_tests_libexecdir should be empty unless have_installed_tests is
false, or this file will be installed anyway.

See https://github.com/mesonbuild/meson/issues/4160
2019-02-04 15:49:56 +00:00
Florian Müllner
5c3ec27b4b cogl: Fix builds with G_DISABLE_ASSERT
Commit 25f416c13d added additional compilation warnings, including
-Werror=return-type. There are several places where this results
in build failures if `g_assert_not_reached()` is disabled at compile
time and the compiler misses a return value.

https://gitlab.gnome.org/GNOME/mutter/issues/447
2019-01-25 00:48:12 +01:00
Marco Trevisan (Treviño)
3838341d83 meson: Set cogl as dependency of libmutter-cogl dependency
Since a libmutter-cogl dependency is declared as libmutter_cogl_dep, it can be
used to avoid repeating cogl dependency everywhere.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/3955
2019-01-23 13:03:40 +00:00
Jonas Ådahl
982d135ace cogl: Add missing function declarations
In plenty of places a non-static function was defined but didn't have
the corresponding declaration. Fix this by adding them, or alternatively
making them static.
2019-01-22 18:31:52 +01:00
Jonas Ådahl
c55004864d cogl: Add missing void to functions with no arguments
I.e. foo () -> foo (void).
2019-01-22 18:31:52 +01:00
Georges Basile Stavracas Neto
763ae36cee
Drop Autotools
I saw Meson fade from the sky
On the wind I heard a sigh
As snowflakes cover fallen Makefiles
I will say this last goodbye

Meson is now coming
So ends Autotools days
Future is now coming
And we must away
Over Python and without Bashisms
Through lands where never Meson touched
By silver streams that run down to the Sea

Under parsers, beneath old legacy
Over snow one winter’s morn
I turned at last to paths that lead home
And though where the road then takes me
I cannot tell
We came all this way
But now comes the day
To bid you farewell

Many places I have been
Many sorrows I have seen
But I don’t regret
Nor will I forget
All Makefiles that took that road with me

I bid you all a very fond farewell.
2019-01-10 11:50:54 -02:00
Georges Basile Stavracas Neto
ebb6c56f67
Add Meson support for installed tests
This is the last remaining feature necessary to achieve
parity with the Autotools build.

A few changes were made to the install locations of the
tests, in order to better acomodate them in Meson:

 * Tests are now installed under a versioned folder (e.g.
   /usr/share/installed-tests/mutter-4)

 * The mutter-cogl.test file is now generated from an .in
   file, instead of a series of $(echo)s from within Makefile.

Notice that those tests need very controlled environments
to run correctly. Mutter installed tests, for example, will
failed when running under a regular session due to D-Bus
failing to acquire the ScreenCast and/or RemoteScreen names.
2018-12-20 13:52:35 -02:00
Georges Basile Stavracas Neto
05ab8eebe8
cogl/tests: Use tmp file to dump test results
When running installed tests, the working directory for Cogl
tests is /usr/libexec/installed-tests/mutter-cogl-4/conform,
which isn't writable by normal users.

To avoid the adding stray hidden files to the current directory,
adapt the runner script to fallback to $(mktemp) - which is
available on all platform we care about - and avoid adding
hidden files everywhere.
2018-12-20 11:30:40 -02:00
Ting-Wei Lan
b34bb773a4 tests: Don't show 'core dumped' messages 2018-12-11 12:53:31 -02:00
Georges Basile Stavracas Neto
7d20101198 cogl-framebuffer: Remove swap_throttled config
Since now we don't set the swap throttled value based
on sync-to-vblank, we can effectively remove it from
Cogl. Throttling swap buffers in Cogl is as much a
historical artifact as sync-to-vblank. Furthermore,
it doesn't make sense to disable it on a compositor,
which is the case with the embedded Cogl.

In addition to that, the winsys vfunc for updating
whenever swap throttling changes could also be removed,
since swap throttling is always enabled now.

Removing it means less code, less branches when running,
and one less config option to deal with.

This also removes the micro-perf test, since it doesn't
make sense for the case where Cogl is embedded into the
compositor.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/191
2018-12-06 14:29:34 +00:00
Ting-Wei Lan
319500e4f3 tests: Fix warnings reported by shellcheck
This commit includes following fixes for a few shell scripts:

1. Follow the best practice of quoting variables everywhere unless they
   are used in places where word-splitting and globbing can never happen.

2. Replace `command` with $(command) because the latter is easier to use
   and read.

3. Don't use "$@" in places expecting a string because it is an array
   of strings instead of a single string.
2018-12-01 13:07:29 +00:00
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
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
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
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
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