[FIX] opengl probes 56/27356/4
authorVitaliy Cherepanov <v.cherepanov@samsung.com>
Thu, 11 Sep 2014 11:48:56 +0000 (15:48 +0400)
committerDmitry Kovalenko <d.kovalenko@samsung.com>
Fri, 26 Sep 2014 12:12:24 +0000 (05:12 -0700)
error: no probe comes

Change-Id: I54bbfeb2d16a1bdc2d75d3575d8feb80cd743489
Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
probe_graphics/da_evas_gl.c
probe_graphics/da_gl_api_init.c
scripts/api_names.txt

index baa13f358e1423a3e7e54d3b7b4a5c86f5c5e2e5..707cba6af86585d3bb59454d15a07718ee7f5da3 100644 (file)
@@ -159,6 +159,8 @@ Eina_Bool evas_gl_native_surface_get(Evas_GL *evas_gl, Evas_GL_Surface *surf,
        return res;
 }
 
+/* ----------------- api get functions -------------- */
+
 Evas_GL_API *evas_gl_api_get(Evas_GL *evas_gl)
 {
        typedef Evas_GL_API *(*methodType)(Evas_GL *evas_gl);
@@ -166,10 +168,50 @@ Evas_GL_API *evas_gl_api_get(Evas_GL *evas_gl)
        Evas_GL_API *res = evas_gl_api_getp(evas_gl);
 
        /* save original api functions and rewrite it by probes */
-       save_orig_gl_api_list(res);
-       change_gl_api_list(res);
+       if (res != NULL) {
+               save_orig_gl_api_list(res);
+               change_gl_api_list(res);
+       }
 
        AFTER('p', res, APITYPE_CONTEXT, "", "p",
              voidp_to_uint64(evas_gl));
+
+       return res;
+}
+
+Evas_GL_API* elm_glview_gl_api_get(const Evas_Object *obj)
+{
+       typedef Evas_GL_API *(*methodType)(const Evas_Object *obj);
+       BEFORE_EVAS_GL(elm_glview_gl_api_get);
+       Evas_GL_API *res = elm_glview_gl_api_getp(obj);
+
+       /* save original api functions and rewrite it by probes */
+       if (res != NULL) {
+               save_orig_gl_api_list(res);
+               change_gl_api_list(res);
+       }
+
+       GL_GET_ERROR();
+       AFTER('p', res, APITYPE_CONTEXT, "", "p",
+             voidp_to_uint64(obj));
+
+       return res;
+}
+
+Evas_GL_API *evas_gl_context_api_get(Evas_GL *evas_gl, Evas_GL_Context *ctx)
+{
+       typedef Evas_GL_API *(*methodType)(Evas_GL *evas_gl, Evas_GL_Context *ctx);
+       static methodType evas_gl_context_api_getp = 0;
+
+       GET_REAL_FUNC_RTLD_NEXT(evas_gl_context_api_get);
+
+       Evas_GL_API *res = evas_gl_context_api_getp(evas_gl, ctx);
+
+       /* save original api functions and rewrite it by probes */
+       if (res != NULL) {
+               save_orig_gl_api_list(res);
+               change_gl_api_list(res);
+       }
+
        return res;
 }
index e01125dd60f147d0337f0366ccff5577b55c74ac..30d068379a2ca5c4a46fe2ff32a3b0dce2e10a16 100644 (file)
@@ -39,6 +39,7 @@
 /* --------------------------------- */
 
 
+static bool __gl_api_initialized = 0;
 Evas_GL_API *__gl_api = NULL;
 
 void __init_gl_api__(void)
@@ -50,7 +51,11 @@ void __init_gl_api__(void)
 
 void save_orig_gl_api_list(Evas_GL_API *api)
 {
-       memcpy(__gl_api, api, sizeof(*api));
+       /* TODO make this check more pretty */
+       if (__gl_api_initialized == 0) {
+               memcpy(__gl_api, api, sizeof(*api));
+               __gl_api_initialized = 1;
+       }
 }
 
 /* IMPORTANT this code must be right before change_gl_api_list function!
index d1ffa3ca9470d94c83b039ad02ed64ddc9fc13df..e984497b5185e9b2bed5231f92e9b21f0f062a06 100644 (file)
@@ -285,6 +285,8 @@ ecore_event_evas_mouse_button_down
 ecore_event_evas_mouse_button_up
 ecore_event_evas_mouse_move
 
+elm_glview_gl_api_get
+
 evas_gl_free
 evas_gl_config_free
 evas_gl_surface_destroy