it should be supported by ECORE.
by default, it will be 1.
if the ecore_evas support manual stride,
auto_align could be 0
Change-Id: If28025e4e3772d9ac05be5798f6eaf8d8670fe5b
ADD_DEFINITIONS("-DNDEBUG")
ADD_DEFINITIONS("-D_USE_ECORE_TIME_GET")
ADD_DEFINITIONS("-DLOG_TAG=\"LIVEBOX_EDJE\"")
+ADD_DEFINITIONS("-DAUTO_ALIGN=1")
ADD_LIBRARY(${PROJECT_NAME} SHARED
src/script_port.c
extern void *script_buffer_pixmap_buffer(void *handle);
extern int script_buffer_lock(void *handle);
extern int script_buffer_unlock(void *handle);
-
+extern int script_buffer_stride(void *handle);
+extern int script_buffer_auto_align(void);
+extern int script_buffer_pixels(void *handle);
extern void *script_buffer_fb(void *handle);
extern int script_buffer_get_size(void *handle, int *w, int *h);
Name: liblivebox-edje
Summary: EDJE Script loader for the data provider master
-Version: 0.6.4
+Version: 0.7.0
Release: 1
Group: HomeTF/Livebox
License: Flora
return signal_emit(buffer_handle, part, signal, x, y, ex, ey);
}
+int script_buffer_stride(void *handle)
+{
+ static int (*buffer_stride)(void *handle) = NULL;
+
+ if (!buffer_stride) {
+ buffer_stride = dlsym(RTLD_DEFAULT, "buffer_handler_stride");
+ if (!buffer_stride) {
+ ErrPrint("broken ABI: %s\n", dlerror());
+ return LB_STATUS_ERROR_NOT_IMPLEMENTED;
+ }
+ }
+
+ return buffer_stride(handle);
+}
+
+int script_buffer_auto_align(void)
+{
+ static int (*buffer_auto_align)(void) = NULL;
+
+ if (!buffer_auto_align) {
+ buffer_auto_align = dlsym(RTLD_DEFAULT, "buffer_handler_auto_align");
+ if (!buffer_auto_align) {
+ ErrPrint("borken ABI: %s\n", dlerror());
+ return LB_STATUS_ERROR_NOT_IMPLEMENTED;
+ }
+ }
+
+ return buffer_auto_align();
+}
+
+int script_buffer_pixels(void *handle)
+{
+ static int (*buffer_pixels)(void *handle) = NULL;
+
+ if (!buffer_pixels) {
+ buffer_pixels = dlsym(RTLD_DEFAULT, "buffer_handler_pixels");
+ if (!buffer_pixels) {
+ ErrPrint("broken ABI: %s\n", dlerror());
+ return LB_STATUS_ERROR_NOT_IMPLEMENTED;
+ }
+ }
+
+ return buffer_pixels(handle);
+}
+
/* End of a file */
}
}
+#if AUTO_ALIGN
static void *alloc_fb(void *data, int size)
{
struct info *handle = data;
return script_buffer_fb(handle->buffer_handle);
}
+#else
+static void *alloc_fb(void *data, int size, int *stride, int *bpp)
+{
+ struct info *handle = data;
+ int _stride;
+ int _bpp;
+
+ _bpp = script_buffer_pixels(handle->buffer_handle);
+ if (_bpp < 0) {
+ ErrPrint("Failed to get pixel size, fallback to 4\n");
+ _bpp = sizeof(int);
+ }
+
+ _stride = script_buffer_stride(handle->buffer_handle);
+ if (_stride < 0) {
+ int w = 0;
+
+ ecore_evas_geometry_get(handle->ee, NULL, NULL, &w, NULL);
+
+ _stride = w * _bpp;
+ ErrPrint("Failed to get stride info, fallback to %d\n", _stride);
+ }
+
+ *stride = _stride;
+ *bpp = _bpp;
+
+ if (script_buffer_load(handle->buffer_handle) < 0) {
+ ErrPrint("Failed to load buffer handler\n");
+ return NULL;
+ }
+
+ return script_buffer_fb(handle->buffer_handle);
+}
+#endif
static void free_fb(void *data, void *ptr)
{
return LB_STATUS_SUCCESS;
}
+#if AUTO_ALIGN
handle->ee = ecore_evas_buffer_allocfunc_new(*w, *h, alloc_fb, free_fb, handle);
if (!handle->ee) {
ErrPrint("Failed to create a buffer\n");
return LB_STATUS_ERROR_FAULT;
}
+#else
+ handle->ee = ecore_evas_buffer_allocfunc_with_stride_new(*w, *h, alloc_fb, free_fb, handle);
+ if (!handle->ee) {
+ ErrPrint("Failed to create a buffer\n");
+ return LB_STATUS_ERROR_FAULT;
+ }
+#endif
handle->e = ecore_evas_get(handle->ee);
if (!handle->e) {