summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:50:31 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:50:31 -0700
commit46e2e103d7fcc08dbe5b12990c36234ebf13d3c1 (patch)
tree802115524ac16e20bf0bd27c94b92300926bac68
parent326ff87216967cb5aa544adc88cebdc5564cc290 (diff)
evas: refactor the call to window_use.
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c121
1 files changed, 47 insertions, 74 deletions
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index 0de805d..ef9bf2a 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -58,6 +58,14 @@ gl_generic_context_get(Render_Output_GL_Generic *output)
58 58
59} 59}
60 60
61static void
62gl_generic_window_use(void *engine)
63{
64 Render_Output_GL_Generic *re = engine;
65
66 re->window_use(re->software.ob);
67}
68
61static int eng_gl_image_direct_get(void *data, void *image); 69static int eng_gl_image_direct_get(void *data, void *image);
62static int eng_gl_surface_destroy(void *data, void *surface); 70static int eng_gl_surface_destroy(void *data, void *surface);
63static Eina_Bool eng_gl_surface_lock(void *data, void *surface); 71static Eina_Bool eng_gl_surface_lock(void *data, void *surface);
@@ -186,7 +194,6 @@ eng_image_colorspace_get(void *engine EINA_UNUSED, void *image)
186static void * 194static void *
187eng_image_alpha_set(void *engine, void *image, int has_alpha) 195eng_image_alpha_set(void *engine, void *image, int has_alpha)
188{ 196{
189 Render_Output_GL_Generic *re = engine;
190 Evas_GL_Image *im; 197 Evas_GL_Image *im;
191 198
192 if (!image) return NULL; 199 if (!image) return NULL;
@@ -197,7 +204,7 @@ eng_image_alpha_set(void *engine, void *image, int has_alpha)
197 im->alpha = has_alpha; 204 im->alpha = has_alpha;
198 return image; 205 return image;
199 } 206 }
200 re->window_use(re->software.ob); 207 gl_generic_window_use(engine);
201 if ((im->tex) && (im->tex->pt->dyn.img)) 208 if ((im->tex) && (im->tex->pt->dyn.img))
202 { 209 {
203 im->alpha = has_alpha; 210 im->alpha = has_alpha;
@@ -269,7 +276,6 @@ eng_image_data_direct_get(void *engine EINA_UNUSED, void *image, int plane,
269static void 276static void
270eng_image_colorspace_set(void *engine, void *image, Evas_Colorspace cspace) 277eng_image_colorspace_set(void *engine, void *image, Evas_Colorspace cspace)
271{ 278{
272 Render_Output_GL_Generic *re = engine;
273 Evas_GL_Image *im; 279 Evas_GL_Image *im;
274 280
275 if (!image) return; 281 if (!image) return;
@@ -277,7 +283,7 @@ eng_image_colorspace_set(void *engine, void *image, Evas_Colorspace cspace)
277 if (im->native.data) return; 283 if (im->native.data) return;
278 /* FIXME: can move to gl_common */ 284 /* FIXME: can move to gl_common */
279 if (im->cs.space == cspace) return; 285 if (im->cs.space == cspace) return;
280 re->window_use(re->software.ob); 286 gl_generic_window_use(engine);
281 evas_gl_common_image_alloc_ensure(im); 287 evas_gl_common_image_alloc_ensure(im);
282 switch (cspace) 288 switch (cspace)
283 { 289 {
@@ -385,7 +391,6 @@ static void *
385eng_image_native_set(void *engine, void *image, void *native) 391eng_image_native_set(void *engine, void *image, void *native)
386{ 392{
387 Evas_Engine_GL_Context *gl_context; 393 Evas_Engine_GL_Context *gl_context;
388 Render_Output_GL_Generic *re = engine;
389 Evas_Native_Surface *ns = native; 394 Evas_Native_Surface *ns = native;
390 Evas_GL_Image *im = image, *im2 = NULL; 395 Evas_GL_Image *im = image, *im2 = NULL;
391 uint32_t texid; 396 uint32_t texid;
@@ -393,7 +398,7 @@ eng_image_native_set(void *engine, void *image, void *native)
393 unsigned int tex = 0; 398 unsigned int tex = 0;
394 unsigned int fbo = 0; 399 unsigned int fbo = 0;
395 400
396 gl_context = gl_generic_context_get(re); 401 gl_context = gl_generic_context_get(engine);
397 402
398 if (!im) 403 if (!im)
399 { 404 {
@@ -426,7 +431,7 @@ eng_image_native_set(void *engine, void *image, void *native)
426 } 431 }
427 if ((!ns) && (!im->native.data)) return im; 432 if ((!ns) && (!im->native.data)) return im;
428 433
429 re->window_use(re->software.ob); 434 gl_generic_window_use(engine);
430 435
431 if (im->native.data) 436 if (im->native.data)
432 { 437 {
@@ -508,10 +513,9 @@ static void *
508eng_image_load(void *engine, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo) 513eng_image_load(void *engine, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo)
509{ 514{
510 Evas_Engine_GL_Context *gl_context; 515 Evas_Engine_GL_Context *gl_context;
511 Render_Output_GL_Generic *re = engine;
512 516
513 *error = EVAS_LOAD_ERROR_NONE; 517 *error = EVAS_LOAD_ERROR_NONE;
514 gl_context = gl_generic_context_get(re); 518 gl_context = gl_generic_context_get(engine);
515 return evas_gl_common_image_load(gl_context, file, key, lo, error); 519 return evas_gl_common_image_load(gl_context, file, key, lo, error);
516} 520}
517 521
@@ -519,10 +523,9 @@ static void *
519eng_image_mmap(void *engine, Eina_File *f, const char *key, int *error, Evas_Image_Load_Opts *lo) 523eng_image_mmap(void *engine, Eina_File *f, const char *key, int *error, Evas_Image_Load_Opts *lo)
520{ 524{
521 Evas_Engine_GL_Context *gl_context; 525 Evas_Engine_GL_Context *gl_context;
522 Render_Output_GL_Generic *re = engine;
523 526
524 *error = EVAS_LOAD_ERROR_NONE; 527 *error = EVAS_LOAD_ERROR_NONE;
525 gl_context = gl_generic_context_get(re); 528 gl_context = gl_generic_context_get(engine);
526 return evas_gl_common_image_mmap(gl_context, f, key, lo, error); 529 return evas_gl_common_image_mmap(gl_context, f, key, lo, error);
527} 530}
528 531
@@ -530,9 +533,8 @@ static void *
530eng_image_new_from_data(void *engine, int w, int h, DATA32 *image_data, int alpha, Evas_Colorspace cspace) 533eng_image_new_from_data(void *engine, int w, int h, DATA32 *image_data, int alpha, Evas_Colorspace cspace)
531{ 534{
532 Evas_Engine_GL_Context *gl_context; 535 Evas_Engine_GL_Context *gl_context;
533 Render_Output_GL_Generic *re = engine;
534 536
535 gl_context = gl_generic_context_get(re); 537 gl_context = gl_generic_context_get(engine);
536 return evas_gl_common_image_new_from_data(gl_context, w, h, image_data, alpha, cspace); 538 return evas_gl_common_image_new_from_data(gl_context, w, h, image_data, alpha, cspace);
537} 539}
538 540
@@ -540,19 +542,16 @@ static void *
540eng_image_new_from_copied_data(void *engine, int w, int h, DATA32 *image_data, int alpha, Evas_Colorspace cspace) 542eng_image_new_from_copied_data(void *engine, int w, int h, DATA32 *image_data, int alpha, Evas_Colorspace cspace)
541{ 543{
542 Evas_Engine_GL_Context *gl_context; 544 Evas_Engine_GL_Context *gl_context;
543 Render_Output_GL_Generic *re = engine;
544 545
545 gl_context = gl_generic_context_get(re); 546 gl_context = gl_generic_context_get(engine);
546 return evas_gl_common_image_new_from_copied_data(gl_context, w, h, image_data, alpha, cspace); 547 return evas_gl_common_image_new_from_copied_data(gl_context, w, h, image_data, alpha, cspace);
547} 548}
548 549
549void 550void
550eng_image_free(void *engine, void *image) 551eng_image_free(void *engine, void *image)
551{ 552{
552 Render_Output_GL_Generic *re = engine;
553
554 if (!image) return; 553 if (!image) return;
555 re->window_use(re->software.ob); 554 gl_generic_window_use(engine);
556 evas_gl_common_image_free(image); 555 evas_gl_common_image_free(image);
557} 556}
558 557
@@ -595,7 +594,6 @@ static void *
595eng_image_size_set(void *engine, void *image, int w, int h) 594eng_image_size_set(void *engine, void *image, int w, int h)
596{ 595{
597 Evas_Engine_GL_Context *gl_context; 596 Evas_Engine_GL_Context *gl_context;
598 Render_Output_GL_Generic *re = engine;
599 Evas_GL_Image *im = image; 597 Evas_GL_Image *im = image;
600 Evas_GL_Image *im_old; 598 Evas_GL_Image *im_old;
601 599
@@ -607,7 +605,7 @@ eng_image_size_set(void *engine, void *image, int w, int h)
607 evas_gl_common_image_native_enable(im); 605 evas_gl_common_image_native_enable(im);
608 return image; 606 return image;
609 } 607 }
610 gl_context = gl_generic_context_get(re); 608 gl_context = gl_generic_context_get(engine);
611 if ((im->tex) && (im->tex->pt->dyn.img)) 609 if ((im->tex) && (im->tex->pt->dyn.img))
612 { 610 {
613 evas_gl_common_texture_free(im->tex, EINA_TRUE); 611 evas_gl_common_texture_free(im->tex, EINA_TRUE);
@@ -646,12 +644,11 @@ eng_image_size_set(void *engine, void *image, int w, int h)
646static void * 644static void *
647eng_image_dirty_region(void *engine, void *image, int x, int y, int w, int h) 645eng_image_dirty_region(void *engine, void *image, int x, int y, int w, int h)
648{ 646{
649 Render_Output_GL_Generic *re = engine;
650 Evas_GL_Image *im = image; 647 Evas_GL_Image *im = image;
651 648
652 if (!image) return NULL; 649 if (!image) return NULL;
653 if (im->native.data) return image; 650 if (im->native.data) return image;
654 re->window_use(re->software.ob); 651 gl_generic_window_use(engine);
655 evas_gl_common_image_dirty(image, x, y, w, h); 652 evas_gl_common_image_dirty(image, x, y, w, h);
656 return image; 653 return image;
657} 654}
@@ -717,7 +714,6 @@ _rotate_image_data(Render_Output_GL_Generic *re, Evas_GL_Image *im1)
717void * 714void *
718eng_image_data_get(void *engine, void *image, int to_write, DATA32 **image_data, int *err, Eina_Bool *tofree) 715eng_image_data_get(void *engine, void *image, int to_write, DATA32 **image_data, int *err, Eina_Bool *tofree)
719{ 716{
720 Render_Output_GL_Generic *re = engine;
721 Evas_GL_Image *im_new = NULL; 717 Evas_GL_Image *im_new = NULL;
722 Evas_GL_Image *im = image; 718 Evas_GL_Image *im = image;
723 int error; 719 int error;
@@ -740,7 +736,7 @@ eng_image_data_get(void *engine, void *image, int to_write, DATA32 **image_data,
740 goto rotate_image; 736 goto rotate_image;
741 737
742#ifdef GL_GLES 738#ifdef GL_GLES
743 re->window_use(re->software.ob); 739 gl_generic_window_use(engine);
744 740
745 if ((im->tex) && (im->tex->pt) && (im->tex->pt->dyn.img) && 741 if ((im->tex) && (im->tex->pt) && (im->tex->pt->dyn.img) &&
746 (im->cs.space == EVAS_COLORSPACE_ARGB8888)) 742 (im->cs.space == EVAS_COLORSPACE_ARGB8888))
@@ -791,7 +787,7 @@ eng_image_data_get(void *engine, void *image, int to_write, DATA32 **image_data,
791 return im; 787 return im;
792 } 788 }
793 789
794 re->window_use(re->software.ob); 790 gl_generic_window_use(engine);
795#endif 791#endif
796 792
797 /* use glReadPixels for FBOs (assume fbo > 0) */ 793 /* use glReadPixels for FBOs (assume fbo > 0) */
@@ -944,13 +940,12 @@ rotate_image:
944void * 940void *
945eng_image_data_put(void *engine, void *image, DATA32 *image_data) 941eng_image_data_put(void *engine, void *image, DATA32 *image_data)
946{ 942{
947 Render_Output_GL_Generic *re = engine;
948 Evas_GL_Image *im, *im2; 943 Evas_GL_Image *im, *im2;
949 944
950 if (!image) return NULL; 945 if (!image) return NULL;
951 im = image; 946 im = image;
952 if (im->native.data) return image; 947 if (im->native.data) return image;
953 re->window_use(re->software.ob); 948 gl_generic_window_use(engine);
954 evas_gl_common_image_alloc_ensure(im); 949 evas_gl_common_image_alloc_ensure(im);
955 if ((im->tex) && (im->tex->pt) 950 if ((im->tex) && (im->tex->pt)
956 && (im->tex->pt->dyn.data) 951 && (im->tex->pt->dyn.data)
@@ -1031,7 +1026,6 @@ eng_image_data_put(void *engine, void *image, DATA32 *image_data)
1031static void * 1026static void *
1032eng_image_orient_set(void *engine, void *image, Evas_Image_Orient orient) 1027eng_image_orient_set(void *engine, void *image, Evas_Image_Orient orient)
1033{ 1028{
1034 Render_Output_GL_Generic *re = engine;
1035 Evas_GL_Image *im; 1029 Evas_GL_Image *im;
1036 Evas_GL_Image *im_new; 1030 Evas_GL_Image *im_new;
1037 1031
@@ -1039,7 +1033,7 @@ eng_image_orient_set(void *engine, void *image, Evas_Image_Orient orient)
1039 im = image; 1033 im = image;
1040 if (im->orient == orient) return image; 1034 if (im->orient == orient) return image;
1041 1035
1042 re->window_use(re->software.ob); 1036 gl_generic_window_use(engine);
1043 1037
1044 evas_gl_common_image_update(im->gc, im); 1038 evas_gl_common_image_update(im->gc, im);
1045 1039
@@ -1100,7 +1094,7 @@ eng_image_data_preload_request(void *engine EINA_UNUSED, void *image, const Eo *
1100 { 1094 {
1101 Evas_Engine_GL_Context *gl_context; 1095 Evas_Engine_GL_Context *gl_context;
1102 1096
1103 gl_context = gl_generic_context_get(re); 1097 gl_context = gl_generic_context_get(engine);
1104 gim->tex = evas_gl_common_texture_new(gl_context, gim->im, EINA_FALSE); 1098 gim->tex = evas_gl_common_texture_new(gl_context, gim->im, EINA_FALSE);
1105 EINA_SAFETY_ON_NULL_RETURN(gim->tex); 1099 EINA_SAFETY_ON_NULL_RETURN(gim->tex);
1106 gim->tex->im = gim; 1100 gim->tex->im = gim;
@@ -1140,9 +1134,10 @@ eng_image_draw(void *engine EINA_UNUSED, void *data, void *context, void *surfac
1140 Evas_Native_Surface *n; 1134 Evas_Native_Surface *n;
1141 1135
1142 if (!im) return EINA_FALSE; 1136 if (!im) return EINA_FALSE;
1137
1143 n = im->native.data; 1138 n = im->native.data;
1144 1139
1145 gl_context = gl_generic_context_get(re); 1140 gl_context = gl_generic_context_get(data);
1146 1141
1147 if (eng_gl_image_direct_get(data, image)) 1142 if (eng_gl_image_direct_get(data, image))
1148 { 1143 {
@@ -1227,10 +1222,9 @@ eng_image_map_draw(void *engine, void *data, void *context, void *surface, void
1227{ 1222{
1228 Evas_Engine_GL_Context *gl_context; 1223 Evas_Engine_GL_Context *gl_context;
1229 Evas_GL_Image *gim = image; 1224 Evas_GL_Image *gim = image;
1230 Render_Output_GL_Generic *re = data;
1231 1225
1232 if (!image) return EINA_FALSE; 1226 if (!image) return EINA_FALSE;
1233 gl_context = gl_generic_context_get(re); 1227 gl_context = gl_generic_context_get(data);
1234 evas_gl_common_context_target_surface_set(gl_context, surface); 1228 evas_gl_common_context_target_surface_set(gl_context, surface);
1235 gl_context->dc = context; 1229 gl_context->dc = context;
1236 1230
@@ -1279,10 +1273,9 @@ eng_image_map_clean(void *engine EINA_UNUSED, RGBA_Map *m EINA_UNUSED)
1279static void * 1273static void *
1280eng_image_map_surface_new(void *engine, int w, int h, int alpha) 1274eng_image_map_surface_new(void *engine, int w, int h, int alpha)
1281{ 1275{
1282 Render_Output_GL_Generic *re = engine;
1283 Evas_Engine_GL_Context *gl_context; 1276 Evas_Engine_GL_Context *gl_context;
1284 1277
1285 gl_context = gl_generic_context_get(re); 1278 gl_context = gl_generic_context_get(engine);
1286 return evas_gl_common_image_surface_new(gl_context, w, h, alpha, EINA_FALSE); 1279 return evas_gl_common_image_surface_new(gl_context, w, h, alpha, EINA_FALSE);
1287} 1280}
1288 1281
@@ -1297,9 +1290,7 @@ eng_image_scaled_update(void *engine EINA_UNUSED, void *scaled, void *image,
1297static void 1290static void
1298eng_image_content_hint_set(void *engine, void *image, int hint) 1291eng_image_content_hint_set(void *engine, void *image, int hint)
1299{ 1292{
1300 Render_Output_GL_Generic *re = engine; 1293 gl_generic_window_use(engine);
1301
1302 re->window_use(re->software.ob);
1303 evas_gl_common_image_content_hint_set(image, hint); 1294 evas_gl_common_image_content_hint_set(image, hint);
1304} 1295}
1305 1296
@@ -1315,10 +1306,9 @@ static void
1315eng_image_cache_flush(void *engine) 1306eng_image_cache_flush(void *engine)
1316{ 1307{
1317 Evas_Engine_GL_Context *gl_context; 1308 Evas_Engine_GL_Context *gl_context;
1318 Render_Output_GL_Generic *re = engine;
1319 int tmp_size; 1309 int tmp_size;
1320 1310
1321 gl_context = gl_generic_context_get(re); 1311 gl_context = gl_generic_context_get(engine);
1322 if (!gl_context) return; 1312 if (!gl_context) return;
1323 1313
1324 tmp_size = evas_common_image_get_cache(); 1314 tmp_size = evas_common_image_get_cache();
@@ -1332,9 +1322,8 @@ static void
1332eng_image_cache_set(void *engine, int bytes) 1322eng_image_cache_set(void *engine, int bytes)
1333{ 1323{
1334 Evas_Engine_GL_Context *gl_context; 1324 Evas_Engine_GL_Context *gl_context;
1335 Render_Output_GL_Generic *re = engine;
1336 1325
1337 gl_context = gl_generic_context_get(re); 1326 gl_context = gl_generic_context_get(engine);
1338 1327
1339 evas_common_image_set_cache(bytes); 1328 evas_common_image_set_cache(bytes);
1340 evas_common_rgba_image_scalecache_size_set(bytes); 1329 evas_common_rgba_image_scalecache_size_set(bytes);
@@ -1350,10 +1339,9 @@ eng_image_cache_get(void *engine EINA_UNUSED)
1350static void 1339static void
1351eng_font_cache_flush(void *engine) 1340eng_font_cache_flush(void *engine)
1352{ 1341{
1353 Render_Output_GL_Generic *re = engine;
1354 int tmp_size; 1342 int tmp_size;
1355 1343
1356 re->window_use(re->software.ob); 1344 gl_generic_window_use(engine);
1357 tmp_size = evas_common_font_cache_get(); 1345 tmp_size = evas_common_font_cache_get();
1358 evas_common_font_cache_set(0); 1346 evas_common_font_cache_set(0);
1359 evas_common_font_flush(); 1347 evas_common_font_flush();
@@ -1363,18 +1351,14 @@ eng_font_cache_flush(void *engine)
1363static void 1351static void
1364eng_font_cache_set(void *engine, int bytes) 1352eng_font_cache_set(void *engine, int bytes)
1365{ 1353{
1366 Render_Output_GL_Generic *re = engine; 1354 gl_generic_window_use(engine);
1367
1368 re->window_use(re->software.ob);
1369 evas_common_font_cache_set(bytes); 1355 evas_common_font_cache_set(bytes);
1370} 1356}
1371 1357
1372static int 1358static int
1373eng_font_cache_get(void *engine) 1359eng_font_cache_get(void *engine)
1374{ 1360{
1375 Render_Output_GL_Generic *re = engine; 1361 gl_generic_window_use(engine);
1376
1377 re->window_use(re->software.ob);
1378 return evas_common_font_cache_get(); 1362 return evas_common_font_cache_get();
1379} 1363}
1380 1364
@@ -1433,9 +1417,8 @@ static Eina_Bool
1433eng_font_draw(void *engine EINA_UNUSED, void *data, void *context, void *surface, Evas_Font_Set *font EINA_UNUSED, int x, int y, int w EINA_UNUSED, int h EINA_UNUSED, int ow EINA_UNUSED, int oh EINA_UNUSED, Evas_Text_Props *intl_props, Eina_Bool do_async EINA_UNUSED) 1417eng_font_draw(void *engine EINA_UNUSED, void *data, void *context, void *surface, Evas_Font_Set *font EINA_UNUSED, int x, int y, int w EINA_UNUSED, int h EINA_UNUSED, int ow EINA_UNUSED, int oh EINA_UNUSED, Evas_Text_Props *intl_props, Eina_Bool do_async EINA_UNUSED)
1434{ 1418{
1435 Evas_Engine_GL_Context *gl_context; 1419 Evas_Engine_GL_Context *gl_context;
1436 Render_Output_GL_Generic *re = data;
1437 1420
1438 gl_context = gl_generic_context_get(re); 1421 gl_context = gl_generic_context_get(data);
1439 1422
1440 evas_gl_common_context_target_surface_set(gl_context, surface); 1423 evas_gl_common_context_target_surface_set(gl_context, surface);
1441 gl_context->dc = context; 1424 gl_context->dc = context;
@@ -1532,7 +1515,6 @@ eng_gl_context_destroy(void *engine, void *context)
1532static int 1515static int
1533eng_gl_make_current(void *engine, void *surface, void *context) 1516eng_gl_make_current(void *engine, void *surface, void *context)
1534{ 1517{
1535 Render_Output_GL_Generic *re = engine;
1536 EVGL_Surface *sfc = (EVGL_Surface *)surface; 1518 EVGL_Surface *sfc = (EVGL_Surface *)surface;
1537 EVGL_Context *ctx = (EVGL_Context *)context; 1519 EVGL_Context *ctx = (EVGL_Context *)context;
1538 int ret = 0; 1520 int ret = 0;
@@ -1543,7 +1525,7 @@ eng_gl_make_current(void *engine, void *surface, void *context)
1543 { 1525 {
1544 Evas_Engine_GL_Context *gl_context; 1526 Evas_Engine_GL_Context *gl_context;
1545 1527
1546 gl_context = gl_generic_context_get(re); 1528 gl_context = gl_generic_context_get(engine);
1547 if ((gl_context->havestuff) || 1529 if ((gl_context->havestuff) ||
1548 (gl_context->master_clip.used)) 1530 (gl_context->master_clip.used))
1549 { 1531 {
@@ -1592,7 +1574,7 @@ static void *
1592eng_gl_proc_address_get(void *engine, const char *name) 1574eng_gl_proc_address_get(void *engine, const char *name)
1593{ 1575{
1594 Render_Output_GL_Generic *re = engine; 1576 Render_Output_GL_Generic *re = engine;
1595 EVGLINIT(re, NULL); 1577 EVGLINIT(engine, NULL);
1596 void *fun = NULL; 1578 void *fun = NULL;
1597 1579
1598 if (!evgl_safe_extension_get(name, &fun)) 1580 if (!evgl_safe_extension_get(name, &fun))
@@ -1623,12 +1605,11 @@ eng_gl_native_surface_get(void *engine EINA_UNUSED, void *surface, void *native_
1623static void * 1605static void *
1624eng_gl_api_get(void *engine, int version) 1606eng_gl_api_get(void *engine, int version)
1625{ 1607{
1626 Render_Output_GL_Generic *re = engine;
1627 void *ret; 1608 void *ret;
1628 Evas_Engine_GL_Context *gl_context; 1609 Evas_Engine_GL_Context *gl_context;
1629 EVGLINIT(re, NULL); 1610 EVGLINIT(engine, NULL);
1630 1611
1631 gl_context = gl_generic_context_get(re); 1612 gl_context = gl_generic_context_get(engine);
1632 if (!gl_context) 1613 if (!gl_context)
1633 { 1614 {
1634 ERR("Invalid context!"); 1615 ERR("Invalid context!");
@@ -2036,9 +2017,8 @@ static void
2036eng_image_max_size_get(void *engine, int *maxw, int *maxh) 2017eng_image_max_size_get(void *engine, int *maxw, int *maxh)
2037{ 2018{
2038 Evas_Engine_GL_Context *gl_context; 2019 Evas_Engine_GL_Context *gl_context;
2039 Render_Output_GL_Generic *re = engine;
2040 2020
2041 gl_context = gl_generic_context_get(re); 2021 gl_context = gl_generic_context_get(engine);
2042 if (maxw) *maxw = gl_context->shared->info.max_texture_size; 2022 if (maxw) *maxw = gl_context->shared->info.max_texture_size;
2043 if (maxh) *maxh = gl_context->shared->info.max_texture_size; 2023 if (maxh) *maxh = gl_context->shared->info.max_texture_size;
2044} 2024}
@@ -2136,9 +2116,8 @@ static void
2136eng_context_flush(void *engine) 2116eng_context_flush(void *engine)
2137{ 2117{
2138 Evas_Engine_GL_Context *gl_context; 2118 Evas_Engine_GL_Context *gl_context;
2139 Render_Output_GL_Generic *re = engine;
2140 2119
2141 gl_context = gl_generic_context_get(re); 2120 gl_context = gl_generic_context_find(engine);
2142 2121
2143 if ((gl_context->havestuff) || 2122 if ((gl_context->havestuff) ||
2144 (gl_context->master_clip.used)) 2123 (gl_context->master_clip.used))
@@ -2301,10 +2280,9 @@ static void
2301eng_drawable_scene_render(void *engine, void *data EINA_UNUSED, void *drawable, void *scene_data) 2280eng_drawable_scene_render(void *engine, void *data EINA_UNUSED, void *drawable, void *scene_data)
2302{ 2281{
2303 Evas_Engine_GL_Context *gl_context; 2282 Evas_Engine_GL_Context *gl_context;
2304 Render_Output_GL_Generic *re = engine;
2305 E3D_Renderer *renderer = NULL; 2283 E3D_Renderer *renderer = NULL;
2306 2284
2307 gl_context = gl_generic_context_get(re); 2285 gl_context = gl_generic_context_get(engine);
2308 evas_gl_common_context_flush(gl_context); 2286 evas_gl_common_context_flush(gl_context);
2309 2287
2310 eng_context_3d_use(engine); 2288 eng_context_3d_use(engine);
@@ -2335,10 +2313,9 @@ static Eina_Bool
2335eng_drawable_scene_render_to_texture(void *engine, void *drawable, void *scene_data) 2313eng_drawable_scene_render_to_texture(void *engine, void *drawable, void *scene_data)
2336{ 2314{
2337 Evas_Engine_GL_Context *gl_context; 2315 Evas_Engine_GL_Context *gl_context;
2338 Render_Output_GL_Generic *re = engine;
2339 E3D_Renderer *renderer = NULL; 2316 E3D_Renderer *renderer = NULL;
2340 2317
2341 gl_context = gl_generic_context_get(re); 2318 gl_context = gl_generic_context_get(engine);
2342 evas_gl_common_context_flush(gl_context); 2319 evas_gl_common_context_flush(gl_context);
2343 2320
2344 eng_context_3d_use(engine); 2321 eng_context_3d_use(engine);
@@ -2403,9 +2380,8 @@ static void
2403eng_texture_image_set(void *engine, void *texture, void *image) 2380eng_texture_image_set(void *engine, void *texture, void *image)
2404{ 2381{
2405 Evas_Engine_GL_Context *gl_context; 2382 Evas_Engine_GL_Context *gl_context;
2406 Render_Output_GL_Generic *re = engine;
2407 2383
2408 gl_context = gl_generic_context_get(re); 2384 gl_context = gl_generic_context_get(engine);
2409 2385
2410 e3d_texture_set(gl_context, (E3D_Texture *)texture, (Evas_GL_Image *)image); 2386 e3d_texture_set(gl_context, (E3D_Texture *)texture, (Evas_GL_Image *)image);
2411} 2387}
@@ -2581,11 +2557,10 @@ eng_ector_begin(void *engine, void *context EINA_UNUSED, Ector_Surface *ector,
2581 int x, int y, Eina_Bool do_async EINA_UNUSED) 2557 int x, int y, Eina_Bool do_async EINA_UNUSED)
2582{ 2558{
2583 Evas_Engine_GL_Context *gl_context; 2559 Evas_Engine_GL_Context *gl_context;
2584 Render_Output_GL_Generic *re = engine;
2585 Evas_GL_Ector *buffer = engine_data; 2560 Evas_GL_Ector *buffer = engine_data;
2586 int w, h; 2561 int w, h;
2587 2562
2588 gl_context = gl_generic_context_get(re); 2563 gl_context = gl_generic_context_get(engine);
2589 evas_gl_common_context_target_surface_set(gl_context, surface); 2564 evas_gl_common_context_target_surface_set(gl_context, surface);
2590 gl_context->dc = context; 2565 gl_context->dc = context;
2591 2566
@@ -2633,14 +2608,13 @@ eng_ector_end(void *engine, void *context EINA_UNUSED, Ector_Surface *ector,
2633 Eina_Bool do_async EINA_UNUSED) 2608 Eina_Bool do_async EINA_UNUSED)
2634{ 2609{
2635 Evas_Engine_GL_Context *gl_context; 2610 Evas_Engine_GL_Context *gl_context;
2636 Render_Output_GL_Generic *re = engine;
2637 Evas_GL_Ector *buffer = engine_data; 2611 Evas_GL_Ector *buffer = engine_data;
2638 int w, h; 2612 int w, h;
2639 Eina_Bool mul_use; 2613 Eina_Bool mul_use;
2640 2614
2641 if (use_cairo || !use_gl) 2615 if (use_cairo || !use_gl)
2642 { 2616 {
2643 gl_context = gl_generic_context_get(re); 2617 gl_context = gl_generic_context_get(engine);
2644 w = gl_context->w; h = gl_context->h; 2618 w = gl_context->w; h = gl_context->h;
2645 mul_use = gl_context->dc->mul.use; 2619 mul_use = gl_context->dc->mul.use;
2646 2620
@@ -3009,9 +2983,8 @@ static void *
3009eng_image_surface_noscale_new(void *engine, int w, int h, int alpha) 2983eng_image_surface_noscale_new(void *engine, int w, int h, int alpha)
3010{ 2984{
3011 Evas_Engine_GL_Context *gl_context; 2985 Evas_Engine_GL_Context *gl_context;
3012 Render_Output_GL_Generic *re = engine;
3013 2986
3014 gl_context = gl_generic_context_get(re); 2987 gl_context = gl_generic_context_get(engine);
3015 return evas_gl_common_image_surface_noscale_new(gl_context, w, h, alpha); 2988 return evas_gl_common_image_surface_noscale_new(gl_context, w, h, alpha);
3016} 2989}
3017 2990