Commit Graph

5 Commits

Author SHA1 Message Date
Georges Basile Stavracas Neto
6c4b897d74 clutter/actor: Cull out when picking
Testing points and rays against boxes is substantially cheaper - in
fact, almost trivial - compared to triangles. Check if the actor's
paint volume doesn't intersect with the current pick point / ray,
and skip recursing altogether in those cases.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1520>
2020-11-25 16:34:29 +00:00
Georges Basile Stavracas Neto
c3534d3390 clutter/pick-context: Store point and ray on construction
It'll be used to do a quick box test to cull out while picking.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1520>
2020-11-25 16:34:29 +00:00
Georges Basile Stavracas Neto
f411834d42 Introduce ClutterPickStack
ClutterPickStack is a new boxed type that stores the vertices
and clip rectangles. It is meant to be a byproduct of picking,
and takes over most of what ClutterStage currently does.

It introduces a 'seal' system, inspired by MetaKmsUpdate. After
the pick operation is done, and the rectangles are collected,
the pick stack is sealed, and is not allowed to be externally
modified anymore. Internally, it still can invalidate pick
records when an actor is destroyed.

For now, it handles both the clip rectangles, and the matrix
stack, separatedly. Future commits will rearrange this.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1509
2020-10-26 09:56:42 -03:00
Georges Basile Stavracas Neto
a4961ad4a7 clutter/pick-context: Make pick context aware of the pick mode
Pass the pick mode during construction, and add a getter for it. It'll
be used by the next patches to make clutter_actor_should_pick_paint()
not depend on a global context.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1509
2020-10-26 09:20:38 -03:00
Jonas Ådahl
cb9d6b79ef clutter: Introduce pick contexts
Just as with painting, add a pick context that carries pick related
temporary state when doing actor picking. It is currently unused, and
will at least at first still carry around a framebuffer to deal track
view transforms etc.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00