Changeset View
Changeset View
Standalone View
Standalone View
src/server/buffer_interface.h
Show All 28 Lines | |||||
29 | struct wl_shm_buffer; | 29 | struct wl_shm_buffer; | ||
30 | 30 | | |||
31 | namespace KWayland | 31 | namespace KWayland | ||
32 | { | 32 | { | ||
33 | namespace Server | 33 | namespace Server | ||
34 | { | 34 | { | ||
35 | class SurfaceInterface; | 35 | class SurfaceInterface; | ||
36 | 36 | | |||
37 | namespace LinuxDmabuf | ||||
38 | { | ||||
39 | class Buffer; | ||||
40 | } | ||||
37 | 41 | | |||
38 | /** | 42 | /** | ||
39 | * @brief Reference counted representation of a Wayland buffer on Server side. | 43 | * @brief Reference counted representation of a Wayland buffer on Server side. | ||
40 | * | 44 | * | ||
41 | * This class encapsulates a rendering buffer which is normally attached to a SurfaceInterface. | 45 | * This class encapsulates a rendering buffer which is normally attached to a SurfaceInterface. | ||
42 | * A client should not render to a Wayland buffer as long as the buffer gets used by the server. | 46 | * A client should not render to a Wayland buffer as long as the buffer gets used by the server. | ||
43 | * The server signals whether it's still used. This class provides a convenience access for this | 47 | * The server signals whether it's still used. This class provides a convenience access for this | ||
44 | * functionality by performing reference counting and deleting the BufferInterface instance | 48 | * functionality by performing reference counting and deleting the BufferInterface instance | ||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 72 | public: | |||
100 | * @returns The SurfaceInterface this BufferInterface is attached to. | 104 | * @returns The SurfaceInterface this BufferInterface is attached to. | ||
101 | **/ | 105 | **/ | ||
102 | SurfaceInterface *surface() const; | 106 | SurfaceInterface *surface() const; | ||
103 | /** | 107 | /** | ||
104 | * @returns The native wl_shm_buffer if the BufferInterface represents a shared memory buffer, otherwise @c nullptr. | 108 | * @returns The native wl_shm_buffer if the BufferInterface represents a shared memory buffer, otherwise @c nullptr. | ||
105 | **/ | 109 | **/ | ||
106 | wl_shm_buffer *shmBuffer(); | 110 | wl_shm_buffer *shmBuffer(); | ||
107 | /** | 111 | /** | ||
112 | * Returns a pointer to the LinuxDmabuf::Buffer when the buffer is a dmabuf buffer, and nullptr otherwise. | ||||
113 | */ | ||||
114 | LinuxDmabuf::Buffer *linuxDmabufBuffer(); | ||||
115 | /** | ||||
108 | * @returns the native wl_resource wrapped by this BufferInterface. | 116 | * @returns the native wl_resource wrapped by this BufferInterface. | ||
109 | **/ | 117 | **/ | ||
110 | wl_resource *resource() const; | 118 | wl_resource *resource() const; | ||
111 | 119 | | |||
112 | /** | 120 | /** | ||
113 | * Creates a QImage for the shared memory buffer. | 121 | * Creates a QImage for the shared memory buffer. | ||
114 | * | 122 | * | ||
115 | * If the BufferInterface does not reference a shared memory buffer a null QImage is returned. | 123 | * If the BufferInterface does not reference a shared memory buffer a null QImage is returned. | ||
▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines |