Commit Graph

153 Commits

Author SHA1 Message Date
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)
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
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
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
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
Florian Müllner
a1e325f749 build: Don't use absolute paths with subdir keyword
Meson 0.50.0 made passing an absolute path to install_headers()'
subdir keyword a fatal error. This means we have to track both
relative (to includedir) paths for header subdirs and absolute
paths for generated headers now :-(

https://gitlab.gnome.org/GNOME/mutter/merge_requests/492
2019-03-18 12:37:14 +00:00
Florian Müllner
9aca31c814 cogl: Introspect CoglTexture2D(Sliced)
gnome-shell cannot use CoglTexture if gjs can't tell that an object
in question implements the CoglTexture interface.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1020
https://gitlab.gnome.org/GNOME/mutter/merge_requests/482
2019-03-11 23:57:08 +00:00
Adam Jackson
a555a2c8eb cogl: Remove unused CoglTextureDriver::try_setting_gl_border_color
https://gitlab.gnome.org/GNOME/mutter/merge_requests/480
2019-03-11 23:50:10 +00:00
Carlos Garnacho
a871d56f88 cogl: Revert swizzling for BGRA buffers
As it was originally reported on
https://bugzilla.gnome.org/show_bug.cgi?id=779234#c0, the hottest path was
convert_ubyte() in mesa. Reverting this shows no trace of those hot paths,
nor any higher than usual CPU activity.

As the improvements at the time were real, I can only conclude that pixel
conversion was happening somewhere further the pipeline, and swizzling just
helped indirectly. That got eventually fixed, so swizzling just stayed to
cause grief. And lots it caused.

Time to bin this, it seems.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/486
2019-03-08 10:41:25 +01:00
Carlos Garnacho
d83a325f98 Revert "Revert "cogl: Pick glReadPixels format by target, not source""
This reverts commit 4f72099023.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/486
2019-03-07 23:04:55 +01:00
Robert Mader
4f72099023 Revert "cogl: Pick glReadPixels format by target, not source"
This reverts commit 981b045459.

Fixes https://gitlab.gnome.org/GNOME/mutter/issues/418
2019-03-06 17:02:00 +01:00
Niels De Graef
1c6ea5d1db Use a consistent style for enum braces
https://gitlab.gnome.org/GNOME/mutter/merge_requests/361
2019-02-28 09:31:01 +01: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
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
Marco Trevisan (Treviño)
08130912f0 meson: Set proper soversion and version to libraries
Soname of the libraries should be the major version number, while the version
triplet is currently used:
  objdump -p libmutter-4.so.0.0.0 | grep SONAME
    SONAME               libmutter-4.so.0.0.0

While is expected to be only libmutter-4.so.0

Fix all shared libraries by setting valid version and soversion.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/3955
2019-01-23 13:03:40 +00:00
Marco Trevisan (Treviño)
371b97af27 meson: Fix map files and load them to hide private symbols
Map files were using wrong syntax (missing final `;` or invalid chars).

Also, the map files were only monitored for rebuilding, but not really used by
ld, so pass the ldflags with version-script so that private symbols are really
hidden.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/395
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
548c0f16f4 cogl: Remove redundant function declarations 2019-01-22 18:31:52 +01:00
Jonas Ådahl
bbd295ae09 cogl: Fix const qualifier usage 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
Florian Müllner
d360b25b81 build: Install .pc files in correct location
If a library is provided in the positional arguments, then meson
defaults to installing the .pc file in a 'pkgconfig' subdirectory
in the library's install location. We want the files in the regular
$libdir/pkgconfig rather than $libdir/mutter-$api/pkgconfig, so
specify the location explicitly in the parameters.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/382
2019-01-08 22:36:20 +01:00