static tpl_runtime_t *runtime = NULL;
static pthread_mutex_t runtime_mutex = PTHREAD_MUTEX_INITIALIZER;
-static tpl_bool_t
+static tpl_result_t
__tpl_runtime_init()
{
if (runtime == NULL)
{
runtime = (tpl_runtime_t *) calloc(1, sizeof(tpl_runtime_t));
if (runtime == NULL)
- return TPL_FALSE;
+ {
+ TPL_ERR("Failed to allocate new tpl_runtime_t.");
+ return TPL_ERROR_INVALID_OPERATION;
+ }
}
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
static void __attribute__((destructor))
return display;
}
-tpl_bool_t
+tpl_result_t
__tpl_runtime_add_display(tpl_display_t *display)
{
- tpl_bool_t ret;
+ tpl_result_t ret;
tpl_handle_t handle;
tpl_backend_type_t type;
TPL_ASSERT(0 <= type && TPL_BACKEND_COUNT > type);
if (0 != pthread_mutex_lock(&runtime_mutex))
- return TPL_FALSE;
+ {
+ TPL_ERR("runtime_mutex pthread_mutex_lock filed.");
+ return TPL_ERROR_INVALID_OPERATION;
+ }
- if (TPL_TRUE != __tpl_runtime_init())
- return TPL_FALSE;
+ if (TPL_ERROR_NONE != __tpl_runtime_init())
+ {
+ TPL_ERR("__tpl_runtime_init() failed.");
+ return TPL_ERROR_INVALID_OPERATION;
+ }
if (NULL == runtime->displays[type])
{
runtime->displays[type] = __tpl_hashlist_create();
if (NULL == runtime->displays[type])
- return TPL_FALSE;
+ {
+ TPL_ERR("__tpl_hashlist_create failed.");
+ return TPL_ERROR_INVALID_OPERATION;
+ }
}
ret = __tpl_hashlist_insert(runtime->displays[type], (size_t) handle, (void *) display);
- if (TPL_TRUE != ret)
+ if (TPL_ERROR_NONE != ret)
{
+ TPL_ERR("__tpl_hashlist_insert failed. list(%p), handle(%d), display(%p)",
+ runtime->displays[type], handle, display);
__tpl_hashlist_destroy(&runtime->displays[type]);
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_OPERATION;
}
pthread_mutex_unlock(&runtime_mutex);
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
void
} tpl_backend_type_t;
/**
+ * Enumeration for TPL result type.
+ *
+ */
+typedef enum
+{
+ TPL_ERROR_NONE = 0, /* Successfull */
+ TPL_ERROR_INVALID_PARAMETER, /* Invalid parmeter */
+ TPL_ERROR_INVALID_OPERATION /* Invalid operation */
+} tpl_result_t;
+
+/**
* Increase reference count of a TPL object.
*
* All TPL objects are reference-counted. They have reference count 1 on
*
* @see tpl_object_get_user_data()
*/
-tpl_bool_t tpl_object_set_user_data(tpl_object_t *object,
+tpl_result_t tpl_object_set_user_data(tpl_object_t *object,
void *key,
void *data,
tpl_free_func_t free_func);
* @param depth_size Size of a pixel in bits (Color depth).
* @param native_visual_id Pointer to receive native visual id.
* @param is_slow Pointer to receive whether the given config is slow.
- * @return TPL_TRUE is the given config is supported, TPL_FALSE otherwise.
+ * @return TPL_ERROR_NONE is the given config is supported, TPL_ERROR otherwise.
*/
-tpl_bool_t tpl_display_query_config(tpl_display_t *display,
+tpl_result_t tpl_display_query_config(tpl_display_t *display,
tpl_surface_type_t surface_type,
int red_size,
int green_size,
* @param display display to query pixel formats.
* @param visual_id Pointer to receive native visual id.
* @param alpha_size Size of the alpha component in bits.
- * @return TPL_TRUE if the given config has been modified, TPL_FALSE otherwise.
+ * @return TPL_ERROR_NONE if the given config has been modified, TPL_ERROR otherwise.
*/
-tpl_bool_t tpl_display_filter_config(tpl_display_t *display,
+tpl_result_t tpl_display_filter_config(tpl_display_t *display,
int *visual_id,
int alpha_size);
* @param width pointer to receive width value.
* @param height pointer to receive height value.
*/
-tpl_bool_t tpl_surface_get_size(tpl_surface_t *surface,
+tpl_result_t tpl_surface_get_size(tpl_surface_t *surface,
int *width,
int *height);
* @param tbm_surface buffer to post.
*
*/
-tpl_bool_t tpl_surface_enqueue_buffer(tpl_surface_t *surface, tbm_surface_h tbm_surface);
+tpl_result_t tpl_surface_enqueue_buffer(tpl_surface_t *surface, tbm_surface_h tbm_surface);
/**
* Post a given tbm_surface with region of damage.
*
* @see tpl_surface_enqueue_buffer()
*/
-tpl_bool_t tpl_surface_enqueue_buffer_with_damage(tpl_surface_t *surface,
+tpl_result_t tpl_surface_enqueue_buffer_with_damage(tpl_surface_t *surface,
tbm_surface_h tbm_surface,
int num_rects,
const int *rects);
*
* @see tpl_surface_get_post_interval()
*/
-tpl_bool_t tpl_surface_set_post_interval(tpl_surface_t *surface,
- int interval);
+tpl_result_t tpl_surface_set_post_interval(tpl_surface_t *surface,
+ int interval);
/**
* Get frame interval of the given TPL surface.
* @param width pointer to receive width of the window.
* @param height pointer to receive height of the window.
* @param format pointer to receive format of the window.
- * @return TPL_TRUE if the window is valid, TPL_FALSE otherwise.
+ * @return TPL_ERROR_NONE if the window is valid, TPL_ERROR otherwise.
*/
-tpl_bool_t tpl_display_get_native_window_info(tpl_display_t *display,
+tpl_result_t tpl_display_get_native_window_info(tpl_display_t *display,
tpl_handle_t window,
int *width,
int *height,
* @param width pointer to receive width of the pixmap.
* @param height pointer to receive height of the pixmap.
* @param format pointer to receive format of the pixmap.
- * @return TPL_TRUE if the pixmap is valid, TPL_FALSE otherwise.
+ * @return TPL_ERROR_NONE if the pixmap is valid, TPL_ERROR otherwise.
*/
-tpl_bool_t tpl_display_get_native_pixmap_info(tpl_display_t *display,
+tpl_result_t tpl_display_get_native_pixmap_info(tpl_display_t *display,
tpl_handle_t pixmap,
int *width,
int *height,
tbm_surface_h tpl_display_get_buffer_from_native_pixmap(tpl_display_t *display,
tpl_handle_t pixmap);
-
-void tpl_display_wait_native(tpl_display_t *display);
-
#endif /* TPL_H */
{
TPL_ASSERT(display);
- if (display->backend.fini)
+ if (display->backend.fini != NULL)
display->backend.fini(display);
__tpl_runtime_remove_display(display);
tpl_display_create(tpl_backend_type_t type, tpl_handle_t native_dpy)
{
tpl_display_t *display;
- tpl_bool_t ret;
+ tpl_result_t ret;
/* Search for an already connected display for the given native display. */
display = __tpl_runtime_find_display(type, native_dpy);
/* Initialize object base class. */
ret = __tpl_object_init(&display->base, TPL_OBJECT_DISPLAY, __tpl_display_free);
- if (TPL_TRUE != ret)
+ if (TPL_ERROR_NONE != ret)
{
TPL_ERR("Failed to initialize display's base class!");
free(display);
/* Initialize backend. */
__tpl_display_init_backend(display, type);
- if (!display->backend.init(display))
+ if (TPL_ERROR_NONE != display->backend.init(display))
{
TPL_ERR("Failed to initialize display's backend!");
tpl_object_unreference((tpl_object_t *) display);
/* Add it to the runtime. */
ret = __tpl_runtime_add_display(display);
- if (TPL_TRUE != ret)
+ if (TPL_ERROR_NONE != ret)
{
TPL_ERR("Failed to add display to runtime list!");
tpl_object_unreference((tpl_object_t *) display);
return display->native_handle;
}
-tpl_bool_t
+tpl_result_t
tpl_display_query_config(tpl_display_t *display,
tpl_surface_type_t surface_type,
int red_size,
if(NULL == display || TPL_TRUE != __tpl_object_is_valid(&display->base) || NULL == display->backend.query_config)
{
TPL_ERR("display is invalid!");
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_PARAMETER;
}
return display->backend.query_config(display, surface_type, red_size, green_size, blue_size, alpha_size, depth_size, native_visual_id, is_slow);
}
-tpl_bool_t
+tpl_result_t
tpl_display_filter_config(tpl_display_t *display, int *visual_id, int alpha_size)
{
if(NULL == display || TPL_TRUE != __tpl_object_is_valid(&display->base) || NULL == display->backend.filter_config)
{
TPL_ERR("display is invalid!");
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_PARAMETER;
}
return display->backend.filter_config(display, visual_id, alpha_size);
}
-tpl_bool_t
+tpl_result_t
tpl_display_get_native_window_info(tpl_display_t *display, tpl_handle_t window,
int *width, int *height, tbm_format *format, int depth, int a_size)
{
if (display->backend.get_window_info == NULL)
{
TPL_ERR("Backend for display has not been initialized!");
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_OPERATION;
}
return display->backend.get_window_info(display, window, width, height, format, depth, a_size);
}
-tpl_bool_t
+tpl_result_t
tpl_display_get_native_pixmap_info(tpl_display_t *display, tpl_handle_t pixmap,
int *width, int *height, tbm_format *format)
{
if (display->backend.get_pixmap_info == NULL)
{
TPL_ERR("Backend for display has not been initialized!");
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_OPERATION;
}
return display->backend.get_pixmap_info(display, pixmap, width, height, format);
return TPL_FALSE;
}
-static tpl_bool_t
+static tpl_result_t
__tpl_gbm_display_init(tpl_display_t *display)
{
tpl_gbm_display_t *gbm_display = NULL;
/* Do not allow default display in gbm. */
if (display->native_handle == NULL)
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_PARAMETER;
gbm_display = (tpl_gbm_display_t *) calloc(1, sizeof(tpl_gbm_display_t));
if (gbm_display == NULL)
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_PARAMETER;
display->bufmgr_fd = dup(gbm_device_get_fd(display->native_handle));
gbm_display->bufmgr = tbm_bufmgr_init(display->bufmgr_fd);
display->backend.data = gbm_display;
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
static void
display->backend.data = NULL;
}
-static tpl_bool_t
+static tpl_result_t
__tpl_gbm_display_query_config(tpl_display_t *display, tpl_surface_type_t surface_type,
int red_size, int green_size, int blue_size, int alpha_size,
int color_depth, int *native_visual_id, tpl_bool_t *is_slow)
if (native_visual_id != NULL) *native_visual_id = GBM_FORMAT_ARGB8888;
}
else
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_PARAMETER;
if (is_slow != NULL) *is_slow = TPL_FALSE;
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
if (alpha_size == 0)
{
if (native_visual_id != NULL) *native_visual_id = GBM_FORMAT_XRGB8888;
}
else
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_PARAMETER;
if (is_slow != NULL) *is_slow = TPL_FALSE;
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
}
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_PARAMETER;
}
-static tpl_bool_t
+static tpl_result_t
__tpl_gbm_display_filter_config(tpl_display_t *display,
int *visual_id, int alpha_size)
{
if (visual_id != NULL && *visual_id == GBM_FORMAT_ARGB8888 && alpha_size == 0)
{
*visual_id = GBM_FORMAT_XRGB8888;
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_PARAMETER;
}
-static tpl_bool_t
+static tpl_result_t
__tpl_gbm_display_get_window_info(tpl_display_t *display, tpl_handle_t window,
int *width, int *height, tbm_format *format, int depth, int a_size)
{
struct gbm_surface *gbm_surface = (struct gbm_surface *)window;
tbm_surface_queue_h surf_queue = (tbm_surface_queue_h)gbm_tbm_get_surface_queue(gbm_surface);
+ if (surf_queue == NULL)
+ {
+ TPL_ERR("Failed to get tbm_surface_queue from gbm_surface.");
+ return TPL_ERROR_INVALID_OPERATION;
+ }
if (width != NULL) *width = tbm_surface_queue_get_width(surf_queue);
if (height != NULL) *height = tbm_surface_queue_get_height(surf_queue);
if (format != NULL) *format = tbm_surface_queue_get_format(surf_queue);
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
-static tpl_bool_t
+static tpl_result_t
__tpl_gbm_display_get_pixmap_info(tpl_display_t *display, tpl_handle_t pixmap,
int *width, int *height, tbm_format *format)
{
tbm_surface = wayland_tbm_server_get_surface(NULL, (struct wl_resource*)pixmap);
if (tbm_surface == NULL)
- return TPL_FALSE;
+ {
+ TPL_ERR("Failed to get tbm_surface_h from native pixmap.");
+ return TPL_ERROR_INVALID_OPERATION;
+ }
if (width) *width = tbm_surface_get_width(tbm_surface);
if (height) *height = tbm_surface_get_height(tbm_surface);
if (format) *format = tbm_surface_get_format(tbm_surface);
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
static tbm_surface_h
tbm_surface = wayland_tbm_server_get_surface(NULL, (struct wl_resource*)pixmap);
if (tbm_surface == NULL)
{
- TPL_ERR("Failed to get tbm surface from wayland_tbm.");
+ TPL_ERR("Failed to get tbm_surface_h from wayland_tbm.");
return NULL;
}
return tbm_surface;
}
-static tpl_bool_t
+static tpl_result_t
__tpl_gbm_surface_init(tpl_surface_t *surface)
{
tpl_gbm_surface_t *tpl_gbm_surface = NULL;
TPL_ASSERT(surface);
tpl_gbm_surface = (tpl_gbm_surface_t *) calloc(1, sizeof(tpl_gbm_surface_t));
- if (NULL == tpl_gbm_surface)
- return TPL_FALSE;
+ if (tpl_gbm_surface == NULL)
+ {
+ TPL_ERR("Failed to allocate new gbm backend surface.");
+ return TPL_ERROR_INVALID_OPERATION;
+ }
surface->backend.data = (void *)tpl_gbm_surface;
tpl_gbm_surface->tbm_queue = NULL;
{
struct gbm_surface *gbm_surface = (struct gbm_surface*)surface->native_handle;
tpl_gbm_surface->tbm_queue = (tbm_surface_queue_h)gbm_tbm_get_surface_queue(gbm_surface);
+ if (tpl_gbm_surface->tbm_queue == NULL)
+ {
+ TPL_ERR("Failed to get tbm_surface_queue from gbm_surface.");
+ goto error;
+ }
- if (TPL_TRUE != __tpl_gbm_display_get_window_info(surface->display, surface->native_handle,
+ if (TPL_ERROR_NONE != __tpl_gbm_display_get_window_info(surface->display, surface->native_handle,
&surface->width, &surface->height, NULL, 0, 0))
+ {
+ TPL_ERR("Failed to get native window info.");
goto error;
+ }
TPL_LOG(3, "window(%p, %p) %dx%d", surface, surface->native_handle, surface->width, surface->height);
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
else if (surface->type == TPL_SURFACE_TYPE_PIXMAP)
{
- if (TPL_TRUE != __tpl_gbm_display_get_pixmap_info(surface->display, surface->native_handle,
+ if (TPL_ERROR_NONE != __tpl_gbm_display_get_pixmap_info(surface->display, surface->native_handle,
&surface->width, &surface->height, NULL))
+ {
+ TPL_ERR("Failed to get native pixmap info.");
goto error;
+ }
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
error:
free(tpl_gbm_surface);
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_OPERATION;
}
static void
surface->backend.data = NULL;
}
-static void
+static tpl_result_t
__tpl_gbm_surface_enqueue_buffer(tpl_surface_t *surface, tbm_surface_h tbm_surface,
int num_rects, const int *rects)
{
TPL_LOG(3, "window(%p, %p)", surface, surface->native_handle);
tpl_gbm_surface_t *gbm_surface = (tpl_gbm_surface_t*)surface->backend.data;
+ if (gbm_surface == NULL)
+ {
+ TPL_ERR("tpl_gbm_surface_t is invalid. tpl_surface_t(%p)", surface);
+ return TPL_ERROR_INVALID_PARAMETER;
+ }
tbm_surface_internal_unref(tbm_surface);
- if (gbm_surface->tbm_queue)
+ if (gbm_surface->tbm_queue == NULL)
{
- tbm_surface_queue_enqueue(gbm_surface->tbm_queue, tbm_surface);
- TPL_LOG(6, "tbm_surface ENQUEUED!!");
+ TPL_ERR("tbm_surface_queue is invalid. tpl_gbm_surface_t(%p)", gbm_surface);
+ return TPL_ERROR_INVALID_PARAMETER;
}
+
+ if (tbm_surface_queue_enqueue(gbm_surface->tbm_queue, tbm_surface) != TBM_SURFACE_QUEUE_ERROR_NONE)
+ {
+ TPL_ERR("tbm_surface_queue_enqueue failed. tbm_surface_queue(%p) tbm_surface(%p)",
+ gbm_surface->tbm_queue, tbm_surface);
+ return TPL_ERROR_INVALID_PARAMETER;
+ }
+
+ return TPL_ERROR_NONE;
}
static tpl_bool_t
tpl_backend_type_t type;
void *data;
- tpl_bool_t (*init)(tpl_display_t *display);
+ tpl_result_t (*init)(tpl_display_t *display);
void (*fini)(tpl_display_t *display);
- tpl_bool_t (*query_config)(tpl_display_t *display,
+ tpl_result_t (*query_config)(tpl_display_t *display,
tpl_surface_type_t surface_type, int red_bits,
int green_bits, int blue_bits, int alpha_bits,
int color_depth, int *native_visual_id, tpl_bool_t *is_slow);
- tpl_bool_t (*filter_config)(tpl_display_t *display, int *visual_id, int alpha_bits);
+ tpl_result_t (*filter_config)(tpl_display_t *display, int *visual_id, int alpha_bits);
- tpl_bool_t (*get_window_info)(tpl_display_t *display, tpl_handle_t window,
+ tpl_result_t (*get_window_info)(tpl_display_t *display, tpl_handle_t window,
int *width, int *height, tbm_format *format, int depth,int a_size);
- tpl_bool_t (*get_pixmap_info)(tpl_display_t *display, tpl_handle_t pixmap,
+ tpl_result_t (*get_pixmap_info)(tpl_display_t *display, tpl_handle_t pixmap,
int *width, int *height, tbm_format *format);
tbm_surface_h (*get_buffer_from_native_pixmap)(tpl_handle_t pixmap);
tpl_backend_type_t type;
void *data;
- tpl_bool_t (*init)(tpl_surface_t *surface);
+ tpl_result_t (*init)(tpl_surface_t *surface);
void (*fini)(tpl_surface_t *surface);
tpl_bool_t (*validate)(tpl_surface_t *surface);
tbm_surface_h (*dequeue_buffer)(tpl_surface_t *surface);
- void (*enqueue_buffer)(tpl_surface_t *surface, tbm_surface_h tbm_surface,
+ tpl_result_t (*enqueue_buffer)(tpl_surface_t *surface, tbm_surface_h tbm_surface,
int num_rects, const int *rects);
};
/** brief check wether a TPL object is valid
* @param object the TPL object to check
- * @return TPL_TRUE on success, TPL_FALSE on error
+ * @return TPL_ERROR_NONE on success, TPL_ERROR on error
*/
tpl_bool_t __tpl_object_is_valid(tpl_object_t *object);
* @param object the TPL object to initialize
* @param type type of the TPL object
* @param free_func customized deallocation routine for this TPL object
- * @return TPL_TRUE on success, TPL_FALSE on error
+ * @return TPL_ERROR_NONE on success, TPL_ERROR on error
*/
-tpl_bool_t __tpl_object_init(tpl_object_t *object, tpl_object_type_t type, tpl_free_func_t free_func);
+tpl_result_t __tpl_object_init(tpl_object_t *object, tpl_object_type_t type, tpl_free_func_t free_func);
/** brief destroy a TPL object
* @param object the TPL object to destroy
- * @return TPL_TRUE on success, TPL_FALSE on error
+ * @return TPL_ERROR_NONE on success, TPL_ERROR on error
* @warning this function is automatically called when the reference count reaches 0, therefore it should not be expliclity called
*/
-tpl_bool_t __tpl_object_fini(tpl_object_t *object);
+tpl_result_t __tpl_object_fini(tpl_object_t *object);
/** brief lock a TPL object
* @param object the TPL object to lock
- * @return TPL_TRUE on success, TPL_FALSE on error
+ * @return TPL_ERROR_NONE on success, TPL_ERROR on error
*/
-tpl_bool_t __tpl_object_lock(tpl_object_t *object);
+tpl_result_t __tpl_object_lock(tpl_object_t *object);
/** brief unlock a TPL object
* @param object the TPL object to unlock
/* Runtime functions. */
tpl_display_t * __tpl_runtime_find_display(tpl_backend_type_t type, tpl_handle_t native_display);
-tpl_bool_t __tpl_runtime_add_display(tpl_display_t *display);
+tpl_result_t __tpl_runtime_add_display(tpl_display_t *display);
void __tpl_runtime_remove_display(tpl_display_t *display);
void __tpl_runtime_flush_all_display();
/* Data structure functions */
tpl_hlist_t * __tpl_hashlist_create();
void __tpl_hashlist_destroy(tpl_hlist_t **list);
-tpl_bool_t __tpl_hashlist_insert(tpl_hlist_t *list, size_t key, void *data);
+tpl_result_t __tpl_hashlist_insert(tpl_hlist_t *list, size_t key, void *data);
void __tpl_hashlist_delete(tpl_hlist_t *list, size_t key);
void __tpl_hashlist_do_for_all_nodes(tpl_hlist_t *list, void (*cb_func)(void *));
void * __tpl_hashlist_lookup(tpl_hlist_t *list, size_t key);
return (0 != __tpl_util_atomic_get(&object->reference));
}
-tpl_bool_t
+tpl_result_t
__tpl_object_init(tpl_object_t *object, tpl_object_type_t type, tpl_free_func_t free_func)
{
TPL_ASSERT(object);
__tpl_util_atomic_set(&object->reference, 1);
if (0 != pthread_mutex_init(&object->mutex, NULL))
- return TPL_FALSE;
+ {
+ TPL_ERR("tpl_object_t pthread_mutex_init failed.");
+ return TPL_ERROR_INVALID_OPERATION;
+ }
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
-tpl_bool_t
+tpl_result_t
__tpl_object_fini(tpl_object_t *object)
{
TPL_ASSERT(object);
if (0 != pthread_mutex_destroy(&object->mutex))
- return TPL_FALSE;
+ {
+ TPL_ERR("tpl_object_t pthread_mutex_destroy failed.");
+ return TPL_ERROR_INVALID_OPERATION;
+ }
tpl_util_map_fini(&object->user_data_map);
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
-tpl_bool_t
+tpl_result_t
__tpl_object_lock(tpl_object_t *object)
{
TPL_ASSERT(object);
if (0 != pthread_mutex_lock(&object->mutex))
- return TPL_FALSE;
-
- return TPL_TRUE;
+ {
+ TPL_ERR("tpl_object_t pthread_mutex_lock failed.");
+ return TPL_ERROR_INVALID_OPERATION;
+ }
+ return TPL_ERROR_NONE;
}
void
return object->type;
}
-tpl_bool_t
+tpl_result_t
tpl_object_set_user_data(tpl_object_t *object, void *key, void *data, tpl_free_func_t free_func)
{
tpl_util_key_t _key;
if (TPL_TRUE != __tpl_object_is_valid(object))
{
TPL_ERR("input object is invalid!");
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_PARAMETER;
}
__tpl_object_lock(object);
tpl_util_map_set(&object->user_data_map, _key, data, free_func);
__tpl_object_unlock(object);
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
void *
__tpl_surface_free(void *data)
{
TPL_ASSERT(data);
- TPL_LOG(9, "tpl_surface_t(%p)", data);
__tpl_surface_fini((tpl_surface_t *) data);
free(data);
}
return NULL;
}
- if (TPL_TRUE != __tpl_object_init(&surface->base, TPL_OBJECT_SURFACE, __tpl_surface_free))
+ if (TPL_ERROR_NONE != __tpl_object_init(&surface->base, TPL_OBJECT_SURFACE, __tpl_surface_free))
{
TPL_ERR("Failed to initialize surface's base class!");
free(surface);
/* Intialize backend. */
__tpl_surface_init_backend(surface, display->backend.type);
- if (NULL == surface->backend.init || TPL_TRUE != surface->backend.init(surface))
+ if (NULL == surface->backend.init || TPL_ERROR_NONE != surface->backend.init(surface))
{
TPL_ERR("Failed to initialize surface's backend!");
tpl_object_unreference(&surface->base);
return surface->type;
}
-tpl_bool_t
+tpl_result_t
tpl_surface_get_size(tpl_surface_t *surface, int *width, int *height)
{
if (NULL == surface)
{
TPL_ERR("Surface is NULL!");
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_PARAMETER;
}
if (width)
if (height)
*height = surface->height;
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
return was_valid;
}
-tpl_bool_t
+tpl_result_t
tpl_surface_set_post_interval(tpl_surface_t *surface, int interval)
{
if (NULL == surface || TPL_SURFACE_TYPE_WINDOW != surface->type)
{
TPL_ERR("Invalid surface!");
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_PARAMETER;
}
TPL_OBJECT_LOCK(surface);
surface->post_interval = interval;
TPL_OBJECT_UNLOCK(surface);
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
int
return tbm_surface;
}
-tpl_bool_t
+tpl_result_t
tpl_surface_enqueue_buffer(tpl_surface_t *surface, tbm_surface_h tbm_surface)
{
+ tpl_result_t ret = TPL_ERROR_INVALID_OPERATION;
+
if (NULL == surface || TPL_SURFACE_TYPE_WINDOW != surface->type)
{
TPL_ERR("Invalid surface!");
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_PARAMETER;
}
TRACE_BEGIN("TPL:POST");
TPL_OBJECT_UNLOCK(surface);
TRACE_END();
TPL_ERR("tbm surface is invalid.");
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_PARAMETER;
}
/* Call backend post */
- surface->backend.enqueue_buffer(surface, tbm_surface, 0, NULL);
+ ret = surface->backend.enqueue_buffer(surface, tbm_surface, 0, NULL);
TPL_OBJECT_UNLOCK(surface);
TRACE_END();
- return TPL_TRUE;
+ return ret;
}
-tpl_bool_t
+tpl_result_t
tpl_surface_enqueue_buffer_with_damage(tpl_surface_t *surface, tbm_surface_h tbm_surface,
int num_rects, const int *rects)
{
+ tpl_result_t ret = TPL_ERROR_INVALID_OPERATION;
+
if (NULL == surface || TPL_SURFACE_TYPE_WINDOW != surface->type)
{
TPL_ERR("Invalid surface!");
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_PARAMETER;
}
TRACE_BEGIN("TPL:POST");
TPL_OBJECT_UNLOCK(surface);
TRACE_END();
TPL_ERR("tbm surface is invalid.");
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_PARAMETER;
}
/* Call backend post */
- surface->backend.enqueue_buffer(surface, tbm_surface, num_rects, rects);
+ ret = surface->backend.enqueue_buffer(surface, tbm_surface, num_rects, rects);
TPL_OBJECT_UNLOCK(surface);
TRACE_END();
- return TPL_TRUE;
+ return ret;
}
int dummy;
};
-static tpl_bool_t
+static tpl_result_t
__tpl_tbm_display_init(tpl_display_t *display)
{
tpl_tbm_display_t *tbm_display = NULL;
tbm_display = (tpl_tbm_display_t *) calloc(1, sizeof(tpl_tbm_display_t));
if (tbm_display == NULL)
- return TPL_FALSE;
+ {
+ TPL_ERR("Failed to allocate memory for new tpl_tbm_display_t.");
+ return TPL_ERROR_INVALID_OPERATION;
+ }
display->backend.data = tbm_display;
display->bufmgr_fd = -1;
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
static void
tbm_bufmgr_deinit((tbm_bufmgr)display->native_handle);
}
-static tpl_bool_t
+static tpl_result_t
__tpl_tbm_display_query_config(tpl_display_t *display, tpl_surface_type_t surface_type,
int red_size, int green_size, int blue_size, int alpha_size,
int color_depth, int *native_visual_id, tpl_bool_t *is_slow)
if (is_slow != NULL)
*is_slow = TPL_FALSE;
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
if (alpha_size == 0)
{
if (is_slow != NULL)
*is_slow = TPL_FALSE;
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
}
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_PARAMETER;
}
-static tpl_bool_t
+static tpl_result_t
__tpl_tbm_display_filter_config(tpl_display_t *display,
int *visual_id, int alpha_size)
{
if (visual_id != NULL && *visual_id == TBM_FORMAT_ARGB8888 && alpha_size == 0)
{
*visual_id = TBM_FORMAT_XRGB8888;
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_PARAMETER;
}
-static tpl_bool_t
+static tpl_result_t
__tpl_tbm_display_get_window_info(tpl_display_t *display, tpl_handle_t window,
int *width, int *height, tbm_format *format, int depth, int a_size)
{
TPL_ASSERT(window);
tbm_surface_queue_h surf_queue = (tbm_surface_queue_h)window;
+ if (surf_queue == NULL)
+ {
+ TPL_ERR("Native widow(%p) is invalid.", window);
+ return TPL_ERROR_INVALID_PARAMETER;
+ }
if (width != NULL)
*width = tbm_surface_queue_get_width(surf_queue);
if (format != NULL)
*format = tbm_surface_queue_get_format(surf_queue);
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
-static tpl_bool_t
+static tpl_result_t
__tpl_tbm_display_get_pixmap_info(tpl_display_t *display, tpl_handle_t pixmap,
int *width, int *height, tbm_format *format)
{
tbm_surface = (tbm_surface_h)pixmap;
if (tbm_surface == NULL)
- return TPL_FALSE;
+ {
+ TPL_ERR("Native pixmap(%p) is invalid.", pixmap);
+ return TPL_ERROR_INVALID_PARAMETER;
+ }
if (width)
*width = tbm_surface_get_width(tbm_surface);
if (format)
*format = tbm_surface_get_format(tbm_surface);
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
static tbm_surface_h
/* Do something */
}
-static tpl_bool_t
+static tpl_result_t
__tpl_tbm_surface_init(tpl_surface_t *surface)
{
tpl_tbm_surface_t *tpl_tbm_surface = NULL;
tpl_tbm_surface = (tpl_tbm_surface_t *) calloc(1, sizeof(tpl_tbm_surface_t));
if (NULL == tpl_tbm_surface)
- return TPL_FALSE;
+ {
+ TPL_ERR("Failed to allocate memory for new tpl_tbm_surface_t");
+ return TPL_ERROR_INVALID_OPERATION;
+ }
surface->backend.data = (void *)tpl_tbm_surface;
if (surface->type == TPL_SURFACE_TYPE_WINDOW)
{
- if (TPL_TRUE != __tpl_tbm_display_get_window_info(surface->display, surface->native_handle,
+ if (TPL_ERROR_NONE != __tpl_tbm_display_get_window_info(surface->display, surface->native_handle,
&surface->width, &surface->height, NULL, 0, 0))
+ {
+ TPL_ERR("Failed to get native window(%p) info.", surface->native_handle);
goto error;
+ }
tbm_surface_queue_set_destroy_cb((tbm_surface_queue_h)surface->native_handle,
__tpl_tbm_surface_queue_notify_cb, surface);
TPL_LOG(3, "window(%p, %p) %dx%d", surface, surface->native_handle, surface->width, surface->height);
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
else if (surface->type == TPL_SURFACE_TYPE_PIXMAP)
{
if (TPL_TRUE != __tpl_tbm_display_get_pixmap_info(surface->display, surface->native_handle,
&surface->width, &surface->height, NULL))
+ {
+ TPL_ERR("Failed to get native pixmap(%p) info.", surface->native_handle);
goto error;
+ }
tbm_surface_internal_ref((tbm_surface_h)surface->native_handle);
TPL_LOG(3, "pixmap(%p, %p) %dx%d", surface, surface->native_handle, surface->width, surface->height);
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
error:
free(tpl_tbm_surface);
surface->backend.data = NULL;
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_OPERATION;
}
static void
surface->backend.data = NULL;
}
-static void
+static tpl_result_t
__tpl_tbm_surface_enqueue_buffer(tpl_surface_t *surface, tbm_surface_h tbm_surface,
int num_rects, const int *rects)
{
if (surface->type == TPL_SURFACE_TYPE_PIXMAP)
{
- TPL_WARN("Pixmap cannot post(%p, %p)",surface, surface->native_handle);
- return;
+ TPL_ERR("Pixmap cannot post(%p, %p)",surface, surface->native_handle);
+ return TPL_ERROR_INVALID_PARAMETER;
}
TPL_LOG(3, "window(%p, %p)", surface, surface->native_handle);
tbm_surface_queue_h tbm_queue = (tbm_surface_queue_h)surface->native_handle;
+ if (tbm_queue == NULL)
+ {
+ TPL_ERR("tbm_surface_queue is invalid.");
+ return TPL_ERROR_INVALID_PARAMETER;
+ }
- if (tbm_queue)
+ if (tbm_surface_queue_enqueue(tbm_queue, tbm_surface) != TBM_SURFACE_QUEUE_ERROR_NONE)
{
- tbm_surface_queue_enqueue(tbm_queue, tbm_surface);
- TPL_LOG(6, "tbm_surface ENQUEUED!!");
+ TPL_ERR("tbm_surface_queue_enqueue failed. tbm_queue(%p) tbm_surface(%p)",
+ tbm_queue, tbm_surface);
+ return TPL_ERROR_INVALID_OPERATION;
}
+
+ return TPL_ERROR_NONE;
}
static tpl_bool_t
free(node);
}
-static TPL_INLINE tpl_bool_t
+static TPL_INLINE tpl_result_t
__tpl_list_insert(tpl_list_node_t *pos, void *data)
{
tpl_list_node_t *node = (tpl_list_node_t *)malloc(sizeof(tpl_list_node_t));
if (NULL == node)
- return TPL_FALSE;
+ {
+ TPL_ERR("Failed to allocate new tpl_list_node_t.");
+ return TPL_ERROR_INVALID_OPERATION;
+ }
node->data = data;
node->list = pos->list;
pos->list->count++;
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
static TPL_INLINE void
__tpl_list_insert(&list->head, data);
}
-static TPL_INLINE tpl_bool_t
+static TPL_INLINE tpl_result_t
__tpl_list_push_back(tpl_list_t *list, void *data)
{
TPL_ASSERT(list);
hash = CALC_HASH(key);
if (__tpl_hlist_empty(&list->heads[hash]))
+ {
return NULL;
+ }
/* iterate until next node is NULL */
for (pos = list->heads[hash].first; pos->next; pos = pos->next);
*list = NULL;
}
-tpl_bool_t __tpl_hashlist_insert(tpl_hlist_t *list, size_t key, void *data)
+tpl_result_t __tpl_hashlist_insert(tpl_hlist_t *list, size_t key, void *data)
{
size_t hash;
tpl_hlist_node_t *prev_node;
tpl_hlist_node_t *new_node;
if (list == NULL)
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_PARAMETER;
/* check if key already exists in the list */
prev_node = __tpl_hlist_get_node(list, key);
if (prev_node != NULL)
- return TPL_FALSE;
+ {
+ TPL_ERR("key(%d) already exists in tpl_hlist_t(%p).", key, list);
+ return TPL_ERROR_INVALID_PARAMETER;
+ }
/* create new node and assign given values */
new_node = (tpl_hlist_node_t *) malloc(sizeof(tpl_hlist_node_t));
if (new_node == NULL)
- return TPL_FALSE;
+ {
+ TPL_ERR("Failed to allocate new tpl_hlist_node_t.");
+ return TPL_ERROR_INVALID_OPERATION;
+ }
hash = CALC_HASH(key);
__tpl_hlist_init_node(new_node);
/* add new node to head */
__tpl_hlist_add_head(new_node, &list->heads[hash]);
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
void __tpl_hashlist_delete(tpl_hlist_t *list, size_t key)
return ret;
}
-static tpl_bool_t
+static tpl_result_t
__tpl_wayland_display_init(tpl_display_t *display)
{
tpl_wayland_display_t *wayland_display = NULL;
/* Do not allow default display in wayland. */
if (display->native_handle == NULL)
- return TPL_FALSE;
+ {
+ TPL_ERR("Invalid native handle for display.");
+ return TPL_ERROR_INVALID_PARAMETER;
+ }
wayland_display = (tpl_wayland_display_t *) calloc(1, sizeof(tpl_wayland_display_t));
if (wayland_display == NULL)
- return TPL_FALSE;
+ {
+ TPL_ERR("Failed to allocate memory for new tpl_wayland_display_t.");
+ return TPL_ERROR_INVALID_OPERATION;
+ }
display->backend.data = wayland_display;
display->bufmgr_fd = -1;
{
struct wl_display *wl_dpy = (struct wl_display *)display->native_handle;
wayland_display->wl_tbm_client = wayland_tbm_client_init((struct wl_display *) wl_dpy);
-
if (wayland_display->wl_tbm_client == NULL)
{
TPL_ERR("Wayland TBM initialization failed!");
wayland_display->wl_queue = wl_display_create_queue(wl_dpy);
if (NULL == wayland_display->wl_queue)
+ {
+ TPL_ERR("Failed to create wl_queue with wl_dpy(%p).", wl_dpy);
goto free_wl_display;
+ }
wayland_display->wl_registry = wl_display_get_registry(wl_dpy);
if (NULL == wayland_display->wl_registry)
+ {
+ TPL_ERR("Failed to get wl_registry with wl_dpy(%p).", wl_dpy);
goto destroy_queue;
+ }
wl_proxy_set_queue((struct wl_proxy *)wayland_display->wl_registry, wayland_display->wl_queue);
}
else
goto free_wl_display;
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
+
destroy_queue:
wl_event_queue_destroy(wayland_display->wl_queue);
free_wl_display:
free(wayland_display);
display->backend.data = NULL;
}
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_OPERATION;
}
static void
display->backend.data = NULL;
}
-static tpl_bool_t
+static tpl_result_t
__tpl_wayland_display_query_config(tpl_display_t *display, tpl_surface_type_t surface_type,
int red_size, int green_size, int blue_size, int alpha_size,
int color_depth, int *native_visual_id, tpl_bool_t *is_slow)
{
if (native_visual_id != NULL) *native_visual_id = TBM_FORMAT_ARGB8888;
if (is_slow != NULL) *is_slow = TPL_FALSE;
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
if (alpha_size == 0)
{
if (native_visual_id != NULL) *native_visual_id = TBM_FORMAT_XRGB8888;
if (is_slow != NULL) *is_slow = TPL_FALSE;
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
}
- return TPL_FALSE;
+ return TPL_ERROR_INVALID_PARAMETER;
}
-static tpl_bool_t
+static tpl_result_t
__tpl_wayland_display_filter_config(tpl_display_t *display, int *visual_id, int alpha_size)
{
TPL_IGNORE(display);
TPL_IGNORE(visual_id);
TPL_IGNORE(alpha_size);
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
-static tpl_bool_t
+static tpl_result_t
__tpl_wayland_display_get_window_info(tpl_display_t *display, tpl_handle_t window,
int *width, int *height, tbm_format *format, int depth, int a_size)
{
if (width != NULL) *width = wl_egl_window->width;
if (height != NULL) *height = wl_egl_window->height;
- return TPL_TRUE;
+ return TPL_ERROR_NONE;
}
static void
__cb_client_window_resize_callback(struct wl_egl_window* wl_egl_window, void* private);
-static tpl_bool_t
+static tpl_result_t
__tpl_wayland_surface_init(tpl_surface_t *surface)
{
tpl_wayland_surface_t *wayland_surface = NULL;
struct wl_egl_window *wl_egl_window = (struct wl_egl_window *)surface->native_handle;
-
TPL_ASSERT(surface);
TPL_ASSERT(surface->type == TPL_SURFACE_TYPE_WINDOW);
TPL_ASSERT(surface->native_handle);
wayland_surface = (tpl_wayland_surface_t *) calloc(1, sizeof(tpl_wayland_surface_t));
if (NULL == wayland_surface)
- return TPL_FALSE;
+ {
+ TPL_ERR("Failed to allocate memory for new tpl_wayland_surface_t.");
+ return TPL_ERROR_INVALID_OPERATION;
+ }
surface->backend.data = (void *)wayland_surface;
wayland_surface->tbm_queue = NULL;
wl_egl_window->height,
surface->format,
0);
- TPL_LOG(9, "tbm_surface_queue_create!! || wl_egl_window(%p)| tbm_queue(%p)",
- wl_egl_window, wayland_surface->tbm_queue);
if (wayland_surface->tbm_queue == NULL)
{
TPL_ERR("TBM surface queue creation failed!");
- goto error;
+ free(wayland_surface);
+ return TPL_ERROR_INVALID_OPERATION;
}
surface->width = wl_egl_window->width;
wl_egl_window->resize_callback = (void*)__cb_client_window_resize_callback;
TPL_LOG(3, "window(%p, %p) %dx%d", surface, surface->native_handle, surface->width, surface->height);
- return TPL_TRUE;
-error:
- free(wayland_surface);
-
- return TPL_FALSE;
+ return TPL_ERROR_NONE;
}
static void
TPL_ASSERT(wl_egl_window);
/* TPL_ASSERT(wl_egl_window->surface); */ /* to be enabled once evas/gl patch is in place */
- TPL_LOG(9, "tpl_surface_t(%p)| wl_egl_window(%p)| wayland_surface(%p)",
- surface, wl_egl_window, wayland_surface);
wl_egl_window->private = NULL;
/* Detach all pending buffers */
wl_display_flush(surface->display->native_handle);
__tpl_wayland_display_roundtrip(surface->display);
- TPL_LOG(9, "tbm_surface_queue_destroy || wl_egl_window(%p)| tbm_queue(%p)",
- wl_egl_window, wayland_surface->tbm_queue);
-
if (wayland_surface->current_buffer)
tbm_surface_internal_unref(wayland_surface->current_buffer);
surface->backend.data = NULL;
}
-static void
+static tpl_result_t
__tpl_wayland_surface_enqueue_buffer(tpl_surface_t *surface, tbm_surface_h tbm_surface,
int num_rects, const int *rects)
{
wl_egl_window = (struct wl_egl_window *)surface->native_handle;
tbm_surface_internal_unref(tbm_surface);
- TPL_LOG(9, "tbm_surface(%p) ----------", tbm_surface);
tsq_err = tbm_surface_queue_enqueue(wayland_surface->tbm_queue, tbm_surface);
if (tsq_err != TBM_SURFACE_QUEUE_ERROR_NONE)
+ {
TPL_ERR("Failed to enqeueue tbm_surface. | tsq_err = %d", tsq_err);
+ return TPL_ERROR_INVALID_OPERATION;
+ }
/* deprecated */
tsq_err = tbm_surface_queue_acquire(wayland_surface->tbm_queue, &tbm_surface);
if (tsq_err != TBM_SURFACE_QUEUE_ERROR_NONE)
+ {
TPL_ERR("Failed to acquire tbm_surface. | tsq_err = %d", tsq_err);
+ return TPL_ERROR_INVALID_OPERATION;
+ }
tbm_surface_internal_ref(tbm_surface);
- TPL_LOG(9, "tbm_surface(%p) ++++++++++",tbm_surface);
wl_surface_attach(wl_egl_window->surface,
(void *)wayland_buffer->wl_proxy,
wl_egl_window->dx,
wl_egl_window->attached_width = wl_egl_window->width;
wl_egl_window->attached_height = wl_egl_window->height;
-
if (num_rects < 1 || rects == NULL)
{
wl_surface_damage(wl_egl_window->surface,
wl_surface_commit(wl_egl_window->surface);
wl_display_flush(surface->display->native_handle);
+
+ return TPL_ERROR_NONE;
}
static tpl_bool_t
__tpl_wayland_surface_dequeue_buffer(tpl_surface_t *surface)
{
TPL_ASSERT(surface);
- TPL_ASSERT(surface->native_handle);
TPL_ASSERT(surface->backend.data);
TPL_ASSERT(surface->display);
tpl_wayland_buffer_t *wayland_buffer = NULL;
tpl_wayland_surface_t *wayland_surface = (tpl_wayland_surface_t*)surface->backend.data;
tpl_wayland_display_t *wayland_display = (tpl_wayland_display_t*)surface->display->backend.data;
- struct wl_egl_window *wl_egl_window = (struct wl_egl_window *)surface->native_handle;
struct wl_proxy *wl_proxy = NULL;
tbm_surface_queue_error_e tsq_err = 0;
tbm_surface_internal_ref(tbm_surface);
- TPL_LOG(9, "tbm_surface(%p) ++++++++++",tbm_surface);
if ((wayland_buffer = __tpl_wayland_get_wayland_buffer_from_tbm_surface(tbm_surface)) != NULL)
{
return tbm_surface;
wl_proxy = (struct wl_proxy *)wayland_tbm_client_create_buffer(
wayland_display->wl_tbm_client,
tbm_surface);
- TPL_LOG(9, "wl_proxy(%p)CREATED| wl_egl_window(%p)| tbm_surface(%p)| wayland_surface(%p)",
- wl_proxy, wl_egl_window, tbm_surface, wayland_surface);
if (wl_proxy == NULL)
{
TPL_ERR("Failed to create TBM client buffer!");
wl_display_flush((struct wl_display *)wayland_buffer->display->native_handle);
- TPL_LOG(9, "wl_proxy(%p) DESTROYED| wayland_surface(%p)| wayland_buffer(%p)",
- wayland_buffer->wl_proxy, wayland_buffer->wayland_surface, wayland_buffer);
if (wayland_buffer->wl_proxy != NULL)
wayland_tbm_client_destroy_buffer(wayland_display->wl_tbm_client, (void *)wayland_buffer->wl_proxy);
tbm_surface_internal_unref(tbm_surface);
- TPL_LOG(9, "tbm_surface(%p) ----------",tbm_surface);
tbm_surface_queue_release(wayland_surface->tbm_queue, tbm_surface);
}
}
width != tbm_surface_queue_get_width(wayland_surface->tbm_queue) ||
height != tbm_surface_queue_get_height(wayland_surface->tbm_queue))
{
- TPL_LOG(9, "RESIZE!!|tpl_surface_t(%p)| wl_egl_window(%p)| wayland_surface(%p)",
- surface, wl_egl_window, wayland_surface);
if (wayland_surface->current_buffer != NULL)
tbm_surface_internal_unref(wayland_surface->current_buffer);
tbm_surface_queue_reset(wayland_surface->tbm_queue, width, height, format);
}
-
- TPL_LOG(9, "tpl_surface_t(%p)| wl_egl_window(%p)| wayland_surface(%p)",
- surface, wl_egl_window, wayland_surface);
}