@ -75,13 +75,13 @@ bool wlr_buffer_get_dmabuf(struct wlr_buffer *buffer,
return buffer - > impl - > get_dmabuf ( buffer , attribs ) ;
}
bool buffer_begin_data_ptr_access ( struct wlr_buffer * buffer , void * * data ,
uint32_t * format , size_t * stride ) {
bool buffer_begin_data_ptr_access ( struct wlr_buffer * buffer , uint32_t flags ,
void * * data , uint32_t * format , size_t * stride ) {
assert ( ! buffer - > accessing_data_ptr ) ;
if ( ! buffer - > impl - > begin_data_ptr_access ) {
return false ;
}
if ( ! buffer - > impl - > begin_data_ptr_access ( buffer , data, format , stride ) ) {
if ( ! buffer - > impl - > begin_data_ptr_access ( buffer , flags, data, format , stride ) ) {
return false ;
}
buffer - > accessing_data_ptr = true ;
@ -292,7 +292,8 @@ bool wlr_client_buffer_apply_damage(struct wlr_client_buffer *client_buffer,
void * data ;
uint32_t format ;
size_t stride ;
if ( ! buffer_begin_data_ptr_access ( next , & data , & format , & stride ) ) {
if ( ! buffer_begin_data_ptr_access ( next , WLR_BUFFER_DATA_PTR_ACCESS_READ ,
& data , & format , & stride ) ) {
return false ;
}
@ -343,7 +344,7 @@ static void shm_client_buffer_destroy(struct wlr_buffer *wlr_buffer) {
}
static bool shm_client_buffer_begin_data_ptr_access ( struct wlr_buffer * wlr_buffer ,
void * * data , uint32_t * format , size_t * stride ) {
uint32_t flags , void * * data , uint32_t * format , size_t * stride ) {
struct wlr_shm_client_buffer * buffer =
shm_client_buffer_from_buffer ( wlr_buffer ) ;
* format = buffer - > format ;
@ -454,13 +455,16 @@ static void readonly_data_buffer_destroy(struct wlr_buffer *wlr_buffer) {
}
static bool readonly_data_buffer_begin_data_ptr_access ( struct wlr_buffer * wlr_buffer ,
void * * data , uint32_t * format , size_t * stride ) {
uint32_t flags , void * * data , uint32_t * format , size_t * stride ) {
struct wlr_readonly_data_buffer * buffer =
readonly_data_buffer_from_buffer ( wlr_buffer ) ;
if ( buffer - > data = = NULL ) {
return false ;
}
* data = ( void * ) buffer - > data ;
if ( flags & WLR_BUFFER_DATA_PTR_ACCESS_WRITE ) {
return false ;
}
* data = ( void * ) buffer - > data ;
* format = buffer - > format ;
* stride = buffer - > stride ;
return true ;