mutter/clutter/clutter/deprecated
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
..
clutter-actor-deprecated.c clutter: Remove unused deprecated/clutter-shader.c 2019-02-28 10:35:29 -05:00
clutter-actor.h clutter: Remove unused deprecated code from clutter-actor-deprecated.c 2019-02-27 03:32:21 +00:00
clutter-alpha.c clutter: Unconditionally include clutter-build-config.h 2018-11-06 17:17:36 +01:00
clutter-alpha.h clutter: Remove clutter specific version 2018-11-06 17:17:36 +01:00
clutter-animatable.h clutter: Remove clutter specific version 2018-11-06 17:17:36 +01:00
clutter-animation.c clutter: Remove marshallers that are available in GLib 2019-08-19 13:09:56 +00:00
clutter-animation.h clutter: Remove clutter specific version 2018-11-06 17:17:36 +01:00
clutter-behaviour-depth.c clutter: Unconditionally include clutter-build-config.h 2018-11-06 17:17:36 +01:00
clutter-behaviour-depth.h clutter: Remove clutter specific version 2018-11-06 17:17:36 +01:00
clutter-behaviour-opacity.c clutter: Unconditionally include clutter-build-config.h 2018-11-06 17:17:36 +01:00
clutter-behaviour-opacity.h clutter: Remove clutter specific version 2018-11-06 17:17:36 +01:00
clutter-behaviour-scale.c clutter: Unconditionally include clutter-build-config.h 2018-11-06 17:17:36 +01:00
clutter-behaviour-scale.h clutter: Remove clutter specific version 2018-11-06 17:17:36 +01:00
clutter-behaviour.c clutter: Remove marshallers that are available in GLib 2019-08-19 13:09:56 +00:00
clutter-behaviour.h clutter: Remove clutter specific version 2018-11-06 17:17:36 +01:00
clutter-bin-layout.h clutter: Remove clutter specific version 2018-11-06 17:17:36 +01:00
clutter-box.c clutter: Unconditionally include clutter-build-config.h 2018-11-06 17:17:36 +01:00
clutter-box.h clutter: Remove clutter specific version 2018-11-06 17:17:36 +01:00
clutter-cairo-texture.c clutter: Unconditionally include clutter-build-config.h 2018-11-06 17:17:36 +01:00
clutter-cairo-texture.h clutter: Remove clutter specific version 2018-11-06 17:17:36 +01:00
clutter-container.h clutter: Remove clutter specific version 2018-11-06 17:17:36 +01:00
clutter-group.c clutter: Unconditionally include clutter-build-config.h 2018-11-06 17:17:36 +01:00
clutter-group.h clutter: Remove clutter specific version 2018-11-06 17:17:36 +01:00
clutter-keysyms.h move everything into a clutter/ directory 2016-04-12 20:04:26 +02:00
clutter-layout-manager-deprecated.c clutter: Unconditionally include clutter-build-config.h 2018-11-06 17:17:36 +01:00
clutter-rectangle.c clutter-rectangle: Remove cogl_rectangle() 2018-11-18 20:28:39 -02:00
clutter-rectangle.h clutter: Remove clutter specific version 2018-11-06 17:17:36 +01:00
clutter-stage-manager.h clutter: Remove clutter specific version 2018-11-06 17:17:36 +01:00
clutter-stage.h clutter: Remove clutter specific version 2018-11-06 17:17:36 +01:00
clutter-state.c clutter: Remove marshallers that are available in GLib 2019-08-19 13:09:56 +00:00
clutter-state.h clutter: Remove the rest of deprecated/clutter-animator.c 2019-02-27 03:32:21 +00:00
clutter-table-layout.c clutter: Unconditionally include clutter-build-config.h 2018-11-06 17:17:36 +01:00
clutter-table-layout.h clutter: Remove clutter specific version 2018-11-06 17:17:36 +01:00
clutter-texture.c clutter: Introduce geometric picking 2019-09-02 16:41:13 +00:00
clutter-texture.h clutter: Remove clutter specific version 2018-11-06 17:17:36 +01:00
clutter-timeline.h clutter: Remove clutter specific version 2018-11-06 17:17:36 +01:00