E_CONFIG_VAL(D, T, comp_canvas_bg.opmode, INT);
E_CONFIG_VAL(D, T, delayed_load_idle_count, INT);
E_CONFIG_VAL(D, T, use_buffer_flush, UCHAR);
+ E_CONFIG_VAL(D, T, use_buffer_flush_timeout, UCHAR);
+ E_CONFIG_VAL(D, T, buffer_flush_timer_interval, DOUBLE);
E_CONFIG_VAL(D, T, use_desk_smart_obj, UCHAR);
E_CONFIG_LIST(D, T, sock_accesses, _e_config_socket_access_edd);
E_CONFIG_LIST(D, T, aux_hint_supported, _e_config_aux_hint_supported_edd);
E_CONFIG_LIMIT(e_config->comp_canvas_bg.opmode, 0, 11);
E_CONFIG_LIMIT(e_config->delayed_load_idle_count, 0, 100);
E_CONFIG_LIMIT(e_config->use_buffer_flush, 0, 1);
+ E_CONFIG_LIMIT(e_config->use_buffer_flush_timeout, 0, 1);
E_CONFIG_LIMIT(e_config->use_desk_smart_obj, 0, 1);
E_CONFIG_LIMIT(e_config->use_module_srv.qp, 0, 1);
E_CONFIG_LIMIT(e_config->launchscreen_timeout, 7.0, 100.0);
uuid_t uuid;
struct wl_resource *shm_flusher;
+ Ecore_Timer *buffer_flush_timer;
+ Eina_Bool buffer_flush_only_free;
E_Comp_Wl_Client_Data *cdata;
Eina_Bool own_cdata : 1;
if (cp->buffer)
wl_list_remove(&cp->buffer_destroy_listener.link);
+ if (cp->buffer_flush_timer)
+ ecore_timer_del(cp->buffer_flush_timer);
+
free(cp);
}
{
}
-/* By this calling, client will destroy their buffer by this feature
- * implementation. the implementation for shared memory is in evas_shm engine.
- */
-E_API void
-e_pixmap_buffer_clear(E_Pixmap *cp, Eina_Bool only_free)
+static void
+_e_pixmap_buffer_clear(E_Pixmap *cp, Eina_Bool only_free)
{
E_Comp_Wl_Client_Data *cdata;
struct wl_resource *cb;
Eina_List *l, *ll;
- EINA_SAFETY_ON_NULL_RETURN(cp);
-
- /* disabled this feature */
- if (!(cp->client && cp->client->exp_iconify.buffer_flush))
- return;
+ if (!cp->client) return;
+ if (!e_policy_visibility_client_is_iconic(cp->client)) return;
DBG("PIXMAP: Buffer Flush(%s) '%s'(%p) only_free:%d", cp->shm_flusher ? "SHM" : "NATIVE",
cp->client->icccm.name?:"", cp->client, only_free);
- if (cp->shm_flusher)
+ if (only_free)
{
- if (only_free == EINA_TRUE)
- {
- if (TIZEN_SURFACE_SHM_FLUSHER_FREE_FLUSH_SINCE_VERSION <= wl_resource_get_version(cp->shm_flusher))
- {
- tizen_surface_shm_flusher_send_free_flush(cp->shm_flusher);
- }
- else
- {
- /*free_flush was supported from version 2*/
- return;
- }
- }
- else
- {
- tizen_surface_shm_flusher_send_flush(cp->shm_flusher);
- }
- }
- else if (cp->buffer)
- {
- if (only_free)
+ if (!cp->shm_flusher) return;
+
+ /*free_flush was supported from version 2*/
+ if (wl_resource_get_version(cp->shm_flusher) < TIZEN_SURFACE_SHM_FLUSHER_FREE_FLUSH_SINCE_VERSION)
return;
- switch (cp->buffer->type)
- {
- case E_COMP_WL_BUFFER_TYPE_TBM:
- case E_COMP_WL_BUFFER_TYPE_NATIVE:
- {
- struct wayland_tbm_client_queue *cqueue;
-
- cqueue =
- wayland_tbm_server_client_queue_get(e_comp_wl->tbm.server,
- cp->client->comp_data->wl_surface);
- if (!cqueue)
- return;
-
- wayland_tbm_server_client_queue_flush(cqueue);
- }
- break;
- default:
- /* Do nothing */
- break;
- }
+ tizen_surface_shm_flusher_send_free_flush(cp->shm_flusher);
}
else
- return;
-
- if (only_free == EINA_FALSE)
{
+ if (cp->shm_flusher)
+ tizen_surface_shm_flusher_send_flush(cp->shm_flusher);
+ else
+ {
+ if ((cp->buffer) && (cp->client->comp_data))
+ {
+ if ((cp->buffer->type == E_COMP_WL_BUFFER_TYPE_TBM) ||
+ (cp->buffer->type == E_COMP_WL_BUFFER_TYPE_NATIVE))
+ {
+ struct wayland_tbm_client_queue *cqueue;
+
+ cqueue = wayland_tbm_server_client_queue_get(e_comp_wl->tbm.server,
+ cp->client->comp_data->wl_surface);
+ if (!cqueue) return;
+
+ wayland_tbm_server_client_queue_flush(cqueue);
+ }
+ }
+ }
+
+ /* release the helded buffer by e_client */
if (cp->client->comp_data)
{
/* release the helded buffer by e_client */
wl_resource_destroy(cb);
}
}
+}
+
+static Eina_Bool
+_e_pixmap_cb_buffer_flush_timer(void *data)
+{
+ E_Pixmap *cp = (E_Pixmap *)data;
+ if (!cp) return ECORE_CALLBACK_CANCEL;
+
+ cp->buffer_flush_timer = NULL;
+ _e_pixmap_buffer_clear(cp, cp->buffer_flush_only_free);
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+/* By this calling, client will destroy their buffer by this feature
+ * implementation. the implementation for shared memory is in evas_shm engine.
+ */
+E_API void
+e_pixmap_buffer_clear(E_Pixmap *cp, Eina_Bool only_free)
+{
+ EINA_SAFETY_ON_NULL_RETURN(cp);
+
+ /* disabled this feature */
+ if (!cp->client) return;
+ if (!cp->client->exp_iconify.buffer_flush) return;
+
+ if (only_free)
+ {
+ if (!cp->shm_flusher) return;
+
+ /*free_flush was supported from version 2*/
+ if (wl_resource_get_version(cp->shm_flusher) < TIZEN_SURFACE_SHM_FLUSHER_FREE_FLUSH_SINCE_VERSION)
+ return;
+ }
+
+ if ((e_config->use_buffer_flush_timeout) && (e_config->buffer_flush_timer_interval > 0))
+ {
+ if (cp->buffer_flush_timer)
+ {
+ ecore_timer_del(cp->buffer_flush_timer);
+ cp->buffer_flush_timer = NULL;
+ }
+ cp->buffer_flush_only_free = only_free;
+ cp->buffer_flush_timer = ecore_timer_add(e_config->buffer_flush_timer_interval,
+ _e_pixmap_cb_buffer_flush_timer,
+ cp);
+ }
+ else
+ _e_pixmap_buffer_clear(cp, only_free);
}
EINTERN void *