summaryrefslogtreecommitdiff
path: root/src/x11/xprops.h
diff options
context:
space:
mode:
authorDaniel van Vugt <daniel.van.vugt@canonical.com>2018-08-02 19:03:30 +0800
committerJonas Ã…dahl <jadahl@gmail.com>2019-09-02 16:41:13 +0000
commit14c706e51b4d70ac4046ea3c8bacd7292681651c (patch)
tree19cfff38f726d8e6bbb6f67d71a1845b1a2d228a /src/x11/xprops.h
parenta70823dd1ca3a0892f7b5fa9c7fe88d885d306eb (diff)
downloadmutter-14c706e51b4d70ac4046ea3c8bacd7292681651c.tar.gz
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
Diffstat (limited to 'src/x11/xprops.h')
0 files changed, 0 insertions, 0 deletions