Commit Graph

2189 Commits

Author SHA1 Message Date
Georges Basile Stavracas Neto
1428280054
cogl/matrix: Fix rotation 2019-03-20 15:17:15 +00:00
Georges Basile Stavracas Neto
5289026257
cogl/graphene-utils: Simplify 2019-03-20 15:17:15 +00:00
Georges Basile Stavracas Neto
b1c0128a2b
fixup! cogl/matrix: Scale using Graphene 2019-03-20 15:17:15 +00:00
Georges Basile Stavracas Neto
f5fe0c05ab
Scale matrices before rotating and translating
This is the correct operation.
2019-03-20 15:17:15 +00:00
Georges Basile Stavracas Neto
a9d32be61e
cogl/matrix: Make it row-major 2019-03-20 15:17:14 +00:00
Georges Basile Stavracas Neto
2ed596088f
cogl/matrix: Translate using Graphene 2019-03-20 15:17:14 +00:00
Georges Basile Stavracas Neto
7f708ce39e
cogl/tests: Temporarily mark euler-quaternion as failing 2019-03-20 15:17:14 +00:00
Georges Basile Stavracas Neto
a127360df1
cogl/matrix: Apply look-at using Graphene 2019-03-20 15:17:13 +00:00
Georges Basile Stavracas Neto
8ff79c3b7d
cogl/matrix: Init from quaternion or euler using graphene 2019-03-20 15:17:13 +00:00
Georges Basile Stavracas Neto
1aac180e8d
cogl/matrix: Rotate using graphene 2019-03-20 15:17:13 +00:00
Georges Basile Stavracas Neto
d0590de9e8
cogl/matrix: Apply perspective with Graphene 2019-03-20 15:17:13 +00:00
Georges Basile Stavracas Neto
7c909d184c
cogl/matrix: Apply orthographic with graphene 2019-03-20 15:17:12 +00:00
Georges Basile Stavracas Neto
10f1d3118c
cogl/matrix: Frustum with graphene 2019-03-20 15:17:12 +00:00
Georges Basile Stavracas Neto
08015ce784
cogl/matrix: Remove more dead code 2019-03-20 15:17:12 +00:00
Georges Basile Stavracas Neto
25c7d15040
cogl/matrix: Remove cogl_matrix_ortho
It's deprecated and unused, and will only complicate transitioning
to Graphene even further.
2019-03-20 15:17:12 +00:00
Georges Basile Stavracas Neto
ecee159113
cogl/matrix: Scale using Graphene
It sucks that we have to double transpose the matrix.
2019-03-20 15:17:12 +00:00
Georges Basile Stavracas Neto
bb257868f3
cogl/matrix: Remove matrix flags and types 2019-03-20 15:17:11 +00:00
Georges Basile Stavracas Neto
a055e443aa
cogl/matrix: Multiply using Graphene 2019-03-20 15:17:11 +00:00
Georges Basile Stavracas Neto
c938b25d6a
cogl/matrix: Invert matrices with Graphene 2019-03-20 15:17:11 +00:00
Georges Basile Stavracas Neto
8e2658a601
cogl/matrix: Init translation matrix using Graphene 2019-03-20 15:17:11 +00:00
Georges Basile Stavracas Neto
3e02a89c2a
cogl/matrix: Use Graphene to compare matrices 2019-03-20 15:17:11 +00:00
Georges Basile Stavracas Neto
10dd3399ca
cogl/matrix: Use graphene to transpose matrix 2019-03-20 15:17:10 +00:00
Georges Basile Stavracas Neto
92a58d9afa
cogl: Add Graphene utility functions to Cogl 2019-03-20 15:17:10 +00:00
Georges Basile Stavracas Neto
54f9bebeb8
cogl/matrix: Change semantincs of cogl_matrix_get_array
CoglMatrix.get_array() returns the column-major CoglMatrix itself,
since the first fields of the matrix is effectively an array of
floats, and we can just pretend it is. Of course, it basically
ignores any C-specific type checking.

WIP
2019-03-20 15:17:10 +00:00
Georges Basile Stavracas Neto
88be11f6e2
cogl/matrix-stack: Move GL code to GL 2019-03-20 15:17:10 +00:00
Georges Basile Stavracas Neto
97206476ac
cogl/matrix-stack: Use graphene types on entries
This will help moving to graphene_matrix_t, since the convertions
between nodes and graphene types won't be necessary anymore.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-03-20 15:16:53 +00:00
Georges Basile Stavracas Neto
c66221db76
Replace CoglVector* by graphene_vec*_t
This is an extremely straightforward and minimalistic port of
CoglVector APIs to the corresponding Graphene APIs.

Make ClutterPlane use graphene_vec3_t internally too, for the
simplest purpose of keeping the patch focused.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-03-20 15:16:51 +00:00
Georges Basile Stavracas Neto
41a03f0589
Replace CoglQuaternion by graphene_quaternion_t
Same story, but smaller damage area. CoglQuaternion was used
in fewer places than CoglEuler, resulting in a smaller patch.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-03-20 15:16:51 +00:00
Georges Basile Stavracas Neto
4a4a423182
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-03-20 15:16:51 +00:00
Georges Basile Stavracas Neto
9cc096d189
Add Graphene dependency
Graphene is a small library with data types and APIs
specially crafted to computer graphics. It contains
performant implementations of matrices, vectors, points
and rotation tools. It is performance because, among
other reasons, it uses vectorized processor commands
to compute various operations.

Add Graphene dependency to Mutter.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-03-20 15:16:50 +00:00
Georges Basile Stavracas Neto
844722e8aa
cogl/tests: Remove usage of implicit API from color-mask test
Small cleanup that I happened to have here.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-03-20 15:16:49 +00:00
Georges Basile Stavracas Neto
c829fd3374
Remove fog support
Fog is explicitly deprecated in favour of CoglSnippet API,
and in nowhere we are using this deprecated feature, which
means we can simply drop it without any sort of replacement.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-03-20 15:16:47 +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
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)
7f551ba776 meson: Don't list libraries private dependencies in pc files
pkg-config files for mutter are generated using *_pkg_deps as requires, but
programs linked with libmutter doesn't need most of these private dependencies
which are only needed for building and linking mutter and its subprojects.

So list packages needed only by mutter itself inside *_pkg_private_deps and
don't expose such packages to pkg-config, but only use them at build time.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/3955
2019-01-23 13:03:40 +00: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
c57ae7fc9c cogl/path: Don't depend on GL/glu.h
It's not needed for anything, and we can get rid of the dependency we
just added.

Also remove the installation step from Dockerfile.
2019-01-22 19:06:14 +01: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