Class Device

java.lang.Object
io.github.jwharm.cairobindings.Proxy
org.freedesktop.cairo.Device
All Implemented Interfaces:
AutoCloseable
Direct Known Subclasses:
Script

public class Device extends Proxy implements AutoCloseable
Devices are the abstraction Cairo employs for the rendering system used by a Surface. You can get the device of a surface using Surface.getDevice().

Devices are created using custom functions specific to the rendering system you want to use. See the documentation for the surface types for those functions.

An important function that devices fulfill is sharing access to the rendering system between Cairo and your application. If you want to access a device directly that you used to draw to with Cairo, you must first call flush() to ensure that Cairo finishes all operations on the device and resets it to a clean state.

Cairo also provides the functions acquire() and release() to synchronize access to the rendering system in a multithreaded environment. This is done internally, but can also be used by applications.

Please refer to the documentation of each backend for additional usage requirements, guarantees provided, and interactions with existing surface API of the device functions for surfaces of that type.

Since:
1.10