4 * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
8 * Vitaliy Cherepanov <v.cherepanov@samsung.com>
10 * This library is free software; you can redistribute it and/or modify it under
11 * the terms of the GNU Lesser General Public License as published by the
12 * Free Software Foundation; either version 2.1 of the License, or (at your option)
15 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
16 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this library; if not, write to the Free Software Foundation, Inc., 51
22 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 * - Samsung RnD Institute Russia
29 #include "da_gles20.h"
32 #include "common_probe_init.h"
33 #include "real_functions.h"
35 static enum DaOptions _sopt = OPT_GLES;
37 /* Evas open gl API functions */
39 void evas_gl_free(Evas_GL *evas_gl)
41 typedef void (*methodType)(Evas_GL *evas_gl);
42 BEFORE_EVAS_GL(evas_gl_free);
43 evas_gl_freep(evas_gl);
44 AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "p",
45 voidp_to_uint64(evas_gl));
48 void evas_gl_config_free(Evas_GL_Config *cfg)
50 typedef void (*methodType)(Evas_GL_Config *cfg);
51 BEFORE_EVAS_GL(evas_gl_config_free);
52 evas_gl_config_freep(cfg);
53 AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "p",
54 voidp_to_uint64(cfg));
57 void evas_gl_surface_destroy(Evas_GL *evas_gl, Evas_GL_Surface *surf)
59 typedef void (*methodType)(Evas_GL *evas_gl, Evas_GL_Surface *surf);
60 BEFORE_EVAS_GL(evas_gl_surface_destroy);
61 evas_gl_surface_destroyp(evas_gl, surf);
62 AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "pp",
63 voidp_to_uint64(evas_gl), voidp_to_uint64(surf));
66 void evas_gl_context_destroy(Evas_GL *evas_gl, Evas_GL_Context *ctx)
68 typedef void (*methodType)(Evas_GL *evas_gl, Evas_GL_Context *ctx);
69 BEFORE_EVAS_GL(evas_gl_context_destroy);
70 evas_gl_context_destroyp(evas_gl, ctx);
71 AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "pp",
72 voidp_to_uint64(evas_gl), voidp_to_uint64(ctx));
75 Evas_GL *evas_gl_new(Evas *e)
77 typedef Evas_GL *(*methodType)(Evas *e);
78 BEFORE_EVAS_GL(evas_gl_new);
79 Evas_GL *res = evas_gl_newp(e);
80 AFTER('p', voidp_to_uint64(res), APITYPE_CONTEXT, "", "p",
85 Evas_GL_Config *evas_gl_config_new(void)
87 typedef Evas_GL_Config *(*methodType)(void);
88 BEFORE_EVAS_GL(evas_gl_config_new);
89 Evas_GL_Config *res = evas_gl_config_newp();
90 AFTER_NO_PARAM('p', voidp_to_uint64(res), APITYPE_CONTEXT, "");
94 Evas_GL_Surface *evas_gl_surface_create(Evas_GL *evas_gl, Evas_GL_Config *cfg,
97 typedef Evas_GL_Surface *(*methodType)(Evas_GL *evas_gl,
100 BEFORE_EVAS_GL(evas_gl_surface_create);
101 Evas_GL_Surface *res = evas_gl_surface_createp(evas_gl, cfg, w, h);
102 AFTER('p', voidp_to_uint64(res), APITYPE_CONTEXT, "", "ppdd",
103 voidp_to_uint64(evas_gl), voidp_to_uint64(cfg), w, h);
107 Evas_GL_Context *evas_gl_context_create(Evas_GL *evas_gl,
108 Evas_GL_Context *share_ctx)
110 typedef Evas_GL_Context *(*methodType)(Evas_GL *evas_gl,
111 Evas_GL_Context *share_ctx);
112 BEFORE_EVAS_GL(evas_gl_context_create);
113 Evas_GL_Context *res = evas_gl_context_createp(evas_gl, share_ctx);
114 AFTER('p', voidp_to_uint64(res), APITYPE_CONTEXT, "", "pp",
115 voidp_to_uint64(evas_gl), voidp_to_uint64(share_ctx));
119 Eina_Bool evas_gl_make_current(Evas_GL *evas_gl, Evas_GL_Surface *surf,
120 Evas_GL_Context *ctx)
122 typedef Eina_Bool (*methodType)(Evas_GL *evas_gl, Evas_GL_Surface *surf,
123 Evas_GL_Context *ctx);
124 BEFORE_EVAS_GL(evas_gl_make_current);
125 Eina_Bool res = evas_gl_make_currentp(evas_gl, surf, ctx);
126 AFTER('b', res, APITYPE_CONTEXT, "", "ppp",
127 voidp_to_uint64(evas_gl), voidp_to_uint64(surf), voidp_to_uint64(ctx));
131 const char *evas_gl_string_query(Evas_GL *evas_gl, int name)
133 typedef const char *(*methodType)(Evas_GL *evas_gl, int name);
134 BEFORE_EVAS_GL(evas_gl_string_query);
135 const char *res = evas_gl_string_queryp(evas_gl, name);
136 AFTER('s', res, APITYPE_CONTEXT, "", "pd",
137 voidp_to_uint64(evas_gl), name);
141 Evas_GL_Func evas_gl_proc_address_get(Evas_GL *evas_gl, const char *name)
143 typedef Evas_GL_Func(*methodType)(Evas_GL *evas_gl, const char *name);
144 BEFORE_EVAS_GL(evas_gl_proc_address_get);
145 Evas_GL_Func res = evas_gl_proc_address_getp(evas_gl, name);
146 AFTER('p', voidp_to_uint64(res), APITYPE_CONTEXT, "", "ps",
147 voidp_to_uint64(evas_gl), name);
151 Eina_Bool evas_gl_native_surface_get(Evas_GL *evas_gl, Evas_GL_Surface *surf,
152 Evas_Native_Surface *ns)
154 typedef Eina_Bool(*methodType)(Evas_GL *evas_gl, Evas_GL_Surface *surf,
155 Evas_Native_Surface *ns);
156 BEFORE_EVAS_GL(evas_gl_native_surface_get);
157 Eina_Bool res = evas_gl_native_surface_getp(evas_gl, surf, ns);
158 AFTER('b', res, APITYPE_CONTEXT, "", "ppp",
159 voidp_to_uint64(evas_gl), voidp_to_uint64(surf), voidp_to_uint64(ns));
163 /* ----------------- api get functions -------------- */
165 Evas_GL_API *evas_gl_api_get(Evas_GL *evas_gl)
167 typedef Evas_GL_API *(*methodType)(Evas_GL *evas_gl);
168 BEFORE_EVAS_GL(evas_gl_api_get);
169 Evas_GL_API *res = evas_gl_api_getp(evas_gl);
171 /* save original api functions and rewrite it by probes */
173 save_orig_gl_api_list(res);
174 change_gl_api_list(res);
177 AFTER('p', res, APITYPE_CONTEXT, "", "p",
178 voidp_to_uint64(evas_gl));
183 Evas_GL_API* elm_glview_gl_api_get(const Evas_Object *obj)
185 typedef Evas_GL_API *(*methodType)(const Evas_Object *obj);
186 BEFORE_EVAS_GL(elm_glview_gl_api_get);
187 Evas_GL_API *res = elm_glview_gl_api_getp(obj);
189 /* save original api functions and rewrite it by probes */
191 save_orig_gl_api_list(res);
192 change_gl_api_list(res);
196 __gl_api->glGetError();
198 AFTER('p', res, APITYPE_CONTEXT, "", "p",
199 voidp_to_uint64(obj));
204 Evas_GL_API *evas_gl_context_api_get(Evas_GL *evas_gl, Evas_GL_Context *ctx)
206 typedef Evas_GL_API *(*methodType)(Evas_GL *evas_gl, Evas_GL_Context *ctx);
207 static methodType evas_gl_context_api_getp = 0;
209 GET_REAL_FUNC_RTLD_NEXT(evas_gl_context_api_get);
211 Evas_GL_API *res = evas_gl_context_api_getp(evas_gl, ctx);
213 /* save original api functions and rewrite it by probes */
215 save_orig_gl_api_list(res);
216 change_gl_api_list(res);