Skip to content
  • Daniel van Vugt's avatar
    clutter: Introduce geometric picking · 14c706e5
    Daniel van Vugt authored and Jonas Ådahl's avatar Jonas Ådahl committed
    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 di...
    14c706e5