Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: third_party/wayland-protocols/include/protocol/linux-explicit-synchronization-unstable-v1-client-protocol.h

Issue 2397843002: wayland-protocols: Add protocol for explicit synchronization support.
Patch Set: rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /* Generated by wayland-scanner 1.11.0 */
2
3 #ifndef LINUX_EXPLICIT_SYNCHRONIZATION_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define LINUX_EXPLICIT_SYNCHRONIZATION_UNSTABLE_V1_CLIENT_PROTOCOL_H
5
6 #include <stdint.h>
7 #include <stddef.h>
8 #include "wayland-client.h"
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 /**
15 * @page page_linux_explicit_synchronization_unstable_v1 The linux_explicit_sync hronization_unstable_v1 protocol
16 * Protocol for explicit synchronization
17 *
18 * @section page_desc_linux_explicit_synchronization_unstable_v1 Description
19 *
20 * This protocol specifies a set of interfaces used to provide explicit
21 * synchronization of buffers to the the client.
22 *
23 * Warning! The protocol described in this file is experimental and backward
24 * incompatible changes may be made. Backward compatible changes may be added
25 * together with the corresponding interface version bump. Backward
26 * incompatible changes are done by bumping the version number in the protocol
27 * and interface names and resetting the interface version. Once the protocol
28 * is to be declared stable, the version number in the protocol is removed and
29 * the interface version number is reset.
30 *
31 * @section page_ifaces_linux_explicit_synchronization_unstable_v1 Interfaces
32 * - @subpage page_iface_zcr_linux_explicit_synchronization_v1 - Protocol for pr oviding explicit synchronization
33 * - @subpage page_iface_zcr_synchronization_v1 -
34 * @section page_copyright_linux_explicit_synchronization_unstable_v1 Copyright
35 * <pre>
36 *
37 * Copyright 2016 The Chromium Authors.
38 *
39 * Permission is hereby granted, free of charge, to any person obtaining a
40 * copy of this software and associated documentation files (the "Software"),
41 * to deal in the Software without restriction, including without limitation
42 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
43 * and/or sell copies of the Software, and to permit persons to whom the
44 * Software is furnished to do so, subject to the following conditions:
45 *
46 * The above copyright notice and this permission notice (including the next
47 * paragraph) shall be included in all copies or substantial portions of the
48 * Software.
49 *
50 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
51 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
52 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
53 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
54 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
55 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
56 * DEALINGS IN THE SOFTWARE.
57 * </pre>
58 */
59 struct wl_surface;
60 struct zcr_linux_explicit_synchronization_v1;
61 struct zcr_synchronization_v1;
62
63 /**
64 * @page page_iface_zcr_linux_explicit_synchronization_v1 zcr_linux_explicit_syn chronization_v1
65 * @section page_iface_zcr_linux_explicit_synchronization_v1_desc Description
66 *
67 * The global interface that allows clients to set explicit synchronization
68 * fences for given wl_surface.
69 * @section page_iface_zcr_linux_explicit_synchronization_v1_api API
70 * See @ref iface_zcr_linux_explicit_synchronization_v1.
71 */
72 /**
73 * @defgroup iface_zcr_linux_explicit_synchronization_v1 The zcr_linux_explicit_ synchronization_v1 interface
74 *
75 * The global interface that allows clients to set explicit synchronization
76 * fences for given wl_surface.
77 */
78 extern const struct wl_interface zcr_linux_explicit_synchronization_v1_interface ;
79 /**
80 * @page page_iface_zcr_synchronization_v1 zcr_synchronization_v1
81 * @section page_iface_zcr_synchronization_v1_api API
82 * See @ref iface_zcr_synchronization_v1.
83 */
84 /**
85 * @defgroup iface_zcr_synchronization_v1 The zcr_synchronization_v1 interface
86 */
87 extern const struct wl_interface zcr_synchronization_v1_interface;
88
89 #ifndef ZCR_LINUX_EXPLICIT_SYNCHRONIZATION_V1_ERROR_ENUM
90 #define ZCR_LINUX_EXPLICIT_SYNCHRONIZATION_V1_ERROR_ENUM
91 enum zcr_linux_explicit_synchronization_v1_error {
92 /**
93 * the surface already has an synchronization object associated
94 */
95 ZCR_LINUX_EXPLICIT_SYNCHRONIZATION_V1_ERROR_SYNCHRONIZATION_EXISTS = 0,
96 };
97 #endif /* ZCR_LINUX_EXPLICIT_SYNCHRONIZATION_V1_ERROR_ENUM */
98
99 #define ZCR_LINUX_EXPLICIT_SYNCHRONIZATION_V1_DESTROY 0
100 #define ZCR_LINUX_EXPLICIT_SYNCHRONIZATION_V1_GET_SYNCHRONIZATION 1
101
102 /**
103 * @ingroup iface_zcr_linux_explicit_synchronization_v1
104 */
105 #define ZCR_LINUX_EXPLICIT_SYNCHRONIZATION_V1_DESTROY_SINCE_VERSION 1
106 /**
107 * @ingroup iface_zcr_linux_explicit_synchronization_v1
108 */
109 #define ZCR_LINUX_EXPLICIT_SYNCHRONIZATION_V1_GET_SYNCHRONIZATION_SINCE_VERSION 1
110
111 /** @ingroup iface_zcr_linux_explicit_synchronization_v1 */
112 static inline void
113 zcr_linux_explicit_synchronization_v1_set_user_data(struct zcr_linux_explicit_sy nchronization_v1 *zcr_linux_explicit_synchronization_v1, void *user_data)
114 {
115 wl_proxy_set_user_data((struct wl_proxy *) zcr_linux_explicit_synchroniz ation_v1, user_data);
116 }
117
118 /** @ingroup iface_zcr_linux_explicit_synchronization_v1 */
119 static inline void *
120 zcr_linux_explicit_synchronization_v1_get_user_data(struct zcr_linux_explicit_sy nchronization_v1 *zcr_linux_explicit_synchronization_v1)
121 {
122 return wl_proxy_get_user_data((struct wl_proxy *) zcr_linux_explicit_syn chronization_v1);
123 }
124
125 static inline uint32_t
126 zcr_linux_explicit_synchronization_v1_get_version(struct zcr_linux_explicit_sync hronization_v1 *zcr_linux_explicit_synchronization_v1)
127 {
128 return wl_proxy_get_version((struct wl_proxy *) zcr_linux_explicit_synch ronization_v1);
129 }
130
131 /**
132 * @ingroup iface_zcr_linux_explicit_synchronization_v1
133 *
134 * Destroy this explicit synchronization object. Existing explicit
135 * synchronization objects shall not be affected by this request.
136 */
137 static inline void
138 zcr_linux_explicit_synchronization_v1_destroy(struct zcr_linux_explicit_synchron ization_v1 *zcr_linux_explicit_synchronization_v1)
139 {
140 wl_proxy_marshal((struct wl_proxy *) zcr_linux_explicit_synchronization_ v1,
141 ZCR_LINUX_EXPLICIT_SYNCHRONIZATION_V1_DESTROY);
142
143 wl_proxy_destroy((struct wl_proxy *) zcr_linux_explicit_synchronization_ v1);
144 }
145
146 /**
147 * @ingroup iface_zcr_linux_explicit_synchronization_v1
148 *
149 * Instantiate an interface extension for the given wl_surface to
150 * provide explicit synchronization. If the given wl_surface already has
151 * an explicit synchronization object associated, the
152 * synchronization_exists protocol error is raised.
153 */
154 static inline struct zcr_synchronization_v1 *
155 zcr_linux_explicit_synchronization_v1_get_synchronization(struct zcr_linux_expli cit_synchronization_v1 *zcr_linux_explicit_synchronization_v1, struct wl_surface *surface)
156 {
157 struct wl_proxy *id;
158
159 id = wl_proxy_marshal_constructor((struct wl_proxy *) zcr_linux_explicit _synchronization_v1,
160 ZCR_LINUX_EXPLICIT_SYNCHRONIZATION_V1_GET_SYNCHRONIZATI ON, &zcr_synchronization_v1_interface, NULL, surface);
161
162 return (struct zcr_synchronization_v1 *) id;
163 }
164
165 #ifndef ZCR_SYNCHRONIZATION_V1_ERROR_ENUM
166 #define ZCR_SYNCHRONIZATION_V1_ERROR_ENUM
167 enum zcr_synchronization_v1_error {
168 /**
169 * the fence specified by the client could not be imported
170 */
171 ZCR_SYNCHRONIZATION_V1_ERROR_INVALID_FENCE = 0,
172 };
173 #endif /* ZCR_SYNCHRONIZATION_V1_ERROR_ENUM */
174
175 #define ZCR_SYNCHRONIZATION_V1_DESTROY 0
176 #define ZCR_SYNCHRONIZATION_V1_SET_ACQUIRE_FENCE 1
177
178 /**
179 * @ingroup iface_zcr_synchronization_v1
180 */
181 #define ZCR_SYNCHRONIZATION_V1_DESTROY_SINCE_VERSION 1
182 /**
183 * @ingroup iface_zcr_synchronization_v1
184 */
185 #define ZCR_SYNCHRONIZATION_V1_SET_ACQUIRE_FENCE_SINCE_VERSION 1
186
187 /** @ingroup iface_zcr_synchronization_v1 */
188 static inline void
189 zcr_synchronization_v1_set_user_data(struct zcr_synchronization_v1 *zcr_synchron ization_v1, void *user_data)
190 {
191 wl_proxy_set_user_data((struct wl_proxy *) zcr_synchronization_v1, user_ data);
192 }
193
194 /** @ingroup iface_zcr_synchronization_v1 */
195 static inline void *
196 zcr_synchronization_v1_get_user_data(struct zcr_synchronization_v1 *zcr_synchron ization_v1)
197 {
198 return wl_proxy_get_user_data((struct wl_proxy *) zcr_synchronization_v1 );
199 }
200
201 static inline uint32_t
202 zcr_synchronization_v1_get_version(struct zcr_synchronization_v1 *zcr_synchroniz ation_v1)
203 {
204 return wl_proxy_get_version((struct wl_proxy *) zcr_synchronization_v1);
205 }
206
207 /**
208 * @ingroup iface_zcr_synchronization_v1
209 *
210 * Destroy this explicit synchronization object.
211 */
212 static inline void
213 zcr_synchronization_v1_destroy(struct zcr_synchronization_v1 *zcr_synchronizatio n_v1)
214 {
215 wl_proxy_marshal((struct wl_proxy *) zcr_synchronization_v1,
216 ZCR_SYNCHRONIZATION_V1_DESTROY);
217
218 wl_proxy_destroy((struct wl_proxy *) zcr_synchronization_v1);
219 }
220
221 /**
222 * @ingroup iface_zcr_synchronization_v1
223 *
224 * Set the acquire fence that must be signaled before the compositor
225 * is allowed to read the pixels in the pending wl_buffer.
226 *
227 * The acquire state is double-buffered state, and will be applied on
228 * the next wl_surface.commit.
229 *
230 * If the fence could not be imported, an INVALID_FENCE error is signaled
231 * to the client.
232 */
233 static inline void
234 zcr_synchronization_v1_set_acquire_fence(struct zcr_synchronization_v1 *zcr_sync hronization_v1, int32_t fd)
235 {
236 wl_proxy_marshal((struct wl_proxy *) zcr_synchronization_v1,
237 ZCR_SYNCHRONIZATION_V1_SET_ACQUIRE_FENCE, fd);
238 }
239
240 #ifdef __cplusplus
241 }
242 #endif
243
244 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698