mutter/src
Daniel van Vugt 14c706e51b clutter: Introduce geometric picking
Currently, Clutter does picking by drawing with Cogl and reading
the pixel that's beneath the given point. Since Cogl has a journal
that records drawing operations, and has optimizations to read a
single pixel from a list of rectangle, it would be expected that
we would hit this fast path and not flush the journal while picking.

However, that's not the case: dithering, clipping with scissors, etc,
can all flush the journal, issuing commands to the GPU and making
picking slow. On NVidia-based systems, this glReadPixels() call is
extremely costly.

Introduce geometric picking, and avoid using the Cogl journal entirely.
Do this by introducing a stack of actors in ClutterStage. This stack
is cached, but for now, don't use the cache as much as possible.

The picking routines are still tied to painting.

When projecting the actor vertexes, do it manually and take the modelview
matrix of the framebuffer into account as well.

CPU usage on an Intel i7-7700, tested with two different GPUs/drivers:

  |         |     Intel | Nvidia |
  | ------: | --------: | -----: |
  | Moving the mouse:            |
  | Before  |       10% |    10% |
  | After   |        6% |     6% |
  | Moving a window:             |
  | Before  |       23% |    81% |
  | After   |       19% |    40% |

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/154,
        https://gitlab.gnome.org/GNOME/mutter/issues/691

Helps significantly with: https://gitlab.gnome.org/GNOME/mutter/issues/283,
                          https://gitlab.gnome.org/GNOME/mutter/issues/590,
                          https://gitlab.gnome.org/GNOME/mutter/issues/700

v2: Fix code style issues
    Simplify quadrilateral checks
    Remove the 0.5f hack
    Differentiate axis-aligned rectangles

https://gitlab.gnome.org/GNOME/mutter/merge_requests/189
2019-09-02 16:41:13 +00:00
..
backends cogl: Remove GLX "threaded swap wait" used on Nvidia 2019-09-02 18:12:10 +08:00
compositor clutter: Introduce geometric picking 2019-09-02 16:41:13 +00:00
core core: Fix multiple reparent requests handling 2019-09-02 15:50:37 +00:00
meta main: Add test initialization function 2019-08-27 16:34:01 +00:00
tests clutter: Introduce geometric picking 2019-09-02 16:41:13 +00:00
ui cleanup: Don't use g_memmove() 2019-07-18 11:01:09 +02:00
wayland window-actor: Add 'damaged' signal 2019-08-27 15:31:25 +00:00
x11 x11: Add window test before accessing reparents_pending field 2019-09-02 18:27:37 +02:00
libmutter.pc.in
meson.build clutter: Move evdev input to src/backends/native 2019-08-24 08:59:08 +00:00
meta-marshal.list cursor-tracker: Use our own marshal for cursor-moved 2019-07-31 09:34:17 +00:00
org.freedesktop.login1.xml
org.gnome.Mutter.DisplayConfig.xml
org.gnome.Mutter.IdleMonitor.xml
org.gnome.Mutter.RemoteDesktop.xml
org.gnome.Mutter.ScreenCast.xml