This adds support for doing incremental, clipped redraws but also using
flipping to present instead of blitting.
The approach builds on Cogl's support for cogl_onscreen_start_frame(),
cogl_onscreen_get_back_buffer_age() and
cogl_onscreen_swap_buffers_with_damage().
At the start of each frame we determine how old the back buffer contents
are and if it's a reused buffer we aim to repair the old buffer based on
the history of regions that have changed since the old buffer was
created. When we present we present the back buffer we use
cogl_onscreen_swap_buffers_with_damage() which the driver can implement
using a flip and the damage region can also be passed to a system
compositor to ensure it only recomposes the region that changed.
This gives each stage a dedicated 1 pixel framebuffer for handling
picking when we are only reading back a single point under the cursor.
Having a dedicated pick buffer means we can avoid damaging the contents
of the back buffer used for painting so we can re-use the contents of
old back buffers to reduce how much is drawn each frame.
Note that we don't create a full stage size pick buffer because we want
to avoid the large allocations of memory that would imply.
Note when a clutter scene is static then we will still use the back
buffer for picking so that we can do a full stage size pick render
without requiring the allocation of a dedicated buffer.
stage-window: make it possible to damage the back buffer
This allows us to report to the backend that the stage's back buffer has
been trashed while handling picking. If the backend is keeping track of
the contents of back buffers so it can minimize how much of the stage is
redrawn then it needs to know when we do pick renders so it can
invalidate the back buffer.
evdev: Adds api to release/reclaim the evdev devices
Clutter applications using evdev are typically fullscreen applications
associated with a single virtual termainal. When switching away from
the applications associated tty then Clutter should stop managing all
evdev devices and re-probe for devices when the application regains
focus by switching back to the tty. To facilitate this, this patch
adds clutter_evdev_release_devices() and clutter_evdev_reclaim_devices()
functions.
Reviewed-by: Neil Roberts <email address hidden>
Reviewed-by: Emmanuele Bassi <email address hidden>
When using the Wayland backend this sets a constraint that the
CoglRenderer selects the Wayland EGL winsys.
When a Wayland compositor display is set it now also sets a constraint
that the render should use EGL because only EGL renderers will set up
the required wl_drm global object.
device-manager-core-x11: Create core input devices as x11
The core input devices when XInput doesn't work were being created as
generic ClutterInputDevices instead of ClutterInputDeviceX11s. This
meant the keycode_to_evdev virtual wouldn't work.
Add an input device function to convert keycodes to evdev codes
This adds a virtual function to ClutterInputDevice to translate a
keycode from the hardware_keycode member of ClutterKeyEvent to an
evdev keycode. The function can fail so that input backends that don't
have a sensible way to translate to evdev keycodes can return FALSE.
There are implementations for evdev, wayland and X. The X
implementation assumes that the X server is using an evdev driver in
which case the hardware keycodes are the evdev codes plus 8.