Sync with the latest tizen 2.4 12/45012/1
authorSung-jae Park <nicesj.park@samsung.com>
Thu, 30 Jul 2015 10:31:57 +0000 (19:31 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Thu, 30 Jul 2015 10:31:57 +0000 (19:31 +0900)
Update GL engine checking code

Change-Id: Ie85ce445cd7e605a40bcc09ddebb7491d6f02ab5

include/binder.h
packaging/libwidget.spec
src/binder.c

index a9bb94e..d211f62 100644 (file)
@@ -54,6 +54,7 @@ extern const char *binder_widget_find_pkgname(const char *uri);
 extern Ecore_Evas *binder_ecore_evas_new(vwin_info_t info);
 extern int binder_widget_auto_align(void);
 
-#define GL_ENGINE "opengl_x11"
+#define GL_ENGINE_X11 "opengl_x11"
+#define GL_ENGINE     "opengl"
 
 /* End of a file */
index 256a9f0..d2e4df7 100644 (file)
@@ -2,7 +2,7 @@
 
 Name: libwidget
 Summary: Widget development library
-Version: 1.1.5
+Version: 1.2.0
 Release: 1
 Group: Applications/Core Applications
 License: Flora-1.1
index 74d4cde..a839c87 100644 (file)
@@ -2,6 +2,8 @@
 #include <stdlib.h>
 #define __USE_GNU
 #include <dlfcn.h>
+#define _GNU_SOURCE
+#include <string.h>
 
 #include <Elementary.h>
 #include <Ecore_Evas.h>
@@ -498,6 +500,16 @@ static void free_fb(void *data, void *ptr)
        }
 }
 
+static inline int check_gl_engine(const char *engine)
+{
+       /**
+        * @todo
+        * If the "engine" string going to be changed to more complicated formatted string,
+        * We should replace this with sytanx recognizer (parser).
+        */
+       return !!strcasestr(engine, GL_ENGINE);
+}
+
 Ecore_Evas *binder_ecore_evas_new(vwin_info_t info)
 {
        const char *engine;
@@ -507,8 +519,8 @@ Ecore_Evas *binder_ecore_evas_new(vwin_info_t info)
 
        engine = elm_config_accel_preference_get();
 
-       DbgPrint("Preferred engine: %s (%s)\n", engine, GL_ENGINE);
-       if (engine && !strcmp(engine, GL_ENGINE)) {
+       DbgPrint("Preferred engine: %s (%s or %s)\n", engine, GL_ENGINE, GL_ENGINE_X11);
+       if (engine && check_gl_engine(engine)) {
                if (s_info.alloc_canvas_with_pixmap) {
                        ee = s_info.alloc_canvas_with_pixmap(NULL, 0u, 0, 0, info->w, info->h, alloc_pixmap_cb, free_pixmap_cb, info);
                        if (!ee) {