Mir
mir_buffer.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2016 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  */
17 
18 #ifndef MIR_TOOLKIT_MIR_BUFFER_H_
19 #define MIR_TOOLKIT_MIR_BUFFER_H_
20 
23 
24 #ifdef __cplusplus
25 
29 extern "C" {
30 #endif
31 
47  MirConnection* connection,
48  int width, int height,
49  MirPixelFormat format,
50  MirBufferUsage buffer_usage,
51  mir_buffer_callback available_callback, void* available_context);
52 
57 bool mir_buffer_is_valid(MirBuffer* buffer);
58 
67 char const *mir_buffer_get_error_message(MirBuffer* buffer);
68 
77  MirBuffer* buffer,
78  mir_buffer_callback available_callback, void* available_context);
79 
103 
118 
127 
140  MirBuffer* buffer,
141  MirNativeFence* native_fence,
142  MirBufferAccess access);
143 
155  MirBuffer* buffer,
156  MirBufferAccess access,
157  int timeout);
158 
164 unsigned int mir_buffer_get_width(MirBuffer* buffer);
165 
171 unsigned int mir_buffer_get_height(MirBuffer* buffer);
172 
179 
186 
192 void mir_buffer_release(MirBuffer* buffer);
193 
194 #ifdef __cplusplus
195 }
197 #endif
198 
199 #endif // MIR_TOOLKIT_MIR_BUFFER_H_
void mir_connection_allocate_buffer(MirConnection *connection, int width, int height, MirPixelFormat format, MirBufferUsage buffer_usage, mir_buffer_callback available_callback, void *available_context)
Allocate a MirBuffer and do not wait for the server to return it.
Definition: mir_buffer_api.cpp:33
unsigned int mir_buffer_get_width(MirBuffer *buffer)
Retrieve the width of the buffer in pixels.
Definition: mir_buffer_api.cpp:131
MirPixelFormat mir_buffer_get_pixel_format(MirBuffer *buffer)
Retrieve the pixel format of the buffer.
Definition: mir_buffer_api.cpp:157
unsigned int mir_buffer_get_height(MirBuffer *buffer)
Retrieve the height of the buffer in pixels.
Definition: mir_buffer_api.cpp:144
MirBufferUsage mir_buffer_get_buffer_usage(MirBuffer *buffer)
Retrieve the buffer usage of the buffer.
Definition: mir_buffer_api.cpp:170
struct MirBuffer MirBuffer
Definition: client_types_nbs.h:33
void * MirNativeFence
Definition: client_types_nbs.h:34
void mir_buffer_release(MirBuffer *buffer)
release a MirBuffer
Definition: mir_buffer_api.cpp:49
int mir_buffer_wait_for_access(MirBuffer *buffer, MirBufferAccess access, int timeout)
Wait for the fence associated with the buffer to signal.
Definition: mir_buffer_api.cpp:87
MirNativeFence * mir_buffer_get_fence(MirBuffer *)
Retrieve the native fence associated with this buffer.
Definition: mir_buffer_api.cpp:62
void mir_buffer_associate_fence(MirBuffer *buffer, MirNativeFence *native_fence, MirBufferAccess access)
Protect the buffer&#39;s contents by associating a native fence with it.
Definition: mir_buffer_api.cpp:75
Definition: mir_native_buffer.h:30
MirNativeBuffer * mir_buffer_get_native_buffer(MirBuffer *, MirBufferAccess access)
Access the native buffer associated with MirBuffer for a given purpose.
Definition: mir_buffer_api.cpp:100
char const * mir_buffer_get_error_message(MirBuffer *buffer)
Retrieve a text description an error associated with a MirBuffer.
Definition: mir_buffer_api.cpp:195
void mir_buffer_set_callback(MirBuffer *buffer, mir_buffer_callback available_callback, void *available_context)
Reassign the callback that the MirBuffer will call when the buffer is available for use again...
Definition: mir_buffer_api.cpp:207
MirBufferAccess
Definition: client_types_nbs.h:38
bool mir_buffer_is_valid(MirBuffer *buffer)
Test for a valid buffer.
Definition: mir_buffer_api.cpp:183
MirGraphicsRegion mir_buffer_get_graphics_region(MirBuffer *buffer, MirBufferAccess access)
Access a CPU-mapped region associated with a given buffer for the given purpose.
Definition: mir_buffer_api.cpp:115
unsigned int width
Definition: touchspot_image.c:4
MirBufferUsage
MirBufferUsage specifies how a surface can and will be used.
Definition: client_types.h:159
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:134
unsigned int height
Definition: touchspot_image.c:5
Definition: mir_connection.h:96
Retrieved information about a MirSurface.
Definition: client_types.h:236
void(* mir_buffer_callback)(MirBuffer *, void *context)
Definition: client_types_nbs.h:36

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Sep 8 14:50:19 UTC 2016