Commit Graph

26509 Commits

Author SHA1 Message Date
Georges Basile Stavracas Neto
02a30f2a22 cogl/matrix: Multiply using graphene matrices
At this point, we are still only changing CoglMatrix APIs internally, and
it should still produce the same output as before.

To achieve this, using graphens matrix implementation, we need to exploit
some knowledge about conventions used in Cogl and graphene respectively.

In Cogl, transformation matrices are equivalent to those of affine
transformation matrices. The convention used by graphene, however, is to
operate on matrices that are transposed compared to their affine
counterparts.

So for example, let's say we want to multiply the affine matrices A and B,
to get C.

  A × B = C

The first step is to convert A and B to graphene matrices. We do this by
importing the floating point array, importing it directly using graphene.

Cogl exports its matrix to a column major floating point array. When we
import this in graphene, being row major, we end up with the same matrix,
only transposed.

Cogl       Graphene

  A   <===>   Aᵀ
  B   <===>   Bᵀ

We then multiply these imported matrices in reverse

  Bᵀ × Aᵀ

which in turn, due to ABᵀ = BᵀAᵀ, gives us

  Bᵀ × Aᵀ = (A × B)ᵀ

Our original goal was to find C, thus we know that

  A × B = C

That means we can shuffle things around a bit.

  A × B = C

  Bᵀ × Aᵀ = (A × B)ᵀ

  Bᵀ × Aᵀ = Cᵀ

With the same conversion as done when going from Cogl to graphene, only
the other way around, we still end up effectively transposing the matrix
during the conversion.

Graphene      Cogl

   Cᵀ  <===>   C

Thus when converting Cᵀ to Cogl, we in fact end up with C.

(Explanation authored by Jonas Ådahl)

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:46 +00:00
Georges Basile Stavracas Neto
2b9ce99ff2 cogl/matrix: Translate using graphene
Add conversion helpers (from and to graphene_matrix_t), and replace
the translation code to use graphene matrices internally.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:46 +00:00
Georges Basile Stavracas Neto
55b05e5631 Don't access CoglMatrix struct fields
Instead, use the new cogl_matrix_get_value() API.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:46 +00:00
Georges Basile Stavracas Neto
8e125fbab6 cogl/matrix: Add cogl_matrix_get_value
This will allow us stop accessing members of the structure
directly. Also mark all struct members as private.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:46 +00:00
Georges Basile Stavracas Neto
e06139323b clutter/util: Remove unused functions
After transitioning to purely graphene-based matrix interpolation,
these functions are unused.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:46 +00:00
Georges Basile Stavracas Neto
8fc3d296b6 clutter/cogl: Use graphene to progress matrices
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:46 +00:00
Georges Basile Stavracas Neto
f61377bb5e clutter/util: Make ClutterVertex4 internal to clutter-util.c
It's an implementation detail now, and not used not exposed anywhere.
One less Clutter type for us to deal with \o/

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:46 +00:00
Georges Basile Stavracas Neto
eed3c62751 clutter/util: Replace ClutterVertex4 with graphene_vec4_t in public API
Soon, ClutterVertex4 will be internal to clutter-util.c, and only for the
_clutter_util_fully_transform_vertices() function, so remove it from all
public API.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:46 +00:00
Georges Basile Stavracas Neto
fe0a325e9f cogl/matrix: Import skew functions from Clutter
Graphene provides skewing as part of graphene_matrix_t API, and it'll
be easier for the transition to just expose similar API surfaces.

Move the matrix skew methods to CoglMatrix.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:46 +00:00
Georges Basile Stavracas Neto
566b081cd7 cogl/tests: Compare matrices using array
We'll remove direct access to CoglMatrix struct fields, so update
the test to not access them already.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:46 +00:00
Georges Basile Stavracas Neto
dc9c1f8983 Remove ClutterMatrix
Good bye. You won't be missed.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:46 +00:00
Georges Basile Stavracas Neto
eee2e331fd cogl/matrix: Add constant identity initializer
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:46 +00:00
Georges Basile Stavracas Neto
a761caf079 cogl/matrix: Add cogl_matrix_init_from_matrix initializer
It does a simple memcpy() to clone the entire structure. This will
be necessary for a smoother removal of ClutterMatrix.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:46 +00:00
Georges Basile Stavracas Neto
c2dbdb3703 clutter: Add progress function for CoglMatrix
So that we can remove the custom ClutterMatrix type that plagues
the codebase.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:46 +00:00
Georges Basile Stavracas Neto
1a9f9b0164 cogl: Remove unused header
Not included nor used anywhere.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:46 +00:00
Georges Basile Stavracas Neto
9b8eaff196 build: Bump graphene requirement to 1.10.2
We will depend on various graphene_matrix_* APIs introduced by 1.10.2.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:45 +00:00
Carlos Garnacho
b9e5a2d6e2 backends/native: Wait to have an stage before emitting CLUTTER_DEVICE_ADDED
During seat initialization, we process early libinput events (adding all known
devices) before the seat gets a stage assigned. This causes warnings when trying
to handle the corresponding CLUTTER_DEVICE_ADDED events, as they are sent
stageless.

As it is definitely too soon to have those events sent meaningfully, filter
those events out and instead handle the CLUTTER_DEVICE_ADDED emission for all
known devices after the seat receives an stage. This makes the events guaranteed
to be emitted early in initialization, but not so soon that they can't be
handled yet.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1472
2020-10-06 13:29:59 +00:00
Florian Müllner
ea179ed8d4 Bump version to 40.alpha
The GNOME project has adopted a new versioning scheme[0], and
GNOME 3.38 will be followed by GNOME 40.

Open the new development cycle by switching to the new scheme, as
well as to post-release bumps as recommended.

[0] https://discourse.gnome.org/t/new-gnome-versioning-scheme/4235

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1473
2020-10-06 15:14:37 +02:00
Florian Müllner
f481cbfa16 plugin: Drop version information
Mutter itself is versioned now, so passing the version information
to the plugin is redunant now: The version is already determined by
linking to a particular API version (gnome-shell) or by installing
to a versioned plugin path (external plugins).

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1473
2020-10-06 15:14:34 +02:00
Florian Müllner
113446f2e9 Bump version to 3.38.1
Update NEWS.
2020-10-05 19:55:19 +02:00
Jonas Ådahl
209b1ba383 clutter/frame-clock: Adapt refresh rate from to frame info
We should update to whatever refresh rate that comes our way, in
particular on X11, as this may change over time.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1430
2020-10-05 11:27:05 +00:00
Jordi Mas
505b3481cd Update Catalan translation 2020-10-03 23:14:34 +02:00
Sergio Costas
5afdbc669d wayland/client: Free GSubprocessLauncher after spawning
A Meta.WaylandClient() object has a GSubprocessLauncher object
passed externally. Currently this object is kept while the
WaylandClient object exists, but is is only needed until the call
to spawn is made.

This patch frees that GSubprocessLauncher just after that call,
thus freeing those resources.

Fix https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1462
2020-10-02 15:37:52 +00:00
Robert Mader
78592cbcc8 surface-actor: Simplify culling logic
This reverts the commits 372d73e275 and 1d20045247 - the special
case for alpha-less textures could only happen on Wayland, but now
the opaque region is also set in those cases.

This commit saves us some allocations, simplifies the logic a bit and
makes sure culling uses the same opaque region as our painting paths.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1463
2020-10-02 15:09:12 +00:00
Robert Mader
71f03a718d wayland/actor-surface: Always set opaque region on alpha-less textures
Wayland clients using buffers without alpha channel are not expected to
set an opaque region. However, we rely on the opaque region for the fast
painting path in `MetaShapedTexture`.

Thus, make sure to always set an opaque region internally in those cases.
For X11 clients, wo do so already.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1463
2020-10-02 15:09:12 +00:00
Daniel van Vugt
64d34a7648 background-content: Apply Cullable clipping even in the transformed case
Just like we used to before 30809665d8.

Because in some cases `clip_region` is able to shave off an extra pixel
from the edge of the redraw rectangle(s). And not shaving that off was
making the background rendering inconsistent with shaped-texture, causing
occasional off-by-one artefacts. Now both shaped-texture and
background-content agree on the clip region again that doesn't happen.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1443

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1464
2020-10-01 18:13:15 +08:00
Carlos Garnacho
4e9a2e4799 build: Do not provide built sources as libmutter_dep sources
This is essentially a revert of
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/326. This commit
had the unintended side effect that the built sources are actually
rebuilt for every individual user of libmutter_dep. With there being more
tests and generated files, the number of targets to build is increasing
squarely.

Not doing this reduces the number of targets from 2044 to 874, thus
saving man hours and CI burnt cycles in the long run. There's the slight
risk of reintroducing the random build breaks, but mutter is essentially
doing as suggested at https://github.com/mesonbuild/meson/issues/1084
(the only difference being addressed in the previous commit), so meson
ought to behave as expected.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1458
2020-09-30 18:44:33 +00:00
Carlos Garnacho
4dbf2dea05 build: Build libmutter using sources as positional arguments
The "sources" keyword argument does not seem documented at
https://mesonbuild.com/Reference-manual.html#shared_library or
the related objects.

It may work, but let's use meson as intended.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1458
2020-09-30 18:44:33 +00:00
Carlos Garnacho
089be8b71d backends: Ensure to clear the last updated device on device removal
If the last updated device is removed, ensure that it does result in
a ::last-device-changed with a NULL device.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1460
2020-09-30 18:26:20 +00:00
Carlos Garnacho
86fa8aff4a core: Do not update last device on CLUTTER_DEVICE_ADDED/REMOVED
We only update the last device from actual input interaction here,
avoid this pair of events. This is specially nasty with
CLUTTER_DEVICE_REMOVED, since the device we're notifying upon will be
disposed soon after emission.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1460
2020-09-30 18:26:20 +00:00
Carlos Garnacho
16139efa5c backends: Do not use stack-allocated ClutterEvents
Use ClutterEvent* and clutter_event_new() to always allocate events.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1460
2020-09-30 18:26:20 +00:00
Carlos Garnacho
6664044679 clutter: Do not use stack-allocated ClutterEvents
Use ClutterEvent* and clutter_event_new() to always allocate events.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1460
2020-09-30 18:26:20 +00:00
Jonas Ådahl
df228e8945 screen-cast/area-src: Clear framebuffer before painting stage
We'll be painting to a framebuffer that may not be completely covered by
the painted areas, meaning the not painted areas would end up undefined,
thus potentially contain garbage or old content.

Avoid this by clearing the framebuffer before painting the stage.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1442

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1459
2020-09-30 15:56:07 +00:00
Daniel van Vugt
67cc60cbda clutter: Align all screen transformations to 1/256th of a stage unit.
So as to eliminate floating point precision errors that creep in
during matrix operations.

1/256th is chosen as a reasonable maximum resolution to cover any
realistic fractional scaling factor. Floats can represent such
a fraction losslessly because it is a small power of 2.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1403

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1429
2020-09-30 14:17:53 +08:00
Carlos Garnacho
3a273028ae backends/x11: Set stage on logical keyboard device
Like it's done for the pointer in other places. Without a stage assigned,
some bits (like IM handling) may end up with events ignored, and misbehave.

Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1413
2020-09-29 21:26:26 +00:00
Sergio Costas
533882ab77 wayland: Fix refcount error
The Meta.WaylandClient constructor receives a GSubprocessLauncher
as a parameter, and stores it internally. Unfortunately, its
refcount value isn't increased, which results in the object being
released twice.

This patch fixes this bug.

Fix https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1454
2020-09-29 20:44:25 +00:00
Yosef Or Boczko
544b92d15a Update Hebrew translation 2020-09-28 19:08:48 +00:00
Simon McVittie
8ae641aa24 cogl tests: Show the actual output from tests if VERBOSE is set
Writing tests' output to a log file makes them difficult to debug when
the test might be running on an autobuilder or CI system where only
stdout/stderr are recorded. This is particularly troublesome if a
failure is only reproducible on a particular autobuilder.

Recent Automake versions have the convention that detailed output from
failing tests is written to stdout/stderr, not just to log files, when
the VERBOSE environment variable is set; borrow that convention as a
trigger for producing detailed test output.

This was originally cogl!14, but applies equally to mutter's fork of cogl.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1273

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-09-28 13:58:19 +00:00
Karol Herbst
9b9b912765 backends: force enable modifiers on tagged devices
Some devices can't scanout to linear buffers directly as the hw is not
capable of eg rendering into a linear depth buffer.

Add code to force kms-modifiers on udev taged devices.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1408

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1443
2020-09-28 14:00:44 +02:00
Robert Mader
82fffacbae wayland: Add versions to primary selection protocols
Just so we follow convention - those versions are unlikely to ever change.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1452
2020-09-27 17:20:23 +02:00
Ray Strode
1e78d90a37 barriers: Free backend implementation at dispose time
When a MetaBarrier is first created it allocates a backend
impl object which does the actual heavy lifting.

Unfortunately, that backend object is never freed.

This commit ensures the implementation gets freed when
the barrier object is freed.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1451
2020-09-27 00:38:58 -04:00
Ray Strode
97f10a0d21 barriers: Fix leak in meta_barrier_destroy
meta_barrier_destroy is responsible for removing the extra
reference added in meta_barrier_constructed.

Unfortunately, it fails to do this because of a misplaced early
return statement.

This commit removes the spurious return.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1449
2020-09-26 22:55:37 -04:00
Rafael Fontenelle
38a96cc104 Update Brazilian Portuguese translation 2020-09-23 19:15:53 +00:00
Carlos Garnacho
a270b6a2ce clutter: Drop _clutter_clear_events_queue_for_stage()
There's only one stage. Let's not overcomplicate things, as it
will not be possible to simply go through the event queue inspecting
every event.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1448
2020-09-23 16:49:32 +02:00
Carlos Garnacho
41042b18d6 backends/native: Remove unused function
This meta_seat_native_get_device() function has been unused for some time.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1448
2020-09-23 16:32:18 +02:00
Carlos Garnacho
f7d0f2ce20 backends: Drop unused function
This meta_input_settings_get_tablet_mapping() was never necessary outside
MetaInputSettings, nor used. It can simply go away.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1448
2020-09-23 16:32:13 +02:00
Carlos Garnacho
a72ab765c9 core: Do not force cursor renderer update here
This is already taken care of in meta_backend_monitors_changed(), called
from the same code paths that emit ::monitors-changed-internal. It is
better to leave this up to backend internals.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1448
2020-09-23 16:32:11 +02:00
Carlos Garnacho
978e6511e0 core: Remove unused struct field
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1448
2020-09-23 16:32:07 +02:00
Carlos Garnacho
df89c30241 backends: Drop unused function
meta_cursor_tracker_get_displayed_cursor() is used nowhere.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1448
2020-09-23 16:32:02 +02:00
Daniel van Vugt
647eec5f7f cogl: Flush specific framebuffers
This resolves a couple of FIXMEs. The FIXME comments were right in
stating that not *all* journals needed flushing, only the one we
are trying to put on screen needs flushing.

However we can't eliminate all flushes because the winsys swap calls
that follow go directly into OpenGL which knows nothing about cogl
journalling. So the journal *must* be flushed before the swap, to give
OpenGL the correct state.

P.S. If this turns out to cause any bugs then the next best answer is
to just remove the FIXME comments. Because flushing is still the right
thing to do.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1362
2020-09-18 11:59:52 +00:00