2 * Copyright (C) 2013 Simon Busch <morphis@gravedo.de>
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef UI_COMPATIBILITY_LAYER_H_
18 #define UI_COMPATIBILITY_LAYER_H_
28 struct graphic_buffer
;
30 struct graphic_buffer
* graphic_buffer_new(void);
31 struct graphic_buffer
* graphic_buffer_new_sized(uint32_t w
, uint32_t h
,
32 int32_t format
, uint32_t usage
);
33 struct graphic_buffer
* graphic_buffer_new_existing(uint32_t w
, uint32_t h
,
34 int32_t format
, uint32_t usage
,
35 uint32_t stride
, void *handle
,
38 void graphic_buffer_free(struct graphic_buffer
*buffer
);
40 uint32_t graphic_buffer_get_width(struct graphic_buffer
*buffer
);
41 uint32_t graphic_buffer_get_height(struct graphic_buffer
*buffer
);
42 uint32_t graphic_buffer_get_stride(struct graphic_buffer
*buffer
);
43 uint32_t graphic_buffer_get_usage(struct graphic_buffer
*buffer
);
44 int32_t graphic_buffer_get_pixel_format(struct graphic_buffer
*buffer
);
46 uint32_t graphic_buffer_reallocate(struct graphic_buffer
*buffer
, uint32_t w
,
47 uint32_t h
, int32_t f
, uint32_t usage
);
48 uint32_t graphic_buffer_lock(struct graphic_buffer
*buffer
, uint32_t usage
, void **vaddr
);
49 uint32_t graphic_buffer_unlock(struct graphic_buffer
*buffer
);
51 void* graphic_buffer_get_native_buffer(struct graphic_buffer
*buffer
);
53 void graphic_buffer_set_index(struct graphic_buffer
*buffer
, int index
);
54 int graphic_buffer_get_index(struct graphic_buffer
*buffer
);
56 int graphic_buffer_init_check(struct graphic_buffer
*buffer
);
62 #endif // UI_COMPATIBILITY_LAYER_H_