Commit Graph

24112 Commits

Author SHA1 Message Date
Georges Basile Stavracas Neto
3004c5423b
clutter/actor: Revert transform order
When doing affine transforms on 2D and 3D spaces, operations are
done relative to the origin. That means that, when applying
rotations and scales, we must:

 * translate (-anchor_x, -anchor_y, -anchor_z)
 * apply the operation
 * translate (anchor_x, anchor_y, anchor_z)

Since OpenGL has its matrices applied in the reverse order, the
usual way to do it is, then:

 * translate (anchor_x, anchor_y, anchor_z)
 * apply the operation
 * translate (-anchor_x, anchor_y, anchor_z)

However, graphene matrices do not follow the GL format, so matrix
operations are done as the first example. Now that we are using
graphene_matrix_t for every matrix operation, the transform order
is wrong.

Apply the transform operations in the opposite order.
2019-03-20 15:17:16 +00:00
Georges Basile Stavracas Neto
1428280054
cogl/matrix: Fix rotation 2019-03-20 15:17:15 +00:00
Georges Basile Stavracas Neto
c356a2da83
clutter/offscreen-effect: Remove implicit API 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
82382ddc2d
clutter: Use graphene to interpolate matrixes 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
5790c23112
Replace ClutterGeometry by graphene_rect_t
https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-03-20 15:16:53 +00:00
Georges Basile Stavracas Neto
13cac6bcf8
Replace ClutterRect by graphene_rect_t
https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-03-20 15:16:52 +00:00
Georges Basile Stavracas Neto
eb10b79cb0
Replace ClutterPoint by graphene_point_t
https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-03-20 15:16:52 +00:00
Georges Basile Stavracas Neto
a06ad3a923
Replace ClutterSize by graphene_size_t
https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-03-20 15:16:52 +00:00
Georges Basile Stavracas Neto
cb36a7363f
clutter: Set progress function on graphene_point3d_t
This was dropped by the previous commit.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-03-20 15:16:52 +00:00
Georges Basile Stavracas Neto
4dd3e00609
Replace ClutterVertex by graphene_point3d_t
Pretty direct and straightforward port. This requires
a GNOME Shell counterpart.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-03-20 15:16:51 +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
b1255bddcd
clutter: Pull in Clutter dependencies
Mutter requires Clutter, which requires Cogl. That means
Clutter requires all Cogl dependencies, and Mutter requires
all Clutter dependencies as well.

However, currently, Clutter does not pull in its dependencies,
which means we need to link against Cogl manually.

Add Clutter dependencies to declare_dependency() so that the
graphene dependency only needs to be declared once, for Cogl,
and pulled together.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-03-20 15:16:50 +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
5d9c8b072e
ci: Update gsettings-desktop-schemas URL
https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-03-20 15:16:50 +00:00
Georges Basile Stavracas Neto
8955f159ff
clutter/tests: Rename variable
Graphene uses C99 and includes stdbool.h, which adds a
new 'bool' type. Clutter has an a11y test that names a
variable as 'bool' too, and they do not play well together.

Rename this variable to boolean.

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
3190692601
clutter/actor: Drop ClutterActor:clip property
This is a deprecated property that is not used anywhere
in the codebase. Not by GNOME Shell. Because it uses the
deprecated ClutterGeometry type, it's a good target for
cleaning up, given that ClutterGeometry will be dropped
later on.

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
Carlos Garnacho
f0b9654deb core: Remove startup sequences after timeout
The complete/remove semantics were split to cater for presenting windows,
so we must now separately do both here.

Related: https://gitlab.gnome.org/GNOME/mutter/issues/501
2019-03-18 18:06:01 +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
Jonas Ådahl
00b4556051 constraints: Don't use intersection when sliding with custom rule
If an intersection is empty, the (x, y) coordinates are undefined, so
just use the work area and in-progress constrained window rect when
sliding according to the SLIDE_X or SLIDE_Y custom placement rule.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/496
2019-03-17 14:12:40 +00:00
Jonas Ådahl
86b5247770 constraints: Only get parent rect once when placement rule constraining
We got it in a switch case, then again when finalizing. Only get it once
instead.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/496
2019-03-17 14:12:40 +00:00
Jonas Ådahl
23f31e518e constraints: Only readjust placement constraint when not checking
When check_only is TRUE, the constraint should not be applied, just
checked. We failed to comply here when a placed transient window was
to be moved together with its parent, updating the window position
directly even if check_only was TRUE.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/496
2019-03-17 14:12:40 +00:00