Commit Graph

2207 Commits

Author SHA1 Message Date
Georges Basile Stavracas Neto
9b53583945
cogl/trace: Fix typo
https://gitlab.gnome.org/GNOME/mutter/merge_requests/609
2019-06-07 12:58:10 -03:00
Georges Basile Stavracas Neto
7810f0e276
cogl/trace: Add user-visible group name
This way, it shows up as "Compositor" in Sysprof instead of
"t:XYZ".

https://gitlab.gnome.org/GNOME/mutter/merge_requests/197
2019-05-31 11:57:09 -03:00
Georges Basile Stavracas Neto
9b8f9b65b8
clutter: Add more descriptive profiling sections
The idea here is to be able to visualize and immediately
understand what is happening. Something like:

```
                   [ view1 ] [ view2 ]
 [---- Layout ---][------ Paint ------][ Pick ]
[================== Update =====================]
```

But with colors. A few of the previous profiling data
sections were removed, since they didn't really add to
reading the graph.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/197
2019-05-31 11:57:08 -03:00
Georges Basile Stavracas Neto
e741cab3f4
profiler: Support setting output filename
So we can have some control over where the file will
be saved.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/197
2019-05-31 11:57:08 -03:00
Georges Basile Stavracas Neto
53748e3da7
cogl-trace: Cleanup context after disabling
This allows running the Capture() method multiple times,
with different arguments each time.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/197
2019-05-31 11:57:07 -03:00
Jonas Ådahl
e5e58f8075
cogl: Add libsysprof capture based tracing
Add the ability to add tracing instrumentation to the code. When
enabled, trace entries will generate a file with timing information
that will be processable by sysprof for generating visualization of
traces over time.

While enabled by default at compile time, it is possible to disable the
expansion of the macros completely by passing --disable-tracing to
./configure.

Tracing is so far only actually done if actually enabled on explicitly
specified threads.

This will be used by Mutter passing the write end of a pipe, where the
read end is sent to Sysprof itself via the D-Bus method 'Capture()'.

By passing that, we have to detect EPIPE that is sent when Sysprof stops
recording. Fortunately, we already ignore the signal at meta_init(), so
no need to add a custom signal handler.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/197
2019-05-31 11:55:56 -03:00
Robert Mader
a859d76c72 meson: Cleanup debug build handling
Add debug flags based on meson's `debug` option instead of `buildtype`.
This allows custom build configurations to behave like a debug or release build.

Add `-fno-omit-frame-pointer` to Mutter/Cogl. Not to Clutter though, as that would
require more changes to how Clutter's gir is created

Remove `-DG_DISABLE_CAST_CHECKS` from Clutter in debug builds

Add `-DG_DISABLE_CHECKS`, `-DG_DISABLE_ASSERT` and `-DG_DISABLE_CAST_CHECKS` to all
non-debug builds but `plain`, which explicitly should not have any compile flags

Use `cc.get_supported_arguments`, so it becomes more obvious to the user which flags
are set during compilation

https://gitlab.gnome.org/GNOME/mutter/merge_requests/497
2019-05-29 15:52:39 +00:00
Florian Müllner
80d11287eb cogl-path: Undeprecate framebuffer functions
It looks like deprecating the functions with explicit framebuffer/pipeline
arguments made it to (cogl) master by mistake:

https://mail.gnome.org/archives/clutter-list/2016-April/msg00008.html

We now use one of them, so this is a good time to undeprecate the lot.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/597
2019-05-27 22:48:19 +00:00
Marco Trevisan (Treviño)
7e0d185120 cogl/pipeline: Don't try to access to free'd pointer data
When free'ing a pipeline we destroy the BigState first and then the fragment and
vertex snippets lists using the big state pointer which is now invalid.
This causes a crash  when G_SLICE=always-malloc is set and using MALLOC_CHECK_.

So, invert the operations by free'ing the snippet lists first, and the big state
afterwards.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/581
2019-05-27 17:23:54 -05:00
Marco Trevisan (Treviño)
61c173b777 cogl/xlib-renderer: Save Xlib renderer data in custom winsys pointer
XLib renderer saves its data as the object cogl user data, however this data
is free'd as part of the object destruction that happens before free'ing the
renderer in _cogl_renderer_free(), from where we're calling the renderer
disconnect vfunc.
Thus in _cogl_xlib_renderer_disconnect() we happen to get an invalid pointer to
CoglXlibRenderer and we try access to it in order to close the X11 display.

This causes all the cogl tests to crash when G_SLICE=always-malloc is set and
when using MALLOC_CHECK_.

Fix this using the renderer winsys custom data instead of using cogl object data
for storing the CoglXlibRenderer, and handling the destruction of it manually.

As bonus this also makes access to the renderer data faster.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/581
2019-05-27 17:14:25 -05: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)
ea0a89bde8 cogl/meson: Remove uneeded cogl-mutter-config.h generation
This was needed until we had autotools in place.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/585
2019-05-21 12:36:10 -05:00
Niels De Graef
0d7a929b83 cogl: Map CoglPixelFormats to their specific properties
By providing an (internal) table to map `CoglPixelFormat`s to their
respective properties  we will be able to get rid of the unusual enum
values in the future. This is something we will need once we want to
have support for more pixel formats (such as YUV-based formats).

As an extra feature, we provide a `to_string()` method, which is quite
useful for debugging purposes (rather than deciphering enum values).

https://gitlab.gnome.org/GNOME/mutter/merge_requests/524
2019-05-21 15:20:44 +02:00
Niels De Graef
991f9505ad cogl: Put CoglPixelFormat code into its own file
We're going to add some features and extra code to CoglPixelFormat, so
it's much nicer to have it in once place. Notice also that it doesn't
make sense that e.g. `_cogl_pixel_format_get_bytes_per_pixel()` were in
a private header, since they were being exported anyway.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/524
2019-05-21 15:20:44 +02:00
Marco Trevisan (Treviño)
7a17e236f7 Use free_full on GSList's instead of foreach + free
GList's used in legacy code were free'd using a g_slist_foreach + g_slist_free,
while we can just use g_slist_free_full as per GLib 2.28.

So replace code where we were using this legacy codepath.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/576
2019-05-15 14:49:56 -05:00
Marco Trevisan (Treviño)
df7d8e2cbf Use free_full on GList's instead of foreach + free
GList's used in legacy code were free'd using a g_list_foreach + g_list_free,
while we can just use g_list_free_full as per GLib 2.28.

So replace code where we were using this legacy codepath.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/576
2019-05-15 14:42:25 -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)
63c40a9711 meson: Define srcdir and builddir using meson functions
No need to redefine paths starting from top src/build dirs, as meson can give us
this information for free using its functions.

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
7df86fb246 cogl: Use EGL_IMG_context_priority if available
We're the context closest to the display, so we should take priority
over other clients.

v2: Warn if we asked for a high-priority context and didn't get one.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/454
2019-04-18 20:27:26 +00:00
Adam Jackson
3f29b47809 cogl: Generalize EGL context attribute initialization
No functional change, just makes the next change clearer.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/454
2019-04-18 20:27:26 +00:00
Adam Jackson
9ab3a02a8a cogl: Remove unused TEXTURE_RECTANGLE feature flag
https://gitlab.gnome.org/GNOME/mutter/merge_requests/546
2019-04-18 12:53:28 -04:00
Adam Jackson
ca2be8ef5b cogl: Remove CoglTextureType
https://gitlab.gnome.org/GNOME/mutter/merge_requests/546
2019-04-18 12:53:26 -04:00
Adam Jackson
1783ea5af1 cogl: Remove unused texture_type argument from cogl_pipeline_set_layer_null_texture
https://gitlab.gnome.org/GNOME/mutter/merge_requests/546
2019-04-18 12:53:24 -04:00
Adam Jackson
862e56f01d cogl: Remove unused CoglTextureVable::get_type
https://gitlab.gnome.org/GNOME/mutter/merge_requests/546
2019-04-18 12:53:21 -04:00
Adam Jackson
2b9cd50e84 cogl: Eliminate _cogl_gl_util_get_texture_target_string
Its results are effectively constant now. Fold them into the callers and
remove the function.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/546
2019-04-18 12:53:19 -04:00
Adam Jackson
e71f44dbd6 cogl: Remove never-changing COGL_PIPELINE_LAYER_STATE_TEXTURE_TYPE state
https://gitlab.gnome.org/GNOME/mutter/merge_requests/546
2019-04-18 12:53:17 -04:00
Adam Jackson
c881b4970d cogl: Remove unused CoglTextureRectangle
https://gitlab.gnome.org/GNOME/mutter/merge_requests/546
2019-04-18 12:53:16 -04:00
Adam Jackson
d79f176142 cogl: Remove texture_rectangle awareness from the GLX TFP code
GL 2.1 implies ARB_texture_non_power_of_two so this will never be hit.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/546
2019-04-18 12:53:14 -04: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
fb40e2eefb cogl: Remove unused cogl_texture_new_from_foreign
https://gitlab.gnome.org/GNOME/mutter/merge_requests/546
2019-04-18 12:53:09 -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
48f04c7968 cogl: COGL_FEATURE_TEXTURE_NPOT_BASIC is always available
https://gitlab.gnome.org/GNOME/mutter/merge_requests/546
2019-04-18 12:53:06 -04:00
Adam Jackson
007297f1a6 cogl: COGL_FEATURE_TEXTURE_NPOT_MIPMAP is always available
https://gitlab.gnome.org/GNOME/mutter/merge_requests/546
2019-04-18 12:53:04 -04:00
Adam Jackson
302a171c08 cogl: COGL_FEATURE_TEXTURE_NPOT_REPEAT is always available
https://gitlab.gnome.org/GNOME/mutter/merge_requests/546
2019-04-18 12:53:03 -04:00
Adam Jackson
893e894fff cogl: Remove always-true COGL_FEATURE_SHADERS_GLSL
https://gitlab.gnome.org/GNOME/mutter/merge_requests/546
2019-04-18 12:53:01 -04:00
Adam Jackson
2aaed7bdfc cogl: Remove debug disables for GLSL and NPOT textures
https://gitlab.gnome.org/GNOME/mutter/merge_requests/546
2019-04-18 12:52:57 -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
68166f33d9 cogl: Fix some misleading variable names
This was clearly blindly copypasta'd from the (now deleted) 3D texture
code.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/487
2019-04-18 01:26:32 +00: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
Robert Mader
db486ad897 cogl/texture-2d: Remove notes about COGL_FEATURE_ID_TEXTURE_NPOT
NPOT capabilities were made madatory in OpenGL 2.0 and GLES 2.0,
so let's stop encouraging developers to write new code with checks
for it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/467
2019-04-17 20:14:59 +00:00
Adam Jackson
8180927de2 cogl: Bump minimum GLES version to 2.0
This is already effectively true because there is only a GLSL backend.
It also implies OES_texture_npot.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/489
2019-04-17 20:06:47 +00:00
Adam Jackson
191c31b0f0 cogl: Bump minimum GL version to 2.1
We already effectively require GLSL, because there's no fixed-function
backend anymore. OpenGL 2.0 drivers don't really exist in the wild, so
just go ahead and require 2.1 or better. 2.1 implies GLSL 1.20 or
better, so simplify that as well.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/489
2019-04-17 20:06:47 +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
Adam Jackson
b624e94ab1 cogl: Remove viewport scissor workaround
This is effectively a revert of:

    commit 6cfc93f26f
    Author: Robert Bragg <robert@linux.intel.com>
    Date:   Tue Oct 2 11:44:00 2012 +0100

        clip-stack: workaround intel gen6 viewport clip bug

It's been over six years, if this bug is still present we should just
fix Mesa already.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/481
2019-04-17 19:48:03 +00:00
Daniel van Vugt
20c1295a33 cogl-winsys-glx: Fix frame notification race/leak
If a second `set_{sync,complete}_pending` was queued before the idle
handler had flushed the first then one of them would be forgotten.
It would stay queued forever and never emitted as a notification.

This could happen repeatedly causing a slow leak. But worse still,
`clutter-stage-cogl` would then have `pending_swaps` permanently stuck
above zero preventing the presentation timing logic from being used.

The problem is that a boolean can only count to one, but in some cases
(triple buffering, whether intentional or accidental #334) we need it to
count to two. So just change booleans to integers and count properly.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/216
2019-04-12 11:09:00 +08:00
Heiher
afe8610b4a cogl/texture: Implement is_get_data_supported on GLES textures
https://gitlab.gnome.org/GNOME/mutter/merge_requests/515
2019-04-02 09:15:14 +00:00