• Kristian H. Kristensen's avatar
    clients: Nested compositor example · 1cc5ac34
    Kristian H. Kristensen authored
    A wayland compositor doesn't provide a mechanism for buffer sharing between
    clients.  Under X, one client can render to a Pixmap and another can use it
    as a source in a subsequent drawing operations.  Wayland doesn't have a
    mechanims to share Pixmaps or textures between clients like that, but it's
    possible for one client to act as a nested compositor to another client.
    This less work than it sounds, since the nested compositor won't have to
    provide input devices or even any kind of shell extension.  The nested
    compositor and its client can be very tightly coupled and have very specific
    expectations of what the other process should provide.
    In this example, nested.c is a toytoolkit application that uses cairo-gl
    for rendering and forks and execs nested-client.c.  As it execs the client,
    it passes it one end of a socketpair that will be the clients connection
    to the nested compositor.  The nested compositor doesn't even create a
    listening socket.
    The client is a minimal GLES2 application, which just renders a spinning
    triangle in its frame callback.
nested-client.c 8.59 KB