For remove just free buffer, add the function parameter.
the only_free param has meaning that only free_buffer on client side shoud be removed.
For this operation, tizen_surface_shm_flusher is added the protocol and version up to 2.
The first usage is quickpanel. For reduse idle memory, quickpaenl has just on active buffer.
so quick-panel service call e_pixmap_buffer_clear() function with only_free value.
Change-Id: I0979552e8dc724bc48603a3c94d2be9eeda1f3f9
_e_client_hook_call(E_CLIENT_HOOK_ICONIFY, ec);
if (e_config->use_buffer_flush)
- e_pixmap_buffer_clear(ec->pixmap);
+ e_pixmap_buffer_clear(ec->pixmap, EINA_FALSE);
TRACE_DS_END();
}
return EINA_FALSE;
global = wl_global_create(e_comp_wl->wl.disp, &tizen_surface_shm_interface,
- 1, NULL, _e_pixmap_tzsurf_shm_cb_bind);
+ 2, NULL, _e_pixmap_tzsurf_shm_cb_bind);
if (!global)
return EINA_FALSE;
* implementation. the implementation for shared memory is in evas_shm engine.
*/
E_API void
-e_pixmap_buffer_clear(E_Pixmap *cp)
+e_pixmap_buffer_clear(E_Pixmap *cp, Eina_Bool only_free)
{
E_Comp_Wl_Client_Data *cdata;
struct wl_resource *cb;
if (!e_config->use_buffer_flush)
return;
- DBG("PIXMAP: Buffer Flush(%s) '%s'(%p)", cp->shm_flusher ? "SHM" : "NATIVE",
- cp->client->icccm.name?:"", cp->client);
+ 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)
- tizen_surface_shm_flusher_send_flush(cp->shm_flusher);
+ {
+ 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)
+ return;
+
switch (cp->buffer->type)
{
case E_COMP_WL_BUFFER_TYPE_TBM:
break;
}
}
+ else
+ return;
- /* release the helded buffer by e_client */
- if (cp->client->comp_data)
- e_comp_wl_buffer_reference(&cp->client->comp_data->buffer_ref, NULL);
+ if (only_free == EINA_FALSE)
+ {
+ /* release the helded buffer by e_client */
+ if (cp->client->comp_data)
+ e_comp_wl_buffer_reference(&cp->client->comp_data->buffer_ref, NULL);
- /* composite object clear */
- e_comp_object_clear(cp->client->frame);
+ /* composite object clear */
+ e_comp_object_clear(cp->client->frame);
- /* pending frame event callback*/
- if (!cp->client->comp_data) return;
- cdata = (E_Comp_Wl_Client_Data *)cp->client->comp_data;
- EINA_LIST_FOREACH_SAFE(cdata->frames, l, ll, cb)
- {
- wl_callback_send_done(cb, ecore_time_unix_get() * 1000);
- wl_resource_destroy(cb);
+ /* pending frame event callback*/
+ if (!cp->client->comp_data) return;
+ cdata = (E_Comp_Wl_Client_Data *)cp->client->comp_data;
+ EINA_LIST_FOREACH_SAFE(cdata->frames, l, ll, cb)
+ {
+ wl_callback_send_done(cb, ecore_time_unix_get() * 1000);
+ wl_resource_destroy(cb);
+ }
}
}
E_API Eina_Bool e_pixmap_init(void);
E_API void e_pixmap_shutdown(void);
-E_API void e_pixmap_buffer_clear(E_Pixmap *cp);
+E_API void e_pixmap_buffer_clear(E_Pixmap *cp, Eina_Bool only_free);
static inline Eina_Bool
e_pixmap_is_x(const E_Pixmap *cp)
/* make frame event */
e_pixmap_image_clear(ec->pixmap, EINA_TRUE);
+ /* To use single buffer*/
+ if (EINA_FALSE == e_qp_visible_get())
+ e_pixmap_buffer_clear(ec->pixmap, EINA_TRUE);
+
end:
return ECORE_CALLBACK_PASS_ON;
}
if (qp->need_scroll_update)
_e_qp_client_scrollable_update();
+
+ e_pixmap_buffer_clear(qp->ec->pixmap, EINA_TRUE);
}
static void
};
WL_EXPORT const struct wl_interface tizen_surface_shm_interface = {
- "tizen_surface_shm", 1,
+ "tizen_surface_shm", 2,
1, tizen_surface_shm_requests,
0, NULL,
};
static const struct wl_message tizen_surface_shm_flusher_events[] = {
{ "flush", "", types + 0 },
+ { "free_flush", "2", types + 0 },
};
WL_EXPORT const struct wl_interface tizen_surface_shm_flusher_interface = {
- "tizen_surface_shm_flusher", 1,
+ "tizen_surface_shm_flusher", 2,
1, tizen_surface_shm_flusher_requests,
- 1, tizen_surface_shm_flusher_events,
+ 2, tizen_surface_shm_flusher_events,
};
#include <stdint.h>
#include <stddef.h>
-#include "wayland-util.h"
+#include "wayland-server.h"
struct wl_client;
struct wl_resource;
struct tizen_surface_shm;
struct tizen_surface_shm_flusher;
+struct wl_surface;
extern const struct wl_interface tizen_surface_shm_interface;
extern const struct wl_interface tizen_surface_shm_flusher_interface;
struct wl_resource *surface);
};
+
struct tizen_surface_shm_flusher_interface {
/**
* destroy - (none)
};
#define TIZEN_SURFACE_SHM_FLUSHER_FLUSH 0
+#define TIZEN_SURFACE_SHM_FLUSHER_FREE_FLUSH 1
+
+#define TIZEN_SURFACE_SHM_FLUSHER_FLUSH_SINCE_VERSION 1
+#define TIZEN_SURFACE_SHM_FLUSHER_FREE_FLUSH_SINCE_VERSION 2
static inline void
tizen_surface_shm_flusher_send_flush(struct wl_resource *resource_)
wl_resource_post_event(resource_, TIZEN_SURFACE_SHM_FLUSHER_FLUSH);
}
+static inline void
+tizen_surface_shm_flusher_send_free_flush(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, TIZEN_SURFACE_SHM_FLUSHER_FREE_FLUSH);
+}
+
#ifdef __cplusplus
}
#endif
--- /dev/null
+<protocol name="tizen_surface">
+ <interface name="tizen_surface_shm" version="2">
+ <request name="get_flusher">
+ <arg name="id" type="new_id" interface="tizen_surface_shm_flusher" summary=""/>
+ <arg name="surface" type="object" interface="wl_surface" summary="surface object"/>
+ </request>
+ </interface>
+
+ <interface name="tizen_surface_shm_flusher" version="2">
+ <request name="destroy" type="destructor" />
+ <event name="flush">
+ </event>
+ <event name="free_flush" since="2">
+ </event>
+ </interface>
+</protocol>