[EGIT] [core/efl] master 05/06: Evas filters: Remove useless source_count and cow checks
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=7db01ea39624edf3d9bb5a5357a286ecacce6c34 commit 7db01ea39624edf3d9bb5a5357a286ecacce6c34 Author: Jean-Philippe Andre Date: Wed Oct 22 14:14:58 2014 +0900 Evas filters: Remove useless source_count and cow checks --- src/lib/evas/canvas/evas_object_image.c | 23 +- src/lib/evas/canvas/evas_object_main.c | 2 +- src/lib/evas/canvas/evas_object_text.c | 56 - src/lib/evas/include/evas_private.h | 1 - 4 files changed, 29 insertions(+), 53 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index fccf9ed..6a1b9e9 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -359,10 +359,12 @@ _evas_image_eo_base_constructor(Eo *eo_obj, Evas_Image_Data *o) cspace = obj->layer->evas->engine.func->image_colorspace_get(obj->layer->evas->engine.data.output, o->engine_data); - if (cspace != o->cur->cspace) + if (!o->cur->filter || (cspace != o->cur->cspace)) { EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) state_write->cspace = cspace; + if (!state_write->filter) +state_write->filter = eina_cow_alloc(evas_object_filter_cow); EINA_COW_IMAGE_STATE_WRITE_END(o, state_write); } } @@ -3231,7 +3233,7 @@ start_draw: if (!redraw && o->cur->filter->output) { - if (o->cur->filter->sources && o->cur->filter->sources_count > 0) + if (eina_hash_population(o->cur->filter->sources) > 0) { Evas_Filter_Proxy_Binding *pb; Evas_Object_Protected_Data *prxsource; @@ -3780,7 +3782,7 @@ evas_object_image_render_pre(Evas_Object *eo_obj, evas_object_render_pre_prev_cur_add(&e->clip_changes, eo_obj, obj); if (!o->pixels->pixel_updates) goto done; } - if (o->cur->filter && o->cur->filter->changed) + if (o->cur->filter->changed) { evas_object_render_pre_prev_cur_add(&e->clip_changes, eo_obj, obj); if (!o->pixels->pixel_updates) goto done; @@ -4785,11 +4787,8 @@ _evas_image_filter_program_set(Eo *eo_obj, Evas_Image_Data *o, const char *arg) Evas_Filter_Program *pgm = NULL; if (!o) return; - if (o->cur->filter) - { -if (o->cur->filter->code == arg) return; -if (o->cur->filter->code && arg && !strcmp(arg, o->cur->filter->code)) return; - } + if (o->cur->filter->code == arg) return; + if (o->cur->filter->code && arg && !strcmp(arg, o->cur->filter->code)) return; EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) EINA_COW_IMAGE_FILTER_WRITE_BEGIN(state_write, fcow) @@ -4844,13 +4843,7 @@ _filter_source_hash_free_cb(void *data) if (o && proxy) { -EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) - EINA_COW_IMAGE_FILTER_WRITE_BEGIN(state_write, fcow) -fcow->sources_count--; - EINA_COW_IMAGE_FILTER_WRITE_END(state_write, fcow) -EINA_COW_IMAGE_STATE_WRITE_END(o, state_write) - -if (!o->cur->filter->sources_count) +if (!eina_hash_population(o->cur->filter->sources)) { EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, proxy->proxy, Evas_Object_Proxy_Data, proxy_write) diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index b288623..e5317e2 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c @@ -33,7 +33,7 @@ static const Evas_Object_Protected_State default_state = { 1.0, 0, EVAS_RENDER_BLEND, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE }; static const Evas_Object_Filter_Data default_filter = { - NULL, NULL, NULL, 0, NULL, EINA_FALSE, EINA_FALSE + NULL, NULL, NULL, NULL, EINA_FALSE, EINA_FALSE }; Eina_Cow *evas_object_proxy_cow = NULL; diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 4be7f37..3cf8df3 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -1542,23 +1542,17 @@ evas_object_text_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) Evas_Text_Data *o = eo_data_scope_get(eo_obj, MY_CLASS); /* free filter output */ - if (o->cur.filter) - { -EINA_COW_WRITE_BEGIN(evas_object_filter_cow, o->cur.filter, Evas_Object_Filter_Data, fcow) - { - if (fcow->output) - ENFN->image_free(ENDT, fcow->output); - eina_hash_free(fcow->sources); - evas_filter_program_del(fcow->chain); - eina_stringshare_del(fcow->code); - fcow->output = NULL; -
[EGIT] [core/efl] master 03/06: Evas filters: Move filter COW to evas global stuff
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6935880171c4d5d75c5944ec2e85720939c1ad26 commit 6935880171c4d5d75c5944ec2e85720939c1ad26 Author: Jean-Philippe Andre Date: Wed Oct 22 11:12:33 2014 +0900 Evas filters: Move filter COW to evas global stuff It will be shared between TEXT and IMAGE objects. --- src/lib/evas/canvas/evas_object_main.c | 12 - src/lib/evas/canvas/evas_object_text.c | 82 +- src/lib/evas/include/evas_filter.h | 1 - src/lib/evas/include/evas_private.h| 16 +++ 4 files changed, 48 insertions(+), 63 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index 816e043..b288623 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c @@ -32,25 +32,30 @@ static const Evas_Object_Protected_State default_state = { { 255, 255, 255, 255 }, 1.0, 0, EVAS_RENDER_BLEND, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE }; +static const Evas_Object_Filter_Data default_filter = { + NULL, NULL, NULL, 0, NULL, EINA_FALSE, EINA_FALSE +}; Eina_Cow *evas_object_proxy_cow = NULL; Eina_Cow *evas_object_map_cow = NULL; Eina_Cow *evas_object_state_cow = NULL; Eina_Cow *evas_object_3d_cow = NULL; +Eina_Cow *evas_object_filter_cow = NULL; static Eina_Bool _init_cow(void) { - if (evas_object_map_cow && evas_object_proxy_cow && evas_object_state_cow && evas_object_3d_cow) return EINA_TRUE; + if (evas_object_map_cow && evas_object_proxy_cow && evas_object_state_cow && evas_object_3d_cow && evas_object_filter_cow) return EINA_TRUE; evas_object_proxy_cow = eina_cow_add("Evas Object Proxy", sizeof (Evas_Object_Proxy_Data), 8, &default_proxy, EINA_TRUE); evas_object_map_cow = eina_cow_add("Evas Object Map", sizeof (Evas_Object_Map_Data), 8, &default_map, EINA_TRUE); evas_object_state_cow = eina_cow_add("Evas Object State", sizeof (Evas_Object_Protected_State), 64, &default_state, EINA_FALSE); evas_object_3d_cow = eina_cow_add("Evas Object 3D", sizeof (Evas_Object_3D_Data), 8, &default_proxy, EINA_TRUE); + evas_object_filter_cow = eina_cow_add("Evas Filter Data", sizeof (Evas_Object_Filter_Data), 8, &default_filter, EINA_TRUE); - if (!(evas_object_map_cow && evas_object_proxy_cow && evas_object_state_cow && evas_object_3d_cow)) + if (!(evas_object_map_cow && evas_object_proxy_cow && evas_object_state_cow && evas_object_3d_cow && evas_object_filter_cow)) { eina_cow_del(evas_object_proxy_cow); eina_cow_del(evas_object_map_cow); @@ -62,6 +67,9 @@ _init_cow(void) eina_cow_del(evas_object_3d_cow); evas_object_3d_cow = NULL; +eina_cow_del(evas_object_filter_cow); +evas_object_filter_cow = NULL; + return EINA_FALSE; } diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 5190c7a..4be7f37 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -20,7 +20,6 @@ static const char o_type[] = "text"; /* private struct for text object internal data */ typedef struct _Evas_Text_Data Evas_Text_Data; typedef struct _Evas_Object_Text_Item Evas_Object_Text_Item; -typedef struct _Evas_Filter_Data Evas_Filter_Data; struct _Evas_Text_Data { @@ -42,7 +41,7 @@ struct _Evas_Text_Data Evas_Font_Size size; Evas_Text_Style_Type style; - const Evas_Filter_Data* filter; // cow + const Evas_Object_Filter_Data* filter; // cow } cur, prev; struct { @@ -77,17 +76,6 @@ struct _Evas_Object_Text_Item Evas_Coord x, w, h, adv; }; -struct _Evas_Filter_Data -{ - Eina_Stringshare*code; - Evas_Filter_Program *chain; - Eina_Hash *sources; // Evas_Filter_Proxy_Binding - int sources_count; - void*output; - Eina_Boolchanged : 1; - Eina_Boolinvalid : 1; // Code parse failed -}; - /* private methods for text objects */ static void evas_object_text_init(Evas_Object *eo_obj); static void evas_object_text_render(Evas_Object *eo_obj, @@ -145,9 +133,6 @@ static const Evas_Object_Func object_func = NULL }; -static Eina_Cow *evas_filter_cow = NULL; -static const Evas_Filter_Data evas_filter_cow_default_data = {0}; - /* the actual api call to add a rect */ /* it has no other api calls as all properties are standard */ @@ -380,26 +365,6 @@ evas_object_text_add(Evas *e) return eo_obj; } -static Eina_Bool -_init_cow(Eo *eo_obj) -{ - if (!evas_filter_cow) - { -evas_filter_cow = eina_cow_add("Evas filter data", - sizeof (Evas_Filter_Data), - 8, - &evas_filter_cow_default_data, - EINA_TRUE); -
[EGIT] [core/efl] master 02/06: Evas filters: Use a cow to reduce memory usage of text objects
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9364083b44c4cfa1ffec4dc90e625eb0f9f85c1f commit 9364083b44c4cfa1ffec4dc90e625eb0f9f85c1f Author: Jean-Philippe Andre Date: Wed Oct 22 10:53:45 2014 +0900 Evas filters: Use a cow to reduce memory usage of text objects As pointed out by Cedric, the memory usage of basic evas objects has increased a lot in recent versions of EFL, in part due to this excessive use of filters data. This is a partial fix for ticket 1725. --- src/lib/evas/canvas/evas_object_text.c | 281 ++--- 1 file changed, 187 insertions(+), 94 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 6a1e1df..5190c7a 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -20,6 +20,7 @@ static const char o_type[] = "text"; /* private struct for text object internal data */ typedef struct _Evas_Text_Data Evas_Text_Data; typedef struct _Evas_Object_Text_Item Evas_Object_Text_Item; +typedef struct _Evas_Filter_Data Evas_Filter_Data; struct _Evas_Text_Data { @@ -41,16 +42,7 @@ struct _Evas_Text_Data Evas_Font_Size size; Evas_Text_Style_Type style; - // special effects. VERY EXPERIMENTAL for now. - struct { - Eina_Stringshare*code; - Evas_Filter_Program *chain; - Eina_Hash *sources; // Evas_Filter_Proxy_Binding - int sources_count; - void*output; - Eina_Boolchanged : 1; - Eina_Boolinvalid : 1; // Code parse failed - } filter; + const Evas_Filter_Data* filter; // cow } cur, prev; struct { @@ -85,6 +77,17 @@ struct _Evas_Object_Text_Item Evas_Coord x, w, h, adv; }; +struct _Evas_Filter_Data +{ + Eina_Stringshare*code; + Evas_Filter_Program *chain; + Eina_Hash *sources; // Evas_Filter_Proxy_Binding + int sources_count; + void*output; + Eina_Boolchanged : 1; + Eina_Boolinvalid : 1; // Code parse failed +}; + /* private methods for text objects */ static void evas_object_text_init(Evas_Object *eo_obj); static void evas_object_text_render(Evas_Object *eo_obj, @@ -142,6 +145,9 @@ static const Evas_Object_Func object_func = NULL }; +static Eina_Cow *evas_filter_cow = NULL; +static const Evas_Filter_Data evas_filter_cow_default_data = {0}; + /* the actual api call to add a rect */ /* it has no other api calls as all properties are standard */ @@ -374,8 +380,28 @@ evas_object_text_add(Evas *e) return eo_obj; } +static Eina_Bool +_init_cow(Eo *eo_obj) +{ + if (!evas_filter_cow) + { +evas_filter_cow = eina_cow_add("Evas filter data", + sizeof (Evas_Filter_Data), + 8, + &evas_filter_cow_default_data, + EINA_TRUE); + } + if (!evas_filter_cow) + { +eo_error_set(eo_obj); +return EINA_FALSE; + } + + return EINA_TRUE; +} + EOLIAN static void -_evas_text_eo_base_constructor(Eo *eo_obj, Evas_Text_Data *class_data EINA_UNUSED) +_evas_text_eo_base_constructor(Eo *eo_obj, Evas_Text_Data *o) { eo_do_super(eo_obj, MY_CLASS, eo_constructor()); evas_object_text_init(eo_obj); @@ -384,6 +410,11 @@ _evas_text_eo_base_constructor(Eo *eo_obj, Evas_Text_Data *class_data EINA_UNUSE eo_do(eo_obj, parent = eo_parent_get()); evas_object_inject(eo_obj, obj, evas_object_evas_get(parent)); + + if (!_init_cow(eo_obj)) + return; + + o->cur.filter = eina_cow_alloc(evas_filter_cow); } EOLIAN static void @@ -407,6 +438,17 @@ _evas_text_efl_text_properties_font_source_get(Eo *eo_obj EINA_UNUSED, Evas_Text return o->cur.source; } +static inline void +_evas_text_filter_changed_set(Evas_Text_Data *o, Eina_Bool val) +{ + if (o->cur.filter && (o->cur.filter->changed != val)) + { +EINA_COW_WRITE_BEGIN(evas_filter_cow, o->cur.filter, Evas_Filter_Data, fcow) + fcow->changed = val; +EINA_COW_WRITE_END(evas_filter_cow, o->cur.filter, fcow); + } +} + EOLIAN static void _evas_text_efl_text_properties_font_set(Eo *eo_obj, Evas_Text_Data *o, const char *font, Evas_Font_Size size) { @@ -472,7 +514,7 @@ _evas_text_efl_text_properties_font_set(Eo *eo_obj, Evas_Text_Data *o, const cha _evas_object_text_items_clear(o); _evas_object_text_recalc(eo_obj, o->cur.text); o->changed = 1; - o->cur.filter.changed = EINA_TRUE; + _evas_text_filter_changed_set(o, EINA_TRUE); evas_object_change(eo_obj, obj); evas_object_clip_dirty(eo_obj, obj); evas_object_coords_recalc(eo_obj, obj); @@ -760,10 +802,10 @@ _evas_object_text_layout(Evas_Object *eo_obj, Evas_Text_Da
[EGIT] [core/efl] master 04/06: Evas filters: Feed some cow to the image objects
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b5ccb00ba79b7b03949b664e7e7ac0fa2eec9c53 commit b5ccb00ba79b7b03949b664e7e7ac0fa2eec9c53 Author: Jean-Philippe Andre Date: Wed Oct 22 11:27:11 2014 +0900 Evas filters: Feed some cow to the image objects Same as for the text objects. Fixes T1725. Cedric, please run again your memory test, please. --- src/lib/evas/canvas/evas_object_image.c | 210 +--- 1 file changed, 109 insertions(+), 101 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 1ec2377..fccf9ed 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -86,15 +86,7 @@ struct _Evas_Object_Image_State Evas_Colorspace cspace; - struct { - Eina_Stringshare*code; - Evas_Filter_Program *chain; - Eina_Hash *sources; // Evas_Filter_Proxy_Binding - int sources_count; - void*output; - Eina_Boolchanged : 1; - Eina_Boolinvalid : 1; // Code parse failed - } filter; + const Evas_Object_Filter_Data *filter; Eina_Bool smooth_scale : 1; Eina_Bool has_alpha :1; @@ -238,9 +230,7 @@ static const Evas_Object_Image_State default_state = { 0, //frame EVAS_TEXTURE_REPEAT, EVAS_COLORSPACE_ARGB, - - // filter - { NULL, NULL, NULL, 0, NULL, EINA_FALSE, EINA_FALSE }, + NULL, // filter // flags EINA_TRUE, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE @@ -269,6 +259,12 @@ Eina_Cow *evas_object_image_state_cow = NULL; # define EINA_COW_IMAGE_STATE_WRITE_END(Obj, Write) \ EINA_COW_WRITE_END(evas_object_image_state_cow, Obj->cur, Write) +# define EINA_COW_IMAGE_FILTER_WRITE_BEGIN(State, Write) \ + EINA_COW_WRITE_BEGIN(evas_object_filter_cow, State->filter, Evas_Object_Filter_Data, Write) + +# define EINA_COW_IMAGE_FILTER_WRITE_END(State, Write) \ + EINA_COW_WRITE_END(evas_object_filter_cow, State->filter, Write) + # define EVAS_OBJECT_WRITE_IMAGE_FREE_FILE_AND_KEY(Obj) \ if ((!Obj->cur->mmaped_source && Obj->cur->u.file) || Obj->cur->key) \ { \ @@ -3023,7 +3019,9 @@ _filter_cb(Evas_Filter_Context *ctx, void *data, Eina_Bool success) ERR("Filter failed at runtime!"); EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) - state_write->filter.invalid = EINA_TRUE; + EINA_COW_IMAGE_FILTER_WRITE_BEGIN(state_write, fcow) +fcow->invalid = EINA_TRUE; + EINA_COW_IMAGE_FILTER_WRITE_END(state_write, fcow) EINA_COW_IMAGE_STATE_WRITE_END(o, state_write) // Update object @@ -3221,25 +3219,25 @@ start_draw: * - If filled, then scale down the image to accomodate the whole filter's padding. * - Otherwise, draw image in place and clip the filter's effects (eg. blur will be clipped out). */ - if (!o->cur->filter.invalid && o->cur->filter.code) + if (!o->cur->filter->invalid && o->cur->filter->code) { - Evas_Filter_Program *pgm = o->cur->filter.chain;; - Eina_Bool redraw = (o->changed || o->cur->filter.changed); + Evas_Filter_Program *pgm = o->cur->filter->chain; + Eina_Bool redraw = (o->changed || o->cur->filter->changed); Eina_Bool ok; evas_filter_program_padding_get(pgm, &l, &r, &t, &b); W = obj->cur->geometry.w; H = obj->cur->geometry.h; - if (!redraw && o->cur->filter.output) + if (!redraw && o->cur->filter->output) { - if (o->cur->filter.sources && o->cur->filter.sources_count > 0) + if (o->cur->filter->sources && o->cur->filter->sources_count > 0) { Evas_Filter_Proxy_Binding *pb; Evas_Object_Protected_Data *prxsource; Eina_Iterator *iter; -iter = eina_hash_iterator_data_new(o->cur->filter.sources); +iter = eina_hash_iterator_data_new(o->cur->filter->sources); EINA_ITERATOR_FOREACH(iter, pb) { prxsource = eo_data_scope_get(pb->eo_source, EVAS_OBJECT_CLASS); @@ -3256,7 +3254,7 @@ start_draw: { // Render this image only obj->layer->evas->engine.func->image_draw(output, context, - surface, o->cur->filter.output, + surface, o->cur->filter->outp
[EGIT] [core/efl] master 01/06: Evas GL: Don't pass shared context for GLX with 1.1 API
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d4eb07b4bbbdac9820c0ef529316d5663afd09b9 commit d4eb07b4bbbdac9820c0ef529316d5663afd09b9 Author: Jean-Philippe Andre Date: Wed Oct 22 10:44:06 2014 +0900 Evas GL: Don't pass shared context for GLX with 1.1 API Not sure if this is very relevant, since GLX does not support GL-ES as such, anyways... We should be using the extension GLX_EXT_create_context_es_profile to create proper contexts. Note: GLX + OpenGL-ES 1.1 crashes at any function call on my machine (binary bloc driver), while EGL + GLES1.1 is fine. --- src/modules/evas/engines/gl_x11/evas_engine.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c index a9b850c..477e2fc 100644 --- a/src/modules/evas/engines/gl_x11/evas_engine.c +++ b/src/modules/evas/engines/gl_x11/evas_engine.c @@ -519,7 +519,6 @@ evgl_eng_context_create(void *data, void *share_ctx, Evas_GL_Context_Version ver (GLXContext)share_ctx, 1); } - /* TODO: Check this case. else if (version == EVAS_GL_GLES_1_X) { context = glXCreateContext(eng_get_ob(re)->info->info.display, @@ -527,7 +526,6 @@ evgl_eng_context_create(void *data, void *share_ctx, Evas_GL_Context_Version ver NULL, 1); } - */ else { context = glXCreateContext(eng_get_ob(re)->info->info.display, --
Re: [E-devel] Ecore Thread: stop/kill thread
Hi On Fri, Oct 24, 2014 at 9:10 AM, Viacheslav Reutskiy wrote: > Hi everyone. > > I have one little question about Ecore Thread. > I need to stop the running thread and get > notified, I mean call callback, about it event. > > Ecore Thread has the function ecore_thread_close(), > but if this func not stopped the thread, Ecore > Thread waits until thread is finished, and then call > the cancel callback. > > How I can stop or kill the thread? And if this > functionality is not available, any plans to add > it? > > The thread will have to stop itself. So you need to send an event to request the thread stop. You can't just kill a thread like that. There are some mechanims like pthread_cancel but they need to take some extreme precautions (properly free all resources, etc...). So I wouldn't add this to EFL. With ecore, you might want to use ecore_thread_cancel and then in the thread's loop, check for cancellation with ecore_thread_check. This is not the same as pthread_cancel. It's much easier to use. I don't know of any way to safely kill a thread that would be stuck in an infinite loop. (maybe someone else knows?) Best regards, -- Jean-Philippe André -- ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[EGIT] [core/enlightenment] master 02/02: Add ecore-wayland flags to the general cflags
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=13194fb4e277e4282833e3be49c1580f787f92d4 commit 13194fb4e277e4282833e3be49c1580f787f92d4 Author: Jean-Philippe Andre Date: Fri Oct 24 18:18:38 2014 +0900 Add ecore-wayland flags to the general cflags My build would break on missing Ecore_Wayland.h otherwise. --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index 77148f1..839f0bf 100644 --- a/configure.ac +++ b/configure.ac @@ -557,6 +557,7 @@ PKG_CHECK_MODULES(E, [ ecore-con >= ${efl_version} ecore-ipc >= ${efl_version} ecore-file >= ${efl_version} + ecore-wayland >= ${efl_version} eet >= ${efl_version} edje >= ${efl_version} efreet >= ${efl_version} --
[EGIT] [core/enlightenment] master 01/02: Fix include order of EGL & Evas GL
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=edb535a96e58b45eb5ba6d2b25088ad71c728208 commit edb535a96e58b45eb5ba6d2b25088ad71c728208 Author: Jean-Philippe Andre Date: Fri Oct 24 18:17:32 2014 +0900 Fix include order of EGL & Evas GL Evas_GL.h must be included after EGL.h because it can then skip some redefinitions of khronos typedefs. --- src/bin/e.h | 5 + 1 file changed, 5 insertions(+) diff --git a/src/bin/e.h b/src/bin/e.h index 349df16..dacfbaa 100644 --- a/src/bin/e.h +++ b/src/bin/e.h @@ -97,6 +97,11 @@ void *alloca (size_t); # include # endif +/* egl.h must come before Evas_GL.h otherwise they will conflict */ +# ifdef HAVE_WAYLAND_EGL +# include +# endif + # include # include # include --
[EGIT] [core/enlightenment] master 01/01: Revert "Add ecore-wayland flags to the general cflags"
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=7ec65cd82ee1858d32eeed5009e176a900db0a95 commit 7ec65cd82ee1858d32eeed5009e176a900db0a95 Author: Jean-Philippe Andre Date: Fri Oct 24 19:08:50 2014 +0900 Revert "Add ecore-wayland flags to the general cflags" This reverts commit 13194fb4e277e4282833e3be49c1580f787f92d4. Of course this was the wrong fix, as it adds ecore-wayland as a *required* dependency of E. Since there was this other variable "requirements_e" I thought the pkgconfig would be fine. Nope. --- configure.ac | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.ac b/configure.ac index 839f0bf..77148f1 100644 --- a/configure.ac +++ b/configure.ac @@ -557,7 +557,6 @@ PKG_CHECK_MODULES(E, [ ecore-con >= ${efl_version} ecore-ipc >= ${efl_version} ecore-file >= ${efl_version} - ecore-wayland >= ${efl_version} eet >= ${efl_version} edje >= ${efl_version} efreet >= ${efl_version} --
[EGIT] [core/enlightenment] master 01/01: Really fix the compilation with wayland
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=310c10bca8ad5cfad38353ab23d5780c469a1bb2 commit 310c10bca8ad5cfad38353ab23d5780c469a1bb2 Author: Jean-Philippe Andre Date: Fri Oct 24 19:26:55 2014 +0900 Really fix the compilation with wayland ... I hope. --- src/bin/e_fm/Makefile.mk | 1 + src/modules/Makefile.mk | 1 + 2 files changed, 2 insertions(+) diff --git a/src/bin/e_fm/Makefile.mk b/src/bin/e_fm/Makefile.mk index 1ab59a4..0eec4f4 100644 --- a/src/bin/e_fm/Makefile.mk +++ b/src/bin/e_fm/Makefile.mk @@ -7,6 +7,7 @@ EFM_CPPFLAGS = \ @cf_cflags@ \ @VALGRIND_CFLAGS@ \ @EDJE_DEF@ \ +@WAYLAND_CFLAGS@ \ -DPACKAGE_BIN_DIR=\"@PACKAGE_BIN_DIR@\" \ -DPACKAGE_LIB_DIR=\"@PACKAGE_LIB_DIR@\" \ -DPACKAGE_DATA_DIR=\"@PACKAGE_DATA_DIR@\" \ diff --git a/src/modules/Makefile.mk b/src/modules/Makefile.mk index 5b6bf8b..348b87f 100644 --- a/src/modules/Makefile.mk +++ b/src/modules/Makefile.mk @@ -6,6 +6,7 @@ MOD_CPPFLAGS = -I. \ -I$(top_builddir)/src/bin \ -I$(top_srcdir)/src/modules \ @e_cflags@ \ +@WAYLAND_CFLAGS@ \ -DE_BINDIR=\"$(bindir)\" MOD_LIBS = @e_libs@ @dlopen_libs@ --
[EGIT] [core/efl] master 01/02: Evas GL: Fix typo in an extension's name
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3fe232cd95873396155f4bcac007cd5e62d237bd commit 3fe232cd95873396155f4bcac007cd5e62d237bd Author: Jean-Philippe Andre Date: Fri Oct 24 19:52:21 2014 +0900 Evas GL: Fix typo in an extension's name This could potentially break applications relying on this typo to check for the extension. The chances are very slim. --- src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h index c8986d7..f6c77fa 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h +++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h @@ -384,7 +384,7 @@ _EVASGL_EXT_BEGIN(read_format_bgra_DESKTOP) // Desktop differs _EVASGL_EXT_DRVNAME(GL_EXT_read_format_bgra) _EVASGL_EXT_END() -_EVASGL_EXT_BEGIN(texture_filter_anisotrophic) +_EVASGL_EXT_BEGIN(texture_filter_anisotropic) _EVASGL_EXT_DRVNAME(GL_EXT_texture_filter_anisotropic) _EVASGL_EXT_END() --
[EGIT] [core/efl] master 02/02: Evas GL: string_query returns a const char *
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=5a9d8d6f032b816cd435aacef49af8b86375400b commit 5a9d8d6f032b816cd435aacef49af8b86375400b Author: Jean-Philippe Andre Date: Fri Oct 24 20:52:09 2014 +0900 Evas GL: string_query returns a const char * Why cast to/from void* in the first place? --- src/lib/evas/canvas/evas_gl.c | 2 +- src/lib/evas/include/evas_private.h | 2 +- src/modules/evas/engines/gl_generic/evas_engine.c | 4 ++-- src/modules/evas/engines/software_generic/evas_engine.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/evas/canvas/evas_gl.c b/src/lib/evas/canvas/evas_gl.c index 98b95e0..3373bb4 100644 --- a/src/lib/evas/canvas/evas_gl.c +++ b/src/lib/evas/canvas/evas_gl.c @@ -517,7 +517,7 @@ evas_gl_string_query(Evas_GL *evas_gl, int name) return ""; MAGIC_CHECK_END(); - return (const char *)evas_gl->evas->engine.func->gl_string_query(evas_gl->evas->engine.data.output, name); + return evas_gl->evas->engine.func->gl_string_query(evas_gl->evas->engine.data.output, name); } EAPI Evas_GL_Func diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index 6f715b4..eff901b 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1250,7 +1250,7 @@ struct _Evas_Func void *(*gl_context_create)(void *data, void *share_context, int version); int (*gl_context_destroy)(void *data, void *context); int (*gl_make_current) (void *data, void *surface, void *context); - void *(*gl_string_query) (void *data, int name); + const char *(*gl_string_query)(void *data, int name); void *(*gl_proc_address_get) (void *data, const char *name); int (*gl_native_surface_get) (void *data, void *surface, void *native_surface); void *(*gl_api_get) (void *data, int version); diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c index b2a1ea1..9cfddd1 100644 --- a/src/modules/evas/engines/gl_generic/evas_engine.c +++ b/src/modules/evas/engines/gl_generic/evas_engine.c @@ -1199,11 +1199,11 @@ eng_gl_rotation_angle_get(void *data) return evgl_engine->funcs->rotation_angle_get(data); } -static void * +static const char * eng_gl_string_query(void *data, int name) { EVGLINIT(data, NULL); - return (void *)evgl_string_query(name); + return evgl_string_query(name); } // Need to deprecate this function.. diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c index f6b3420..48e063d 100644 --- a/src/modules/evas/engines/software_generic/evas_engine.c +++ b/src/modules/evas/engines/software_generic/evas_engine.c @@ -2559,7 +2559,7 @@ eng_gl_make_current(void *data EINA_UNUSED, void *surface, void *context) } // FIXME!!! Implement later -static void * +static const char * eng_gl_string_query(void *data EINA_UNUSED, int name EINA_UNUSED) { return NULL; --
[EGIT] [core/efl] master 01/06: Evas filters: Prevent division by 0
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3f73d205023a63e8cdb5762db5755363d20b8a3d commit 3f73d205023a63e8cdb5762db5755363d20b8a3d Author: Jean-Philippe Andre Date: Mon Oct 27 21:37:39 2014 +0900 Evas filters: Prevent division by 0 While it really shouldn't happen, let's just add a quick if() and make Coverity shut up. Fixes: - CID 1191912 - CID 1191911 - CID 1191910 - CID 1191909 --- src/lib/evas/filters/blur/blur_gaussian_alpha_.c | 9 +++-- src/lib/evas/filters/blur/blur_gaussian_rgba_.c | 9 +++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/lib/evas/filters/blur/blur_gaussian_alpha_.c b/src/lib/evas/filters/blur/blur_gaussian_alpha_.c index 21b6b7d..fad14e2 100644 --- a/src/lib/evas/filters/blur/blur_gaussian_alpha_.c +++ b/src/lib/evas/filters/blur/blur_gaussian_alpha_.c @@ -41,7 +41,7 @@ FUNCTION_NAME(const DATA8* restrict srcdata, DATA8* restrict dstdata, acc += (*s) * weights[j + radius - k]; divider += weights[j + radius - k]; } - //if (!divider) abort(); + if (!divider) goto error; *dst = acc / divider; } @@ -66,13 +66,18 @@ FUNCTION_NAME(const DATA8* restrict srcdata, DATA8* restrict dstdata, acc += (*s) * weights[j]; divider += weights[j]; } - //if (!divider) abort(); + if (!divider) goto error; *dst = acc / divider; } dstdata += loopstep; srcdata += loopstep; } + + return; + +error: + CRI("Avoided division by 0."); } #undef FUNCTION_NAME diff --git a/src/lib/evas/filters/blur/blur_gaussian_rgba_.c b/src/lib/evas/filters/blur/blur_gaussian_rgba_.c index 4492e6b..fdbf3da 100644 --- a/src/lib/evas/filters/blur/blur_gaussian_rgba_.c +++ b/src/lib/evas/filters/blur/blur_gaussian_rgba_.c @@ -43,7 +43,7 @@ FUNCTION_NAME(const DATA32* restrict srcdata, DATA32* restrict dstdata, acc[BLUE] += B_VAL(s) * weights[weightidx]; divider += weights[weightidx]; } - //if (!divider) abort(); + if (!divider) goto error; A_VAL(dst) = acc[ALPHA] / divider; R_VAL(dst) = acc[RED] / divider; G_VAL(dst) = acc[GREEN] / divider; @@ -82,7 +82,7 @@ FUNCTION_NAME(const DATA32* restrict srcdata, DATA32* restrict dstdata, acc[BLUE] += B_VAL(s) * weights[j]; divider += weights[j]; } - //if (!divider) abort(); + if (!divider) goto error; A_VAL(dst) = acc[ALPHA] / divider; R_VAL(dst) = acc[RED] / divider; G_VAL(dst) = acc[GREEN] / divider; @@ -92,6 +92,11 @@ FUNCTION_NAME(const DATA32* restrict srcdata, DATA32* restrict dstdata, dstdata += loopstep; srcdata += loopstep; } + + return; + +error: + CRI("Avoided division by 0."); } #undef FUNCTION_NAME --
[EGIT] [core/efl] master 02/06: Evas GL: Set umask before calling mkstemp
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8e4dafcf286af5de7af01cb7f7be0d1b6a8980f7 commit 8e4dafcf286af5de7af01cb7f7be0d1b6a8980f7 Author: Jean-Philippe Andre Date: Mon Oct 27 21:48:37 2014 +0900 Evas GL: Set umask before calling mkstemp Fixes Coverity issues: - CID 1039609 - CID 1039608 --- src/modules/evas/engines/gl_common/evas_gl_core.c | 8 src/modules/evas/engines/gl_common/evas_gl_shader.c | 8 2 files changed, 16 insertions(+) diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c b/src/modules/evas/engines/gl_common/evas_gl_core.c index ed2a089..78ae9e0 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_core.c +++ b/src/modules/evas/engines/gl_common/evas_gl_core.c @@ -616,7 +616,15 @@ _surface_cap_cache_save() /* use mkstemp for writing */ snprintf(tmp_file, sizeof(tmp_file), "%s.XX", cap_file_path); + +#ifndef _WIN32 + mode_t old_umask = umask(S_IRWXG|S_IRWXO); +#endif tmpfd = mkstemp(tmp_file); +#ifndef _WIN32 + umask(old_umask); +#endif + if (tmpfd < 0) goto error; close(tmpfd); diff --git a/src/modules/evas/engines/gl_common/evas_gl_shader.c b/src/modules/evas/engines/gl_common/evas_gl_shader.c index 35201af..351415b 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_shader.c +++ b/src/modules/evas/engines/gl_common/evas_gl_shader.c @@ -1167,7 +1167,15 @@ _evas_gl_common_shader_binary_save(Evas_GL_Shared *shared) /* use mkstemp for writing */ snprintf(tmp_file, sizeof(tmp_file), "%s.XX", bin_file_path); + +#ifndef _WIN32 + mode_t old_umask = umask(S_IRWXG|S_IRWXO); +#endif tmpfd = mkstemp(tmp_file); +#ifndef _WIN32 + umask(old_umask); +#endif + if (tmpfd < 0) goto error; close(tmpfd); --
[EGIT] [core/efl] master 03/06: Embryo: Use strncpy instead of strcpy in a few places
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e550b37453f6f948566e8f8ec7ce97bba70546d2 commit e550b37453f6f948566e8f8ec7ce97bba70546d2 Author: Jean-Philippe Andre Date: Mon Oct 27 22:07:36 2014 +0900 Embryo: Use strncpy instead of strcpy in a few places There are still lots of unsafe uses of strcpy, strcat, etc... Dunno if they are relevant though. Also, assert() may be compiled out at build time (release mode) so don't rely on it for safety. Fixes CID 1039593 --- src/bin/embryo/embryo_cc_sc1.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/bin/embryo/embryo_cc_sc1.c b/src/bin/embryo/embryo_cc_sc1.c index 0cf39e4..30a5329 100644 --- a/src/bin/embryo/embryo_cc_sc1.c +++ b/src/bin/embryo/embryo_cc_sc1.c @@ -1033,7 +1033,8 @@ declglb(char *firstname, int firsttag, int fpublic, int fstatic, if (firstname) { assert(strlen(firstname) <= sNAMEMAX); -strcpy(name, firstname); /* save symbol name */ +strncpy(name, firstname, sNAMEMAX);/* save symbol name */ +name[sNAMEMAX] = 0; tag = firsttag; firstname = NULL; } @@ -1043,7 +1044,8 @@ declglb(char *firstname, int firsttag, int fpublic, int fstatic, if (lex(&val, &str) != tSYMBOL)/* read in (new) token */ error(20, str); /* invalid symbol name */ assert(strlen(str) <= sNAMEMAX); -strcpy(name, str); /* save symbol name */ +strncpy(name, str, sNAMEMAX); /* save symbol name */ +name[sNAMEMAX] = 0; } /* if */ sym = findglb(name); if (!sym) @@ -1181,7 +1183,8 @@ declloc(int fstatic) if (lex(&val, &str) != tSYMBOL) /* read in (new) token */ error(20, str); /* invalid symbol name */ assert(strlen(str) <= sNAMEMAX); - strcpy(name, str); /* save symbol name */ + strncpy(name, str, sNAMEMAX); /* save symbol name */ + name[sNAMEMAX] = 0; if (name[0] == PUBLIC_CHAR) error(56, name); /* local variables cannot be public */ /* Note: block locals may be named identical to locals at higher @@ -1657,7 +1660,8 @@ decl_enum(int vclass) tok = lex(&lexval, &str); /* read in (new) token */ if (tok != tSYMBOL && tok != tLABEL) error(20, str); /* invalid symbol name */ - strcpy(constname, str); /* save symbol name */ + strncpy(constname, str, sNAMEMAX); /* save symbol name */ + constname[sNAMEMAX] = 0; size = increment; /* default increment of 'val' */ if (tok == tLABEL || matchtoken(':')) constexpr(&size, NULL); /* get size */ --
[EGIT] [core/efl] master 06/06: Evas convert: Remove dead code
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=56e614101330203460214436e4be9e00a7474ef3 commit 56e614101330203460214436e4be9e00a7474ef3 Author: Jean-Philippe Andre Date: Mon Oct 27 23:09:18 2014 +0900 Evas convert: Remove dead code Woah coverity... Fixes CID 1039448 --- src/lib/evas/common/evas_convert_main.c | 34 + 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/src/lib/evas/common/evas_convert_main.c b/src/lib/evas/common/evas_convert_main.c index 0961bce..c9b4363 100644 --- a/src/lib/evas/common/evas_convert_main.c +++ b/src/lib/evas/common/evas_convert_main.c @@ -344,39 +344,7 @@ evas_common_convert_func_get(DATA8 *dest, int w, int h EINA_UNUSED, int depth, D else return evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_90; } - } -if ((rmask == 0xf800) && (gmask == 0x07e0) && (bmask == 0x001f)) - { - if (rotation == 0) - { - if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3))) -return evas_common_convert_rgba2_to_16bpp_rgb_454645_dith; - else -return evas_common_convert_rgba_to_16bpp_rgb_454645_dith; - - } - if (rotation == 180) - { - if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3))) -return evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_180; - else -return evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_180; - } - if (rotation == 270) - { - if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3))) -return evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_270; - else -return evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_270; - } - if (rotation == 90) - { - if ((!(w & 0x1)) && (!((intptr_t)dest & 0x3))) -return evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_90; - else -return evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_90; - } - } + } } if (depth == 32) { --
[EGIT] [core/efl] master 04/06: Evas cserve2: Check message size
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6ace8313728b31f602af8af90dbcb686031be562 commit 6ace8313728b31f602af8af90dbcb686031be562 Author: Jean-Philippe Andre Date: Mon Oct 27 22:16:53 2014 +0900 Evas cserve2: Check message size Fixes CID 1039570 --- src/bin/evas/evas_cserve2_usage.c | 4 1 file changed, 4 insertions(+) diff --git a/src/bin/evas/evas_cserve2_usage.c b/src/bin/evas/evas_cserve2_usage.c index b1946ad..449c9fd 100644 --- a/src/bin/evas/evas_cserve2_usage.c +++ b/src/bin/evas/evas_cserve2_usage.c @@ -133,6 +133,10 @@ _server_read(int *size) if (n < 0) return NULL; + // We don't expect large messages + if (sr_size < 0 || sr_size > 0x1) + return NULL; + sr_buf = malloc(sr_size); get_data: --
[EGIT] [core/efl] master 05/06: inotify: Fix safety after read in 3 places
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8d9c6c0a00a25dae580f3ee0cfaa84abcb911611 commit 8d9c6c0a00a25dae580f3ee0cfaa84abcb911611 Author: Jean-Philippe Andre Date: Mon Oct 27 22:57:53 2014 +0900 inotify: Fix safety after read in 3 places Fixes Coverity issues: - CID 1039565 - CID 1039566 --- src/bin/evas/evas_cserve2_main_loop_linux.c | 3 ++- src/lib/ecore_file/ecore_file_monitor_inotify.c | 3 ++- src/lib/eio/eio_monitor_inotify.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/bin/evas/evas_cserve2_main_loop_linux.c b/src/bin/evas/evas_cserve2_main_loop_linux.c index e213cc4..33a9955 100644 --- a/src/bin/evas/evas_cserve2_main_loop_linux.c +++ b/src/bin/evas/evas_cserve2_main_loop_linux.c @@ -328,7 +328,7 @@ _inotifyfd_handler(int fd, Fd_Flags flags, void *data EINA_UNUSED) } size = read(fd, buffer, sizeof(buffer)); - while (i < size) + while ((i + (int) sizeof(struct inotify_event)) <= (int) size) { struct inotify_event *event; int event_size; @@ -338,6 +338,7 @@ _inotifyfd_handler(int fd, Fd_Flags flags, void *data EINA_UNUSED) event = (struct inotify_event *)&buffer[i]; event_size = sizeof(struct inotify_event) + event->len; +if ((event_size + i) > size) break ; i += event_size; ids = eina_hash_find(inotify_id_hash, &event->wd); diff --git a/src/lib/ecore_file/ecore_file_monitor_inotify.c b/src/lib/ecore_file/ecore_file_monitor_inotify.c index e21e41c..067a281 100644 --- a/src/lib/ecore_file/ecore_file_monitor_inotify.c +++ b/src/lib/ecore_file/ecore_file_monitor_inotify.c @@ -162,10 +162,11 @@ _ecore_file_monitor_inotify_handler(void *data EINA_UNUSED, Ecore_Fd_Handler *fd if (fd < 0) return ECORE_CALLBACK_RENEW; size = read(fd, buffer, sizeof(buffer)); - while (i < size) + while ((i + (int) sizeof(struct inotify_event)) <= (int) size) { event = (struct inotify_event *)&buffer[i]; event_size = sizeof(struct inotify_event) + event->len; +if ((event_size + i) > size) break ; i += event_size; em = _ecore_file_monitor_inotify_monitor_find(event->wd); diff --git a/src/lib/eio/eio_monitor_inotify.c b/src/lib/eio/eio_monitor_inotify.c index fbfc24e..faa34b3 100644 --- a/src/lib/eio/eio_monitor_inotify.c +++ b/src/lib/eio/eio_monitor_inotify.c @@ -134,10 +134,11 @@ _eio_inotify_handler(void *data EINA_UNUSED, Ecore_Fd_Handler *fdh) if (fd < 0) return ECORE_CALLBACK_RENEW; size = read(fd, buffer, sizeof(buffer)); - while (i < size) + while ((i + (int) sizeof(struct inotify_event)) <= (int) size) { event = (struct inotify_event *)&buffer[i]; event_size = sizeof(struct inotify_event) + event->len; +if ((event_size + i) > size) break ; i += event_size; backend = eina_hash_find(_inotify_monitors, &event->wd); --
Re: [E-devel] Work items for the 1.12 stabilization phase
Hi, On Fri, Oct 24, 2014 at 8:57 PM, Stefan Schmidt wrote: > Hello. > > On 21/10/14 17:37, Stefan Schmidt wrote: > > Hello. > > > > Now that 1.12-alpha1 is out we all should have time to look over the > > good and fix it up as best as we can before the final release. > > > > To give you folks a list at hand that can be worked on here are some > > work items for the next 2.5 weeks. > > > > o Run ABI checker and carefully look through the reports. (I guess Tom > > handles this again?) > > o Bring up all critical items and fix them > > Thanks Tom for preparing them. Anybody had a look yet? > > > > > o Run benchmarks to see if we have performance regressions (Cedric, I > > guess you will be driving this? > > > > o Look over your own code and make sure you test it under various > > conditions. > >o Adding test cases will help with this and they are still welcome in > > this phase of development. > > > > o Go through the phab issue tracker to find open issues we need to fix > > before the release > >o Look through the incoming queue and add project, priority and > > assign as needed > >o Have a look at all showstopper, high and normal bugs for EFL and > > Elementary > >o Comment, test, fix, close as needed > > I was running to some of the incoming queue and changed priotity as well > as tackled some of these. > Take at least a look at the ones marked as high. > > > > > o Look through the open coverity issues > >o EFL lists 59 open defects as of now > >o Emotion generic players lists 9 > > A quick look ove rthe list in EFL showed that 6 are in edje and its > tools, 5 are in embryo, 5 are in cserve2 and tools, 2 are in eina_cxx, 3 > in edje_edit, 5 are in evas_3d, 4 are evas filter, 3 are in evas gl > common and many others all over the code. > The bugs spotted by Coverity in cserve2 are just pointing out how weak the implementation is (in terms of safety/security). They are IMHO not worth patching up as the protocol needs a rewrite with more security taken into consideration (the protocol itself may not need to change but its implementation should). Tbh I'm not happy about this but I also don't enough time to do this properly right now. While fixing a common problem with inotify I also spotted the fact that we read unaligned int values from a struct sent over the socket. Unaligned accesses may cause crashes on ARM, should I fix this or is there something I missed? (example func: _eio_inotify_handler) > > If you added code to these lately the chances are high that you > introduced some of these problems. Make sure to have a look. > > Another item that popped into my head is fixing either ecore_aufdio or > its tests as they are randomly failing on jenkins as well as my local > builds. > I already had a look but was not able to nail it down. As nobody takes a > break report from jenkins seriously as long as we randomly fail in > ecore_audio I consider to disable its tests as long as this is not > fixed. I know, I shitty solution but I kept in enbaled for months over > months now in the hope it would get fixed without any success. So the > whole idea to keep a broken test to motivate people seems to be broken. > I guess is that they "randomly" fail as you say. ecore_audio tests never fail on my local machine, as far as I can tell. Also, elua keeps failing sometimes when doing fresh parallel builds. q66, can you have a look at that? -- Jean-Philippe André -- ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[EGIT] [core/efl] master 01/01: Evas: Fix lock usage around async_current (gl preload)
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0198fbfee431c39d7e9f2fcc84147e98aed8e952 commit 0198fbfee431c39d7e9f2fcc84147e98aed8e952 Author: Jean-Philippe Andre Date: Tue Oct 28 11:19:24 2014 +0900 Evas: Fix lock usage around async_current (gl preload) Fixes Coverity: - CID 1039361 --- src/modules/evas/engines/gl_common/evas_gl_preload.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_preload.c b/src/modules/evas/engines/gl_common/evas_gl_preload.c index f1a7c9e..7881e3f 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_preload.c +++ b/src/modules/evas/engines/gl_common/evas_gl_preload.c @@ -46,23 +46,23 @@ evas_gl_preload_pop(Evas_GL_Texture *tex) { Eina_Bool running = async_loader_running; evas_gl_make_current_cb tmp_cb = async_gl_make_current; +Evas_GL_Texture_Async_Preload *current = async_current; void *tmp_data = async_engine_data; async_current_cancel = EINA_TRUE; +async_current = NULL; eina_lock_release(&async_loader_lock); if (running) evas_gl_preload_render_lock(tmp_cb, tmp_data); -evas_gl_common_texture_free(async_current->tex, EINA_FALSE); +evas_gl_common_texture_free(current->tex, EINA_FALSE); #ifdef EVAS_CSERVE2 -if (evas_cache2_image_cached(&async_current->im->cache_entry)) - evas_cache2_image_close(&async_current->im->cache_entry); +if (evas_cache2_image_cached(¤t->im->cache_entry)) + evas_cache2_image_close(¤t->im->cache_entry); else #endif -evas_cache_image_drop(&async_current->im->cache_entry); -free(async_current); - -async_current = NULL; +evas_cache_image_drop(¤t->im->cache_entry); +free(current); if (running) evas_gl_preload_render_unlock(tmp_cb, tmp_data); --
[EGIT] [core/efl] master 01/02: Evas GL: Fix potential crash
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f3226f5e815c5bbbe070fd921b958aaa56a385df commit f3226f5e815c5bbbe070fd921b958aaa56a385df Author: Jean-Philippe Andre Date: Wed Oct 29 12:56:00 2014 +0900 Evas GL: Fix potential crash Welp, it looks like this crash actually happened once even though it should not. glGetString() seems to have returned NULL somehow. --- src/modules/evas/engines/gl_common/evas_gl_api_ext.c | 9 - src/modules/evas/engines/gl_common/evas_gl_api_ext.h | 2 +- src/modules/evas/engines/gl_common/evas_gl_core.c| 10 -- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c index 8b86b53..9addf61 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c @@ -238,7 +238,7 @@ evgl_evasglWaitSync(Evas_GL *evas_gl EINA_UNUSED, static int _evgl_api_ext_status = 0; -void +Eina_Bool evgl_api_ext_init(void *getproc, const char *glueexts) { const char *glexts; @@ -258,6 +258,12 @@ evgl_api_ext_init(void *getproc, const char *glueexts) // GLES Extensions glexts = (const char*)glGetString(GL_EXTENSIONS); + if (!glexts) + { +ERR("glGetString returned NULL! Something is very wrong..."); +return EINA_FALSE; + } + /* // GLUE Extensions #ifdef GL_GLES @@ -352,6 +358,7 @@ re->info->info.screen); _evgl_api_ext_status = 1; + return EINA_TRUE; } void diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.h b/src/modules/evas/engines/gl_common/evas_gl_api_ext.h index 535903a..31f7873 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_ext.h +++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext.h @@ -67,7 +67,7 @@ / #define EXTENSION_SUPPORT(name) (_gl_ext_support_##name == 1) -extern void evgl_api_ext_init(void *getproc, const char *glueexts); +extern Eina_Bool evgl_api_ext_init(void *getproc, const char *glueexts); extern void evgl_api_ext_get(Evas_GL_API *gl_funcs); extern const char *evgl_api_ext_string_get(); diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c b/src/modules/evas/engines/gl_common/evas_gl_core.c index 78ae9e0..fb56d00 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_core.c +++ b/src/modules/evas/engines/gl_common/evas_gl_core.c @@ -1400,9 +1400,15 @@ evgl_engine_init(void *eng_data, const EVGL_Interface *efunc) // Initialize Extensions if (efunc->proc_address_get && efunc->ext_string_get) - evgl_api_ext_init(efunc->proc_address_get, efunc->ext_string_get(eng_data)); + { +if (!evgl_api_ext_init(efunc->proc_address_get, efunc->ext_string_get(eng_data))) + { + ERR("Extensions failed to load. This shouldn't happen, Evas GL load fails."); + goto error; + } + } else - ERR("Proc address get function not available. Extension not initialized."); + ERR("Proc address get function not available. Extensions not initialized."); if (efunc->ext_string_get) DBG("GLUE Extension String: %s", efunc->ext_string_get(eng_data)); --
[EGIT] [core/efl] master 02/02: Evas filters: Fix COW usage.
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=251389fefd6df762e9369e5b389c62c4bb1d481f commit 251389fefd6df762e9369e5b389c62c4bb1d481f Author: Jean-Philippe Andre Date: Wed Oct 29 15:10:03 2014 +0900 Evas filters: Fix COW usage. Thanks cedric for the report. We'll need a new function (after 1.12) to detect if the current cow pointer is the default data or not. Maybe eina_cow_default_get() or maybe something just returning a bool. --- src/lib/evas/canvas/evas_object_main.c | 1 + src/lib/evas/canvas/evas_object_text.c | 29 + src/lib/evas/include/evas_private.h| 2 ++ 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index fded1ce..ac1f53e 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c @@ -35,6 +35,7 @@ static const Evas_Object_Protected_State default_state = { static const Evas_Object_Filter_Data default_filter = { NULL, NULL, NULL, NULL, EINA_FALSE, EINA_FALSE }; +const void * const evas_object_filter_cow_default = &default_filter; Eina_Cow *evas_object_proxy_cow = NULL; Eina_Cow *evas_object_map_cow = NULL; diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 3cf8df3..8eadf07 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -403,7 +403,8 @@ _evas_text_efl_text_properties_font_source_get(Eo *eo_obj EINA_UNUSED, Evas_Text static inline void _evas_text_filter_changed_set(Evas_Text_Data *o, Eina_Bool val) { - if (o->cur.filter && (o->cur.filter->changed != val)) + if ((evas_object_filter_cow_default != o->cur.filter) + && (o->cur.filter->changed != val)) { EINA_COW_WRITE_BEGIN(evas_object_filter_cow, o->cur.filter, Evas_Object_Filter_Data, fcow) fcow->changed = val; @@ -1542,17 +1543,21 @@ evas_object_text_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) Evas_Text_Data *o = eo_data_scope_get(eo_obj, MY_CLASS); /* free filter output */ - EINA_COW_WRITE_BEGIN(evas_object_filter_cow, o->cur.filter, Evas_Object_Filter_Data, fcow) - if (fcow->output) - ENFN->image_free(ENDT, fcow->output); - eina_hash_free(fcow->sources); - evas_filter_program_del(fcow->chain); - eina_stringshare_del(fcow->code); - fcow->output = NULL; - fcow->chain = NULL; - fcow->sources = NULL; - fcow->code = NULL; - EINA_COW_WRITE_END(evas_object_filter_cow, o->cur.filter, fcow); + if (evas_object_filter_cow_default != o->cur.filter) + { +EINA_COW_WRITE_BEGIN(evas_object_filter_cow, o->cur.filter, Evas_Object_Filter_Data, fcow) + if (fcow->output) +ENFN->image_free(ENDT, fcow->output); + eina_hash_free(fcow->sources); + evas_filter_program_del(fcow->chain); + eina_stringshare_del(fcow->code); + fcow->output = NULL; + fcow->chain = NULL; + fcow->sources = NULL; + fcow->code = NULL; +EINA_COW_WRITE_END(evas_object_filter_cow, o->cur.filter, fcow); +eina_cow_free(evas_object_filter_cow, (const Eina_Cow_Data **) &o->cur.filter); + } /* free obj */ _evas_object_text_items_clear(o); diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index eff901b..fd37c29 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1715,6 +1715,8 @@ extern Eina_Cow *evas_object_image_load_opts_cow; extern Eina_Cow *evas_object_image_state_cow; extern Eina_Cow *evas_object_filter_cow; +// This should be replaced by something like "eina_cow_default_get()" maybe +extern const void * const evas_object_filter_cow_default; # define EINA_COW_STATE_WRITE_BEGIN(Obj, Write, State) \ EINA_COW_WRITE_BEGIN(evas_object_state_cow, Obj->State, \ --
[EGIT] [core/efl] master 01/01: Eina file: Fix calls to getenv
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=03cc40322880bac36a23dab3070bc51041a1ffdc commit 03cc40322880bac36a23dab3070bc51041a1ffdc Author: Jean-Philippe Andre Date: Thu Oct 30 18:23:49 2014 +0900 Eina file: Fix calls to getenv There seems to be an intent to check that UID==EUID before calling getenv to get the temp directory. But that was lost in commits 61478af3a6c4f9263 and then in e105abc99e717b84723ab35258375e27f17f8e82. --- src/lib/eina/eina_file_common.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/eina/eina_file_common.c b/src/lib/eina/eina_file_common.c index 5c2b87a..3e5b615 100644 --- a/src/lib/eina/eina_file_common.c +++ b/src/lib/eina/eina_file_common.c @@ -908,8 +908,10 @@ eina_file_mkstemp(const char *templatename, Eina_Tmpstr **path) #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) if (getuid() == geteuid()) #endif - tmpdir = getenv("TMPDIR"); - if (!tmpdir) tmpdir = getenv("XDG_RUNTIME_DIR"); + { +tmpdir = getenv("TMPDIR"); +if (!tmpdir) tmpdir = getenv("XDG_RUNTIME_DIR"); + } if (!tmpdir) tmpdir = "/tmp"; #else tmpdir = (char *)evil_tmpdir_get(); --
[EGIT] [core/efl] master 01/01: Eina: Fix eina_condition_timedwait once again
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=864394e7938e7d6389e40c458371bd548d0eb1a3 commit 864394e7938e7d6389e40c458371bd548d0eb1a3 Author: Jean-Philippe Andre Date: Thu Oct 30 20:09:43 2014 +0900 Eina: Fix eina_condition_timedwait once again Much confusion with this spaghetti code of #ifdefs and clocks. So, we can't use CPU clocks for the timedwait, this doesn't make sense (and it's explicit in the manpage, too). But we can use CLOCK_MONOTONIC or CLOCK_MONOTONIC_RAW which are much better than the wall clock (because of ntp updates, etc...) The test case tests that the cond actually waited for as long as was requested and for not too long either. This is hopefully a final fix for T1701. --- src/lib/eina/eina_inline_lock_posix.x | 101 ++ src/tests/eina/eina_test_lock.c | 15 - 2 files changed, 67 insertions(+), 49 deletions(-) diff --git a/src/lib/eina/eina_inline_lock_posix.x b/src/lib/eina/eina_inline_lock_posix.x index 11d18db..1da4a3d 100644 --- a/src/lib/eina/eina_inline_lock_posix.x +++ b/src/lib/eina/eina_inline_lock_posix.x @@ -58,16 +58,9 @@ typedef void (*Eina_Lock_Bt_Func) (); #include "eina_inlist.h" #endif -/* To be removed once we can use _eina_time_get() here*/ -#ifndef _WIN32 -# include -# include -#else -# define WIN32_LEAN_AND_MEAN -# include -# undef WIN32_LEAN_AND_MEAN -#endif /* _WIN2 */ -/* End of to be removed */ +/* For cond_timedwait */ +#include +#include typedef struct _Eina_Lock Eina_Lock; typedef struct _Eina_RWLock Eina_RWLock; @@ -124,6 +117,7 @@ struct _Eina_Condition { Eina_Lock *lock; /**< The lock for this condition */ pthread_cond_t condition; /**< The condition variable */ + clockid_t clkid; /**< The attached clock for timedwait */ }; struct _Eina_RWLock @@ -343,6 +337,8 @@ eina_lock_release(Eina_Lock *mutex) static inline Eina_Bool eina_condition_new(Eina_Condition *cond, Eina_Lock *mutex) { + pthread_condattr_t attr; + #ifdef EINA_HAVE_DEBUG_THREADS assert(mutex != NULL); if (!_eina_threads_activated) @@ -350,9 +346,27 @@ eina_condition_new(Eina_Condition *cond, Eina_Lock *mutex) memset(cond, 0, sizeof (Eina_Condition)); #endif + pthread_condattr_init(&attr); + cond->clkid = (clockid_t) 0; + + /* We try here to chose the best clock for cond_timedwait */ +#if defined(CLOCK_MONOTONIC_RAW) + if (!pthread_condattr_setclock(&attr, CLOCK_MONOTONIC_RAW)) + cond->clkid = CLOCK_MONOTONIC_RAW; +#endif +#if defined(CLOCK_MONOTONIC) + if (!cond->clkid && !pthread_condattr_setclock(&attr, CLOCK_MONOTONIC)) + cond->clkid = CLOCK_MONOTONIC; +#endif +#if defined(CLOCK_REALTIME) + if (!cond->clkid && !pthread_condattr_setclock(&attr, CLOCK_REALTIME)) + cond->clkid = CLOCK_REALTIME; +#endif + cond->lock = mutex; - if (pthread_cond_init(&cond->condition, NULL) != 0) + if (pthread_cond_init(&cond->condition, cond->clkid ? &attr : NULL) != 0) { +pthread_condattr_destroy(&attr); #ifdef EINA_HAVE_DEBUG_THREADS if (errno == EBUSY) printf("eina_condition_new on already initialized Eina_Condition\n"); @@ -360,6 +374,7 @@ eina_condition_new(Eina_Condition *cond, Eina_Lock *mutex) return EINA_FALSE; } + pthread_condattr_destroy(&attr); return EINA_TRUE; } @@ -408,10 +423,10 @@ eina_condition_wait(Eina_Condition *cond) static inline Eina_Bool eina_condition_timedwait(Eina_Condition *cond, double t) { - struct timespec tv; - Eina_Bool r; + struct timespec ts; time_t sec; long nsec; + int err; if (t < 0) { @@ -419,6 +434,22 @@ eina_condition_timedwait(Eina_Condition *cond, double t) return EINA_FALSE; } + if (cond->clkid) + { +if (clock_gettime(cond->clkid, &ts) != 0) + return EINA_FALSE; + } + else + { +/* Obsolete - this probably will never happen */ +struct timeval tv; +if (gettimeofday(&tv, NULL) != 0) + return EINA_FALSE; + +ts.tv_sec = tv.tv_sec; +ts.tv_nsec = tv.tv_usec * 1000L; + } + #ifdef EINA_HAVE_DEBUG_THREADS assert(_eina_threads_activated); assert(cond->lock != NULL); @@ -429,45 +460,19 @@ eina_condition_timedwait(Eina_Condition *cond, double t) pthread_mutex_unlock(&_eina_tracking_lock); #endif -/* To be removed once we can use _eina_time_get() here*/ -#ifndef _WIN32 -# if defined(CLOCK_PROCESS_CPUTIME_ID) - if (!clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &tv)) - return EINA_FALSE; -# endif -# if defined(CLOCK_PROF) - if (!clock_gettime(CLOCK_PROF, &tv)) - return EINA_FALSE; -# endif -# if defined(CLOCK_REALTIME) - if (!clock_gettime(CLOCK_REALTIME, &tv)) - return EINA_FALSE; -# endif -#endif - - struct timeval tp; - - if (gettimeofday(&tp, NULL)) - return EINA_FALSE; - - tv.tv_sec = tp.tv_sec; -
Re: [E-devel] Probies !
Hi! On Fri, Oct 31, 2014 at 8:03 AM, Cedric BAIL wrote: > Hello everyone, > > I would like to nominate two peoples to work as probies. First is > SubhransuSekhar Mohanty, who is going to help adding gradient support > back into EFL. Second is Bogdan Devichev who is working on Evas_3D and > will work on a Blender tool to integrate with EFL. > > Thanks for proposing this Cedric :) I'd like to see Sub being a probie so it becomes easier for us to work together and see his progress on the gradient implementation. Thanks, -- Jean-Philippe André -- ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[EGIT] [core/efl] master 01/01: Eina lock: try to fix compilation for OSX
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d0bae13693c025293bd2787f15cb22ac99efeb17 commit d0bae13693c025293bd2787f15cb22ac99efeb17 Author: Jean-Philippe ANDRE Date: Sun Nov 2 15:02:32 2014 +0900 Eina lock: try to fix compilation for OSX This is a quick fix. It looks like OSX doesn't provide the same infra as linux for cond_timedwait, but instead they provide directly a relative time wait function. Since I don't have any build / test environment for OSX, this is as far as I can go. Arguably, OSX libc seems to use gettimeofday() for cond_timedwait, so this should close T1701. See the pthread cond implementation: http://www.opensource.apple.com/source/Libc/Libc-167/pthreads.subproj/pthread_cond.c --- src/lib/eina/eina_inline_lock_posix.x | 26 +- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/lib/eina/eina_inline_lock_posix.x b/src/lib/eina/eina_inline_lock_posix.x index 1da4a3d..18732f6e 100644 --- a/src/lib/eina/eina_inline_lock_posix.x +++ b/src/lib/eina/eina_inline_lock_posix.x @@ -117,7 +117,9 @@ struct _Eina_Condition { Eina_Lock *lock; /**< The lock for this condition */ pthread_cond_t condition; /**< The condition variable */ +#if defined(__clockid_t_defined) clockid_t clkid; /**< The attached clock for timedwait */ +#endif }; struct _Eina_RWLock @@ -346,25 +348,28 @@ eina_condition_new(Eina_Condition *cond, Eina_Lock *mutex) memset(cond, 0, sizeof (Eina_Condition)); #endif + cond->lock = mutex; pthread_condattr_init(&attr); - cond->clkid = (clockid_t) 0; + /* OSX doesn't provide clockid_t or clock_gettime. */ +#if defined(__clockid_t_defined) + cond->clkid = (clockid_t) 0; /* We try here to chose the best clock for cond_timedwait */ -#if defined(CLOCK_MONOTONIC_RAW) +# if defined(CLOCK_MONOTONIC_RAW) if (!pthread_condattr_setclock(&attr, CLOCK_MONOTONIC_RAW)) cond->clkid = CLOCK_MONOTONIC_RAW; -#endif -#if defined(CLOCK_MONOTONIC) +# endif +# if defined(CLOCK_MONOTONIC) if (!cond->clkid && !pthread_condattr_setclock(&attr, CLOCK_MONOTONIC)) cond->clkid = CLOCK_MONOTONIC; -#endif -#if defined(CLOCK_REALTIME) +# endif +# if defined(CLOCK_REALTIME) if (!cond->clkid && !pthread_condattr_setclock(&attr, CLOCK_REALTIME)) cond->clkid = CLOCK_REALTIME; +# endif #endif - cond->lock = mutex; - if (pthread_cond_init(&cond->condition, cond->clkid ? &attr : NULL) != 0) + if (pthread_cond_init(&cond->condition, &attr) != 0) { pthread_condattr_destroy(&attr); #ifdef EINA_HAVE_DEBUG_THREADS @@ -434,14 +439,17 @@ eina_condition_timedwait(Eina_Condition *cond, double t) return EINA_FALSE; } +#if defined(__clockid_t_defined) if (cond->clkid) { if (clock_gettime(cond->clkid, &ts) != 0) return EINA_FALSE; } else +#endif { -/* Obsolete - this probably will never happen */ +/* Obsolete for Linux. + * TODO: use pthread_cond_timedwait_relative_np for OSX. */ struct timeval tv; if (gettimeofday(&tv, NULL) != 0) return EINA_FALSE; --
Re: [E-devel] discussion - documentation
ending on how much a feature is lacking in > > > documentation. > > > > > > Also, the generators can improve documentation by using tagged > > > information from Eo files, such as ownership. It can warn the user > > > that one of the parameters, tagged with own, have to be freed by the > > > user for example. And this information is going to be correctly > > > sync'ed because otherwise most bindings would crash. > > > > > > Also, I agree that different languages should have separate > > > documentations because too much information distracts and discourages > > > the user. Specially when the information seems much more complicated > > > than what he is looking for. So a python developer going through > > > anything C or C++ related is going to run away pretty easy. > > > > so you're going to have to put this smarts into some eolian based tool as > > eolian now has to be taught to deal with structs, enums etc. anyway for > > js/lua/python etc. so if this has to go there to generate jsdoc ... and > > C/C++ > > is separate, then some other lua doc thing (don't even now) then some > > different > > python doc? why not just generate it all at once - generate simple > > markdown. :) > > keep the docs somewhere where they are community editable beyond just > core > > devs. if docs stay in .eo files the only peolpe able to work on them are > > those > > with core src commit access. this isn't working. there are many reasons, > > but > > it's failing now for years. and getting worse. > > > > > As for documentation that is exclusive to one language, such as > > > tutorials and examples. The binding maintainer can write a source code > > > in the target language with its documentation or a dox file. > > > > > > BTW, I'm assuming the bindings would be, someday, integrated to the > > > EFL tree. Which I think is a good thing. > > > > c++ are already. lua are already. others will depend on time/effort etc. > > but > > they can be. i am assuming any bindings we support in-tree will generate > > their > > own lang doc pages as above. :) > > > > > Kind regards, > > > > > > [snip] > > > > > > > -- > > > > - Codito, ergo sum - "I code, therefore I am" > > -- > > > > The Rasterman (Carsten Haitzler)ras...@rasterman.com > > > > > > > > > > > > > > > -- > > > > ___ > > > > enlightenment-devel mailing list > > > > enlightenment-devel@lists.sourceforge.net > > > > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > > > > > > > > > -- > > > Felipe Magno de Almeida > > > > > > > > > -- > > > ___ > > > enlightenment-devel mailing list > > > enlightenment-devel@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > > > > > > > > > -- > > - Codito, ergo sum - "I code, therefore I am" -- > > The Rasterman (Carsten Haitzler)ras...@rasterman.com > > > > > > > > > -- > > ___ > > enlightenment-devel mailing list > > enlightenment-devel@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > > > > > > -- > -- Jeff Grimshaw > > -- > ___ > enlightenment-devel mailing list > enlightenment-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > > -- Jean-Philippe André -- ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[EGIT] [core/efl] master 01/03: Evas: Remove ugly REND_DBG
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4fb138a65f943fafc17a4c4a2d084362c3c4cf0b commit 4fb138a65f943fafc17a4c4a2d084362c3c4cf0b Author: Jean-Philippe Andre Date: Wed Nov 5 14:54:35 2014 +0900 Evas: Remove ugly REND_DBG Here's a macro that's used for debugging in some of the ugliest ways possible: avoid passing an extra argument to a function when the cost of always passing it is negligible (it's an int). Fixes T1749. --- src/lib/evas/canvas/evas_3d_texture.c | 6 +-- src/lib/evas/canvas/evas_object_image.c | 6 +-- src/lib/evas/canvas/evas_render.c | 69 + src/lib/evas/filters/evas_filter.c | 6 +-- src/lib/evas/include/evas_private.h | 7 +--- 5 files changed, 24 insertions(+), 70 deletions(-) diff --git a/src/lib/evas/canvas/evas_3d_texture.c b/src/lib/evas/canvas/evas_3d_texture.c index 4aecbef..9f46167 100644 --- a/src/lib/evas/canvas/evas_3d_texture.c +++ b/src/lib/evas/canvas/evas_3d_texture.c @@ -144,11 +144,7 @@ _texture_proxy_subrender(Evas_3D_Texture *obj) -source->cur->geometry.x, -source->cur->geometry.y, 1, 0, 0, e->output.w, e->output.h, -&proxy_render_data -#ifdef REND_DBG -, 1 -#endif -, EINA_FALSE); +&proxy_render_data, 1, EINA_FALSE); } e->engine.func->context_free(e->engine.data.output, ctx); diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index fb0fc3e..5530af4 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -2426,11 +2426,7 @@ _proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_proxy, Evas -source->cur->geometry.x, -source->cur->geometry.y, 1, 0, 0, e->output.w, e->output.h, - &proxy_render_data -#ifdef REND_DBG - , 1 -#endif - , do_async); + &proxy_render_data, 1, do_async); e->engine.func->context_free(e->engine.data.output, ctx); proxy_write->surface = e->engine.func->image_dirty_region diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index dda7df1..f36b259 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -390,11 +390,7 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj, int restack, int *redraw_all, Eina_Bool mapped_parent, - Eina_Bool src_changed -#ifdef REND_DBG - , int level -#endif - ) + Eina_Bool src_changed, int level) { Eina_Bool clean_them = EINA_FALSE; int is_active; @@ -490,11 +486,8 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj, obj->restack, redraw_all, EINA_TRUE, - src_changed -#ifdef REND_DBG - , level + 1 -#endif - ); + src_changed, + level + 1); } } } @@ -544,11 +537,8 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj, obj->restack, redraw_all, mapped_parent, - src_changed -#ifdef REND_DBG - , level + 1 -#endif -); + src_changed, + level + 1); } } else @@ -615,11 +605,8 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj, restack, redraw_all,
[EGIT] [core/efl] master 03/03: Evas shaders: Auto-generate the shaders from Makefile
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ae4f7f4e617ccaf5888a788778ae875b69be99cb commit ae4f7f4e617ccaf5888a788778ae875b69be99cb Author: Jean-Philippe Andre Date: Wed Nov 12 14:55:34 2014 +0900 Evas shaders: Auto-generate the shaders from Makefile Let's regenerate the shaders when a SHD file changes. I've removed the Git commit id because only touching a file would insert a code change. --- src/Makefile_Evas.am | 97 ++-- .../engines/gl_common/shader/evas_gl_shaders.x | 173 ++--- .../evas/engines/gl_common/shader/gen_shaders.sh | 5 +- 3 files changed, 97 insertions(+), 178 deletions(-) diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index 077977e..3e1f129 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -577,90 +577,7 @@ modules/evas/engines/gl_common/evas_gl_core_private.h \ modules/evas/engines/gl_common/evas_gl_api.c \ modules/evas/engines/gl_common/evas_gl_api_gles1.c \ modules/evas/engines/gl_common/evas_gl_api_ext.c \ -modules/evas/engines/gl_common/shader/font_frag.h \ -modules/evas/engines/gl_common/shader/font_vert.h \ -modules/evas/engines/gl_common/shader/img_12_bgra_frag.h \ -modules/evas/engines/gl_common/shader/img_12_bgra_nomul_frag.h \ -modules/evas/engines/gl_common/shader/img_12_bgra_nomul_vert.h \ -modules/evas/engines/gl_common/shader/img_12_bgra_vert.h \ -modules/evas/engines/gl_common/shader/img_12_frag.h \ -modules/evas/engines/gl_common/shader/img_12_nomul_frag.h \ -modules/evas/engines/gl_common/shader/img_12_nomul_vert.h \ -modules/evas/engines/gl_common/shader/img_12_vert.h \ -modules/evas/engines/gl_common/shader/img_21_bgra_frag.h \ -modules/evas/engines/gl_common/shader/img_21_bgra_nomul_frag.h \ -modules/evas/engines/gl_common/shader/img_21_bgra_nomul_vert.h \ -modules/evas/engines/gl_common/shader/img_21_bgra_vert.h \ -modules/evas/engines/gl_common/shader/img_21_frag.h \ -modules/evas/engines/gl_common/shader/img_21_nomul_frag.h \ -modules/evas/engines/gl_common/shader/img_21_nomul_vert.h \ -modules/evas/engines/gl_common/shader/img_21_vert.h \ -modules/evas/engines/gl_common/shader/img_22_bgra_frag.h \ -modules/evas/engines/gl_common/shader/img_22_bgra_nomul_frag.h \ -modules/evas/engines/gl_common/shader/img_22_bgra_nomul_vert.h \ -modules/evas/engines/gl_common/shader/img_22_bgra_vert.h \ -modules/evas/engines/gl_common/shader/img_22_frag.h \ -modules/evas/engines/gl_common/shader/img_22_nomul_frag.h \ -modules/evas/engines/gl_common/shader/img_22_nomul_vert.h \ -modules/evas/engines/gl_common/shader/img_22_vert.h \ -modules/evas/engines/gl_common/shader/img_bgra_frag.h \ -modules/evas/engines/gl_common/shader/img_bgra_nomul_frag.h \ -modules/evas/engines/gl_common/shader/img_bgra_nomul_vert.h \ -modules/evas/engines/gl_common/shader/img_bgra_vert.h \ -modules/evas/engines/gl_common/shader/img_frag.h \ -modules/evas/engines/gl_common/shader/img_nomul_frag.h \ -modules/evas/engines/gl_common/shader/img_nomul_vert.h \ -modules/evas/engines/gl_common/shader/img_vert.h \ -modules/evas/engines/gl_common/shader/nv12_frag.h \ -modules/evas/engines/gl_common/shader/nv12_nomul_frag.h \ -modules/evas/engines/gl_common/shader/nv12_nomul_vert.h \ -modules/evas/engines/gl_common/shader/nv12_vert.h \ -modules/evas/engines/gl_common/shader/rect_frag.h \ -modules/evas/engines/gl_common/shader/rect_vert.h \ -modules/evas/engines/gl_common/shader/rgb_a_pair_frag.h \ -modules/evas/engines/gl_common/shader/rgb_a_pair_nomul_frag.h \ -modules/evas/engines/gl_common/shader/rgb_a_pair_nomul_vert.h \ -modules/evas/engines/gl_common/shader/rgb_a_pair_vert.h \ -modules/evas/engines/gl_common/shader/tex_12_frag.h \ -modules/evas/engines/gl_common/shader/tex_12_nomul_frag.h \ -modules/evas/engines/gl_common/shader/tex_12_nomul_vert.h \ -modules/evas/engines/gl_common/shader/tex_12_vert.h \ -modules/evas/engines/gl_common/shader/tex_21_frag.h \ -modules/evas/engines/gl_common/shader/tex_21_nomul_frag.h \ -modules/evas/engines/gl_common/shader/tex_21_nomul_vert.h \ -modules/evas/engines/gl_common/shader/tex_21_vert.h \ -modules/evas/engines/gl_common/shader/tex_22_frag.h \ -modules/evas/engines/gl_common/shader/tex_22_nomul_frag.h \ -modules/evas/engines/gl_common/shader/tex_22_nomul_vert.h \ -modules/evas/engines/gl_common/shader/tex_22_vert.h \ -modules/evas/engines/gl_common/shader/tex_frag.h \ -modules/evas/engines/gl_common/shader/tex_nomul_frag.h \ -modules/evas/engines/gl_common/shader/tex_nomul_vert.h \ -modules/evas/engines/gl_common/shader/tex_vert.h \ -modules/evas/engines/gl_common/shader/tex_12_afill_frag.h \ -modules/evas/engines/gl_common/shader/tex_12_nomul_afill_frag.h \ -modules/evas/engines/gl_common/shader/tex_12_nomul_afill_vert.h \ -modules/evas/engines/gl_common/shader/tex_12_afill_vert.h \ -modules/evas/engines/gl_common/shader/tex_21_afill_frag.h \ -modules/evas/engines/gl_common/shader/tex_21_nomul_afill_f
[EGIT] [core/efl] master 01/01: Evas image: Use macros ENFN/ENDT to improve code readability
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=792ac177361bea36ca54b5b629699e3f346a33f2 commit 792ac177361bea36ca54b5b629699e3f346a33f2 Author: Jean-Philippe Andre Date: Wed Oct 22 18:34:51 2014 +0900 Evas image: Use macros ENFN/ENDT to improve code readability These macros replace some very repetitive code: - define ENFN obj->layer->evas->engine.func - define ENDT obj->layer->evas->engine.data.output This commit includes lots of space changes as well. This is a purely cosmetic commit. --- src/lib/evas/canvas/evas_object_image.c | 528 1 file changed, 204 insertions(+), 324 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 5530af4..99e7b8b 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -22,6 +22,10 @@ #define VERBOSE_PROXY_ERROR 1 +/* save typing */ +#define ENFN obj->layer->evas->engine.func +#define ENDT obj->layer->evas->engine.data.output + /* private magic number for image objects */ static const char o_type[] = "image"; @@ -294,9 +298,7 @@ _evas_object_image_cleanup(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, if ((o->preloading) && (o->engine_data)) { o->preloading = EINA_FALSE; - obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output, - o->engine_data, - eo_obj); +ENFN->image_data_preload_cancel(ENDT, o->engine_data, eo_obj); } if (o->cur->source) _proxy_unset(eo_obj, obj, o); if (o->cur->scene) _3d_unset(eo_obj, obj, o); @@ -361,8 +363,7 @@ _evas_image_eo_base_constructor(Eo *eo_obj, Evas_Image_Data *o) o->prev = eina_cow_alloc(evas_object_image_state_cow); o->proxy_src_clip = EINA_TRUE; - cspace = obj->layer->evas->engine.func->image_colorspace_get(obj->layer->evas->engine.data.output, - o->engine_data); + cspace = ENFN->image_colorspace_get(ENDT, o->engine_data); if (!o->cur->filter || (cspace != o->cur->cspace)) { @@ -459,9 +460,9 @@ _image_init_set(const Eina_File *f, const char *file, const char *key, if (o->preloading) { o->preloading = EINA_FALSE; - obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output, o->engine_data, eo_obj); + ENFN->image_data_preload_cancel(ENDT, o->engine_data, eo_obj); } - obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output, o->engine_data); +ENFN->image_free(ENDT, o->engine_data); } o->load_error = EVAS_LOAD_ERROR_NONE; lo->scale_down_by = o->load_opts->scale_down_by; @@ -494,16 +495,16 @@ _image_done_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o) int w, h; int stride; - obj->layer->evas->engine.func->image_size_get(obj->layer->evas->engine.data.output, o->engine_data, &w, &h); -if (obj->layer->evas->engine.func->image_stride_get) - obj->layer->evas->engine.func->image_stride_get(obj->layer->evas->engine.data.output, o->engine_data, &stride); +ENFN->image_size_get(ENDT, o->engine_data, &w, &h); +if (ENFN->image_stride_get) + ENFN->image_stride_get(ENDT, o->engine_data, &stride); else stride = w * 4; EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) { - state_write->has_alpha = obj->layer->evas->engine.func->image_alpha_get(obj->layer->evas->engine.data.output, o->engine_data); - state_write->cspace = obj->layer->evas->engine.func->image_colorspace_get(obj->layer->evas->engine.data.output, o->engine_data); + state_write->has_alpha = ENFN->image_alpha_get(ENDT, o->engine_data); + state_write->cspace = ENFN->image_colorspace_get(ENDT, o->engine_data); if ((o->cur->image.w != w) || (o->cur->image.h != h)) resize_call = EINA_TRUE; @@ -554,11 +555,7 @@ _evas_image_mmap_set(Eo *eo_obj, Evas_Image_Data *o, const Eina_File *f, const c } _image_init_set(f, NULL, key, eo_obj, obj, o, &lo); - o->engine_data = obj->layer->evas->engine.func->image_mmap(obj->layer->evas->engine.data.output, - o->cur->u.f, - o->cur->key, - &o->load_error, - &lo); + o->engine_data = ENFN->image_mmap(ENDT, o->cur->u.f, o->cur->key, &o->load_error, &lo); _image_done_set(eo_obj, obj, o); } @@ -587,
[EGIT] [core/efl] master 03/03: Evas: Use common function for proxy_subrender
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=fe677a0518b6b60f016d51ed6ceb4a1cf3f820a0 commit fe677a0518b6b60f016d51ed6ceb4a1cf3f820a0 Author: Jean-Philippe Andre Date: Thu Oct 23 15:27:40 2014 +0900 Evas: Use common function for proxy_subrender Merges functions from: - filters - image object --- src/lib/evas/canvas/evas_3d_texture.c | 2 + src/lib/evas/canvas/evas_object_image.c | 87 ++--- src/lib/evas/canvas/evas_render.c | 82 +++ src/lib/evas/filters/evas_filter.c | 87 + src/lib/evas/include/evas_private.h | 2 + 5 files changed, 91 insertions(+), 169 deletions(-) diff --git a/src/lib/evas/canvas/evas_3d_texture.c b/src/lib/evas/canvas/evas_3d_texture.c index 9f46167..b87d143 100644 --- a/src/lib/evas/canvas/evas_3d_texture.c +++ b/src/lib/evas/canvas/evas_3d_texture.c @@ -66,6 +66,8 @@ _texture_proxy_subrender(Evas_3D_Texture *obj) if (!pd->source) return; + // TODO: replace this function by evas_render_proxy_subrender (as appropriate) + source = eo_data_scope_get(pd->source, EVAS_OBJECT_CLASS); is_image = eo_isa(pd->source, EVAS_IMAGE_CLASS); diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 99e7b8b..03f422d 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -2272,85 +2272,6 @@ _proxy_error(Evas_Object *eo_proxy, void *context, void *output, void *surface, return; } - -/** - * Render the source object when a proxy is set. - * - * Used to force a draw if necessary, else just makes sure it's available. - */ -static void -_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_proxy, Evas_Object_Protected_Data *proxy_obj, Eina_Bool do_async) -{ - Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS); - Evas_Object_Protected_Data *source; - void *ctx; - int w, h; - - if (!eo_source) return; - source = eo_data_scope_get(eo_source, EVAS_OBJECT_CLASS); - - w = source->cur->geometry.w; - h = source->cur->geometry.h; - - EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, source->proxy, Evas_Object_Proxy_Data, proxy_write) - { -proxy_write->redraw = EINA_FALSE; - -/* We need to redraw surface then */ -if ((proxy_write->surface) && -((proxy_write->w != w) || (proxy_write->h != h))) - { - e->engine.func->image_map_surface_free(e->engine.data.output, -proxy_write->surface); - proxy_write->surface = NULL; - } - -/* FIXME: Hardcoded alpha 'on' */ -/* FIXME (cont): Should see if the object has alpha */ -if (!proxy_write->surface) - { - proxy_write->surface = e->engine.func->image_map_surface_new - (e->engine.data.output, w, h, 1); - if (!proxy_write->surface) goto end; - proxy_write->w = w; - proxy_write->h = h; - } - -ctx = e->engine.func->context_new(e->engine.data.output); -e->engine.func->context_color_set(e->engine.data.output, ctx, 0, 0, - 0, 0); -e->engine.func->context_render_op_set(e->engine.data.output, ctx, - EVAS_RENDER_COPY); -e->engine.func->rectangle_draw(e->engine.data.output, ctx, - proxy_write->surface, 0, 0, w, h, - do_async); -e->engine.func->context_free(e->engine.data.output, ctx); - -ctx = e->engine.func->context_new(e->engine.data.output); - -Eina_Bool source_clip = EINA_FALSE; -eo_do(eo_proxy, source_clip = evas_obj_image_source_clip_get()); - -Evas_Proxy_Render_Data proxy_render_data = { - .eo_proxy = eo_proxy, - .proxy_obj = proxy_obj, - .eo_src = eo_source, - .source_clip = source_clip -}; -evas_render_mapped(e, eo_source, source, ctx, proxy_write->surface, - -source->cur->geometry.x, - -source->cur->geometry.y, - 1, 0, 0, e->output.w, e->output.h, - &proxy_render_data, 1, do_async); - -e->engine.func->context_free(e->engine.data.output, ctx); -proxy_write->surface = e->engine.func->image_dirty_region - (e->engine.data.output, proxy_write->surface, 0, 0, w, h); - } - end: - EINA_COW_WRITE_END(evas_object_proxy_cow, source->proxy, proxy_write); -} - static void _3d_set(Evas_Object *eo_obj, Evas_3D_Scene *scene) { @@ -3038,8 +2959,8 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v else { o->proxyrendering = EINA_TRUE; -
[EGIT] [core/efl] master 01/03: Evas: Fix SW rendering COPY function with mask
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=85ecf662d4a93339f57e66c901be3b4b250287e6 commit 85ecf662d4a93339f57e66c901be3b4b250287e6 Author: Jean-Philippe Andre Date: Mon Nov 10 16:48:38 2014 +0900 Evas: Fix SW rendering COPY function with mask This does not fix any known bug as there is no known path using this function. --- src/lib/evas/common/evas_op_copy/op_copy_mask_color_.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib/evas/common/evas_op_copy/op_copy_mask_color_.c b/src/lib/evas/common/evas_op_copy/op_copy_mask_color_.c index efe7cca..3cbecbe 100644 --- a/src/lib/evas/common/evas_op_copy/op_copy_mask_color_.c +++ b/src/lib/evas/common/evas_op_copy/op_copy_mask_color_.c @@ -3,20 +3,21 @@ static void _op_copy_mas_c_dp(DATA32 *s EINA_UNUSED, DATA8 *m, DATA32 c, DATA32 *d, int l) { DATA32 *e; - int color; + int alpha; UNROLL8_PLD_WHILE(d, l, e, { -color = *m; -switch(color) +alpha = *m; +switch(alpha) { case 0: + *d = 0; break; case 255: *d = c; break; default: - color++; - *d = INTERP_256(color, c, *d); + alpha++; + *d = MUL_256(alpha, c); break; } m++; d++; --
[EGIT] [core/efl] master 02/03: Evas: Fix COPY op for mask+color
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e21a40de9dfdebdcd3f350aa5e5104be35058675 commit e21a40de9dfdebdcd3f350aa5e5104be35058675 Author: Jean-Philippe Andre Date: Mon Nov 10 18:16:56 2014 +0900 Evas: Fix COPY op for mask+color Also, mark some functions with a FIXME as they look just wrong. COPY_REL is never used... MMX and NEON optimizations should be implemented for COPY MASK+COL. --- .../evas/common/evas_op_copy/op_copy_mask_color_.c | 5 + .../common/evas_op_copy/op_copy_mask_color_i386.c | 26 ++ .../common/evas_op_copy/op_copy_mask_color_neon.c | 14 +++- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/src/lib/evas/common/evas_op_copy/op_copy_mask_color_.c b/src/lib/evas/common/evas_op_copy/op_copy_mask_color_.c index 3cbecbe..dcb4545 100644 --- a/src/lib/evas/common/evas_op_copy/op_copy_mask_color_.c +++ b/src/lib/evas/common/evas_op_copy/op_copy_mask_color_.c @@ -6,6 +6,7 @@ _op_copy_mas_c_dp(DATA32 *s EINA_UNUSED, DATA8 *m, DATA32 c, DATA32 *d, int l) { int alpha; UNROLL8_PLD_WHILE(d, l, e, { +/* d = m*c */ alpha = *m; switch(alpha) { @@ -82,14 +83,17 @@ init_copy_mask_color_pt_funcs_c(void) static void _op_copy_rel_mas_c_dp(DATA32 *s EINA_UNUSED, DATA8 *m, DATA32 c, DATA32 *d, int l) { + /* FIXME: THIS FUNCTION HAS PROBABLY NEVER BEEN TESTED */ DATA32 *e; int color; UNROLL8_PLD_WHILE(d, l, e, { +/* d = (m*c)*da */ color = *m; switch(color) { case 0: + *d = 0; break; case 255: color = 1 + (*d >> 24); @@ -134,6 +138,7 @@ init_copy_rel_mask_color_span_funcs_c(void) static void _op_copy_rel_pt_mas_c_dp(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) { + /* FIXME: THIS FUNCTION HAS PROBABLY NEVER BEEN TESTED */ s = 1 + (*d >> 24); s = MUL_256(s, c); *d = INTERP_256(m + 1, s, *d); diff --git a/src/lib/evas/common/evas_op_copy/op_copy_mask_color_i386.c b/src/lib/evas/common/evas_op_copy/op_copy_mask_color_i386.c index a8c85e0..4381326 100644 --- a/src/lib/evas/common/evas_op_copy/op_copy_mask_color_i386.c +++ b/src/lib/evas/common/evas_op_copy/op_copy_mask_color_i386.c @@ -3,6 +3,30 @@ #ifdef BUILD_MMX static void _op_copy_mas_c_dp_mmx(DATA32 *s EINA_UNUSED, DATA8 *m, DATA32 c, DATA32 *d, int l) { +#if 1 + DATA32 *e; + int alpha; + UNROLL8_PLD_WHILE(d, l, e, + { +/* d = m*c */ +alpha = *m; +switch(alpha) + { + case 0: + *d = 0; + break; + case 255: + *d = c; + break; + default: + alpha++; + *d = MUL_256(alpha, c); + break; + } +m++; d++; + }); +#else +#warning This MMX function looks broken. Please fixme. DATA32 *e = d + l; pxor_r2r(mm0, mm0); MOV_P2R(c, mm2, mm0) @@ -29,6 +53,7 @@ _op_copy_mas_c_dp_mmx(DATA32 *s EINA_UNUSED, DATA8 *m, DATA32 c, DATA32 *d, int } m++; d++; } +#endif } #define _op_copy_mas_cn_dp_mmx _op_copy_mas_c_dp_mmx @@ -99,6 +124,7 @@ init_copy_mask_color_pt_funcs_mmx(void) #ifdef BUILD_MMX static void _op_copy_rel_mas_c_dp_mmx(DATA32 *s EINA_UNUSED, DATA8 *m, DATA32 c, DATA32 *d, int l) { + /* FIXME: THIS FUNCTION HAS PROBABLY NEVER BEEN TESTED */ DATA32 *e = d + l; pxor_r2r(mm0, mm0); MOV_P2R(c, mm2, mm0) diff --git a/src/lib/evas/common/evas_op_copy/op_copy_mask_color_neon.c b/src/lib/evas/common/evas_op_copy/op_copy_mask_color_neon.c index 7d9a44e..e5d6d57 100644 --- a/src/lib/evas/common/evas_op_copy/op_copy_mask_color_neon.c +++ b/src/lib/evas/common/evas_op_copy/op_copy_mask_color_neon.c @@ -5,20 +5,22 @@ static void _op_copy_mas_c_dp_neon(DATA32 *s EINA_UNUSED, DATA8 *m, DATA32 c, DATA32 *d, int l) { // FIXME: neon-it DATA32 *e; - int color; + int alpha; UNROLL8_PLD_WHILE(d, l, e, { -color = *m; -switch(color) +/* d = m*c */ +alpha = *m; +switch(alpha) { case 0: + *d = 0; break; case 255:
[EGIT] [core/efl] master 01/02: Evas: Avoid creating an extra context for proxy rendering
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a56cc8a8c1f81dbdf9242c198c7a62523a582249 commit a56cc8a8c1f81dbdf9242c198c7a62523a582249 Author: Jean-Philippe Andre Date: Wed Nov 12 19:18:09 2014 +0900 Evas: Avoid creating an extra context for proxy rendering --- src/lib/evas/canvas/evas_3d_texture.c | 2 +- src/lib/evas/canvas/evas_render.c | 18 +- src/lib/evas/include/evas_private.h | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/lib/evas/canvas/evas_3d_texture.c b/src/lib/evas/canvas/evas_3d_texture.c index b87d143..8945fad 100644 --- a/src/lib/evas/canvas/evas_3d_texture.c +++ b/src/lib/evas/canvas/evas_3d_texture.c @@ -146,7 +146,7 @@ _texture_proxy_subrender(Evas_3D_Texture *obj) -source->cur->geometry.x, -source->cur->geometry.y, 1, 0, 0, e->output.w, e->output.h, -&proxy_render_data, 1, EINA_FALSE); +&proxy_render_data, 1, EINA_FALSE, EINA_FALSE); } e->engine.func->context_free(e->engine.data.output, ctx); diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index ea25d76..9494d3a 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -1107,7 +1107,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, void *surface, int off_x, int off_y, int mapped, int ecx, int ecy, int ecw, int ech, Evas_Proxy_Render_Data *proxy_render_data, int level, - Eina_Bool do_async) + Eina_Bool use_mapped_ctx, Eina_Bool do_async) { void *ctx; Evas_Object_Protected_Data *obj2; @@ -1278,6 +1278,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, ecx, ecy, ecw, ech, proxy_render_data, level + 1, + EINA_FALSE, do_async); /* We aren't sure this object will be rendered by normal(not proxy) drawing after, we reset this @@ -1394,7 +1395,10 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, { RDI(level); RD("draw child of mapped obj\n"); - ctx = e->engine.func->context_new(e->engine.data.output); + if (use_mapped_ctx) + ctx = context; + else + ctx = e->engine.func->context_new(e->engine.data.output); if (obj->is_smart) { EINA_INLIST_FOREACH @@ -1406,6 +1410,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, ecx, ecy, ecw, ech, proxy_render_data, level + 1, + EINA_FALSE, do_async); /* We aren't sure this object will be rendered by normal(not proxy) drawing after, we reset this @@ -1432,7 +1437,8 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, e->engine.data.output, ctx, surface, off_x, off_y, EINA_FALSE); } - e->engine.func->context_free(e->engine.data.output, ctx); + if (!use_mapped_ctx) + e->engine.func->context_free(e->engine.data.output, ctx); } else { @@ -1545,7 +1551,7 @@ evas_render_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_ -source->cur->geometry.x, -source->cur->geometry.y, 1, 0, 0, e->output.w, e->output.h, - &proxy_render_data, 1, do_async); + &proxy_render_data, 1, EINA_TRUE, do_async); e->engine.func->context_free(e->engine.data.output, ctx); proxy_write->surface = e->engine.func->image_dirty_region @@ -2022,7 +2028,9 @@ evas_render_updates_internal(Evas *eo_e, surface, off_x + fx, off_y + fy, 0, cx, cy, cw, ch, - NULL, 1, do_async); +
[EGIT] [core/efl] master 02/02: Evas: Use ENFN/ENDT in proxy subrender
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=5a13e97c1b9501a247c6a78d2194f66fae07f7fe commit 5a13e97c1b9501a247c6a78d2194f66fae07f7fe Author: Jean-Philippe Andre Date: Wed Nov 12 19:25:21 2014 +0900 Evas: Use ENFN/ENDT in proxy subrender Again, just a code readability change. --- src/lib/evas/canvas/evas_render.c | 37 + 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index 9494d3a..4a340ee 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -89,6 +89,10 @@ do \ eina_array_flush(array); \ } +/* save typing */ +#define ENFN evas->engine.func +#define ENDT evas->engine.data.output + typedef struct _Render_Updates Render_Updates; struct _Render_Updates { @@ -1489,7 +1493,7 @@ void evas_render_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_proxy, Evas_Object_Protected_Data *proxy_obj, Eina_Bool do_async) { - Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS); + Evas_Public_Data *evas = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS); Evas_Object_Protected_Data *source; Eina_Bool source_clip = EINA_FALSE; void *ctx; @@ -1510,8 +1514,7 @@ evas_render_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_ if ((proxy_write->surface) && ((proxy_write->w != w) || (proxy_write->h != h))) { - e->engine.func->image_map_surface_free(e->engine.data.output, -proxy_write->surface); + ENFN->image_map_surface_free(ENDT, proxy_write->surface); proxy_write->surface = NULL; } @@ -1519,24 +1522,19 @@ evas_render_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_ /* FIXME (cont): Should see if the object has alpha */ if (!proxy_write->surface) { - proxy_write->surface = e->engine.func->image_map_surface_new - (e->engine.data.output, w, h, 1); + proxy_write->surface = ENFN->image_map_surface_new(ENDT, w, h, 1); if (!proxy_write->surface) goto end; proxy_write->w = w; proxy_write->h = h; } -ctx = e->engine.func->context_new(e->engine.data.output); -e->engine.func->context_color_set(e->engine.data.output, ctx, 0, 0, - 0, 0); -e->engine.func->context_render_op_set(e->engine.data.output, ctx, - EVAS_RENDER_COPY); -e->engine.func->rectangle_draw(e->engine.data.output, ctx, - proxy_write->surface, 0, 0, w, h, - do_async); -e->engine.func->context_free(e->engine.data.output, ctx); +ctx = ENFN->context_new(ENDT); +ENFN->context_color_set(ENDT, ctx, 0, 0,0, 0); +ENFN->context_render_op_set(ENDT, ctx,EVAS_RENDER_COPY); +ENFN->rectangle_draw(ENDT, ctx, proxy_write->surface, 0, 0, w, h, do_async); +ENFN->context_free(ENDT, ctx); -ctx = e->engine.func->context_new(e->engine.data.output); +ctx = ENFN->context_new(ENDT); if (eo_isa(eo_proxy, EVAS_IMAGE_CLASS)) eo_do(eo_proxy, source_clip = evas_obj_image_source_clip_get()); @@ -1547,15 +1545,14 @@ evas_render_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_ .eo_src = eo_source, .source_clip = source_clip }; -evas_render_mapped(e, eo_source, source, ctx, proxy_write->surface, +evas_render_mapped(evas, eo_source, source, ctx, proxy_write->surface, -source->cur->geometry.x, -source->cur->geometry.y, - 1, 0, 0, e->output.w, e->output.h, + 1, 0, 0, evas->output.w, evas->output.h, &proxy_render_data, 1, EINA_TRUE, do_async); -e->engine.func->context_free(e->engine.data.output, ctx); -proxy_write->surface = e->engine.func->image_dirty_region - (e->engine.data.output, proxy_write->surface, 0, 0, w, h); +ENFN->context_free(ENDT, ctx); +proxy_write->surface = ENFN->image_dirty_region(ENDT, proxy_write->surface, 0, 0, w, h); } end: EINA_COW_WRITE_END(evas_object_proxy_cow, source->proxy, proxy_write); --
[EGIT] [core/efl] master 01/01: Evas: Don't pass whole RGBA_Image to low-level render functions
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=05aee3e3706867605d3b1bb84c3a70ccafba0673 commit 05aee3e3706867605d3b1bb84c3a70ccafba0673 Author: Jean-Philippe Andre Date: Thu Nov 13 11:27:50 2014 +0900 Evas: Don't pass whole RGBA_Image to low-level render functions Idea originated from Cedric the b0rker. This is a big fat search-and-replace commit. This commit also introduces space changes... Sorry for the mix. NOTE: This commit may have one side effect as there was some very dubious code chaning the dst image's alpha flag in the Gfx get functions. Logically this didn't make sense (at draw time the dst alpha should already be well defined), so it should be safe. --- src/lib/evas/common/evas_blend_main.c | 157 ++- src/lib/evas/common/evas_blend_private.h | 20 +-- src/lib/evas/common/evas_font_draw.c | 4 +- src/lib/evas/common/evas_line_main.c | 20 +-- src/lib/evas/common/evas_map_image_internal.c | 8 +- src/lib/evas/common/evas_op_add_main_.c| 146 - src/lib/evas/common/evas_op_blend_main_.c | 156 +- src/lib/evas/common/evas_op_copy_main_.c | 174 - src/lib/evas/common/evas_op_mask_main_.c | 88 --- src/lib/evas/common/evas_op_mul_main_.c| 88 --- src/lib/evas/common/evas_op_sub_main_.c| 146 - src/lib/evas/common/evas_polygon_main.c| 4 +- src/lib/evas/common/evas_rectangle_main.c | 4 +- src/lib/evas/common/evas_scale_sample.c| 8 +- .../evas/common/evas_scale_smooth_scaler_down.c| 4 +- .../evas/common/evas_scale_smooth_scaler_noscale.c | 4 +- src/lib/evas/common/evas_scale_smooth_scaler_up.c | 4 +- src/lib/evas/filters/evas_filter_blend.c | 4 +- src/lib/evas/filters/evas_filter_mask.c| 6 +- src/lib/evas/include/evas_common_private.h | 22 +-- 20 files changed, 490 insertions(+), 577 deletions(-) diff --git a/src/lib/evas/common/evas_blend_main.c b/src/lib/evas/common/evas_blend_main.c index b0221b1..ebac8f3 100644 --- a/src/lib/evas/common/evas_blend_main.c +++ b/src/lib/evas/common/evas_blend_main.c @@ -24,43 +24,43 @@ evas_gfx_compositor_get(unsigned char op) RGBA_Gfx_Compositor *comp; switch (op) - { - case _EVAS_RENDER_BLEND: - comp = evas_common_gfx_compositor_blend_get(); - break; - case _EVAS_RENDER_BLEND_REL: - comp = evas_common_gfx_compositor_blend_rel_get(); - break; - case _EVAS_RENDER_COPY: - comp = evas_common_gfx_compositor_copy_get(); - break; - case _EVAS_RENDER_COPY_REL: - comp = evas_common_gfx_compositor_copy_rel_get(); - break; -/* - case _EVAS_RENDER_ADD: - comp = evas_common_gfx_compositor_add_get(); - break; - case _EVAS_RENDER_ADD_REL: - comp = evas_common_gfx_compositor_add_rel_get(); - break; - case _EVAS_RENDER_SUB: - comp = evas_common_gfx_compositor_sub_get(); - break; - case _EVAS_RENDER_SUB_REL: - comp = evas_common_gfx_compositor_sub_rel_get(); - break; -*/ - case _EVAS_RENDER_MASK: - comp = evas_common_gfx_compositor_mask_get(); - break; - case _EVAS_RENDER_MUL: - comp = evas_common_gfx_compositor_mul_get(); - break; - default: - comp = evas_common_gfx_compositor_blend_get(); - break; - } + { + case _EVAS_RENDER_BLEND: +comp = evas_common_gfx_compositor_blend_get(); +break; + case _EVAS_RENDER_BLEND_REL: +comp = evas_common_gfx_compositor_blend_rel_get(); +break; + case _EVAS_RENDER_COPY: +comp = evas_common_gfx_compositor_copy_get(); +break; + case _EVAS_RENDER_COPY_REL: +comp = evas_common_gfx_compositor_copy_rel_get(); +break; +/* + case _EVAS_RENDER_ADD: +comp = evas_common_gfx_compositor_add_get(); +break; + case _EVAS_RENDER_ADD_REL: +comp = evas_common_gfx_compositor_add_rel_get(); +break; + case _EVAS_RENDER_SUB: +comp = evas_common_gfx_compositor_sub_get(); +break; + case _EVAS_RENDER_SUB_REL: +comp = evas_common_gfx_compositor_sub_rel_get(); +break; + */ + case _EVAS_RENDER_MASK: +comp = evas_common_gfx_compositor_mask_get(); +break; + case _EVAS_RENDER_MUL: +comp = evas_common_gfx_compositor_mul_get(); +break; + default: +comp = evas_common_gfx_compositor_blend_get(); +break; + } return comp; } @@ -88,7 +88,7 @@ evas_common_blend_init(void) comp = evas_common_gfx_compositor_blen
[EGIT] [core/efl] master 01/01: Evas GL: Fix list of shaders to distribute
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e18886a2a3c82adce0477f6a689c26ae62359502 commit e18886a2a3c82adce0477f6a689c26ae62359502 Author: Jean-Philippe Andre Date: Fri Nov 14 09:41:15 2014 +0900 Evas GL: Fix list of shaders to distribute Some shader files (shd) were not included in EXTRA_DIST. This didn't break the build because the .x file was correctly generated. I guess the missing files in previous releases also had no impact because the .h files would be generated and shipped. Also generate the enum automagically. New shaders need to be added to Makefile_Evas.am. --- src/Makefile_Evas.am | 31 +- .../evas/engines/gl_common/evas_gl_common.h| 71 +-- .../evas/engines/gl_common/shader/evas_gl_enum.x | 48 ++ .../engines/gl_common/shader/evas_gl_shaders.x | 620 ++--- .../evas/engines/gl_common/shader/gen_shaders.sh | 13 +- 5 files changed, 397 insertions(+), 386 deletions(-) diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index 3e1f129..0ca771c 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -577,7 +577,8 @@ modules/evas/engines/gl_common/evas_gl_core_private.h \ modules/evas/engines/gl_common/evas_gl_api.c \ modules/evas/engines/gl_common/evas_gl_api_gles1.c \ modules/evas/engines/gl_common/evas_gl_api_ext.c \ -modules/evas/engines/gl_common/shader/evas_gl_shaders.x +modules/evas/engines/gl_common/shader/evas_gl_shaders.x \ +modules/evas/engines/gl_common/shader/evas_gl_enum.x # 3D GL_COMMON_SOURCES += \ @@ -633,21 +634,37 @@ modules/evas/engines/gl_common/shader/rgb_a_pair_nomul_frag.shd \ modules/evas/engines/gl_common/shader/rgb_a_pair_nomul_vert.shd \ modules/evas/engines/gl_common/shader/rgb_a_pair_vert.shd \ modules/evas/engines/gl_common/shader/tex_12_frag.shd \ +modules/evas/engines/gl_common/shader/tex_12_vert.shd \ modules/evas/engines/gl_common/shader/tex_12_nomul_frag.shd \ modules/evas/engines/gl_common/shader/tex_12_nomul_vert.shd \ -modules/evas/engines/gl_common/shader/tex_12_vert.shd \ modules/evas/engines/gl_common/shader/tex_21_frag.shd \ +modules/evas/engines/gl_common/shader/tex_21_vert.shd \ modules/evas/engines/gl_common/shader/tex_21_nomul_frag.shd \ modules/evas/engines/gl_common/shader/tex_21_nomul_vert.shd \ -modules/evas/engines/gl_common/shader/tex_21_vert.shd \ modules/evas/engines/gl_common/shader/tex_22_frag.shd \ +modules/evas/engines/gl_common/shader/tex_22_vert.shd \ modules/evas/engines/gl_common/shader/tex_22_nomul_frag.shd \ modules/evas/engines/gl_common/shader/tex_22_nomul_vert.shd \ -modules/evas/engines/gl_common/shader/tex_22_vert.shd \ modules/evas/engines/gl_common/shader/tex_frag.shd \ +modules/evas/engines/gl_common/shader/tex_vert.shd \ modules/evas/engines/gl_common/shader/tex_nomul_frag.shd \ modules/evas/engines/gl_common/shader/tex_nomul_vert.shd \ -modules/evas/engines/gl_common/shader/tex_vert.shd \ +modules/evas/engines/gl_common/shader/tex_afill_frag.shd \ +modules/evas/engines/gl_common/shader/tex_afill_vert.shd \ +modules/evas/engines/gl_common/shader/tex_22_afill_frag.shd \ +modules/evas/engines/gl_common/shader/tex_22_afill_vert.shd \ +modules/evas/engines/gl_common/shader/tex_21_afill_frag.shd \ +modules/evas/engines/gl_common/shader/tex_21_afill_vert.shd \ +modules/evas/engines/gl_common/shader/tex_12_afill_frag.shd \ +modules/evas/engines/gl_common/shader/tex_12_afill_vert.shd \ +modules/evas/engines/gl_common/shader/tex_22_nomul_afill_frag.shd \ +modules/evas/engines/gl_common/shader/tex_22_nomul_afill_vert.shd \ +modules/evas/engines/gl_common/shader/tex_21_nomul_afill_frag.shd \ +modules/evas/engines/gl_common/shader/tex_21_nomul_afill_vert.shd \ +modules/evas/engines/gl_common/shader/tex_12_nomul_afill_frag.shd \ +modules/evas/engines/gl_common/shader/tex_12_nomul_afill_vert.shd \ +modules/evas/engines/gl_common/shader/tex_nomul_afill_frag.shd \ +modules/evas/engines/gl_common/shader/tex_nomul_afill_vert.shd \ modules/evas/engines/gl_common/shader/yuv_frag.shd \ modules/evas/engines/gl_common/shader/yuv_nomul_frag.shd \ modules/evas/engines/gl_common/shader/yuv_nomul_vert.shd \ @@ -663,7 +680,9 @@ $(GL_SHADERS_GEN) modules/evas/engines/gl_common/shader/evas_gl_shaders.x: modules/evas/engines/gl_common/shader/gen_shaders.sh $(GL_SHADERS_GEN) @echo " SHADERS $@" - @modules/evas/engines/gl_common/shader/gen_shaders.sh + @modules/evas/engines/gl_common/shader/gen_shaders.sh $(GL_SHADERS_GEN) + +modules/evas/engines/gl_common/shader/evas_gl_enum.x: modules/evas/engines/gl_common/shader/evas_gl_shaders.x GL_GENERIC_SOURCES = \ modules/evas/engines/gl_generic/evas_engine.c \ diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h b/src/modules/evas/engines/gl_common/evas_gl_common.h index 7ab6360..6d82623 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_common.h +++ b/src/modules/evas/en
[EGIT] [core/efl] master 01/02: Evas GL: Import a few more extensions and fix a name
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=cd8d68cda450c8b377f51710baa1328c0f448ae8 commit cd8d68cda450c8b377f51710baa1328c0f448ae8 Author: Jean-Philippe Andre Date: Fri Nov 14 11:10:27 2014 +0900 Evas GL: Import a few more extensions and fix a name --- .../evas/engines/gl_common/evas_gl_api_ext_def.h | 118 +++-- 1 file changed, 107 insertions(+), 11 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h index 13f616e..52f0c19 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h +++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h @@ -309,10 +309,16 @@ _EVASGL_EXT_BEGIN(multisampled_render_to_texture) _EVASGL_EXT_FUNCTION_PRIVATE_END() _EVASGL_EXT_END() +/* ETC1 compressed texture format support */ _EVASGL_EXT_BEGIN(compressed_ETC1_RGB8_texture) _EVASGL_EXT_DRVNAME(GL_OES_compressed_ETC1_RGB8_texture) _EVASGL_EXT_END() +/* SubImage texture upload support for ETC1*/ +_EVASGL_EXT_BEGIN(compressed_ETC1_RGB8_sub_texture) +_EVASGL_EXT_DRVNAME(GL_EXT_compressed_ETC1_RGB8_sub_texture) +_EVASGL_EXT_END() + _EVASGL_EXT_BEGIN(compressed_ETC2_RGB8_texture) _EVASGL_EXT_DRVNAME(GL_OES_compressed_ETC2_RGB8_texture) _EVASGL_EXT_END() @@ -361,6 +367,10 @@ _EVASGL_EXT_BEGIN(texture_half_float) _EVASGL_EXT_DRVNAME(GL_OES_texture_half_float) _EVASGL_EXT_END() +_EVASGL_EXT_BEGIN(texture_float_linear) +_EVASGL_EXT_DRVNAME(GL_OES_texture_float_linear) +_EVASGL_EXT_END() + _EVASGL_EXT_BEGIN(texture_half_float_linear) _EVASGL_EXT_DRVNAME(GL_OES_texture_half_float_linear) _EVASGL_EXT_END() @@ -452,6 +462,19 @@ _EVASGL_EXT_END() _EVASGL_EXT_BEGIN(QCOM_writeonly_rendering) _EVASGL_EXT_DRVNAME(GL_QCOM_writeonly_rendering) _EVASGL_EXT_END() + +_EVASGL_EXT_BEGIN(read_format) +_EVASGL_EXT_DRVNAME(GL_OES_read_format) +_EVASGL_EXT_END() + +/* GL_OES_fragment_precision_high: +This extension has been withdrawn. See the specification of +GetShaderPrecisionFormat in section 6.1.8 of the OpenGL ES 2.0 +Specification to determine within the API if high-precision fragment +shader varyings are supported by the implementation. + */ + + /// @@ -1089,6 +1112,35 @@ _EVASGL_EXT_BEGIN(QCOM_tiled_rendering) _EVASGL_EXT_FUNCTION_END() _EVASGL_EXT_END() +_EVASGL_EXT_BEGIN(element_index_uint) +_EVASGL_EXT_DRVNAME(GL_OES_element_index_uint) +_EVASGL_EXT_END() + +_EVASGL_EXT_BEGIN(fbo_render_mipmap) +_EVASGL_EXT_DRVNAME(GL_OES_fbo_render_mipmap) +_EVASGL_EXT_END() + +_EVASGL_EXT_BEGIN(mali_program_binary) +_EVASGL_EXT_DRVNAME(GL_ARM_mali_program_binary) +_EVASGL_EXT_END() + +_EVASGL_EXT_BEGIN(mali_shader_binary) +_EVASGL_EXT_DRVNAME(GL_ARM_mali_shader_binary) +_EVASGL_EXT_END() + +_EVASGL_EXT_BEGIN(depth_texture) +_EVASGL_EXT_DRVNAME(GL_OES_depth_texture) +_EVASGL_EXT_END() + +_EVASGL_EXT_BEGIN(depth_texture_cube_map) +_EVASGL_EXT_DRVNAME(GL_OES_depth_texture_cube_map) +_EVASGL_EXT_END() + +_EVASGL_EXT_BEGIN(shader_texture_lod) +_EVASGL_EXT_DRVNAME(GL_EXT_shader_texture_lod) +_EVASGL_EXT_END() + + /// @@ -1307,13 +1359,43 @@ _EVASGL_EXT_END() // -- _EVASGL_EXT_BEGIN(framebuffer_blit) _EVASGL_EXT_DRVNAME(GL_NV_framebuffer_blit) +_EVASGL_EXT_DRVNAME(GL_ANGLE_framebuffer_blit) _EVASGL_EXT_FUNCTION_WHITELIST("glBlitFramebuffer") _EVASGL_EXT_FUNCTION_WHITELIST("glBlitFramebufferNV") +_EVASGL_EXT_FUNCTION_WHITELIST("glBlitFramebufferANGLE") _EVASGL_EXT_END() +// -- +_EVASGL_EXT_BEGIN(framebuffer_multisample) +_EVASGL_EXT_DRVNAME(GL_ANGLE_framebuffer_multisample) + +_EVASGL_EXT_FUNCTION_WHITELIST("glRenderbufferStorageMultisampleANGLE") + +_EVASGL_EXT_END() + + +// -- +_EVASGL_EXT_BEGIN(point_sprite) + _EVASGL_EXT_DRVNAME(GL_OES_point_sprite) +_EVASGL_EXT_END() + + +// -- +// This "extension" is already listed in the base GLES1 API +// Provided here as convenience for evas_gl_proc_address_get +_EVASGL_EXT_BEGIN(point_size_array) + _EVASGL_EXT_DRVNAME(GL_OES_point_size_array) + + _EVASGL_EXT_FUNCTION_WHITELIST("glPointSizePointer") + _EVASGL_EXT_FUNCTION_WHITELIST("glPointSizePointerOES") +_EVASGL_EXT_END() + + + + #endif // _EVASGL_EXT_WHITELIST_ONLY ("safe" extensions) /// @@ -1350,8 +1432,8 @@ _EVASGL_EXT_BEGIN(EGL_KH
[EGIT] [core/efl] master 02/02: Evas GL: Fix bug in evgl_eng_pbuffer_surface_create (EGL)
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f3a53acbf0f28471394de68de9161c5edb459079 commit f3a53acbf0f28471394de68de9161c5edb459079 Author: Jean-Philippe Andre Date: Fri Nov 14 11:22:59 2014 +0900 Evas GL: Fix bug in evgl_eng_pbuffer_surface_create (EGL) Thanks Henry Song for the report. @fix --- src/modules/evas/engines/gl_x11/evas_engine.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c index 31b5fa5..1447c53 100644 --- a/src/modules/evas/engines/gl_x11/evas_engine.c +++ b/src/modules/evas/engines/gl_x11/evas_engine.c @@ -646,6 +646,7 @@ evgl_eng_pbuffer_surface_create(void *data, EVGL_Surface *sfc, WRN("This PBuffer implementation does not support extra attributes yet"); #ifdef GL_GLES + Evas_Engine_GL_Context *evasglctx; int config_attrs[20]; int surface_attrs[20]; EGLSurface egl_sfc; @@ -655,7 +656,8 @@ evgl_eng_pbuffer_surface_create(void *data, EVGL_Surface *sfc, EGLContext ctx; disp = re->window_egl_display_get(re->software.ob); - ctx = re->window_gl_context_get(re->software.ob); + evasglctx = re->window_gl_context_get(re->software.ob); + ctx = evasglctx->eglctxt; #if 0 // Choose framebuffer configuration --
[EGIT] [core/efl] efl-1.12 01/01: Evas GL: Fix bug in evgl_eng_pbuffer_surface_create (EGL)
jpeg pushed a commit to branch efl-1.12. http://git.enlightenment.org/core/efl.git/commit/?id=76974e063ff4f655281007390f49de872c8b9903 commit 76974e063ff4f655281007390f49de872c8b9903 Author: Jean-Philippe Andre Date: Fri Nov 14 11:22:59 2014 +0900 Evas GL: Fix bug in evgl_eng_pbuffer_surface_create (EGL) Thanks Henry Song for the report. @fix --- src/modules/evas/engines/gl_x11/evas_engine.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c index 31b5fa5..1447c53 100644 --- a/src/modules/evas/engines/gl_x11/evas_engine.c +++ b/src/modules/evas/engines/gl_x11/evas_engine.c @@ -646,6 +646,7 @@ evgl_eng_pbuffer_surface_create(void *data, EVGL_Surface *sfc, WRN("This PBuffer implementation does not support extra attributes yet"); #ifdef GL_GLES + Evas_Engine_GL_Context *evasglctx; int config_attrs[20]; int surface_attrs[20]; EGLSurface egl_sfc; @@ -655,7 +656,8 @@ evgl_eng_pbuffer_surface_create(void *data, EVGL_Surface *sfc, EGLContext ctx; disp = re->window_egl_display_get(re->software.ob); - ctx = re->window_gl_context_get(re->software.ob); + evasglctx = re->window_gl_context_get(re->software.ob); + ctx = evasglctx->eglctxt; #if 0 // Choose framebuffer configuration --
[EGIT] [core/efl] master 01/02: Evas GL: Add some debug
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f663980111740112d41fbe86dbe56fabca5a9172 commit f663980111740112d41fbe86dbe56fabca5a9172 Author: Jean-Philippe Andre Date: Tue Nov 18 17:37:25 2014 +0900 Evas GL: Add some debug It will be triggered when EVAS_GL_API_DEBUG is set. Yeah, that's abusing the variable a bit, as it was intended for GL calls only, but this is pretty harmless. Also add string "GL_DEPTH_STENCIL". --- src/modules/evas/engines/gl_common/evas_gl_core.c | 73 +-- 1 file changed, 67 insertions(+), 6 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c b/src/modules/evas/engines/gl_common/evas_gl_core.c index 7768af7..81bc3b2 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_core.c +++ b/src/modules/evas/engines/gl_common/evas_gl_core.c @@ -128,6 +128,8 @@ _internal_resource_make_current(void *eng_data, EVGL_Context *ctx) surface = (void*)rsc->surface; // Do the make current + if (evgl_engine->api_debug_mode) + DBG("Calling make_current(%p, %p)", surface, context); ret = evgl_engine->funcs->make_current(eng_data, surface, context, 1); if (!ret) { @@ -769,6 +771,8 @@ _glenum_string_get(GLenum e) return "GL_STENCIL_INDEX8"; // Depth_Stencil + case GL_DEPTH_STENCIL: +return "GL_DEPTH_STENCIL"; case GL_DEPTH24_STENCIL8: return "GL_DEPTH24_STENCIL8"; #endif @@ -1503,6 +1507,7 @@ evgl_surface_create(void *eng_data, Evas_GL_Config *cfg, int w, int h) char *s = NULL; int direct_override = 0, direct_mem_opt = 0; Eina_Bool need_reconfigure = EINA_FALSE; + Eina_Bool dbg; // Check if engine is valid if (!evgl_engine) @@ -1511,6 +1516,7 @@ evgl_surface_create(void *eng_data, Evas_GL_Config *cfg, int w, int h) evas_gl_common_error_set(eng_data, EVAS_GL_BAD_ACCESS); return NULL; } + dbg = evgl_engine->api_debug_mode; if (!cfg) { @@ -1608,6 +1614,7 @@ evgl_surface_create(void *eng_data, Evas_GL_Config *cfg, int w, int h) } } + if (dbg) DBG("Calling make_current(NULL, NULL)"); if (!evgl_engine->funcs->make_current(eng_data, NULL, NULL, 0)) { ERR("Error doing make_current(NULL, NULL)."); @@ -1618,7 +1625,6 @@ evgl_surface_create(void *eng_data, Evas_GL_Config *cfg, int w, int h) // Keep track of all the created surfaces LKL(evgl_engine->resource_lock); evgl_engine->surfaces = eina_list_prepend(evgl_engine->surfaces, sfc); - LKU(evgl_engine->resource_lock); if (sfc->direct_fb_opt && (sfc->depth_fmt || sfc->stencil_fmt || sfc->depth_stencil_fmt)) @@ -1627,6 +1633,7 @@ evgl_surface_create(void *eng_data, Evas_GL_Config *cfg, int w, int h) evgl_engine->direct_depth_stencil_surfaces = eina_list_prepend(evgl_engine->direct_depth_stencil_surfaces, sfc); } + LKU(evgl_engine->resource_lock); if (need_reconfigure) { @@ -1634,6 +1641,8 @@ evgl_surface_create(void *eng_data, Evas_GL_Config *cfg, int w, int h) ERR("Surface reconfigure is not implemented yet"); } + if (dbg) DBG("Created surface sfc %p (eng %p)", sfc, eng_data); + return sfc; error: @@ -1647,6 +1656,7 @@ evgl_pbuffer_surface_create(void *eng_data, Evas_GL_Config *cfg, { EVGL_Surface *sfc = NULL; void *pbuffer; + Eina_Bool dbg; // Check if engine is valid if (!evgl_engine) @@ -1655,6 +1665,7 @@ evgl_pbuffer_surface_create(void *eng_data, Evas_GL_Config *cfg, evas_gl_common_error_set(eng_data, EVAS_GL_BAD_ACCESS); return NULL; } + dbg = evgl_engine->api_debug_mode; if (!cfg) { @@ -1735,6 +1746,7 @@ evgl_pbuffer_surface_create(void *eng_data, Evas_GL_Config *cfg, sfc->pbuffer.native_surface = pbuffer; + if (dbg) DBG("Calling make_current(NULL, NULL)"); if (!evgl_engine->funcs->make_current(eng_data, NULL, NULL, 0)) { ERR("Error doing make_current(NULL, NULL)."); @@ -1746,6 +1758,8 @@ evgl_pbuffer_surface_create(void *eng_data, Evas_GL_Config *cfg, evgl_engine->surfaces = eina_list_prepend(evgl_engine->surfaces, sfc); LKU(evgl_engine->resource_lock); + if (dbg) DBG("Created PBuffer surface sfc %p:%p (eng %p)", sfc, pbuffer, eng_data); + return sfc; error: @@ -1758,6 +1772,9 @@ evgl_surface_destroy(void *eng_data, EVGL_Surface *sfc) { EVGL_Resource *rsc; Eina_Bool need_reconfigure = EINA_FALSE; + Eina_Bool dbg; + + // FIXME: This does some make_current(0,0) which may have side effects // Check input parameter if ((!evgl_engine) || (!sfc)) @@ -1773,6 +1790,9 @@ evgl_surface_destroy(void *eng_data, EVGL_Surface *sfc) return 0; } + if ((dbg = evgl_engine->api_debug_mode)) + DBG("Destroying surface sfc %p (eng %p)", sfc, eng_data); + if ((rsc->current_ctx) && (rsc->current_ctx->current_sfc ==
[EGIT] [core/efl] master 02/02: Evas GL: Create TLS during make_current if there isn't any
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=1608d3039076a0c6072c079a6b6ea8368b4f5b4a commit 1608d3039076a0c6072c079a6b6ea8368b4f5b4a Author: Jean-Philippe Andre Date: Tue Nov 18 18:37:59 2014 +0900 Evas GL: Create TLS during make_current if there isn't any Apps would crash if they call make current without creating a surface in the same thread. I don't see a good reason why we should have this a limitation. --- src/modules/evas/engines/gl_common/evas_gl_core.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c b/src/modules/evas/engines/gl_common/evas_gl_core.c index 81bc3b2..adc027d 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_core.c +++ b/src/modules/evas/engines/gl_common/evas_gl_core.c @@ -2041,7 +2041,12 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx) dbg = evgl_engine->api_debug_mode; if (dbg) DBG("(eng = %p, sfc = %p, ctx = %p), rsc = %p", eng_data, sfc, ctx, rsc); - if (!rsc) return 0; + if (!rsc) + { +DBG("Creating new TLS for this thread: %lu", eina_thread_self()); +rsc = _evgl_tls_resource_create(eng_data); +if (!rsc) return 0; + } // Unset if ((!sfc) && (!ctx)) @@ -2052,7 +2057,6 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx) evgl_direct_partial_render_end(); } -// FIXME: This code path does not properly set the underlying TLS vars. if (dbg) DBG("Calling make_current(NULL, NULL)"); if (!evgl_engine->funcs->make_current(eng_data, NULL, NULL, 0)) { @@ -2060,7 +2064,7 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx) return 0; } -//FIXME!!! +// FIXME -- What is this "FIXME" about? if (rsc->current_ctx) { rsc->current_ctx->current_sfc = NULL; --
[EGIT] [core/efl] master 02/02: Evas GL: Change comment and DBG message
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=54afef04c2a8c285b4e8b010d59f22ef2cec14bb commit 54afef04c2a8c285b4e8b010d59f22ef2cec14bb Author: Jean-Philippe Andre Date: Wed Nov 19 15:30:12 2014 +0900 Evas GL: Change comment and DBG message --- src/modules/evas/engines/software_generic/evas_engine.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c index ccb6ccb..f8e1504 100644 --- a/src/modules/evas/engines/software_generic/evas_engine.c +++ b/src/modules/evas/engines/software_generic/evas_engine.c @@ -3619,12 +3619,15 @@ gl_sym_init(void) #undef FINDSYM #undef FALLBAK - // Checking to see if this function exists is a poor but reasonable way to - // check if it's gles but it works for now - // FIXME: This is wrong as OpenGL 4.1 also supports this function. - if (_sym_glGetShaderPrecisionFormat != (typeof(_sym_glGetShaderPrecisionFormat))sym_missing ) + /* +* For desktop OpenGL we wrap these: +* - glGetShaderPrecisionFormat +* - glReleaseShaderCompiler +* - glShaderBinary +*/ + if (_sym_glGetShaderPrecisionFormat != (typeof(_sym_glGetShaderPrecisionFormat))sym_missing ) { -DBG("GL Library is GLES."); +DBG("The GL library is OpenGL ES or OpenGL 4.1+"); gl_lib_is_gles = 1; } @@ -4051,6 +4054,7 @@ override_gl_apis(Evas_GL_API *api) { // Override functions wrapped by Evas_GL // GLES2.0 API compat on top of desktop gl +// Note that Open GL 4.1+ provides these 3 functions as well ORD(glGetShaderPrecisionFormat); ORD(glReleaseShaderCompiler); ORD(glShaderBinary); --
[EGIT] [core/efl] master 01/02: Evas GL: Wrap glGetString for VERSION
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=1a403849dca1c832c43bf4abf8226da63570fbca commit 1a403849dca1c832c43bf4abf8226da63570fbca Author: Jean-Philippe Andre Date: Wed Nov 19 15:08:00 2014 +0900 Evas GL: Wrap glGetString for VERSION - glGetString(GL_VERSION) should not return "OpenGL ES 3.0" because GLESv3 is not supported yet. - GL_EXTENSIONS should return only the list of supported extensions --> disabled for now as the whitelist of safe extensions is way too small. --- src/modules/evas/engines/gl_common/evas_gl_api.c | 81 +++--- .../evas/engines/gl_common/evas_gl_api_ext.c | 35 ++ .../evas/engines/gl_common/evas_gl_api_ext.h | 2 +- src/modules/evas/engines/gl_common/evas_gl_core.c | 2 +- .../evas/engines/software_generic/evas_engine.c| 1 + 5 files changed, 99 insertions(+), 22 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_api.c b/src/modules/evas/engines/gl_common/evas_gl_api.c index 477e831..6007b7c 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api.c @@ -531,6 +531,76 @@ _evgl_glGetIntegerv(GLenum pname, GLint* params) glGetIntegerv(pname, params); } +static const GLubyte * +_evgl_glGetString(GLenum name) +{ + static char _version[64] = {0}; + EVGL_Resource *rsc; + const GLubyte *ret; + char *r; + + /* We wrap two values here: +* +* VERSION: Since OpenGL ES 3 is not supported yet, we return OpenGL ES 2.0 +* The string is not modified on desktop GL (eg. 4.4.0 NVIDIA 343.22) +* GLES 3 support is not exposed because apps can't use GLES 3 core +* functions yet. +* +* EXTENSIONS: This should return the list of GL extensions supported by Evas GL +* --> FIXME: Unfortunately the whitelist does not contain enough extensions +* especially for desktop GL and needs updating as OpenGL evolves. +*/ + + /* +* Note from Khronos: "If an error is generated, glGetString returns 0." +* I decided not to call glGetString if there is no context as this is +* known to cause crashes on certain GL drivers (eg. Nvidia binary blob). +* --> crash moved to app side if they blindly call strstr() +*/ + + if ((!(rsc = _evgl_tls_resource_get())) || !rsc->current_ctx) + { +ERR("Current context is NULL, not calling glGetString"); +// This sets evas_gl_error_get instead of glGetError... +evas_gl_common_error_set(NULL, EVAS_GL_BAD_CONTEXT); +return NULL; + } + + switch (name) + { + case GL_VENDOR: + case GL_RENDERER: + case GL_SHADING_LANGUAGE_VERSION: // wrap me? +break; + case GL_VERSION: +ret = glGetString(GL_VERSION); +if (!ret) return NULL; +if (strstr((const char *) ret, "OpenGL ES 3")) + { + // We try not to remove the vendor fluff (contains driver version) + strncpy(_version, (const char *) ret, sizeof(_version)); + r = strchr(_version, '3'); + *r++ = '2'; + *r++ = '.'; + *r++ = '0'; + *r = ' '; + _version[sizeof(_version) - 1] = '\0'; + return (const GLubyte *) _version; + } +return ret; + case GL_EXTENSIONS: +// return (GLubyte *) evgl_api_ext_string_get +// (EINA_TRUE, (rsc->current_ctx->version == EVAS_GL_GLES_1_X)); +break; + default: +// GL_INVALID_ENUM is generated if name is not an accepted value. +WRN("Unknown string requested: %x", (unsigned int) name); +break; + } + + return glGetString(name); +} + static void _evgl_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels) { @@ -1458,13 +1528,7 @@ _evgld_glGetString(GLenum name) const GLubyte *ret = NULL; EVGL_FUNC_BEGIN(); -#if 0 - if (name == GL_EXTENSIONS) - return (GLubyte *)_gl_ext_string; //glGetString(GL_EXTENSIONS); - else - return glGetString(name); -#endif - ret = glGetString(name); + ret = _evgl_glGetString(name); GLERR(__FUNCTION__, __FILE__, __LINE__, ""); EVGL_FUNC_END(); return ret; @@ -2487,7 +2551,7 @@ _normal_gl_api_get(Evas_GL_API *funcs) ORD(glGetShaderInfoLog); // ORD(glGetShaderPrecisionFormat); ORD(glGetShaderSource); - ORD(glGetString); +// ORD(glGetString); ORD(glGetTexParameterfv); ORD(glGetTexParameteriv); ORD(glGetUniformfv); @@ -2575,6 +2639,7 @@ _normal_gl_api_get(Evas_GL_API *funcs) ORD(glDisable); ORD(glEnable); ORD(glGetIntegerv); + ORD(glGetString); ORD(glReadPixels); ORD(glScissor); ORD(glViewport); diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c index 537b9dd..d19d2eb 100644 --- a/src/modules/evas/
Re: [E-devel] [EGIT] [core/elementary] elementary-1.12 01/01: Update russian translation
Hi, On Wed, Nov 19, 2014 at 4:43 PM, Stefan Schmidt wrote: > On 18/11/14 20:48, Sebastian Dransfeld wrote: > > And translations are often not up-to-date on .0 releases, so if you want > good translations, this is good. > > That is also true for better docs or updated examples, more tests, etc. > Where do we draw that line? > > If someone bothers backporting and it's a bug/example/doc/translation fix, I don't see any good reason to prevent them from doing that, as long as master is also fixed. It's not like it was adding some extra burden to a person doing all the backports. Someone wants to backport something and it's safe? Let them do it. -- Jean-Philippe André -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[EGIT] [core/efl] master 01/01: Evas: Remove irrelevant comment and disabled code
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=bbe94252371396136a5dc011fe7374d9d53d4ee8 commit bbe94252371396136a5dc011fe7374d9d53d4ee8 Author: Jean-Philippe Andre Date: Wed Nov 19 17:10:37 2014 +0900 Evas: Remove irrelevant comment and disabled code --- src/lib/evas/common/evas_image_main.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/src/lib/evas/common/evas_image_main.c b/src/lib/evas/common/evas_image_main.c index 89d46a2..b9af38a 100644 --- a/src/lib/evas/common/evas_image_main.c +++ b/src/lib/evas/common/evas_image_main.c @@ -310,13 +310,6 @@ _evas_common_rgba_image_delete(Image_Entry *ie) } evas_common_rgba_image_scalecache_shutdown(&im->cache_entry); if (ie->info.module) evas_module_unref((Evas_Module *)ie->info.module); - /* memset the image to 0x99 because i recently saw a segv where an -* seemed to be used BUT its contents were wrong - it looks like it was -* overwritten by something from efreet - as there was an execute command -* for a command there and some other signs - but to make sure, I am -* going to empty this struct out in case this happens again so i know -* that something else is overwritign this struct - or not */ -// memset(im, 0x99, sizeof(im)); #ifdef EVAS_CSERVE2 if (ie->data1) ERR("Shouldn't reach this point since we are using cache2: '%s' '%s'", --
[EGIT] [core/efl] master 02/02: Evas: Set image load_error after load
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=42d2f8a12b4706b79e7cf16162d34f259bdc23d4 commit 42d2f8a12b4706b79e7cf16162d34f259bdc23d4 Author: Jean-Philippe Andre Date: Wed Nov 19 19:06:18 2014 +0900 Evas: Set image load_error after load In case of async preload, this avoids loading an image twice if it already failed loading. Thanks Minkyoung Kim for spotting this. --- src/modules/evas/engines/gl_common/evas_gl_image.c | 35 +- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c b/src/modules/evas/engines/gl_common/evas_gl_image.c index 9e852bb..4faf6b2 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_image.c +++ b/src/modules/evas/engines/gl_common/evas_gl_image.c @@ -762,6 +762,7 @@ void evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im) { Image_Entry *ie; + if (!im->im) return; ie = &im->im->cache_entry; evas_gl_common_image_alloc_ensure(im); @@ -808,33 +809,37 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im) #ifdef EVAS_CSERVE2 if (evas_cache2_image_cached(ie)) { - evas_cache2_image_load_data(ie); - evas_gl_common_texture_update(im->tex, im->im); + ie->load_error = evas_cache2_image_load_data(ie); + if (ie->load_error == EVAS_LOAD_ERROR_NONE) + evas_gl_common_texture_update(im->tex, im->im); evas_cache2_image_unload_data(ie); } else #endif { - evas_cache_image_load_data(ie); - evas_gl_common_texture_update(im->tex, im->im); + ie->load_error = evas_cache_image_load_data(ie); + if (ie->load_error == EVAS_LOAD_ERROR_NONE) + evas_gl_common_texture_update(im->tex, im->im); evas_cache_image_unload_data(ie); } ie->flags.updated_data = 0; } -if (!im->tex) +else if ((!im->tex) && (ie->load_error == EVAS_LOAD_ERROR_NONE)) { #ifdef EVAS_CSERVE2 if (evas_cache2_image_cached(ie)) { - evas_cache2_image_load_data(ie); - im->tex = evas_gl_common_texture_new(gc, im->im); + ie->load_error = evas_cache2_image_load_data(ie); + if (ie->load_error == EVAS_LOAD_ERROR_NONE) +im->tex = evas_gl_common_texture_new(gc, im->im); evas_cache2_image_unload_data(ie); } else #endif { - evas_cache_image_load_data(ie); - im->tex = evas_gl_common_texture_new(gc, im->im); + ie->load_error = evas_cache_image_load_data(ie); + if (ie->load_error == EVAS_LOAD_ERROR_NONE) +im->tex = evas_gl_common_texture_new(gc, im->im); evas_cache_image_unload_data(ie); } } @@ -844,14 +849,16 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im) case EVAS_COLORSPACE_ETC1_ALPHA: if ((im->tex) && (im->dirty)) { - evas_cache_image_load_data(ie); - evas_gl_common_texture_rgb_a_pair_update(im->tex, im->im); + ie->load_error = evas_cache_image_load_data(ie); + if (ie->load_error == EVAS_LOAD_ERROR_NONE) + evas_gl_common_texture_rgb_a_pair_update(im->tex, im->im); evas_cache_image_unload_data(ie); } -else if ((!im->tex)) +else if ((!im->tex) && (ie->load_error == EVAS_LOAD_ERROR_NONE)) { - evas_cache_image_load_data(ie); - im->tex = evas_gl_common_texture_rgb_a_pair_new(gc, im->im); + ie->load_error = evas_cache_image_load_data(ie); + if (ie->load_error == EVAS_LOAD_ERROR_NONE) + im->tex = evas_gl_common_texture_rgb_a_pair_new(gc, im->im); evas_cache_image_unload_data(ie); } im->dirty = 0; --
[EGIT] [core/efl] master 01/02: Evas: Cosmetic changes in evas_gl_image
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9afe5ffb9dd7b9cf2ea151e2ae7f7e70724c5e62 commit 9afe5ffb9dd7b9cf2ea151e2ae7f7e70724c5e62 Author: Jean-Philippe Andre Date: Wed Nov 19 18:54:36 2014 +0900 Evas: Cosmetic changes in evas_gl_image --- src/modules/evas/engines/gl_common/evas_gl_image.c | 66 +- 1 file changed, 26 insertions(+), 40 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c b/src/modules/evas/engines/gl_common/evas_gl_image.c index 1192bbe..9e852bb 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_image.c +++ b/src/modules/evas/engines/gl_common/evas_gl_image.c @@ -763,8 +763,9 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im) { Image_Entry *ie; if (!im->im) return; - ie = (Image_Entry *)(im->im); + ie = &im->im->cache_entry; evas_gl_common_image_alloc_ensure(im); + /* if ((im->cs.space == EVAS_COLORSPACE_YCBCR422P601_PL) || (im->cs.space == EVAS_COLORSPACE_YCBCR422P709_PL)) @@ -786,6 +787,7 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im) } else */ + switch (im->cs.space) { case EVAS_COLORSPACE_ARGB: @@ -804,36 +806,36 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im) ((im->dirty) || (ie->animated.animated) || (ie->flags.updated_data))) { #ifdef EVAS_CSERVE2 - if (evas_cache2_image_cached(&im->im->cache_entry)) + if (evas_cache2_image_cached(ie)) { - evas_cache2_image_load_data(&im->im->cache_entry); + evas_cache2_image_load_data(ie); evas_gl_common_texture_update(im->tex, im->im); - evas_cache2_image_unload_data(&im->im->cache_entry); + evas_cache2_image_unload_data(ie); } else #endif { - evas_cache_image_load_data(&im->im->cache_entry); + evas_cache_image_load_data(ie); evas_gl_common_texture_update(im->tex, im->im); - evas_cache_image_unload_data(&im->im->cache_entry); + evas_cache_image_unload_data(ie); } ie->flags.updated_data = 0; } - if (!im->tex) +if (!im->tex) { #ifdef EVAS_CSERVE2 - if (evas_cache2_image_cached(&im->im->cache_entry)) + if (evas_cache2_image_cached(ie)) { - evas_cache2_image_load_data(&im->im->cache_entry); + evas_cache2_image_load_data(ie); im->tex = evas_gl_common_texture_new(gc, im->im); - evas_cache2_image_unload_data(&im->im->cache_entry); + evas_cache2_image_unload_data(ie); } else #endif { - evas_cache_image_load_data(&im->im->cache_entry); + evas_cache_image_load_data(ie); im->tex = evas_gl_common_texture_new(gc, im->im); - evas_cache_image_unload_data(&im->im->cache_entry); + evas_cache_image_unload_data(ie); } } im->dirty = 0; @@ -842,15 +844,15 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im) case EVAS_COLORSPACE_ETC1_ALPHA: if ((im->tex) && (im->dirty)) { - evas_cache_image_load_data(&im->im->cache_entry); + evas_cache_image_load_data(ie); evas_gl_common_texture_rgb_a_pair_update(im->tex, im->im); - evas_cache_image_unload_data(&im->im->cache_entry); + evas_cache_image_unload_data(ie); } else if ((!im->tex)) { - evas_cache_image_load_data(&im->im->cache_entry); + evas_cache_image_load_data(ie); im->tex = evas_gl_common_texture_rgb_a_pair_new(gc, im->im); - evas_cache_image_unload_data(&im->im->cache_entry); + evas_cache_image_unload_data(ie); } im->dirty = 0; if (!im->tex) return; @@ -859,16 +861,12 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im) case EVAS_COLORSPACE_YCBCR422P709_PL: if ((im->tex) && (im->dirty)) { - evas_gl_common_texture_yuv_update(im->tex, im->cs.data, - im->im->cache_entry.w, - im->im->cache_entry.h); + evas_gl_common_texture_yuv_update(im->tex, im->cs.data, ie->w, ie->h); im->dirty = 0; } if ((!im->tex) && (im->cs.data) && (*((unsigned char **)im->cs.data))) { - im->tex = evas_gl_common_texture_yuv_new(gc, im->cs.data, -
[EGIT] [core/efl] master 01/01: Revert "Evas: Set image load_error after load"
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=64238ca9f18e8b580da7d77559e52c539b2c095d commit 64238ca9f18e8b580da7d77559e52c539b2c095d Author: Jean-Philippe Andre Date: Wed Nov 19 19:19:56 2014 +0900 Revert "Evas: Set image load_error after load" Oops, I didn't test this enough. This causes some problems with E's pager for instance. This reverts commit 42d2f8a12b4706b79e7cf16162d34f259bdc23d4. --- src/modules/evas/engines/gl_common/evas_gl_image.c | 35 +- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c b/src/modules/evas/engines/gl_common/evas_gl_image.c index 4faf6b2..9e852bb 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_image.c +++ b/src/modules/evas/engines/gl_common/evas_gl_image.c @@ -762,7 +762,6 @@ void evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im) { Image_Entry *ie; - if (!im->im) return; ie = &im->im->cache_entry; evas_gl_common_image_alloc_ensure(im); @@ -809,37 +808,33 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im) #ifdef EVAS_CSERVE2 if (evas_cache2_image_cached(ie)) { - ie->load_error = evas_cache2_image_load_data(ie); - if (ie->load_error == EVAS_LOAD_ERROR_NONE) - evas_gl_common_texture_update(im->tex, im->im); + evas_cache2_image_load_data(ie); + evas_gl_common_texture_update(im->tex, im->im); evas_cache2_image_unload_data(ie); } else #endif { - ie->load_error = evas_cache_image_load_data(ie); - if (ie->load_error == EVAS_LOAD_ERROR_NONE) - evas_gl_common_texture_update(im->tex, im->im); + evas_cache_image_load_data(ie); + evas_gl_common_texture_update(im->tex, im->im); evas_cache_image_unload_data(ie); } ie->flags.updated_data = 0; } -else if ((!im->tex) && (ie->load_error == EVAS_LOAD_ERROR_NONE)) +if (!im->tex) { #ifdef EVAS_CSERVE2 if (evas_cache2_image_cached(ie)) { - ie->load_error = evas_cache2_image_load_data(ie); - if (ie->load_error == EVAS_LOAD_ERROR_NONE) -im->tex = evas_gl_common_texture_new(gc, im->im); + evas_cache2_image_load_data(ie); + im->tex = evas_gl_common_texture_new(gc, im->im); evas_cache2_image_unload_data(ie); } else #endif { - ie->load_error = evas_cache_image_load_data(ie); - if (ie->load_error == EVAS_LOAD_ERROR_NONE) -im->tex = evas_gl_common_texture_new(gc, im->im); + evas_cache_image_load_data(ie); + im->tex = evas_gl_common_texture_new(gc, im->im); evas_cache_image_unload_data(ie); } } @@ -849,16 +844,14 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im) case EVAS_COLORSPACE_ETC1_ALPHA: if ((im->tex) && (im->dirty)) { - ie->load_error = evas_cache_image_load_data(ie); - if (ie->load_error == EVAS_LOAD_ERROR_NONE) - evas_gl_common_texture_rgb_a_pair_update(im->tex, im->im); + evas_cache_image_load_data(ie); + evas_gl_common_texture_rgb_a_pair_update(im->tex, im->im); evas_cache_image_unload_data(ie); } -else if ((!im->tex) && (ie->load_error == EVAS_LOAD_ERROR_NONE)) +else if ((!im->tex)) { - ie->load_error = evas_cache_image_load_data(ie); - if (ie->load_error == EVAS_LOAD_ERROR_NONE) - im->tex = evas_gl_common_texture_rgb_a_pair_new(gc, im->im); + evas_cache_image_load_data(ie); + im->tex = evas_gl_common_texture_rgb_a_pair_new(gc, im->im); evas_cache_image_unload_data(ie); } im->dirty = 0; --
[EGIT] [core/efl] master 01/01: Evas: Check load_error before loading again (GL)
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f902de616e948b7ab5e88b9547b8302d2bb131a1 commit f902de616e948b7ab5e88b9547b8302d2bb131a1 Author: Jean-Philippe Andre Date: Wed Nov 19 19:45:04 2014 +0900 Evas: Check load_error before loading again (GL) This is a new attempt at avoiding reload of an image that failed to load during async preload. See 42d2f8a12b4706b79e7cf16162d34f259bdc23d4 (reverted). I still can't figure out why setting load_error does not work as expected (E pager becomes blank). --- src/modules/evas/engines/gl_common/evas_gl_image.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c b/src/modules/evas/engines/gl_common/evas_gl_image.c index 9e852bb..88692ba 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_image.c +++ b/src/modules/evas/engines/gl_common/evas_gl_image.c @@ -821,7 +821,7 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im) } ie->flags.updated_data = 0; } -if (!im->tex) +else if (!im->tex && !ie->load_error) { #ifdef EVAS_CSERVE2 if (evas_cache2_image_cached(ie)) @@ -848,7 +848,7 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im) evas_gl_common_texture_rgb_a_pair_update(im->tex, im->im); evas_cache_image_unload_data(ie); } -else if ((!im->tex)) +else if (!im->tex && !ie->load_error) { evas_cache_image_load_data(ie); im->tex = evas_gl_common_texture_rgb_a_pair_new(gc, im->im); --
[EGIT] [core/efl] master 03/03: Evas GL common: Cosmetic change
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f6e73c79039f1cb0a8b334dad299eaec607f4b82 commit f6e73c79039f1cb0a8b334dad299eaec607f4b82 Author: Jean-Philippe Andre Date: Mon Nov 24 18:46:49 2014 +0900 Evas GL common: Cosmetic change Don't cast "ext" a hundred times when you can do it once. --- .../evas/engines/gl_common/evas_gl_context.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c b/src/modules/evas/engines/gl_common/evas_gl_context.c index 7d774d9..19c1a2e 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_context.c +++ b/src/modules/evas/engines/gl_common/evas_gl_context.c @@ -565,49 +565,49 @@ evas_gl_common_context_new(void) if (!shared) { -const GLubyte *ext; +const char *ext; shared = calloc(1, sizeof(Evas_GL_Shared)); -ext = glGetString(GL_EXTENSIONS); +ext = (const char *) glGetString(GL_EXTENSIONS); if (ext) { if (getenv("EVAS_GL_INFO")) fprintf(stderr, "EXT:\n%s\n", ext); - if ((strstr((char *)ext, "GL_ARB_texture_non_power_of_two")) || - (strstr((char *)ext, "OES_texture_npot")) || - (strstr((char *)ext, "GL_IMG_texture_npot"))) + if ((strstr(ext, "GL_ARB_texture_non_power_of_two")) || + (strstr(ext, "OES_texture_npot")) || + (strstr(ext, "GL_IMG_texture_npot"))) shared->info.tex_npo2 = 1; - if ((strstr((char *)ext, "GL_NV_texture_rectangle")) || - (strstr((char *)ext, "GL_EXT_texture_rectangle")) || - (strstr((char *)ext, "GL_ARB_texture_rectangle"))) + if ((strstr(ext, "GL_NV_texture_rectangle")) || + (strstr(ext, "GL_EXT_texture_rectangle")) || + (strstr(ext, "GL_ARB_texture_rectangle"))) shared->info.tex_rect = 1; - if ((strstr((char *)ext, "GL_ARB_get_program_binary")) || - (strstr((char *)ext, "GL_OES_get_program_binary"))) + if ((strstr(ext, "GL_ARB_get_program_binary")) || + (strstr(ext, "GL_OES_get_program_binary"))) shared->info.bin_program = 1; else glsym_glGetProgramBinary = NULL; #ifdef GL_UNPACK_ROW_LENGTH shared->info.unpack_row_length = 1; # ifdef GL_GLES - if (!strstr((char *)ext, "_unpack_subimage")) + if (!strstr(ext, "_unpack_subimage")) shared->info.unpack_row_length = 0; # endif #endif #ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT - if ((strstr((char *)ext, "GL_EXT_texture_filter_anisotropic"))) + if ((strstr(ext, "GL_EXT_texture_filter_anisotropic"))) glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &(shared->info.anisotropic)); #endif #ifdef GL_BGRA - if ((strstr((char *)ext, "GL_EXT_bgra")) || - (strstr((char *)ext, "GL_EXT_texture_format_BGRA"))) + if ((strstr(ext, "GL_EXT_bgra")) || + (strstr(ext, "GL_EXT_texture_format_BGRA"))) shared->info.bgra = 1; #endif - if (strstr((char *)ext, "OES_compressed_ETC1_RGB8_texture")) + if (strstr(ext, "OES_compressed_ETC1_RGB8_texture")) shared->info.etc1 = 1; - if (strstr((char *)ext, "GL_EXT_texture_compression_s3tc") || - strstr((char *)ext, "GL_S3_s3tc")) + if (strstr(ext, "GL_EXT_texture_compression_s3tc") || + strstr(ext, "GL_S3_s3tc")) shared->info.s3tc = 1; #ifdef GL_GLES // FIXME: there should be an extension name/string to check for @@ -628,7 +628,7 @@ evas_gl_common_context_new(void) shared->info.sec_image_map = 1; } #endif - if (!strstr((char *)ext, "GL_QCOM_tiled_rendering")) + if (!strstr(ext, "GL_QCOM_tiled_rendering")) { glsym_glStartTiling = NULL; glsym_glEndTiling = NULL; @@ -725,7 +725,7 @@ evas_gl_common_context_new(void) // Note: If we support ETC2 we'll try to always use ETC2 even when the // image has colorspace ETC1 (backwards compatibility). - if (ext && strstr((char *)ext, "GL_EXT_compressed_ETC1_RGB8_sub_texture")) + if (ext && strstr(ext, "GL_EXT_compressed_ETC1_RGB8_sub_texture")) shared->info.etc1_subimage = 1; else shared->info.etc1_subimage = shared->info.etc2; --
[EGIT] [core/efl] master 02/03: Evas GL common: Scan extension string for ETC1 subimage
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2e83b076dbf3ca4f54b7eef0ab40ce0a90d195c5 commit 2e83b076dbf3ca4f54b7eef0ab40ce0a90d195c5 Author: Jean-Philippe Andre Date: Mon Nov 24 18:44:46 2014 +0900 Evas GL common: Scan extension string for ETC1 subimage There is an official name for it: GL_EXT_compressed_ETC1_RGB8_sub_texture Thanks Mythri for pushing that specification. --- src/modules/evas/engines/gl_common/evas_gl_context.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c b/src/modules/evas/engines/gl_common/evas_gl_context.c index d1bedec..7d774d9 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_context.c +++ b/src/modules/evas/engines/gl_common/evas_gl_context.c @@ -724,7 +724,11 @@ evas_gl_common_context_new(void) // Note: If we support ETC2 we'll try to always use ETC2 even when the // image has colorspace ETC1 (backwards compatibility). - shared->info.etc1_subimage = shared->info.etc2; + + if (ext && strstr((char *)ext, "GL_EXT_compressed_ETC1_RGB8_sub_texture")) + shared->info.etc1_subimage = 1; + else + shared->info.etc1_subimage = shared->info.etc2; // FIXME: My NVIDIA driver advertises ETC2 texture formats // but does not support them. Driver bug? Logic bug? --
[EGIT] [core/efl] master 01/03: Evas GL common: Fix RGB+A textures draw
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=09934be78827674588678cdab2ce123e6fa5da5c commit 09934be78827674588678cdab2ce123e6fa5da5c Author: Jean-Philippe Andre Date: Mon Nov 24 18:38:46 2014 +0900 Evas GL common: Fix RGB+A textures draw Also rename texm into texa for consistency. Even though texa might be a mask image, it's still used only for it's a (alpha) channel. --- .../evas/engines/gl_common/evas_gl_context.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c b/src/modules/evas/engines/gl_common/evas_gl_context.c index ff319d6..d1bedec 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_context.c +++ b/src/modules/evas/engines/gl_common/evas_gl_context.c @@ -843,9 +843,9 @@ evas_gl_common_context_new(void) SHADER_TEXTURE_ADD(shared, NV12_NOMUL, texuv); SHADER_TEXTURE_ADD(shared, RGB_A_PAIR, tex); -SHADER_TEXTURE_ADD(shared, RGB_A_PAIR, texm); +SHADER_TEXTURE_ADD(shared, RGB_A_PAIR, texa); SHADER_TEXTURE_ADD(shared, RGB_A_PAIR_NOMUL, tex); -SHADER_TEXTURE_ADD(shared, RGB_A_PAIR_NOMUL, texm); +SHADER_TEXTURE_ADD(shared, RGB_A_PAIR_NOMUL, texa); if (gc->state.current.cur_prog == PRG_INVALID) glUseProgram(shared->shader[0].prog); @@ -1403,7 +1403,7 @@ _evas_gl_common_context_push(int rtype, #else if (!((gc->pipe[pn].region.type == rtype) && (!tex || gc->pipe[pn].shader.cur_tex == current_tex) - && (!texm || gc->pipe[pn].shader.cur_texm == current_texm) + && (!texa || gc->pipe[pn].shader.cur_texa == current_texa) && (gc->pipe[pn].shader.cur_prog == prog) && (gc->pipe[pn].shader.smooth == smooth) && (gc->pipe[pn].shader.blend == blend) @@ -1606,7 +1606,7 @@ again: gc->pipe[pn].array.use_texuv = 0; gc->pipe[pn].array.use_texuv2 = 0; gc->pipe[pn].array.use_texuv3 = 0; - gc->pipe[pn].array.use_texm = 0; + gc->pipe[pn].array.use_texa = 0; gc->pipe[pn].array.use_texsam = 0; #endif @@ -2981,7 +2981,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc) unsigned char *texuv_ptr = NULL; unsigned char *texuv2_ptr = NULL; unsigned char *texuv3_ptr = NULL; -unsigned char *texm_ptr = NULL; +unsigned char *texa_ptr = NULL; unsigned char *texsam_ptr = NULL; if (glsym_glMapBuffer && glsym_glUnmapBuffer) @@ -2996,8 +2996,8 @@ shader_array_flush(Evas_Engine_GL_Context *gc) texuv_ptr = color_ptr + COLOR_SIZE; texuv2_ptr = texuv_ptr + TEX_SIZE; texuv3_ptr = texuv2_ptr + TEX_SIZE; - texm_ptr = texuv3_ptr + TEX_SIZE; - texsam_ptr = texm_ptr + TEX_SIZE; + texa_ptr = texuv3_ptr + TEX_SIZE; + texsam_ptr = texa_ptr + TEX_SIZE; # define END_POINTER (texsam_ptr + TEX_SIZE) glBindBuffer(GL_ARRAY_BUFFER, gc->pipe[i].array.buffer); @@ -3024,7 +3024,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc) if (gc->pipe[i].array.use_texuv3) memcpy(x + (unsigned long)texuv3_ptr, gc->pipe[i].array.texuv3, TEX_SIZE); if (gc->pipe[i].array.use_texa) -memcpy(x + (unsigned long)texm_ptr, gc->pipe[i].array.texa, TEX_SIZE); +memcpy(x + (unsigned long)texa_ptr, gc->pipe[i].array.texa, TEX_SIZE); if (gc->pipe[i].array.use_texsam) memcpy(x + (unsigned long)texsam_ptr, gc->pipe[i].array.texsam, TEX_SIZE); /* @@ -3038,7 +3038,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc) gc->pipe[i].array.use_texuv, gc->pipe[i].array.use_texuv2, gc->pipe[i].array.use_texuv3, - gc->pipe[i].array.use_texm, + gc->pipe[i].array.use_texa, gc->pipe[i].array.use_texsam); */ glsym_glUnmapBuffer(GL_ARRAY_BUFFER); @@ -3051,7 +3051,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc) texuv_ptr = (unsigned char *)gc->pipe[i].array.texuv; texuv2_ptr = (unsigned char *)gc->pipe[i].array.texuv2; texuv3_ptr = (unsigned char *)gc->pipe[i].array.texuv3; - texm_ptr = (unsigned char *)gc->pipe[i].array.texa; + texa_ptr = (unsigned char *)gc->pipe[i].array.texa; texsam_ptr = (unsigned char *)gc->pipe[i].array.texsam; } glVertexAttribPointer(SHAD_VERTEX, 3, GL_SHORT, GL_FALSE, 0, (void *)vertex_ptr); @@ -3102,7 +3102,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc) { glEnableVertexAttribArray(SHAD_TEXA); GLERR(__FUNCTION__, __FILE__, __LINE__, ""); - glVertexAttribPointer
[EGIT] [core/efl] master 01/01: Evas GL: Fix indirect rendering surfaces for GLES 1.1
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8771c78a90f51dd4c5ec4de942630d1b7ef3349b commit 8771c78a90f51dd4c5ec4de942630d1b7ef3349b Author: Jean-Philippe Andre Date: Wed Nov 26 22:42:08 2014 +0900 Evas GL: Fix indirect rendering surfaces for GLES 1.1 Carefully select the requested EGL config and match it with the available visual from X, including the following options: - Stencil - Depth - MSAA TODO: The same thing for GLX. And fix direct rendering as well. --- src/modules/evas/engines/gl_common/evas_gl_core.c | 2 +- .../evas/engines/gl_common/evas_gl_core_private.h | 2 +- src/modules/evas/engines/gl_x11/evas_engine.c | 151 +++-- 3 files changed, 145 insertions(+), 10 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c b/src/modules/evas/engines/gl_common/evas_gl_core.c index 09f521d..ee4b09f 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_core.c +++ b/src/modules/evas/engines/gl_common/evas_gl_core.c @@ -1592,7 +1592,7 @@ evgl_surface_create(void *eng_data, Evas_GL_Config *cfg, int w, int h) } INF("Creating special surface for GLES 1.x rendering"); -evgl_engine->funcs->gles1_surface_create(eng_data, sfc, cfg, w, h); +evgl_engine->funcs->gles1_surface_create(evgl_engine, eng_data, sfc, cfg, w, h); } // Create internal buffers diff --git a/src/modules/evas/engines/gl_common/evas_gl_core_private.h b/src/modules/evas/engines/gl_common/evas_gl_core_private.h index 329f726..4c22dd5 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_core_private.h +++ b/src/modules/evas/engines/gl_common/evas_gl_core_private.h @@ -70,7 +70,7 @@ struct _EVGL_Interface int (*pbuffer_surface_destroy)(void *data, void *surface); // Create a surface for 1.x rendering (could be pbuffer or xpixmap for instance) - void *(*gles1_surface_create)(void *data, EVGL_Surface *evgl_sfc, Evas_GL_Config *cfg, int w, int h); + void *(*gles1_surface_create)(EVGL_Engine *evgl, void *data, EVGL_Surface *evgl_sfc, Evas_GL_Config *cfg, int w, int h); // Destroy 1.x surface (could be pbuffer or xpixmap for instance) int(*gles1_surface_destroy)(void *data, EVGL_Surface *evgl_sfc); diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c index 1447c53..5a36125 100644 --- a/src/modules/evas/engines/gl_x11/evas_engine.c +++ b/src/modules/evas/engines/gl_x11/evas_engine.c @@ -864,11 +864,15 @@ evgl_eng_pbuffer_surface_destroy(void *data, void *surface) // For now, this will create an X pixmap... Ideally it should be able to create // a bindable pbuffer surface or just an FBO if that is supported and it can // be shared with Evas. +// FIXME: Avoid passing evgl_engine around like that. static void * -evgl_eng_gles1_surface_create(void *data, EVGL_Surface *evgl_sfc, +evgl_eng_gles1_surface_create(EVGL_Engine *evgl, void *data, + EVGL_Surface *evgl_sfc, Evas_GL_Config *cfg, int w, int h) { - Render_Engine *re = (Render_Engine *)data; + Render_Engine *re = data; + Eina_Bool alpha = EINA_FALSE; + int colordepth; Pixmap px; if (!re || !evgl_sfc || !cfg) @@ -877,16 +881,25 @@ evgl_eng_gles1_surface_create(void *data, EVGL_Surface *evgl_sfc, return NULL; } - if (cfg->gles_version != EVAS_GL_GLES_1_X) + if ((cfg->gles_version != EVAS_GL_GLES_1_X) || (w < 1) || (h < 1)) { ERR("Inconsistent parameters, not creating any surface!"); glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_PARAMETER); return NULL; } - // FIXME: Check the depth of the buffer! - px = XCreatePixmap(eng_get_ob(re)->disp, eng_get_ob(re)->win, w, h, - XDefaultDepth(eng_get_ob(re)->disp, eng_get_ob(re)->screen)); + /* Choose appropriate pixmap depth */ + if (cfg->color_format == EVAS_GL_RGBA_) + { +alpha = EINA_TRUE; +colordepth = 32; + } + else if (cfg->color_format == EVAS_GL_RGB_888) + colordepth = 24; + else // this could also be XDefaultDepth but this case shouldn't happen + colordepth = 24; + + px = XCreatePixmap(eng_get_ob(re)->disp, eng_get_ob(re)->win, w, h, colordepth); if (!px) { ERR("Failed to create XPixmap!"); @@ -896,8 +909,127 @@ evgl_eng_gles1_surface_create(void *data, EVGL_Surface *evgl_sfc, #ifdef GL_GLES EGLSurface egl_sfc; + EGLConfig egl_cfg; + int i, num = 0; + EGLConfig configs[200]; + int config_attrs[40]; + Eina_Bool found = EINA_FALSE; + int msaa = 0, depth = 0, stencil = 0; + Visual *visual = NULL; + + /* Now we need to iterate over all EGL configurations to check the compatible +* ones and finally check their visual ID. */ + + i = 0; + config_attrs[i++] = EGL_SURFACE_TYPE; + config_attrs[
[EGIT] [core/efl] master 01/02: Evas GL: Remove unnecessary check
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=85b0992657bf79735507a42c005b5732bf2b7521 commit 85b0992657bf79735507a42c005b5732bf2b7521 Author: Jean-Philippe ANDRE Date: Fri Nov 21 00:59:19 2014 +0900 Evas GL: Remove unnecessary check We already checked that re->func.get_pixels wasn't NULL. --- src/modules/evas/engines/gl_generic/evas_engine.c | 64 +++ 1 file changed, 30 insertions(+), 34 deletions(-) diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c index 989f68d..6371fe7 100644 --- a/src/modules/evas/engines/gl_generic/evas_engine.c +++ b/src/modules/evas/engines/gl_generic/evas_engine.c @@ -821,43 +821,39 @@ eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, DBG("Rendering Directly to the window: %p", data); gl_context->dc = context; - -if (re->func.get_pixels) +if ((gl_context->master_clip.enabled) && +(gl_context->master_clip.w > 0) && +(gl_context->master_clip.h > 0)) { - if ((gl_context->master_clip.enabled) && - (gl_context->master_clip.w > 0) && - (gl_context->master_clip.h > 0)) - { - // Pass the preserve flag info the evas_gl - evgl_direct_partial_info_set(gl_context->preserve_bit); - } - - // Set necessary info for direct rendering - evgl_direct_info_set(gl_context->w, - gl_context->h, - gl_context->rot, - dst_x, dst_y, dst_w, dst_h, - gl_context->dc->clip.x, - gl_context->dc->clip.y, - gl_context->dc->clip.w, - gl_context->dc->clip.h); - - // Call pixel get function - re->func.get_pixels(re->func.get_pixels_data, re->func.obj); - - // Call end tile if it's being used - if ((gl_context->master_clip.enabled) && - (gl_context->master_clip.w > 0) && - (gl_context->master_clip.h > 0)) - { - evgl_direct_partial_render_end(); - evgl_direct_partial_info_clear(); - gl_context->preserve_bit = GL_COLOR_BUFFER_BIT0_QCOM; - } + // Pass the preserve flag info the evas_gl + evgl_direct_partial_info_set(gl_context->preserve_bit); + } - // Reset direct rendering info - evgl_direct_info_clear(); +// Set necessary info for direct rendering +evgl_direct_info_set(gl_context->w, + gl_context->h, + gl_context->rot, + dst_x, dst_y, dst_w, dst_h, + gl_context->dc->clip.x, + gl_context->dc->clip.y, + gl_context->dc->clip.w, + gl_context->dc->clip.h); + +// Call pixel get function +re->func.get_pixels(re->func.get_pixels_data, re->func.obj); + +// Call end tile if it's being used +if ((gl_context->master_clip.enabled) && +(gl_context->master_clip.w > 0) && +(gl_context->master_clip.h > 0)) + { + evgl_direct_partial_render_end(); + evgl_direct_partial_info_clear(); + gl_context->preserve_bit = GL_COLOR_BUFFER_BIT0_QCOM; } + +// Reset direct rendering info +evgl_direct_info_clear(); } else { --
[EGIT] [core/efl] master 02/02: Eolian lua: Fix typo in function name
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=72a3ec3fa09df3df2019c96a9e575df6aaa2b03e commit 72a3ec3fa09df3df2019c96a9e575df6aaa2b03e Author: Jean-Philippe ANDRE Date: Sat Nov 22 18:32:52 2014 +0900 Eolian lua: Fix typo in function name --- src/bindings/luajit/eolian.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua index 369252d..5041369 100644 --- a/src/bindings/luajit/eolian.lua +++ b/src/bindings/luajit/eolian.lua @@ -860,7 +860,7 @@ end M.all_classes_get = function() return Ptr_Iterator("const Eolian_Class*", -eolian.eolain_all_classes_get()) +eolian.eolian_all_classes_get()) end M.class_type = { --
[EGIT] [core/efl] master 01/03: Evas GL: Remove useless field
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e2a6f5129c496068353bbfe3ff76d73435662847 commit e2a6f5129c496068353bbfe3ff76d73435662847 Author: Jean-Philippe Andre Date: Thu Nov 27 14:45:34 2014 +0900 Evas GL: Remove useless field - fbo_attached is not used. - buffers_allocated is just a bool --- src/modules/evas/engines/gl_common/evas_gl_core.c | 2 +- src/modules/evas/engines/gl_common/evas_gl_core_private.h | 8 +++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c b/src/modules/evas/engines/gl_common/evas_gl_core.c index ee4b09f..1878f5f 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_core.c +++ b/src/modules/evas/engines/gl_common/evas_gl_core.c @@ -2088,7 +2088,7 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx) { if (_evgl_direct_renderable(rsc, sfc)) { - if (dbg) DBG("sfc %p is direct renderable (has buffers: %d).", sfc, sfc->buffers_allocated); + if (dbg) DBG("sfc %p is direct renderable (has buffers: %d).", sfc, (int) sfc->buffers_allocated); // Destroy created resources if (sfc->buffers_allocated) diff --git a/src/modules/evas/engines/gl_common/evas_gl_core_private.h b/src/modules/evas/engines/gl_common/evas_gl_core_private.h index 4c22dd5..91242d8 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_core_private.h +++ b/src/modules/evas/engines/gl_common/evas_gl_core_private.h @@ -112,13 +112,11 @@ struct _EVGL_Surface unsigned gles1_indirect : 1; unsigned xpixmap : 1; - int cfg_index; + // Init Flag + unsigned buffers_allocated : 1; - // Attached Context - int fbo_attached; + int cfg_index; - // Init Flag - int buffers_allocated; // Rough estimate of buffer in memory per renderbuffer // 0. color 1. depth 2. stencil 3. depth_stencil --
[EGIT] [core/efl] master 02/03: Evas GL: Return current framebuffer based on ctx information
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=129ba38cc75e4553934b569959f1eae86e4b5577 commit 129ba38cc75e4553934b569959f1eae86e4b5577 Author: Jean-Philippe Andre Date: Thu Nov 27 14:51:58 2014 +0900 Evas GL: Return current framebuffer based on ctx information ctx->current_fbo should contain the visible FBO value, even if indirect rendering is used. --- src/modules/evas/engines/gl_common/evas_gl_api.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_api.c b/src/modules/evas/engines/gl_common/evas_gl_api.c index 6007b7c..e8254e3 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api.c @@ -478,7 +478,7 @@ _evgl_glGetIntegerv(GLenum pname, GLint* params) { if (!params) { - ERR("Inavlid Parameter"); + ERR("Invalid Parameter"); return; } @@ -527,6 +527,19 @@ _evgl_glGetIntegerv(GLenum pname, GLint* params) } } } + else + { +if (pname == GL_FRAMEBUFFER_BINDING) + { + rsc = _evgl_tls_resource_get(); + ctx = rsc ? rsc->current_ctx : NULL; + if (ctx) + { + *params = ctx->current_fbo; + return; + } + } + } glGetIntegerv(pname, params); } --
[EGIT] [core/efl] master 03/03: Evas GL: Doc: Tell people not to read info from Evas_Native_Surface
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=da87709dd3bd289181ce221f71877ed62040d5c4 commit da87709dd3bd289181ce221f71877ed62040d5c4 Author: Jean-Philippe Andre Date: Thu Nov 27 16:15:23 2014 +0900 Evas GL: Doc: Tell people not to read info from Evas_Native_Surface The information set there is not meant to be read by applications and reused there. This would break the whole concept of letting Evas deal with its surfaces. Ideally Evas GL should not expose texture or fbo ID to external applications. We could even use a new (non public) surface type for that purpose. --- src/lib/evas/Evas_Common.h | 6 ++ src/lib/evas/Evas_GL.h | 4 2 files changed, 10 insertions(+) diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h index a09cb20..ed336c2 100644 --- a/src/lib/evas/Evas_Common.h +++ b/src/lib/evas/Evas_Common.h @@ -491,6 +491,12 @@ typedef enum _Evas_Native_Surface_Type * @warning Native surface types totally depend on the system. Please * be aware that the types are supported on your system before using * them. + * + * @note The information stored in an @c Evas_Native_Surface returned by + * @ref evas_gl_native_surface_get() is not meant to be used by + * applications except for passing it to + * @ref evas_object_image_native_surface_set(). + * * @see evas_object_image_native_surface_set() */ struct _Evas_Native_Surface diff --git a/src/lib/evas/Evas_GL.h b/src/lib/evas/Evas_GL.h index a06b523..eb55d08 100644 --- a/src/lib/evas/Evas_GL.h +++ b/src/lib/evas/Evas_GL.h @@ -681,6 +681,10 @@ EAPI Evas_GL_Func evas_gl_proc_address_get (Evas_GL *evas_gl, cons * @details This function can be called to later set this native surface as * source of an Evas Object Image. Please refer to * @ref evas_object_image_native_surface_set. + * + * @warning Applications should not rely on the information set in @p ns + * since its properties are internal to Evas and are not meant to be + * tampered with in any way or form from outside Evas. */ EAPI Eina_Boolevas_gl_native_surface_get (Evas_GL *evas_gl, Evas_GL_Surface *surf, Evas_Native_Surface *ns) EINA_ARG_NONNULL(1,2,3); --
[EGIT] [core/efl] master 05/08: Evas GL: Always support BGRA8888 on desktop GL
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=eaefb7c04755fcab73f5867f8fe25b0007c7e90c commit eaefb7c04755fcab73f5867f8fe25b0007c7e90c Author: Jean-Philippe Andre Date: Thu Nov 27 19:47:41 2014 +0900 Evas GL: Always support BGRA on desktop GL --- src/modules/evas/engines/gl_common/evas_gl_api_ext.c | 12 src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h | 6 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c index d19d2eb..5aaa085 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c @@ -258,6 +258,14 @@ evgl_api_ext_init(void *getproc, const char *glueexts) memset(_gl_ext_string, 0, MAX_EXTENSION_STRING_BUFFER); memset(_gl_ext_string_official, 0, MAX_EXTENSION_STRING_BUFFER); +#ifndef GL_GLES + /* Add some extension strings that are always working on desktop GL */ + strcat(_gl_ext_string, "GL_EXT_texture_format_BGRA "); + strcat(_gl_ext_string_official, "GL_EXT_texture_format_BGRA "); +#endif + + / + #define FINDSYM(getproc, dst, sym) \ if (getproc) { \ if (!dst) dst = (__typeof__(dst))getproc(sym); \ @@ -348,10 +356,6 @@ re->info->info.screen); #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR #undef GETPROCADDR - / - - _gl_ext_string[0] = 0; - _gl_ext_string_official[0] = 0; / // Extension HEADER diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h index 52f0c19..0f518ed 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h +++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h @@ -423,11 +423,7 @@ _EVASGL_EXT_BEGIN(texture_filter_anisotropic) _EVASGL_EXT_DRVNAME(GL_EXT_texture_filter_anisotropic) _EVASGL_EXT_END() -_EVASGL_EXT_BEGIN(texture_format_BGRA) // Desktop differs - _EVASGL_EXT_DRVNAME(GL_EXT_texture_format_BGRA) -_EVASGL_EXT_END() - -_EVASGL_EXT_BEGIN(texture_format_BGRA_DESKTOP) // Desktop differs +_EVASGL_EXT_BEGIN(texture_format_BGRA) _EVASGL_EXT_DRVNAME(GL_EXT_texture_format_BGRA) _EVASGL_EXT_END() --
[EGIT] [core/efl] master 02/08: Evas GL: Print GLSL version with EVAS_GL_INFO
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6d652589add61a9e259f5fcd9e0f1d2d93c5723f commit 6d652589add61a9e259f5fcd9e0f1d2d93c5723f Author: Jean-Philippe Andre Date: Thu Nov 27 17:09:22 2014 +0900 Evas GL: Print GLSL version with EVAS_GL_INFO --- src/modules/evas/engines/gl_drm/evas_drm_main.c | 13 - src/modules/evas/engines/gl_x11/evas_x_main.c | 20 +++- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/modules/evas/engines/gl_drm/evas_drm_main.c b/src/modules/evas/engines/gl_drm/evas_drm_main.c index e2fd783..67b1648 100644 --- a/src/modules/evas/engines/gl_drm/evas_drm_main.c +++ b/src/modules/evas/engines/gl_drm/evas_drm_main.c @@ -45,7 +45,7 @@ eng_window_new(Evas_Engine_Info_GL_Drm *info, Evas *e, struct gbm_device *gbm, s int config_attrs[40]; int major_version, minor_version; int num_config, n = 0; - const GLubyte *vendor, *renderer, *version; + const GLubyte *vendor, *renderer, *version, *glslversion; Eina_Bool blacklist = EINA_FALSE; char *num; @@ -182,14 +182,17 @@ eng_window_new(Evas_Engine_Info_GL_Drm *info, Evas *e, struct gbm_device *gbm, s vendor = glGetString(GL_VENDOR); renderer = glGetString(GL_RENDERER); version = glGetString(GL_VERSION); - if (!vendor) vendor = (unsigned char *)"-UNKNOWN-"; + glslversion = glGetString(GL_SHADING_LANGUAGE_VERSION); + if (!vendor) vendor = (unsigned char *)"-UNKNOWN-"; if (!renderer) renderer = (unsigned char *)"-UNKNOWN-"; - if (!version) version = (unsigned char *)"-UNKNOWN-"; + if (!version) version = (unsigned char *)"-UNKNOWN-"; + if (!glslversion) glslversion = (unsigned char *)"-UNKNOWN-"; if (getenv("EVAS_GL_INFO")) { -fprintf(stderr, "vendor: %s\n", vendor); +fprintf(stderr, "vendor : %s\n", vendor); fprintf(stderr, "renderer: %s\n", renderer); -fprintf(stderr, "version: %s\n", version); +fprintf(stderr, "version : %s\n", version); +fprintf(stderr, "glsl ver: %s\n", glslversion); } if (strstr((const char *)vendor, "Mesa Project")) diff --git a/src/modules/evas/engines/gl_x11/evas_x_main.c b/src/modules/evas/engines/gl_x11/evas_x_main.c index 0cf01f9..0c96f55 100644 --- a/src/modules/evas/engines/gl_x11/evas_x_main.c +++ b/src/modules/evas/engines/gl_x11/evas_x_main.c @@ -127,7 +127,7 @@ eng_window_new(Evas_Engine_Info_GL_X11 *info, #else GLXContext rgbactx; #endif - const GLubyte *vendor, *renderer, *version; + const GLubyte *vendor, *renderer, *version, *glslversion; int blacklist = 0; if (!fbconf) eng_best_visual_get(info); @@ -223,14 +223,17 @@ eng_window_new(Evas_Engine_Info_GL_X11 *info, vendor = glGetString(GL_VENDOR); renderer = glGetString(GL_RENDERER); version = glGetString(GL_VERSION); + glslversion = glGetString(GL_SHADING_LANGUAGE_VERSION); if (!vendor) vendor = (unsigned char *)"-UNKNOWN-"; if (!renderer) renderer = (unsigned char *)"-UNKNOWN-"; if (!version) version = (unsigned char *)"-UNKNOWN-"; + if (!glslversion) glslversion = (unsigned char *)"-UNKNOWN-"; if (getenv("EVAS_GL_INFO")) { -fprintf(stderr, "vendor: %s\n", vendor); +fprintf(stderr, "vendor : %s\n", vendor); fprintf(stderr, "renderer: %s\n", renderer); -fprintf(stderr, "version: %s\n", version); +fprintf(stderr, "version : %s\n", version); +fprintf(stderr, "glsl ver: %s\n", glslversion); } if (strstr((const char *)vendor, "Mesa Project")) @@ -310,12 +313,19 @@ eng_window_new(Evas_Engine_Info_GL_X11 *info, vendor = glGetString(GL_VENDOR); renderer = glGetString(GL_RENDERER); version = glGetString(GL_VERSION); + glslversion = glGetString(GL_SHADING_LANGUAGE_VERSION); + if (!vendor) vendor = (unsigned char *)"-UNKNOWN-"; + if (!renderer) renderer = (unsigned char *)"-UNKNOWN-"; + if (!version) version = (unsigned char *)"-UNKNOWN-"; + if (!glslversion) glslversion = (unsigned char *)"-UNKNOWN-"; if (getenv("EVAS_GL_INFO")) { -fprintf(stderr, "vendor: %s\n", vendor); +fprintf(stderr, "vendor : %s\n", vendor); fprintf(stderr, "renderer: %s\n", renderer); -fprintf(stderr, "version: %s\n", version); +fprintf(stderr, "version : %s\n", version); +fprintf(stderr, "glsl ver: %s\n", glslversion); } + // examples: // vendor: NVIDIA Corporation // renderer: NVIDIA Tegra --
[EGIT] [core/efl] master 08/08: Evas GL: Fix up some more desktop GL extensions
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=02d123be77d2388afcf1ff2914d35309e60741b9 commit 02d123be77d2388afcf1ff2914d35309e60741b9 Author: Jean-Philippe Andre Date: Thu Nov 27 20:46:10 2014 +0900 Evas GL: Fix up some more desktop GL extensions OpenGL 1.2 already supports some of the features that GLESv2 has as extensions: - GL_EXT_read_format_bgra - GL_EXT_texture_format_BGRA - GL_EXT_texture_type_2_10_10_10_REV Also, we need to check the proper ARB name of some extensions when running on desktop, instead of their OES/IMG/EXT equivalent: - GL_ARB_texture_float - GL_ARB_texture_half_float - GL_ARB_texture_non_power_of_two - GL_ARB_half_float_vertex - GL_EXT_packed_depth_stencil --- src/modules/evas/engines/gl_common/evas_gl_api_ext.c | 3 ++- .../evas/engines/gl_common/evas_gl_api_ext_def.h | 18 -- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c index ef3e87f..b696d74 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c @@ -266,7 +266,8 @@ evgl_api_ext_init(void *getproc, const char *glueexts) /* Add some extension strings that are always working on desktop GL */ static const char *desktop_exts = "GL_EXT_read_format_bgra " - "GL_EXT_texture_format_BGRA"; + "GL_EXT_texture_format_BGRA " + "GL_EXT_texture_type_2_10_10_10_REV "; strcpy(_gl_ext_string, desktop_exts); strcpy(_gl_ext_string_official, desktop_exts); #endif diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h index 83d4188..7c71ad2 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h +++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h @@ -342,6 +342,7 @@ _EVASGL_EXT_END() _EVASGL_EXT_BEGIN(packed_depth_stencil) _EVASGL_EXT_DRVNAME(GL_OES_packed_depth_stencil) +_EVASGL_EXT_DRVNAME_DESKTOP("GL_EXT_packed_depth_stencil") _EVASGL_EXT_END() _EVASGL_EXT_BEGIN(rgb8_rgba8) @@ -362,18 +363,22 @@ _EVASGL_EXT_END() _EVASGL_EXT_BEGIN(texture_float) _EVASGL_EXT_DRVNAME(GL_OES_texture_float) +_EVASGL_EXT_DRVNAME_DESKTOP("GL_ARB_texture_float") _EVASGL_EXT_END() _EVASGL_EXT_BEGIN(texture_half_float) _EVASGL_EXT_DRVNAME(GL_OES_texture_half_float) +_EVASGL_EXT_DRVNAME_DESKTOP("GL_ARB_texture_half_float") _EVASGL_EXT_END() _EVASGL_EXT_BEGIN(texture_float_linear) _EVASGL_EXT_DRVNAME(GL_OES_texture_float_linear) +//_EVASGL_EXT_DRVNAME_DESKTOP("GL_ARB_texture_float_linear") _EVASGL_EXT_END() _EVASGL_EXT_BEGIN(texture_half_float_linear) _EVASGL_EXT_DRVNAME(GL_OES_texture_half_float_linear) +//_EVASGL_EXT_DRVNAME_DESKTOP("GL_ARB_texture_half_float_linear") _EVASGL_EXT_END() _EVASGL_EXT_BEGIN(texture_npot) @@ -381,12 +386,9 @@ _EVASGL_EXT_BEGIN(texture_npot) _EVASGL_EXT_DRVNAME_DESKTOP("GL_ARB_texture_non_power_of_two") _EVASGL_EXT_END() -_EVASGL_EXT_BEGIN(vertex_half_float) // Desktop differs - _EVASGL_EXT_DRVNAME(GL_OES_vertex_half_float) -_EVASGL_EXT_END() - -_EVASGL_EXT_BEGIN(vertex_half_float_DESKTOP) // Desktop differs +_EVASGL_EXT_BEGIN(vertex_half_float) _EVASGL_EXT_DRVNAME(GL_OES_vertex_half_float) +_EVASGL_EXT_DRVNAME_DESKTOP("GL_ARB_half_float_vertex") _EVASGL_EXT_END() _EVASGL_EXT_BEGIN(vertex_type_10_10_10_2) @@ -421,11 +423,7 @@ _EVASGL_EXT_BEGIN(texture_format_BGRA) // Desktop has it from GL 1.2 _EVASGL_EXT_DRVNAME(GL_EXT_texture_format_BGRA) _EVASGL_EXT_END() -_EVASGL_EXT_BEGIN(texture_type_2_10_10_10_rev) // Desktop differs - _EVASGL_EXT_DRVNAME(GL_EXT_texture_type_2_10_10_10_REV) -_EVASGL_EXT_END() - -_EVASGL_EXT_BEGIN(texture_type_2_10_10_10_rev_DESKTOP) // Desktop differs +_EVASGL_EXT_BEGIN(texture_type_2_10_10_10_rev) // Desktop has it from GL 1.2 _EVASGL_EXT_DRVNAME(GL_EXT_texture_type_2_10_10_10_REV) _EVASGL_EXT_END() --
[EGIT] [core/efl] master 07/08: Evas GL: Also add read bgra for desktop GL
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=45374e25360500f31dd23b0ffcb341aeb26906f2 commit 45374e25360500f31dd23b0ffcb341aeb26906f2 Author: Jean-Philippe Andre Date: Thu Nov 27 20:15:40 2014 +0900 Evas GL: Also add read bgra for desktop GL --- src/modules/evas/engines/gl_common/evas_gl_api_ext.c | 7 +-- src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h | 8 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c index a79efdd..ef3e87f 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c @@ -264,8 +264,11 @@ evgl_api_ext_init(void *getproc, const char *glueexts) #ifndef GL_GLES /* Add some extension strings that are always working on desktop GL */ - strcat(_gl_ext_string, "GL_EXT_texture_format_BGRA "); - strcat(_gl_ext_string_official, "GL_EXT_texture_format_BGRA "); + static const char *desktop_exts = + "GL_EXT_read_format_bgra " + "GL_EXT_texture_format_BGRA"; + strcpy(_gl_ext_string, desktop_exts); + strcpy(_gl_ext_string_official, desktop_exts); #endif / diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h index 135ce74..83d4188 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h +++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h @@ -409,11 +409,7 @@ _EVASGL_EXT_BEGIN(blend_minmax) _EVASGL_EXT_DRVNAME(GL_EXT_blend_minmax) _EVASGL_EXT_END() -_EVASGL_EXT_BEGIN(read_format_bgra) // Desktop differs - _EVASGL_EXT_DRVNAME(GL_EXT_read_format_bgra) -_EVASGL_EXT_END() - -_EVASGL_EXT_BEGIN(read_format_bgra_DESKTOP) // Desktop differs +_EVASGL_EXT_BEGIN(read_format_bgra) // Desktop has it from GL 1.2 _EVASGL_EXT_DRVNAME(GL_EXT_read_format_bgra) _EVASGL_EXT_END() @@ -421,7 +417,7 @@ _EVASGL_EXT_BEGIN(texture_filter_anisotropic) _EVASGL_EXT_DRVNAME(GL_EXT_texture_filter_anisotropic) _EVASGL_EXT_END() -_EVASGL_EXT_BEGIN(texture_format_BGRA) +_EVASGL_EXT_BEGIN(texture_format_BGRA) // Desktop has it from GL 1.2 _EVASGL_EXT_DRVNAME(GL_EXT_texture_format_BGRA) _EVASGL_EXT_END() --
[EGIT] [core/efl] master 06/08: Evas GL: Advertise support for npot on desktop
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9be96f4b96f7f500c8047ca41f0c8b8aa6014e8e commit 9be96f4b96f7f500c8047ca41f0c8b8aa6014e8e Author: Jean-Philippe Andre Date: Thu Nov 27 20:08:10 2014 +0900 Evas GL: Advertise support for npot on desktop The extension name is GL_ARB_texture_non_power_of_two for desktop GL, but GL_OES_texture_npot for GLES. We will consider the extensions compatible, I believe the GLES version is a subset of the desktop one. Not sure if that's 100% true. --- src/modules/evas/engines/gl_common/evas_gl_api_ext.c | 14 ++ src/modules/evas/engines/gl_common/evas_gl_api_ext.h | 4 src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h | 10 -- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c index 5aaa085..a79efdd 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c @@ -23,6 +23,7 @@ char _gl_ext_string_official[MAX_EXTENSION_STRING_BUFFER] = { 0 }; #define _EVASGL_EXT_BEGIN(name) #define _EVASGL_EXT_END() #define _EVASGL_EXT_DRVNAME(name) +#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) ret (*glextsym_##name) param = NULL; #define _EVASGL_EXT_FUNCTION_END() #define _EVASGL_EXT_FUNCTION_DRVFUNC(name) @@ -35,6 +36,7 @@ char _gl_ext_string_official[MAX_EXTENSION_STRING_BUFFER] = { 0 }; #undef _EVASGL_EXT_BEGIN #undef _EVASGL_EXT_END #undef _EVASGL_EXT_DRVNAME +#undef _EVASGL_EXT_DRVNAME_DESKTOP #undef _EVASGL_EXT_FUNCTION_BEGIN #undef _EVASGL_EXT_FUNCTION_END #undef _EVASGL_EXT_FUNCTION_DRVFUNC @@ -49,6 +51,7 @@ char _gl_ext_string_official[MAX_EXTENSION_STRING_BUFFER] = { 0 }; #define _EVASGL_EXT_BEGIN(name) int _gl_ext_support_##name = 0; #define _EVASGL_EXT_END() #define _EVASGL_EXT_DRVNAME(name) +#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) #define _EVASGL_EXT_FUNCTION_END() #define _EVASGL_EXT_FUNCTION_DRVFUNC(name) @@ -61,6 +64,7 @@ char _gl_ext_string_official[MAX_EXTENSION_STRING_BUFFER] = { 0 }; #undef _EVASGL_EXT_BEGIN #undef _EVASGL_EXT_END #undef _EVASGL_EXT_DRVNAME +#undef _EVASGL_EXT_DRVNAME_DESKTOP #undef _EVASGL_EXT_FUNCTION_BEGIN #undef _EVASGL_EXT_FUNCTION_END #undef _EVASGL_EXT_FUNCTION_DRVFUNC @@ -316,6 +320,9 @@ re->info->info.screen); #define _EVASGL_EXT_DRVNAME(name) \ if (_EVASGL_EXT_CHECK_SUPPORT(#name)) *ext_support = 1; +#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) \ + if (_EVASGL_EXT_CHECK_SUPPORT(deskname)) *ext_support = 1; + #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \ { \ ret (**drvfunc)param = &glextsym_##name; @@ -350,6 +357,7 @@ re->info->info.screen); #undef _EVASGL_EXT_BEGIN #undef _EVASGL_EXT_END #undef _EVASGL_EXT_DRVNAME +#undef _EVASGL_EXT_DRVNAME_DESKTOP #undef _EVASGL_EXT_FUNCTION_BEGIN #undef _EVASGL_EXT_FUNCTION_END #undef _EVASGL_EXT_FUNCTION_DRVFUNC @@ -373,6 +381,7 @@ re->info->info.screen); strcat(_gl_ext_string, #name" "); \ strcat(_gl_ext_string_official, #name" "); \ } +#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) #define _EVASGL_EXT_FUNCTION_END() #define _EVASGL_EXT_FUNCTION_DRVFUNC(name) @@ -385,6 +394,7 @@ re->info->info.screen); #undef _EVASGL_EXT_BEGIN #undef _EVASGL_EXT_END #undef _EVASGL_EXT_DRVNAME +#undef _EVASGL_EXT_DRVNAME_DESKTOP #undef _EVASGL_EXT_FUNCTION_BEGIN #undef _EVASGL_EXT_FUNCTION_END #undef _EVASGL_EXT_FUNCTION_DRVFUNC @@ -417,6 +427,7 @@ evgl_api_ext_get(Evas_GL_API *gl_funcs) #define _EVASGL_EXT_END() \ } #define _EVASGL_EXT_DRVNAME(name) +#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \ ORD(name); #define _EVASGL_EXT_FUNCTION_END() @@ -436,6 +447,7 @@ evgl_api_ext_get(Evas_GL_API *gl_funcs) #undef _EVASGL_EXT_BEGIN #undef _EVASGL_EXT_END #undef _EVASGL_EXT_DRVNAME +#undef _EVASGL_EXT_DRVNAME_DESKTOP #undef _EVASGL_EXT_FUNCTION_BEGIN #undef _EVASGL_EXT_FUNCTION_END #undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN @@ -469,6 +481,7 @@ evgl_api_gles1_ext_get(Evas_GL_API *gl_funcs) #define _EVASGL_EXT_END() \ } #define _EVASGL_EXT_DRVNAME(name) +#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \ ORD(name); #define _EVASGL_EXT_FUNCTION_END() @@ -487,6 +500,7 @@ evgl_api_gles1_ext_get(Evas_GL_API *gl_funcs) #undef _EVASGL_EXT_BEGIN #undef _EVASGL_EXT_END #undef _EVASGL_EXT_DRVNAME +#undef _EVASGL_EXT_DRVNAME_DESKTOP #undef _EVASGL_EXT_FUNCTION_BEGIN #undef _EVASGL_EXT_FUNCTION_END #undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.h b/src/modules/evas/engines/gl_com
[EGIT] [core/efl] master 03/08: Evas GL: Always return "OpenGL ES 2.0" as version
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9f38aadd38183c372dd1db445d2cc6c153a3b8ef commit 9f38aadd38183c372dd1db445d2cc6c153a3b8ef Author: Jean-Philippe Andre Date: Thu Nov 27 17:17:03 2014 +0900 Evas GL: Always return "OpenGL ES 2.0" as version This time it's for desktop GL. I decided to keep some vendor info, as it can help for debugging purposes. --- src/modules/evas/engines/gl_common/evas_gl_api.c | 23 ++- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_api.c b/src/modules/evas/engines/gl_common/evas_gl_api.c index 86970d6..4992acd 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api.c @@ -583,7 +583,10 @@ _evgl_glGetString(GLenum name) { case GL_VENDOR: case GL_RENDERER: - case GL_SHADING_LANGUAGE_VERSION: // wrap me? + case GL_SHADING_LANGUAGE_VERSION: +// GLSL version example strings (for the same GPU): +// For OpenGL ES 2.0 or 3.0: "OpenGL ES GLSL ES 3.10" +// For Desktop OpenGL: "4.40 NVIDIA via Cg compiler" break; case GL_VERSION: ret = glGetString(GL_VERSION); @@ -593,10 +596,20 @@ _evgl_glGetString(GLenum name) // We try not to remove the vendor fluff (contains driver version) strncpy(_version, (const char *) ret, sizeof(_version)); r = strchr(_version, '3'); - *r++ = '2'; - *r++ = '.'; - *r++ = '0'; - *r = ' '; + if (r) + { + *r++ = '2'; + *r++ = '.'; + *r++ = '0'; + *r = ' '; + } + _version[sizeof(_version) - 1] = '\0'; + return (const GLubyte *) _version; + } +else if (!strstr((const char *) ret, "OpenGL ES")) + { + // Desktop GL, we still keep the official name + snprintf(_version, sizeof(_version), "OpenGL ES 2.0 (%s)", (char *) ret); _version[sizeof(_version) - 1] = '\0'; return (const GLubyte *) _version; } --
[EGIT] [core/efl] master 04/08: Evas GL: Also return fake GLSL version string
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d8a4792612822d53e28a86f300e3c52ac9156aa4 commit d8a4792612822d53e28a86f300e3c52ac9156aa4 Author: Jean-Philippe Andre Date: Thu Nov 27 19:05:26 2014 +0900 Evas GL: Also return fake GLSL version string --- src/modules/evas/engines/gl_common/evas_gl_api.c | 59 ++-- 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_api.c b/src/modules/evas/engines/gl_common/evas_gl_api.c index 4992acd..6a5ea56 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api.c @@ -547,10 +547,10 @@ _evgl_glGetIntegerv(GLenum pname, GLint* params) static const GLubyte * _evgl_glGetString(GLenum name) { - static char _version[64] = {0}; + static char _version[128] = {0}; + static char _glsl[128] = {0}; EVGL_Resource *rsc; const GLubyte *ret; - char *r; /* We wrap two values here: * @@ -583,40 +583,51 @@ _evgl_glGetString(GLenum name) { case GL_VENDOR: case GL_RENDERER: - case GL_SHADING_LANGUAGE_VERSION: -// GLSL version example strings (for the same GPU): -// For OpenGL ES 2.0 or 3.0: "OpenGL ES GLSL ES 3.10" -// For Desktop OpenGL: "4.40 NVIDIA via Cg compiler" +// Keep these as-is. break; - case GL_VERSION: -ret = glGetString(GL_VERSION); + + case GL_SHADING_LANGUAGE_VERSION: +ret = glGetString(GL_SHADING_LANGUAGE_VERSION); if (!ret) return NULL; -if (strstr((const char *) ret, "OpenGL ES 3")) +#ifdef GL_GLES +if (ret[15] != (GLubyte) '1') { - // We try not to remove the vendor fluff (contains driver version) - strncpy(_version, (const char *) ret, sizeof(_version)); - r = strchr(_version, '3'); - if (r) - { - *r++ = '2'; - *r++ = '.'; - *r++ = '0'; - *r = ' '; - } - _version[sizeof(_version) - 1] = '\0'; - return (const GLubyte *) _version; + // We try not to remove the vendor fluff + snprintf(_glsl, sizeof(_glsl), "OpenGL ES GLSL ES 1.00 Evas GL (%s)", ((char *) ret) + 18); + _glsl[sizeof(_glsl) - 1] = '\0'; + return (const GLubyte *) _glsl; } -else if (!strstr((const char *) ret, "OpenGL ES")) +return ret; +#else +// Desktop GL, we still keep the official name +snprintf(_glsl, sizeof(_glsl), "OpenGL ES GLSL ES 1.00 Evas GL (%s)", (char *) ret); +_version[sizeof(_glsl) - 1] = '\0'; +return (const GLubyte *) _glsl; +#endif + + case GL_VERSION: +ret = glGetString(GL_VERSION); +if (!ret) return NULL; +#ifdef GL_GLES +if (ret[11] != (GLubyte) '2') { - // Desktop GL, we still keep the official name - snprintf(_version, sizeof(_version), "OpenGL ES 2.0 (%s)", (char *) ret); + // We try not to remove the vendor fluff + snprintf(_version, sizeof(_version), "OpenGL ES 2.0 Evas GL (%s)", ((char *) ret) + 10); _version[sizeof(_version) - 1] = '\0'; return (const GLubyte *) _version; } return ret; +#else +// Desktop GL, we still keep the official name +snprintf(_version, sizeof(_version), "OpenGL ES 2.0 Evas GL (%s)", (char *) ret); +_version[sizeof(_version) - 1] = '\0'; +return (const GLubyte *) _version; +#endif + case GL_EXTENSIONS: return (GLubyte *) evgl_api_ext_string_get (EINA_TRUE, (rsc->current_ctx->version == EVAS_GL_GLES_1_X)); + default: // GL_INVALID_ENUM is generated if name is not an accepted value. WRN("Unknown string requested: %x", (unsigned int) name); --
[EGIT] [core/efl] master 01/08: Evas GL: Return supported extensions list in glGetString()
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=af1b679e6c83399dca0d3233163781fdecf6aa68 commit af1b679e6c83399dca0d3233163781fdecf6aa68 Author: Jean-Philippe Andre Date: Thu Nov 27 17:03:04 2014 +0900 Evas GL: Return supported extensions list in glGetString() --- src/modules/evas/engines/gl_common/evas_gl_api.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_api.c b/src/modules/evas/engines/gl_common/evas_gl_api.c index e8254e3..86970d6 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api.c @@ -559,9 +559,9 @@ _evgl_glGetString(GLenum name) * GLES 3 support is not exposed because apps can't use GLES 3 core * functions yet. * -* EXTENSIONS: This should return the list of GL extensions supported by Evas GL -* --> FIXME: Unfortunately the whitelist does not contain enough extensions -* especially for desktop GL and needs updating as OpenGL evolves. +* EXTENSIONS: This should return only the list of GL extensions supported +* by Evas GL. This means as many extensions as possible should be +* added to the whitelist. */ /* @@ -602,9 +602,8 @@ _evgl_glGetString(GLenum name) } return ret; case GL_EXTENSIONS: -// return (GLubyte *) evgl_api_ext_string_get -// (EINA_TRUE, (rsc->current_ctx->version == EVAS_GL_GLES_1_X)); -break; +return (GLubyte *) evgl_api_ext_string_get + (EINA_TRUE, (rsc->current_ctx->version == EVAS_GL_GLES_1_X)); default: // GL_INVALID_ENUM is generated if name is not an accepted value. WRN("Unknown string requested: %x", (unsigned int) name); --
[EGIT] [core/efl] master 01/01: Evas: Fix shader gen script for Ubuntu
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=07c68ac42b7f8b1108e46b14b790a64b2ab19383 commit 07c68ac42b7f8b1108e46b14b790a64b2ab19383 Author: Jean-Philippe Andre Date: Thu Nov 27 21:46:14 2014 +0900 Evas: Fix shader gen script for Ubuntu dash was the shell on that machine. Also, GCC complained about a non const initializer. Thanks SeoZ for the report. --- .../engines/gl_common/shader/evas_gl_shaders.x | 168 ++--- .../evas/engines/gl_common/shader/gen_shaders.sh | 4 +- 2 files changed, 86 insertions(+), 86 deletions(-) diff --git a/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x b/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x index cb3f271..17c1359 100644 --- a/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x +++ b/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x @@ -4,7 +4,7 @@ #include "../evas_gl_private.h" /* Source: modules/evas/engines/gl_common/shader/font_frag.shd */ -static const char font_frag_glsl[] = +static const char const font_frag_glsl[] = "#ifdef GL_ES\n" "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" "precision highp float;\n" @@ -26,7 +26,7 @@ Evas_GL_Program_Source shader_font_frag_src = }; /* Source: modules/evas/engines/gl_common/shader/font_vert.shd */ -static const char font_vert_glsl[] = +static const char const font_vert_glsl[] = "#ifdef GL_ES\n" "precision highp float;\n" "#endif\n" @@ -49,7 +49,7 @@ Evas_GL_Program_Source shader_font_vert_src = }; /* Source: modules/evas/engines/gl_common/shader/img_12_bgra_frag.shd */ -static const char img_12_bgra_frag_glsl[] = +static const char const img_12_bgra_frag_glsl[] = "#ifdef GL_ES\n" "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" "precision highp float;\n" @@ -75,7 +75,7 @@ Evas_GL_Program_Source shader_img_12_bgra_frag_src = }; /* Source: modules/evas/engines/gl_common/shader/img_12_bgra_nomul_frag.shd */ -static const char img_12_bgra_nomul_frag_glsl[] = +static const char const img_12_bgra_nomul_frag_glsl[] = "#ifdef GL_ES\n" "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" "precision highp float;\n" @@ -100,7 +100,7 @@ Evas_GL_Program_Source shader_img_12_bgra_nomul_frag_src = }; /* Source: modules/evas/engines/gl_common/shader/img_12_bgra_nomul_vert.shd */ -static const char img_12_bgra_nomul_vert_glsl[] = +static const char const img_12_bgra_nomul_vert_glsl[] = "#ifdef GL_ES\n" "precision highp float;\n" "#endif\n" @@ -126,7 +126,7 @@ Evas_GL_Program_Source shader_img_12_bgra_nomul_vert_src = }; /* Source: modules/evas/engines/gl_common/shader/img_12_bgra_vert.shd */ -static const char img_12_bgra_vert_glsl[] = +static const char const img_12_bgra_vert_glsl[] = "#ifdef GL_ES\n" "precision highp float;\n" "#endif\n" @@ -155,7 +155,7 @@ Evas_GL_Program_Source shader_img_12_bgra_vert_src = }; /* Source: modules/evas/engines/gl_common/shader/img_12_frag.shd */ -static const char img_12_frag_glsl[] = +static const char const img_12_frag_glsl[] = "#ifdef GL_ES\n" "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" "precision highp float;\n" @@ -181,7 +181,7 @@ Evas_GL_Program_Source shader_img_12_frag_src = }; /* Source: modules/evas/engines/gl_common/shader/img_12_nomul_frag.shd */ -static const char img_12_nomul_frag_glsl[] = +static const char const img_12_nomul_frag_glsl[] = "#ifdef GL_ES\n" "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" "precision highp float;\n" @@ -206,7 +206,7 @@ Evas_GL_Program_Source shader_img_12_nomul_frag_src = }; /* Source: modules/evas/engines/gl_common/shader/img_12_nomul_vert.shd */ -static const char img_12_nomul_vert_glsl[] = +static const char const img_12_nomul_vert_glsl[] = "#ifdef GL_ES\n" "precision highp float;\n" "#endif\n" @@ -232,7 +232,7 @@ Evas_GL_Program_Source shader_img_12_nomul_vert_src = }; /* Source: modules/evas/engines/gl_common/shader/img_12_vert.shd */ -static const char img_12_vert_glsl[] = +static const char const img_12_vert_glsl[] = "#ifdef GL_ES\n" "precision highp float;\n" "#endif\n" @@ -261,7 +261,7 @@ Evas_GL_Program_Source shader_img_12_vert_src = }; /* Source: modules/evas/engines/gl_common/shader/img_21_bgra_frag.shd */ -static const char img_21_bgra_frag_glsl[] = +static const char const img_21_bgra_frag_glsl[] = "#ifdef GL_ES\n" "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" "precision highp float;\n" @@ -287,7 +287,7 @@ Evas_GL_Program_Source shader_img_21_bgra_frag_src = }; /* Source: modules/evas/engines/gl_common/shader/img_21_bgra_nomul_frag.shd */ -static const char img_21_bgra_nomul_frag_glsl[] = +static const char const img_21_bgra_nomul_frag_glsl[] = "#ifdef GL_ES\n" "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" "precision highp float;\n" @@ -312,7 +312,7 @@ Evas_GL_Program_Source shader_img_21_bgra_nomul_frag_src = }; /* Source: modules/evas/engines/gl_common/shader/img_21_bgr
[EGIT] [core/efl] master 01/01: Evas GL: Use strncat and strncpy for safety
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=151eeacec8c21f203e9d17718ac132d7f56e5155 commit 151eeacec8c21f203e9d17718ac132d7f56e5155 Author: Jean-Philippe Andre Date: Fri Nov 28 11:21:43 2014 +0900 Evas GL: Use strncat and strncpy for safety Fixes Coverity reports: - CID 1256183 Coverity was a bit stupid there. It knows the size of both strings and complained about unsafe strcpy. It should have complained about unsafe strcat instead. --- .../evas/engines/gl_common/evas_gl_api_ext.c| 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c index b696d74..576718f 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c @@ -268,8 +268,8 @@ evgl_api_ext_init(void *getproc, const char *glueexts) "GL_EXT_read_format_bgra " "GL_EXT_texture_format_BGRA " "GL_EXT_texture_type_2_10_10_10_REV "; - strcpy(_gl_ext_string, desktop_exts); - strcpy(_gl_ext_string_official, desktop_exts); + strncpy(_gl_ext_string, desktop_exts, MAX_EXTENSION_STRING_BUFFER); + strncpy(_gl_ext_string_official, desktop_exts, MAX_EXTENSION_STRING_BUFFER); #endif / @@ -373,7 +373,11 @@ re->info->info.screen); // Extension HEADER / #define _EVASGL_EXT_BEGIN(name) \ - if (_gl_ext_support_##name != 0) { strcat(_gl_ext_string, #name" "); _curext_supported = 1; } \ + if (_gl_ext_support_##name != 0) \ + { \ + strncat(_gl_ext_string, #name" ", MAX_EXTENSION_STRING_BUFFER); \ + _curext_supported = 1; \ + } \ else _curext_supported = 0; #define _EVASGL_EXT_END() @@ -381,10 +385,10 @@ re->info->info.screen); #define _EVASGL_EXT_DISCARD_SUPPORT() #define _EVASGL_EXT_DRVNAME(name) \ if (_curext_supported) \ - { \ - strcat(_gl_ext_string, #name" "); \ - strcat(_gl_ext_string_official, #name" "); \ - } + { \ +strncat(_gl_ext_string, #name" ", MAX_EXTENSION_STRING_BUFFER); \ +strncat(_gl_ext_string_official, #name" ", MAX_EXTENSION_STRING_BUFFER); \ + } #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) #define _EVASGL_EXT_FUNCTION_END() @@ -405,6 +409,9 @@ re->info->info.screen); #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR / + _gl_ext_string[MAX_EXTENSION_STRING_BUFFER - 1] = '\0'; + _gl_ext_string_official[MAX_EXTENSION_STRING_BUFFER - 1] = '\0'; + _evgl_api_ext_status = 1; return EINA_TRUE; } --
[EGIT] [core/efl] master 01/02: Evas GL: Add preventive padding after Evas_GL_API
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0514cbc1a3c86a86c2abcf39958f562e5bc2e31b commit 0514cbc1a3c86a86c2abcf39958f562e5bc2e31b Author: Jean-Philippe Andre Date: Wed Dec 3 11:44:09 2014 +0900 Evas GL: Add preventive padding after Evas_GL_API Since this struct is likely to grow in size over time, client apps built against future versions of EFL might start indexing fields that are not present in the current form. Also, don't reset the struct memory as this would break multithreaded GL applications. While this is not exactly a fix, I'll backport this. @fix --- src/modules/evas/engines/gl_common/evas_gl_api.c | 2 -- .../evas/engines/gl_common/evas_gl_api_gles1.c| 2 -- src/modules/evas/engines/gl_common/evas_gl_core.c | 19 +++ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_api.c b/src/modules/evas/engines/gl_common/evas_gl_api.c index 6a5ea56..ed8f501 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api.c @@ -2868,8 +2868,6 @@ _debug_gl_api_get(Evas_GL_API *funcs) void _evgl_api_get(Evas_GL_API *funcs, int debug) { - memset(funcs, 0, sizeof(Evas_GL_API)); - if (debug) _debug_gl_api_get(funcs); else diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c b/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c index c018f7e..d3eee22 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c @@ -4263,8 +4263,6 @@ _normal_gles1_api_get(Evas_GL_API *funcs) void _evgl_api_gles1_get(Evas_GL_API *funcs, Eina_Bool debug) { - memset(funcs, 0, sizeof(Evas_GL_API)); - if (!_evgl_gles1_api_init()) return; diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c b/src/modules/evas/engines/gl_common/evas_gl_core.c index 1878f5f..9ec771a 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_core.c +++ b/src/modules/evas/engines/gl_common/evas_gl_core.c @@ -8,9 +8,11 @@ typedef struct _GL_Format GLenum fmt; } GL_Format; -// Globals -static Evas_GL_API gl_funcs; -static Evas_GL_API gles1_funcs; +// Extended struct size based on the 314 functions found in gl31.h +#define EVAS_GL_API_STRUCT_SIZE (sizeof(Evas_GL_API) + 300 * sizeof(void*)) +static Evas_GL_API *gl_funcs = NULL; +static Evas_GL_API *gles1_funcs = NULL; + EVGL_Engine *evgl_engine = NULL; int _evas_gl_log_dom = -1; int _evas_gl_log_level = -1; @@ -1456,7 +1458,8 @@ evgl_engine_init(void *eng_data, const EVGL_Interface *efunc) evgl_engine->main_tid = 0; // Clear Function Pointers - memset(&gl_funcs, 0, sizeof(Evas_GL_API)); + if (!gl_funcs) gl_funcs = calloc(1, EVAS_GL_API_STRUCT_SIZE); + if (!gles1_funcs) gles1_funcs = calloc(1, EVAS_GL_API_STRUCT_SIZE); return evgl_engine; @@ -2414,13 +2417,13 @@ evgl_api_get(Evas_GL_Context_Version version) { if (version == EVAS_GL_GLES_2_X) { -_evgl_api_get(&gl_funcs, evgl_engine->api_debug_mode); -return &gl_funcs; +_evgl_api_get(gl_funcs, evgl_engine->api_debug_mode); +return gl_funcs; } else if (version == EVAS_GL_GLES_1_X) { -_evgl_api_gles1_get(&gles1_funcs, evgl_engine->api_debug_mode); -return &gles1_funcs; +_evgl_api_gles1_get(gles1_funcs, evgl_engine->api_debug_mode); +return gles1_funcs; } else return NULL; } --
[EGIT] [core/efl] master 02/02: Evas GL: Clarify doc about Evas_GL_API struct version
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ef36e0d8877bcc760c7981d3061f551ff05f4e29 commit ef36e0d8877bcc760c7981d3061f551ff05f4e29 Author: Jean-Philippe Andre Date: Wed Dec 3 12:08:03 2014 +0900 Evas GL: Clarify doc about Evas_GL_API struct version --- src/lib/evas/Evas_GL.h | 35 +-- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/src/lib/evas/Evas_GL.h b/src/lib/evas/Evas_GL.h index 302d72c..c3ce92a 100644 --- a/src/lib/evas/Evas_GL.h +++ b/src/lib/evas/Evas_GL.h @@ -3498,9 +3498,15 @@ typedef unsigned long long EvasGLTime; /** @} */ -/* Version 1: OpenGLES 2.0 + extensions only - * Version 2: OpenGLES 1.0 + extensions - * Version 3: wayland extensions +/** + * @brief Defines the version of the API structure. + * + * This helps applications know at runtime whether a function pointer exists + * or not. + * + * Version 1: GLES 2.0 + GLES2 extensions only + * Version 2: GLES 2.0 + GLES2 extensions + GLES1 + GLES1.1 extensions + * Version 3: [version 2] + Wayland extensions */ #define EVAS_GL_API_VERSION 3 @@ -3791,8 +3797,12 @@ struct _Evas_GL_API */ void (*evasglDestroyImage) (EvasGLImage image); + + + // -- // /* Evas_GL_API version 2: */ + /** * @anchor evasglCreateImageForContext * @brief Create an EvasGLImage for a given context. @@ -3817,6 +3827,8 @@ EvasGLImage *img = glapi->evasglCreateImageForContext * @li @c EVAS_GL_NATIVE_SURFACE_TIZEN (Tizen platform only): * Requires the @c EVAS_GL_TIZEN_image_native_surface extension. * +* @note Evas_GL_API must have version 2 or more. +* * @since 1.12 */ EvasGLImage (*evasglCreateImageForContext) (Evas_GL *evas_gl, Evas_GL_Context *ctx, int target, void* buffer, const int* attrib_list) EINA_WARN_UNUSED_RESULT; @@ -3826,7 +3838,7 @@ EvasGLImage *img = glapi->evasglCreateImageForContext /** * @name OpenGL-ES 1.1 * -* Evas_GL_API version 2. +* Evas_GL_API version 2 or more. * * The following functions are some of the standard OpenGL-ES 1.0 functions, * that are not also present in the @ref gles2 "OpenGL-ES 2.0 APIs". @@ -3927,7 +3939,7 @@ EvasGLImage *img = glapi->evasglCreateImageForContext /** * @name OpenGL-ES 1.1 extensions * -* Evas_GL_API version 2. +* Evas_GL_API version 2 or more. * * OpenGL-ES 1.1 specifies a set of extensions on top of OpenGL-ES 1.0. * When available, Evas GL will expose these extensions with the following @@ -4124,8 +4136,16 @@ EvasGLImage *img = glapi->evasglCreateImageForContext int (*evasglWaitSync) (Evas_GL *evas_gl, EvasGLSync sync, int flags); /** @} */ + + + // -- // + /* Evas_GL_API version 3: */ + /** * @name Evas GL Wayland functions +* +* Evas_GL_API version 3 or more. +* * @since 1.13 * @{ */ /** @@ -4145,7 +4165,10 @@ EvasGLImage *img = glapi->evasglCreateImageForContext Eina_Bool(*evasglQueryWaylandBuffer) (Evas_GL *evas_gl, void *buffer, int attribute, int *value); /** @} */ - /* future calls will be added down here for expansion */ + /* Future calls will be added down here for expansion, when adding +* new APIs here, please bump the struct version number (together with +* the EFL version bump). +*/ }; --
[EGIT] [core/efl] master 01/01: Evas font: Compress font algo should round instead of floor
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=52d117c90501c5cec32248b4231f8f44735bdcf9 commit 52d117c90501c5cec32248b4231f8f44735bdcf9 Author: Jean-Philippe Andre Date: Mon Dec 8 13:50:44 2014 +0900 Evas font: Compress font algo should round instead of floor This is an attempt at having higher quality font rendering while still using RLE-based font compression. --- src/lib/evas/common/evas_font_compress.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/common/evas_font_compress.c b/src/lib/evas/common/evas_font_compress.c index 1b8d631..66c8511 100644 --- a/src/lib/evas/common/evas_font_compress.c +++ b/src/lib/evas/common/evas_font_compress.c @@ -151,6 +151,9 @@ compress_rle4(DATA8 *src, int pitch, int w, int h, int *size_ret) { // we only need upper 4 bits of value for span creation DATA8 v = pix[x] >> 4; + // round-up if closer to upper value + if ((pix[x] & 0x8) && (v != 0xF)) + v++; // if the current pixel value (in 4bit) is not the same as the // span value (n 4 bit) OR... if the span now exceeds 16 pixels // then add/write out the span to our RLE span blob @@ -344,7 +347,11 @@ compress_bpp4(DATA8 *src, int pitch, int w, int h, int *size_ret) // 4 bits only needed) and pack for (x = 0; x < (w - 1); x += 2) { - *d = (s[0] & 0xf0) | (s[1] >> 4); + DATA8 v1 = s[0] >> 4; + DATA8 v2 = s[1] >> 4; + if ((s[0] & 0x08) && (v1 != 0x0f)) v1++; + if ((s[1] & 0x08) && (v2 != 0x0f)) v2++; + *d = (v1 << 4) | v2; s += 2; d++; } --
[EGIT] [core/efl] master 01/01: Evas font: Improve RLE rounding alpha8 to alpha44
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=624787c42a4edb1f900051cc2124f9f055d01ce2 commit 624787c42a4edb1f900051cc2124f9f055d01ce2 Author: Jean-Philippe Andre Date: Tue Dec 9 11:00:38 2014 +0900 Evas font: Improve RLE rounding alpha8 to alpha44 This should ensure that the difference between the original pixel value and the rle4 encoded one is <= 8. The previous fix was a bit stupid as it was not taking into account the conversion a4 to a8 (which is a8 = (a4 << 4) | a4). --- src/lib/evas/common/evas_font_compress.c | 24 +++- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/lib/evas/common/evas_font_compress.c b/src/lib/evas/common/evas_font_compress.c index 66c8511..1cbd090 100644 --- a/src/lib/evas/common/evas_font_compress.c +++ b/src/lib/evas/common/evas_font_compress.c @@ -54,6 +54,17 @@ expand_bitmap(DATA8 *src, int pitch, int w, int h, DATA8 *dst) } } +static inline DATA8 +alpha8to4(int a8) +{ + // a4 values are 0x00, 0x11, 0x22, 0x33, ... 0xee, 0xff + // increments by 0x11 = 17 + int a4 = (a8 >> 4) & 0x0f; + int v = (a4 << 4) | a4; + if ((a8 - v) > 8) a4++; + else if ((v - a8) > 8) a4--; + return a4; // v = (a4 << 4) | a4; +} @@ -149,11 +160,8 @@ compress_rle4(DATA8 *src, int pitch, int w, int h, int *size_ret) spanval = spanlen = spannum = 0; for (x = 0; x < w; x++) { - // we only need upper 4 bits of value for span creation - DATA8 v = pix[x] >> 4; - // round-up if closer to upper value - if ((pix[x] & 0x8) && (v != 0xF)) - v++; + // round value from a8 to a44 + DATA8 v = alpha8to4(pix[x]); // if the current pixel value (in 4bit) is not the same as the // span value (n 4 bit) OR... if the span now exceeds 16 pixels // then add/write out the span to our RLE span blob @@ -347,10 +355,8 @@ compress_bpp4(DATA8 *src, int pitch, int w, int h, int *size_ret) // 4 bits only needed) and pack for (x = 0; x < (w - 1); x += 2) { - DATA8 v1 = s[0] >> 4; - DATA8 v2 = s[1] >> 4; - if ((s[0] & 0x08) && (v1 != 0x0f)) v1++; - if ((s[1] & 0x08) && (v2 != 0x0f)) v2++; + DATA8 v1 = alpha8to4(s[0]); + DATA8 v2 = alpha8to4(s[1]); *d = (v1 << 4) | v2; s += 2; d++; --
[EGIT] [core/efl] efl-1.12 01/01: Evas GL: Add preventive padding after Evas_GL_API
jpeg pushed a commit to branch efl-1.12. http://git.enlightenment.org/core/efl.git/commit/?id=4a5f8d6ac9746ef0c237242619e95aa233af2373 commit 4a5f8d6ac9746ef0c237242619e95aa233af2373 Author: Jean-Philippe Andre Date: Wed Dec 3 11:44:09 2014 +0900 Evas GL: Add preventive padding after Evas_GL_API Since this struct is likely to grow in size over time, client apps built against future versions of EFL might start indexing fields that are not present in the current form. Also, don't reset the struct memory as this would break multithreaded GL applications. While this is not exactly a fix, I'll backport this. @fix --- src/modules/evas/engines/gl_common/evas_gl_api.c | 2 -- .../evas/engines/gl_common/evas_gl_api_gles1.c| 2 -- src/modules/evas/engines/gl_common/evas_gl_core.c | 19 +++ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_api.c b/src/modules/evas/engines/gl_common/evas_gl_api.c index 477e831..2bf6485 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api.c @@ -2767,8 +2767,6 @@ _debug_gl_api_get(Evas_GL_API *funcs) void _evgl_api_get(Evas_GL_API *funcs, int debug) { - memset(funcs, 0, sizeof(Evas_GL_API)); - if (debug) _debug_gl_api_get(funcs); else diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c b/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c index f03d731..0363bec 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c @@ -4263,8 +4263,6 @@ _normal_gles1_api_get(Evas_GL_API *funcs) void _evgl_api_gles1_get(Evas_GL_API *funcs, Eina_Bool debug) { - memset(funcs, 0, sizeof(Evas_GL_API)); - if (!_evgl_gles1_api_init()) return; diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c b/src/modules/evas/engines/gl_common/evas_gl_core.c index fb56d00..7956a1e 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_core.c +++ b/src/modules/evas/engines/gl_common/evas_gl_core.c @@ -8,9 +8,11 @@ typedef struct _GL_Format GLenum fmt; } GL_Format; -// Globals -static Evas_GL_API gl_funcs; -static Evas_GL_API gles1_funcs; +// Extended struct size based on the 314 functions found in gl31.h +#define EVAS_GL_API_STRUCT_SIZE (sizeof(Evas_GL_API) + 300 * sizeof(void*)) +static Evas_GL_API *gl_funcs = NULL; +static Evas_GL_API *gles1_funcs = NULL; + EVGL_Engine *evgl_engine = NULL; int _evas_gl_log_dom = -1; int _evas_gl_log_level = -1; @@ -1450,7 +1452,8 @@ evgl_engine_init(void *eng_data, const EVGL_Interface *efunc) evgl_engine->main_tid = 0; // Clear Function Pointers - memset(&gl_funcs, 0, sizeof(Evas_GL_API)); + if (!gl_funcs) gl_funcs = calloc(1, EVAS_GL_API_STRUCT_SIZE); + if (!gles1_funcs) gles1_funcs = calloc(1, EVAS_GL_API_STRUCT_SIZE); return evgl_engine; @@ -2309,13 +2312,13 @@ evgl_api_get(Evas_GL_Context_Version version) { if (version == EVAS_GL_GLES_2_X) { -_evgl_api_get(&gl_funcs, evgl_engine->api_debug_mode); -return &gl_funcs; +_evgl_api_get(gl_funcs, evgl_engine->api_debug_mode); +return gl_funcs; } else if (version == EVAS_GL_GLES_1_X) { -_evgl_api_gles1_get(&gles1_funcs, evgl_engine->api_debug_mode); -return &gles1_funcs; +_evgl_api_gles1_get(gles1_funcs, evgl_engine->api_debug_mode); +return gles1_funcs; } else return NULL; } --
[EGIT] [core/efl] master 02/02: Evas GL: Fix scissors with direct rendering
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e4a11c008c124f246ba410f6398e22559ba6ab00 commit e4a11c008c124f246ba410f6398e22559ba6ab00 Author: Jean-Philippe Andre Date: Tue Dec 9 18:35:35 2014 +0900 Evas GL: Fix scissors with direct rendering If an app calls glDisable(SCISSORS) and uses direct rendering, then the DR scissors were dropped and so glClear would erase the contents of the entire canvas, instead of being restricted to the image object. --- src/modules/evas/engines/gl_common/evas_gl_api.c | 111 +++-- .../evas/engines/gl_common/evas_gl_core_private.h | 10 +- 2 files changed, 108 insertions(+), 13 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_api.c b/src/modules/evas/engines/gl_common/evas_gl_api.c index ed8f501..2e3f980 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api.c @@ -451,8 +451,66 @@ _evgl_glEnable(GLenum cap) ctx = evas_gl_common_current_context_get(); - if (cap == GL_SCISSOR_TEST) - if (ctx) ctx->scissor_enabled = 1; + if (ctx && (cap == GL_SCISSOR_TEST)) + { +ctx->scissor_enabled = 1; + +if (_evgl_direct_enabled()) + { + EVGL_Resource *rsc = _evgl_tls_resource_get(); + int oc[4] = {0,0,0,0}, nc[4] = {0,0,0,0}, cc[4] = {0,0,0,0}; + + if (!ctx->current_fbo) + { + // Direct rendering to canvas + if (!ctx->scissor_updated) +{ + compute_gl_coordinates(rsc->direct.win_w, rsc->direct.win_h, + rsc->direct.rot, 0, + 0, 0, 0, 0, + rsc->direct.img.x, rsc->direct.img.y, + rsc->direct.img.w, rsc->direct.img.h, + rsc->direct.clip.x, rsc->direct.clip.y, + rsc->direct.clip.w, rsc->direct.clip.h, + oc, nc, cc); + glScissor(cc[0], cc[1], cc[2], cc[3]); +} + else +{ + compute_gl_coordinates(rsc->direct.win_w, rsc->direct.win_h, + rsc->direct.rot, 1, + ctx->scissor_coord[0], ctx->scissor_coord[1], + ctx->scissor_coord[2], ctx->scissor_coord[3], + rsc->direct.img.x, rsc->direct.img.y, + rsc->direct.img.w, rsc->direct.img.h, + rsc->direct.clip.x, rsc->direct.clip.y, + rsc->direct.clip.w, rsc->direct.clip.h, + oc, nc, cc); + glScissor(nc[0], nc[1], nc[2], nc[3]); +} + ctx->direct_scissor = 1; + } + else + { + // Bound to an FBO, reset scissors to user data + if (ctx->scissor_updated) +{ + glScissor(ctx->scissor_coord[0], ctx->scissor_coord[1], + ctx->scissor_coord[2], ctx->scissor_coord[3]); +} + else if (ctx->direct_scissor) +{ + // Back to the default scissors (here: max texture size) + glScissor(0, 0, evgl_engine->caps.max_w, evgl_engine->caps.max_h); +} + ctx->direct_scissor = 0; + } + + glEnable(GL_SCISSOR_TEST); + return; + } + } + glEnable(cap); } @@ -463,8 +521,43 @@ _evgl_glDisable(GLenum cap) ctx = evas_gl_common_current_context_get(); - if (cap == GL_SCISSOR_TEST) - if (ctx) ctx->scissor_enabled = 0; + if (ctx && (cap == GL_SCISSOR_TEST)) + { +ctx->scissor_enabled = 0; + +if (_evgl_direct_enabled()) + { + if (!ctx->current_fbo) + { + // Restore default scissors for direct rendering + int oc[4] = {0,0,0,0}, nc[4] = {0,0,0,0}, cc[4] = {0,0,0,0}; + EVGL_Resource *rsc = _evgl_tls_resource_get(); + + compute_gl_coordinates(rsc->direct.win_w, rsc->direct.win_h, + rsc->direct.rot, 1, + 0, 0, rsc->direct.img.w, rsc->direct.img.h, + rsc->direct.img.x, rsc->direct.img.y, + rsc->direct.img.
[EGIT] [core/efl] master 01/02: Evas GL: Fix current FBO after make_current(0, 0)
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2a69980959408ccd7cc48c29d7e3939764cb1281 commit 2a69980959408ccd7cc48c29d7e3939764cb1281 Author: Jean-Philippe Andre Date: Tue Dec 9 18:02:20 2014 +0900 Evas GL: Fix current FBO after make_current(0, 0) Example scenario: - Create a direct rendered Evas GL 'sfc' 'ctx' - Create a PBuffer dummy surface, make it current - Do some stuff - Make current (NULL, NULL) to go back to no target - Make current (sfc, ctx) --> glClear() will not render anything on screen Reason: The current FBO binding is still set to the implicit FBO bound to the PBuffer surface (it could be any surface, really). --- src/modules/evas/engines/gl_common/evas_gl_core.c | 24 ++ .../evas/engines/gl_common/evas_gl_core_private.h | 1 - 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c b/src/modules/evas/engines/gl_common/evas_gl_core.c index 9ec771a..c0d7a2b 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_core.c +++ b/src/modules/evas/engines/gl_common/evas_gl_core.c @@ -1854,9 +1854,6 @@ evgl_surface_destroy(void *eng_data, EVGL_Surface *sfc) int ret; if (dbg) DBG("Surface sfc %p is a pbuffer: %p", sfc, sfc->pbuffer.native_surface); -if (sfc->pbuffer.fbo) - glDeleteFramebuffers(1, &sfc->pbuffer.fbo); - ret = evgl_engine->funcs->pbuffer_surface_destroy(eng_data, sfc->pbuffer.native_surface); LKL(evgl_engine->resource_lock); evgl_engine->surfaces = eina_list_remove(evgl_engine->surfaces, sfc); @@ -1935,7 +1932,12 @@ evgl_context_create(void *eng_data, EVGL_Context *share_ctx, return NULL; } + // Set default values ctx->version = version; + ctx->scissor_coord[0] = 0; + ctx->scissor_coord[1] = 0; + ctx->scissor_coord[2] = evgl_engine->caps.max_w; + ctx->scissor_coord[3] = evgl_engine->caps.max_h; // Call engine create context if (share_ctx) @@ -2058,6 +2060,15 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx) { if (rsc->direct.partial.enabled) evgl_direct_partial_render_end(); + + glGetIntegerv(GL_FRAMEBUFFER_BINDING, &curr_fbo); + if ((rsc->current_ctx->surface_fbo == (GLuint) curr_fbo) || + (rsc->current_ctx->current_sfc && + rsc->current_ctx->current_sfc->color_buf == (GLuint) curr_fbo)) + { + glBindFramebuffer(GL_FRAMEBUFFER, 0); + rsc->current_ctx->current_fbo = 0; + } } if (dbg) DBG("Calling make_current(NULL, NULL)"); @@ -2207,12 +2218,7 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx) if (sfc->color_buf) { - if (!sfc->pbuffer.fbo) - { - glGenFramebuffers(1, &sfc->pbuffer.fbo); - GLERRLOG(); - } - if (!_surface_buffers_fbo_set(sfc, sfc->pbuffer.fbo)) + if (!_surface_buffers_fbo_set(sfc, sfc->color_buf)) ERR("Could not detach current FBO"); } diff --git a/src/modules/evas/engines/gl_common/evas_gl_core_private.h b/src/modules/evas/engines/gl_common/evas_gl_core_private.h index 91242d8..4da0aa4 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_core_private.h +++ b/src/modules/evas/engines/gl_common/evas_gl_core_private.h @@ -133,7 +133,6 @@ struct _EVGL_Surface struct { EVGLNative_Surfacenative_surface; Evas_GL_Color_Format color_fmt; - GLuintfbo; Eina_Bool is_pbuffer : 1; } pbuffer; --
[EGIT] [core/efl] master 01/01: Evas GL: Fix direct rendering with client-side rotation
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4cf2d75715d6d9c3bc7f02a246997b0ca7a330cd commit 4cf2d75715d6d9c3bc7f02a246997b0ca7a330cd Author: Jean-Philippe Andre Date: Tue Dec 9 21:36:45 2014 +0900 Evas GL: Fix direct rendering with client-side rotation There was a problem when checking whether the current surface is compatible with direct rendering. In case of client-side rotation (it's a flag set on the surface by the app), a surface can be directly rendered even if the rotation is not 0. But, before this patch, it was assumed that the surface was current. Which doesn't make sense because make_current is called by the pixel callback, from the application, and this happens *after* we check for direct rendering. As a consequence, it was not possible to mix directly rendered surfaces with FBO-based ones, and use client-side rotation. This patch should solve that issue. --- src/lib/evas/canvas/evas_object_image.c| 20 +-- src/lib/evas/include/evas_private.h| 1 + src/modules/evas/engines/gl_common/evas_gl_core.c | 154 - src/modules/evas/engines/gl_common/evas_gl_core.h | 7 +- .../evas/engines/gl_common/evas_gl_core_private.h | 3 + src/modules/evas/engines/gl_generic/evas_engine.c | 26 +++- .../evas/engines/software_generic/evas_engine.c| 3 +- 7 files changed, 167 insertions(+), 47 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index fdd7161..ce03b71 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -2759,25 +2759,27 @@ evas_process_dirty_pixels(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, (ns->data.opengl.texture_id) && (!ns->data.opengl.framebuffer_id) ) { + Eina_Bool direct_renderable = EINA_FALSE; + // Check if we can do direct rendering... if (ENFN->gl_direct_override_get) ENFN->gl_direct_override_get(output, &direct_override, &direct_force_off); - if ( (((obj->cur->geometry.w == o->cur->image.w) && + if (ENFN->gl_surface_direct_renderable_get) + direct_renderable = ENFN->gl_surface_direct_renderable_get(output, ns); + + if ( ((direct_override) || + ((direct_renderable) && + (obj->cur->geometry.w == o->cur->image.w) && (obj->cur->geometry.h == o->cur->image.h) && (obj->cur->color.r == 255) && (obj->cur->color.g == 255) && (obj->cur->color.b == 255) && (obj->cur->color.a == 255) && - (!obj->map->cur.map)) || - (direct_override)) && -(!direct_force_off) ) + (!obj->map->cur.map)) + ) && (!direct_force_off) ) { - if (ENFN->gl_get_pixels_set) - { - ENFN->gl_get_pixels_set(output, o->pixels->func.get_pixels, o->pixels->func.get_pixels_data, eo_obj); - } - + ENFN->gl_get_pixels_set(output, o->pixels->func.get_pixels, o->pixels->func.get_pixels_data, eo_obj); o->direct_render = EINA_TRUE; } else diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index 4f057c9..c00cc50 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1273,6 +1273,7 @@ struct _Evas_Func void *(*gl_current_surface_get) (void *data); int (*gl_rotation_angle_get) (void *data); Eina_Bool (*gl_surface_query) (void *data, void *surface, int attr, void *value); + Eina_Bool (*gl_surface_direct_renderable_get) (void *data, Evas_Native_Surface *ns); int (*image_load_error_get) (void *data, void *image); int (*font_run_end_get) (void *data, Evas_Font_Set *font, Evas_Font_Instance **script_fi, Evas_Font_Instance **cur_fi, Evas_Script_Type script, const Eina_Unicode *text, int run_len); diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c b/src/modules/evas/engines/gl_common/evas_gl_core.c index c0d7a2b..9d58f02 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_core.c +++ b/src/modules/evas/engines/gl_common/evas_gl_core.c @@ -,7 +,7 @@ _internal_config_set(EVGL_Surface *sfc, Evas_GL_Config *cfg) // TODO:
[EGIT] [core/efl] master 01/01: Evas: Stop installing Evas_Engine_Stuff.h
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=df3958bb892b313ab91b9f0bd5a84452bb62388c commit df3958bb892b313ab91b9f0bd5a84452bb62388c Author: Jean-Philippe Andre Date: Wed Dec 10 20:26:55 2014 +0900 Evas: Stop installing Evas_Engine_Stuff.h Those really are internals shared between ecore and evas. Considering ecore & evas are just part of EFL, and expedite now doesn't even rely on these headers anymore, we can safely remove them from the dist packages. This will allow us to break this seemingly internal API/ABI. --- src/Makefile_Evas.am | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index a625ec6..1badc41 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -505,8 +505,10 @@ modules_evas_engines_software_generic_module_la_LDFLAGS = -module @EFL_LTMODULE_ modules_evas_engines_software_generic_module_la_LIBTOOLFLAGS = --tag=disable-static endif +dist_noinst_DATA = + if BUILD_ENGINE_BUFFER -dist_installed_evasmainheaders_DATA += modules/evas/engines/buffer/Evas_Engine_Buffer.h +dist_noinst_DATA += modules/evas/engines/buffer/Evas_Engine_Buffer.h BUFFER_SOURCES = \ modules/evas/engines/buffer/evas_engine.c \ modules/evas/engines/buffer/evas_outbuf.c \ @@ -529,7 +531,7 @@ endif endif if BUILD_ENGINE_FB -dist_installed_evasmainheaders_DATA += modules/evas/engines/fb/Evas_Engine_FB.h +dist_noinst_DATA += modules/evas/engines/fb/Evas_Engine_FB.h FB_SOURCES = \ modules/evas/engines/fb/evas_engine.c \ modules/evas/engines/fb/evas_fb_main.c \ @@ -740,7 +742,7 @@ endif endif if BUILD_ENGINE_GL_COCOA -dist_installed_evasmainheaders_DATA += modules/evas/engines/gl_cocoa/Evas_Engine_GL_Cocoa.h +dist_noinst_DATA += modules/evas/engines/gl_cocoa/Evas_Engine_GL_Cocoa.h GL_COCOA_SOURCES = \ modules/evas/engines/gl_cocoa/evas_engine.c \ modules/evas/engines/gl_cocoa/evas_gl_cocoa_main.m \ @@ -778,7 +780,7 @@ endif endif if BUILD_ENGINE_GL_SDL -dist_installed_evasmainheaders_DATA += modules/evas/engines/gl_sdl/Evas_Engine_GL_SDL.h +dist_noinst_DATA += modules/evas/engines/gl_sdl/Evas_Engine_GL_SDL.h GL_SDL_SOURCES = \ modules/evas/engines/gl_sdl/evas_engine.c \ modules/evas/engines/gl_sdl/evas_engine.h @@ -809,7 +811,7 @@ endif endif if BUILD_ENGINE_GL_X11 -dist_installed_evasmainheaders_DATA += modules/evas/engines/gl_x11/Evas_Engine_GL_X11.h +dist_noinst_DATA += modules/evas/engines/gl_x11/Evas_Engine_GL_X11.h GL_X11_SOURCES = \ modules/evas/engines/gl_x11/evas_engine.c \ modules/evas/engines/gl_x11/evas_x_main.c \ @@ -842,7 +844,7 @@ endif endif if BUILD_ENGINE_PSL1GHT -dist_installed_evasmainheaders_DATA += modules/evas/engines/psl1ght/Evas_Engine_PSL1GHT.h +dist_noinst_DATA += modules/evas/engines/psl1ght/Evas_Engine_PSL1GHT.h PSL1GHT_SOURCES = \ modules/evas/engines/psl1ght/evas_engine.c \ modules/evas/engines/psl1ght/rsxutil.c \ @@ -871,7 +873,7 @@ endif endif if BUILD_ENGINE_SOFTWARE_DDRAW -dist_installed_evasmainheaders_DATA += modules/evas/engines/software_ddraw/Evas_Engine_Software_DDraw.h +dist_noinst_DATA += modules/evas/engines/software_ddraw/Evas_Engine_Software_DDraw.h SOFTWARE_DDRAW_SOURCES = \ modules/evas/engines/software_ddraw/evas_engine.c \ modules/evas/engines/software_ddraw/evas_outbuf.c \ @@ -903,7 +905,7 @@ endif endif if BUILD_ENGINE_SOFTWARE_GDI -dist_installed_evasmainheaders_DATA += modules/evas/engines/software_gdi/Evas_Engine_Software_Gdi.h +dist_noinst_DATA += modules/evas/engines/software_gdi/Evas_Engine_Software_Gdi.h SOFTWARE_GDI_SOURCES = \ modules/evas/engines/software_gdi/evas_engine.c \ modules/evas/engines/software_gdi/evas_outbuf.c \ @@ -933,7 +935,7 @@ endif endif if BUILD_ENGINE_SOFTWARE_X11 -dist_installed_evasmainheaders_DATA += modules/evas/engines/software_x11/Evas_Engine_Software_X11.h +dist_noinst_DATA += modules/evas/engines/software_x11/Evas_Engine_Software_X11.h SOFTWARE_X11_SOURCES = \ modules/evas/engines/software_x11/evas_engine.c \ modules/evas/engines/software_x11/evas_engine.h \ @@ -991,7 +993,7 @@ endif endif if BUILD_ENGINE_WAYLAND_EGL -dist_installed_evasmainheaders_DATA += modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h +dist_noinst_DATA += modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h WAYLAND_EGL_SOURCES = \ modules/evas/engines/wayland_egl/evas_engine.c \ modules/evas/engines/wayland_egl/evas_wl_main.c \ @@ -1020,7 +1022,7 @@ endif endif if BUILD_ENGINE_WAYLAND_SHM -dist_installed_evasmainheaders_DATA += modules/evas/engines/wayland_shm/Evas_Engine_Wayland_Shm.h +dist_noinst_DATA += modules/evas/engines/wayland_shm/Evas_Engine_Wayland_Shm.h WAYLAND_SHM_SOURCES = \ modules/evas/engines/wayland_shm/Evas_Engine_Wayland_Shm.h \ modules/evas/engines/wayland_shm/evas_engine.c \ @@ -1052,7 +1054,7 @@ endif endif if BUILD_ENGINE_DRM -dist_installed_evasmainhead
Re: [E-devel] [EGIT] [core/efl] master 01/01: Evas: Stop installing Evas_Engine_Stuff.h
Hi, On Thu, Dec 11, 2014 at 9:04 PM, Simon wrote: > I presume this is breaking my enlightenment build atm, > > https://build.opensuse.org/package/live_build_log/X11:Enlightenment:Nightly/enlightenment/openSUSE_13.2/x86_64 > > efl, elementary and enlightenment were all built from tars created with > make dist > Right... looks like I should have been a bit more careful here :) Thanks Chris for the quick revert. I guess if we want to be able to break API/ABI of those structs in the future, this will need versioning or something like that. Tricky since the header is a magic number generated by rand(). Fyi the reason I want to break ABI is loosely related to T1437 (I wanted to add gl information to the struct). > > > Cheers > Simon > > On 12/11/2014 04:05 PM, Jean-Philippe ANDRÉ wrote: > > jpeg pushed a commit to branch master. > > > > > http://git.enlightenment.org/core/efl.git/commit/?id=df3958bb892b313ab91b9f0bd5a84452bb62388c > > > > commit df3958bb892b313ab91b9f0bd5a84452bb62388c > > Author: Jean-Philippe Andre > > Date: Wed Dec 10 20:26:55 2014 +0900 > > > > Evas: Stop installing Evas_Engine_Stuff.h > > > > Those really are internals shared between ecore and evas. > > Considering ecore & evas are just part of EFL, and expedite > > now doesn't even rely on these headers anymore, we can safely > > remove them from the dist packages. > > > > This will allow us to break this seemingly internal API/ABI. > > --- > > src/Makefile_Evas.am | 28 +++- > > 1 file changed, 15 insertions(+), 13 deletions(-) > > > > diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am > > index a625ec6..1badc41 100644 > > --- a/src/Makefile_Evas.am > > +++ b/src/Makefile_Evas.am > > @@ -505,8 +505,10 @@ > modules_evas_engines_software_generic_module_la_LDFLAGS = -module > @EFL_LTMODULE_ > > modules_evas_engines_software_generic_module_la_LIBTOOLFLAGS = > --tag=disable-static > > endif > > > > +dist_noinst_DATA = > > + > > if BUILD_ENGINE_BUFFER > > -dist_installed_evasmainheaders_DATA += > modules/evas/engines/buffer/Evas_Engine_Buffer.h > > +dist_noinst_DATA += modules/evas/engines/buffer/Evas_Engine_Buffer.h > > BUFFER_SOURCES = \ > > modules/evas/engines/buffer/evas_engine.c \ > > modules/evas/engines/buffer/evas_outbuf.c \ > > @@ -529,7 +531,7 @@ endif > > endif > > > > if BUILD_ENGINE_FB > > -dist_installed_evasmainheaders_DATA += > modules/evas/engines/fb/Evas_Engine_FB.h > > +dist_noinst_DATA += modules/evas/engines/fb/Evas_Engine_FB.h > > FB_SOURCES = \ > > modules/evas/engines/fb/evas_engine.c \ > > modules/evas/engines/fb/evas_fb_main.c \ > > @@ -740,7 +742,7 @@ endif > > endif > > > > if BUILD_ENGINE_GL_COCOA > > -dist_installed_evasmainheaders_DATA += > modules/evas/engines/gl_cocoa/Evas_Engine_GL_Cocoa.h > > +dist_noinst_DATA += modules/evas/engines/gl_cocoa/Evas_Engine_GL_Cocoa.h > > GL_COCOA_SOURCES = \ > > modules/evas/engines/gl_cocoa/evas_engine.c \ > > modules/evas/engines/gl_cocoa/evas_gl_cocoa_main.m \ > > @@ -778,7 +780,7 @@ endif > > endif > > > > if BUILD_ENGINE_GL_SDL > > -dist_installed_evasmainheaders_DATA += > modules/evas/engines/gl_sdl/Evas_Engine_GL_SDL.h > > +dist_noinst_DATA += modules/evas/engines/gl_sdl/Evas_Engine_GL_SDL.h > > GL_SDL_SOURCES = \ > > modules/evas/engines/gl_sdl/evas_engine.c \ > > modules/evas/engines/gl_sdl/evas_engine.h > > @@ -809,7 +811,7 @@ endif > > endif > > > > if BUILD_ENGINE_GL_X11 > > -dist_installed_evasmainheaders_DATA += > modules/evas/engines/gl_x11/Evas_Engine_GL_X11.h > > +dist_noinst_DATA += modules/evas/engines/gl_x11/Evas_Engine_GL_X11.h > > GL_X11_SOURCES = \ > > modules/evas/engines/gl_x11/evas_engine.c \ > > modules/evas/engines/gl_x11/evas_x_main.c \ > > @@ -842,7 +844,7 @@ endif > > endif > > > > if BUILD_ENGINE_PSL1GHT > > -dist_installed_evasmainheaders_DATA += > modules/evas/engines/psl1ght/Evas_Engine_PSL1GHT.h > > +dist_noinst_DATA += modules/evas/engines/psl1ght/Evas_Engine_PSL1GHT.h > > PSL1GHT_SOURCES = \ > > modules/evas/engines/psl1ght/evas_engine.c \ > > modules/evas/engines/psl1ght/rsxutil.c \ > > @@ -871,7 +873,7 @@ endif > > endif > > > > if BUILD_ENGINE_SOFTWARE_DDRAW > > -dist_installed_evasmainheaders_DATA += > modules/evas/engines/software_ddraw/Evas_Engine_Software_DDraw.h > > +dist_noinst_DATA += &g
Re: [E-devel] [EGIT] [core/enlightenment] master 01/01: Revert "Randr: Fix null dereference." This reverts commit 4aef218d28ed66e80d882f052c704d92d11c3c81.
ot, > > >> output->xid > > >> >{ > > >> > if (!crtc->outputs) > > >> > goto done; > > >> >} > > >> > crtc = NULL; > > >> > > > >> > - /* grab the root window */ > > >> > - root = ecore_x_window_root_first_get(); > > >> > - > > >> > /* get a list of possible crtcs for this output */ > > >> > possible = ecore_x_randr_output_possible_crtcs_get(root, > > >> output->xid, &num); > > >> > if (num == 0) goto error; > > >> > @@ -1093,20 +1124,21 @@ _e_randr_output_crtc_find(E_Randr_Output > *output) > > >> > goto done; > > >> > } > > >> >} > > >> > + crtc = NULL; > > >> > > > >> > -error: > > >> > +done: > > >> > free(possible); > > >> > free(modes); > > >> > > > >> > - output->crtc = NULL; > > >> > - return; > > >> > + output->crtc = crtc; > > >> > + return output->crtc; > > >> > > > >> > -done: > > >> > +error: > > >> > free(possible); > > >> > free(modes); > > >> > > > >> > - output->crtcid = crtc->xid; > > >> > - output->crtc = crtc; > > >> > + output->crtc = NULL; > > >> > + return output->crtc; > > >> > } > > >> > > > >> > static void > > >> > @@ -1226,6 +1258,8 @@ _e_randr_crtc_from_outputs_set(E_Randr_Crtc > *crtc) > > >> > > > >> > EINA_LIST_FOREACH(crtc->outputs, l, output) > > >> >{ > > >> > +if (!output->active) continue; > > >> > +if (output->status != > > >> ECORE_X_RANDR_CONNECTION_STATUS_CONNECTED) continue; > > >> > printf("RRR: output: '%s' lid: %i active: %i status: > > >> %i\n", output->name, output->is_lid, output->active, output->status); > > >> > /* TODO: Match all connected outputs, not only the first > */ > > >> > crtc->mode = output->mode; > > >> > @@ -1283,32 +1317,60 @@ > _e_randr_output_mode_valid(Ecore_X_Randr_Mode > > >> mode, Ecore_X_Randr_Mode *modes, i > > >> > static void > > >> > _e_randr_output_active_set(E_Randr_Output *output, Eina_Bool > active) > > >> > { > > >> > + E_Randr_Crtc *crtc; > > >> > + Ecore_X_Window root = 0; > > >> > + > > >> > printf("RR: _e_randr_output_active_set... [%s] %i %i\n", > > >> output->name, output->active, active); > > >> > + output->active = active; > > >> > > > >> > - if (!output->crtc) > > >> > + root = ecore_x_window_root_first_get(); > > >> > + printf("RR: ecore_x_randr_output_crtc_get %x = %x\n", > output->xid, > > >> ecore_x_randr_output_crtc_get(root, output->xid)); > > >> > + crtc = _e_randr_crtc_find(ecore_x_randr_output_crtc_get(root, > > >> output->xid)); > > >> > + if (!crtc) > > >> >{ > > >> > -_e_randr_output_crtc_find(output); > > >> > +crtc = _e_randr_output_crtc_find(output); > > >> > +if (!crtc) crtc = output->crtc; > > >> > +if (!crtc) > > >> > + { > > >> > + Eina_List *l; > > >> > + E_Randr_Crtc *crtc2; > > >> > + > > >> > + EINA_LIST_FOREACH(e_randr->crtcs, l, crtc2) > > >> > + { > > >> > + printf("RR: ... looking at %x, outputs = %p\n", > > >> crtc2->xid, crtc2->outputs); > > >> > + if (!crtc2->outputs) break; > > >> > + else > > >> > +{ > > >> > + if (!crtc2->mode) break; > > >> > +} > > >> > + crtc2 = NULL; > > >> > + } > > >> > + if (crtc2) crtc = crtc2; > > >> > + } > > >> > +printf("RR: ... output crtc2 = %p\n", crtc); > > >> > +if (crtc) printf("RR: ... id = %x\n", crtc->xid); > > >> >} > > >> > - if (output->crtc) > > >> > + if (crtc) > > >> >{ > > >> > -output->active = active; > > >> > printf("RR: ... found crtc %i\n", active); > > >> > if (active) > > >> > { > > >> > - output->crtc->outputs = > > >> > -eina_list_append(output->crtc->outputs, output); > > >> > + crtc->outputs = > > >> > +eina_list_append(crtc->outputs, output); > > >> > + output->crtc = crtc; > > >> >e_randr->active++; > > >> >printf("RR: ... add active output for crtc now\n"); > > >> > } > > >> > else > > >> > { > > >> > - output->crtc->outputs = > > >> > -eina_list_remove(output->crtc->outputs, output); > > >> > - e_randr->active--; > > >> > + crtc->outputs = > > >> > +eina_list_remove(crtc->outputs, output); > > >> >output->crtc = NULL; > > >> > + e_randr->active--; > > >> >printf("RR: ... remove output for crtc now\n"); > > >> > } > > >> >} > > >> > + else output->crtc = NULL; > > >> > printf("RR: _e_randr_output_active_set... done - %p\n", > > >> output->crtc); > > >> > } > > >> > > > >> > diff --git a/src/bin/e_randr.h b/src/bin/e_randr.h > > >> > index 30e355d..654a7e4 100644 > > >> > --- a/src/bin/e_randr.h > > >> > +++ b/src/bin/e_randr.h > > >> > @@ -55,7 +55,6 @@ struct _E_Randr_Output > > >> > > > >> > E_Config_Randr_Output *cfg; > > >> > E_Randr_Crtc *crtc; > > >> > - Ecore_X_Randr_Crtc crtcid; > > >> > }; > > >> > > > >> > struct _E_Randr_Crtc > > >> > diff --git a/src/modules/systray/e_mod_notifier_host.c > > >> b/src/modules/systray/e_mod_notifier_host.c > > >> > index f227cad..95b4938 100644 > > >> > --- a/src/modules/systray/e_mod_notifier_host.c > > >> > +++ b/src/modules/systray/e_mod_notifier_host.c > > >> > @@ -138,7 +138,7 @@ _item_submenu_new(E_DBusMenu_Item *item, > E_Menu_Item > > >> *mi) > > >> > { > > >> >e_menu_item_label_set(submi, child->label); > > >> >e_menu_item_callback_set(submi, _sub_item_clicked_cb, > > >> child); > > >> > - //if (!child->enabled) > e_menu_item_disabled_set(submi, 1); > > >> > + if (!child->enabled) e_menu_item_disabled_set(submi, > 1); > > >> >if (child->toggle_type == > > >> E_DBUSMENU_ITEM_TOGGLE_TYPE_CHECKMARK) > > >> > e_menu_item_check_set(submi, 1); > > >> >else if (child->toggle_type == > > >> E_DBUSMENU_ITEM_TOGGLE_TYPE_RADIO) > > >> > > > >> > > >> > > >> > > >> > -- > > >> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > > >> from Actuate! Instantly Supercharge Your Business Reports and > Dashboards > > >> with Interactivity, Sharing, Native Excel Exports, App Integration & > more > > >> Get technology previously reserved for billion-dollar corporations, > FREE > > >> > > >> > http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk > > >> ___ > > >> enlightenment-devel mailing list > > >> enlightenment-devel@lists.sourceforge.net > > >> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > > >> > > > > -- > > > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > > > from Actuate! Instantly Supercharge Your Business Reports and > Dashboards > > > with Interactivity, Sharing, Native Excel Exports, App Integration & > more > > > Get technology previously reserved for billion-dollar corporations, > FREE > > > > http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk > > > ___ > > > enlightenment-devel mailing list > > > enlightenment-devel@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > > > > > -- > > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > > with Interactivity, Sharing, Native Excel Exports, App Integration & more > > Get technology previously reserved for billion-dollar corporations, FREE > > > http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk > > ___ > > enlightenment-devel mailing list > > enlightenment-devel@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > > > > > -- > - Codito, ergo sum - "I code, therefore I am" -- > The Rasterman (Carsten Haitzler)ras...@rasterman.com > > > > -- > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > > http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk > ___ > enlightenment-devel mailing list > enlightenment-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > > -- Jean-Philippe André -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[EGIT] [core/efl] master 01/02: Evas GL: Add a warning in gl_x11 about MSAA & RGBA for GLES1
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3572b3bf3d19b0d0b5e2d27e5abfe4bba35511cc commit 3572b3bf3d19b0d0b5e2d27e5abfe4bba35511cc Author: Jean-Philippe Andre Date: Fri Dec 19 17:36:14 2014 +0900 Evas GL: Add a warning in gl_x11 about MSAA & RGBA for GLES1 We've discovered some bugs on some drivers related to MSAA and RGBA blending. Dunno yet if the same problem can affect GLES2 as well. --- src/modules/evas/engines/gl_x11/evas_engine.c | 31 ++- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c index 0ed2018..7effa53 100644 --- a/src/modules/evas/engines/gl_x11/evas_engine.c +++ b/src/modules/evas/engines/gl_x11/evas_engine.c @@ -914,7 +914,7 @@ evgl_eng_gles1_surface_create(EVGL_Engine *evgl EINA_UNUSED, void *data, #ifdef GL_GLES EGLSurface egl_sfc; EGLConfig egl_cfg; - int i, num = 0; + int i, num = 0, best = 0; EGLConfig configs[200]; int config_attrs[40]; Eina_Bool found = EINA_FALSE; @@ -924,12 +924,24 @@ evgl_eng_gles1_surface_create(EVGL_Engine *evgl EINA_UNUSED, void *data, /* Now we need to iterate over all EGL configurations to check the compatible * ones and finally check their visual ID. */ + if ((cfg->depth_bits > EVAS_GL_DEPTH_NONE) && + (cfg->depth_bits <= EVAS_GL_DEPTH_BIT_32)) + depth = 8 * ((int) cfg->depth_bits); + + if ((cfg->stencil_bits > EVAS_GL_STENCIL_NONE) && + (cfg->stencil_bits <= EVAS_GL_STENCIL_BIT_16)) + stencil = 1 << ((int) cfg->stencil_bits - 1); + + if ((cfg->multisample_bits > EVAS_GL_MULTISAMPLE_NONE) && + (cfg->multisample_bits <= EVAS_GL_MULTISAMPLE_HIGH)) + msaa = evgl->caps.msaa_samples[(int) cfg->multisample_bits - 1]; + i = 0; config_attrs[i++] = EGL_SURFACE_TYPE; config_attrs[i++] = EGL_PIXMAP_BIT; config_attrs[i++] = EGL_RENDERABLE_TYPE; config_attrs[i++] = EGL_OPENGL_ES_BIT; - if (cfg->color_format == EVAS_GL_RGBA_) + if (alpha) { config_attrs[i++] = EGL_ALPHA_SIZE; config_attrs[i++] = 1; // should it be 8? @@ -940,24 +952,21 @@ evgl_eng_gles1_surface_create(EVGL_Engine *evgl EINA_UNUSED, void *data, config_attrs[i++] = EGL_ALPHA_SIZE; config_attrs[i++] = 0; } - if ((cfg->depth_bits > EVAS_GL_DEPTH_NONE) && - (cfg->depth_bits <= EVAS_GL_DEPTH_BIT_32)) + if (depth) { depth = 8 * ((int) cfg->depth_bits); config_attrs[i++] = EGL_DEPTH_SIZE; config_attrs[i++] = depth; DBG("Requesting depth buffer size %d", depth); } - if ((cfg->stencil_bits > EVAS_GL_STENCIL_NONE) && - (cfg->stencil_bits <= EVAS_GL_STENCIL_BIT_16)) + if (stencil) { stencil = 1 << ((int) cfg->stencil_bits - 1); config_attrs[i++] = EGL_STENCIL_SIZE; config_attrs[i++] = stencil; DBG("Requesting stencil buffer size %d", stencil); } - if ((cfg->multisample_bits > EVAS_GL_MULTISAMPLE_NONE) && - (cfg->multisample_bits <= EVAS_GL_MULTISAMPLE_HIGH)) + if (msaa) { msaa = evgl->caps.msaa_samples[(int) cfg->multisample_bits - 1]; config_attrs[i++] = EGL_SAMPLE_BUFFERS; @@ -978,6 +987,7 @@ evgl_eng_gles1_surface_create(EVGL_Engine *evgl EINA_UNUSED, void *data, return NULL; } + DBG("Found %d potential configurations", num); for (i = 0; (i < num) && !found; i++) { EGLint val = 0; @@ -1003,6 +1013,7 @@ evgl_eng_gles1_surface_create(EVGL_Engine *evgl EINA_UNUSED, void *data, { if (xvi[j].depth >= colordepth) { + if (!best) best = i; if (alpha) { fmt = XRenderFindVisualFormat(eng_get_ob(re)->disp, xvi[j].visual); @@ -1026,9 +1037,9 @@ evgl_eng_gles1_surface_create(EVGL_Engine *evgl EINA_UNUSED, void *data, if (!found) { // This config will probably not work, but we try anyways. -ERR("XGetVisualInfo failed. Trying with the first EGL config."); +ERR("XGetVisualInfo failed. Trying with EGL config #%d", best); if (num) - egl_cfg = configs[0]; + egl_cfg = configs[best]; else egl_cfg = eng_get_ob(re)->egl_config; } --
[EGIT] [core/efl] master 02/02: Evas GL: Fix list of GLES 1.1 extensions
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8f6b34d4cced4abd422735c4ad82a48f02ed94d5 commit 8f6b34d4cced4abd422735c4ad82a48f02ed94d5 Author: Jean-Philippe Andre Date: Fri Dec 19 18:06:23 2014 +0900 Evas GL: Fix list of GLES 1.1 extensions We should use GLESv1 functions in a GLESv1 context to scan for GLESv1 extensions. Makes sense yeah? This should expose the proper list... especially enabling FBO extension when it's supported by the driver. --- src/modules/evas/engines/gl_common/evas_gl_api.c | 4 +- .../evas/engines/gl_common/evas_gl_api_ext.c | 208 ++--- .../evas/engines/gl_common/evas_gl_api_ext.h | 4 +- .../evas/engines/gl_common/evas_gl_api_gles1.c | 9 + src/modules/evas/engines/gl_common/evas_gl_core.c | 3 + .../evas/engines/gl_common/evas_gl_core_private.h | 2 + 6 files changed, 203 insertions(+), 27 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_api.c b/src/modules/evas/engines/gl_common/evas_gl_api.c index 6e04c92..72d85ec 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api.c @@ -723,8 +723,8 @@ _evgl_glGetString(GLenum name) #endif case GL_EXTENSIONS: -return (GLubyte *) evgl_api_ext_string_get - (EINA_TRUE, (rsc->current_ctx->version == EVAS_GL_GLES_1_X)); +// No need to check context version, this is GLESv2 API. +return (GLubyte *) evgl_api_ext_string_get(EINA_TRUE, EINA_FALSE); default: // GL_INVALID_ENUM is generated if name is not an accepted value. diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c index 206bd71..d6a3093 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c @@ -10,6 +10,11 @@ char _gl_ext_string[MAX_EXTENSION_STRING_BUFFER] = { 0 }; // list of exts by official name only like "GL_EXT_discard_framebuffer GL_EXT_multi_draw_arrays" char _gl_ext_string_official[MAX_EXTENSION_STRING_BUFFER] = { 0 }; +// list of gles 1.1 exts by official name +static char *_gles1_ext_string = NULL; + +typedef void (*_getproc_fn) (void); +typedef _getproc_fn (*fp_getproc)(const char *); #ifndef EGL_NATIVE_PIXMAP_KHR # define EGL_NATIVE_PIXMAP_KHR 0x30b0 @@ -24,7 +29,9 @@ char _gl_ext_string_official[MAX_EXTENSION_STRING_BUFFER] = { 0 }; #define _EVASGL_EXT_END() #define _EVASGL_EXT_DRVNAME(name) #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) -#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) ret (*glextsym_##name) param = NULL; +#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \ + ret (*gl_ext_sym_##name) param = NULL; \ + ret (*gles1_ext_sym_##name) param = NULL; #define _EVASGL_EXT_FUNCTION_END() #define _EVASGL_EXT_FUNCTION_DRVFUNC(name) #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name) @@ -48,7 +55,9 @@ char _gl_ext_string_official[MAX_EXTENSION_STRING_BUFFER] = { 0 }; / #define _EVASGL_EXT_CHECK_SUPPORT(name) #define _EVASGL_EXT_DISCARD_SUPPORT() -#define _EVASGL_EXT_BEGIN(name) int _gl_ext_support_##name = 0; +#define _EVASGL_EXT_BEGIN(name) \ + int _gl_ext_support_##name = 0; \ + int _gles1_ext_support_##name = 0; #define _EVASGL_EXT_END() #define _EVASGL_EXT_DRVNAME(name) #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) @@ -274,15 +283,13 @@ evgl_evasglQueryWaylandBuffer(Evas_GL *evas_gl EINA_UNUSED, #else #endif +// 0: not initialized, 1: GLESv2 initialized, 2: GLESv1 also initialized static int _evgl_api_ext_status = 0; Eina_Bool evgl_api_ext_init(void *getproc, const char *glueexts) { const char *glexts; - typedef void (*_getproc_fn) (void); - typedef _getproc_fn (*fp_getproc)(const char *); - fp_getproc gp = (fp_getproc)getproc; int _curext_supported = 0; @@ -299,15 +306,6 @@ evgl_api_ext_init(void *getproc, const char *glueexts) strncpy(_gl_ext_string_official, desktop_exts, MAX_EXTENSION_STRING_BUFFER); #endif - / - -#define FINDSYM(getproc, dst, sym) \ - if (getproc) { \ - if (!dst) dst = (__typeof__(dst))getproc(sym); \ - } else { \ - if (!dst) dst = (__typeof__(dst))dlsym(RTLD_DEFAULT, sym); \ - } - // GLES Extensions glexts = (const char*)glGetString(GL_EXTENSIONS); if (!glexts) @@ -356,7 +354,7 @@ re->info->info.screen); #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \ { \ -ret (**drvfunc)param = &glextsym_##name; +ret (**drvfunc)param = &gl_ext_sym_##name; #define _EVASGL_EXT_FUNCTION_END() \ if ((*drvfunc) == NULL) _EVASGL_EXT_DISCARD_SUPPORT(); \ @@ -446,13 +444,13 @@ re->info->info.screen); void evgl_api_ext_ge
[EGIT] [core/efl] master 01/01: Evas GL: Try harder to find a matching config for GLESv1
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=af43bc67e4a79b18343f7f8f55754b3eceaa48a3 commit af43bc67e4a79b18343f7f8f55754b3eceaa48a3 Author: Jean-Philippe Andre Date: Mon Dec 22 22:08:24 2014 +0900 Evas GL: Try harder to find a matching config for GLESv1 If MSAA was requested, it is very likely that no config was found (depending on the driver), so we'll try again without MSAA. Yeah, this might not look very smooth but it should be better that failing at eglMakeCurrent. --- src/modules/evas/engines/gl_x11/evas_engine.c | 30 --- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c index 7effa53..3721d31 100644 --- a/src/modules/evas/engines/gl_x11/evas_engine.c +++ b/src/modules/evas/engines/gl_x11/evas_engine.c @@ -914,12 +914,13 @@ evgl_eng_gles1_surface_create(EVGL_Engine *evgl EINA_UNUSED, void *data, #ifdef GL_GLES EGLSurface egl_sfc; EGLConfig egl_cfg; - int i, num = 0, best = 0; + int i, num = 0, best = -1; EGLConfig configs[200]; int config_attrs[40]; Eina_Bool found = EINA_FALSE; int msaa = 0, depth = 0, stencil = 0; Visual *visual = NULL; + Eina_Bool retried = EINA_FALSE; /* Now we need to iterate over all EGL configurations to check the compatible * ones and finally check their visual ID. */ @@ -936,6 +937,7 @@ evgl_eng_gles1_surface_create(EVGL_Engine *evgl EINA_UNUSED, void *data, (cfg->multisample_bits <= EVAS_GL_MULTISAMPLE_HIGH)) msaa = evgl->caps.msaa_samples[(int) cfg->multisample_bits - 1]; +try_again: i = 0; config_attrs[i++] = EGL_SURFACE_TYPE; config_attrs[i++] = EGL_PIXMAP_BIT; @@ -1013,7 +1015,7 @@ evgl_eng_gles1_surface_create(EVGL_Engine *evgl EINA_UNUSED, void *data, { if (xvi[j].depth >= colordepth) { - if (!best) best = i; + if (best < 0) best = i; if (alpha) { fmt = XRenderFindVisualFormat(eng_get_ob(re)->disp, xvi[j].visual); @@ -1036,12 +1038,26 @@ evgl_eng_gles1_surface_create(EVGL_Engine *evgl EINA_UNUSED, void *data, if (!found) { -// This config will probably not work, but we try anyways. -ERR("XGetVisualInfo failed. Trying with EGL config #%d", best); -if (num) - egl_cfg = configs[best]; +if (num && (best >= 0)) + { + ERR("No matching config found. Trying with EGL config #%d", best); + egl_cfg = configs[best]; + } +else if (msaa && !retried) + { + ERR("Trying again without MSAA."); + msaa = 0; + retried = EINA_TRUE; + goto try_again; + } else - egl_cfg = eng_get_ob(re)->egl_config; + { + // This config will probably not work, but we try anyways. + // NOTE: Maybe it would be safer to just return NULL here, leaving + // the app responsible for changing its config. + ERR("XGetVisualInfo failed. Trying with the window's EGL config."); + egl_cfg = eng_get_ob(re)->egl_config; + } } egl_sfc = eglCreatePixmapSurface(eng_get_ob(re)->egl_disp, egl_cfg, px, NULL); --
Re: [E-devel] PATCH: duplicated XDG_DATA_DIRS fix
Hi, Not sure how you got /usr/share to be duplicated, it is not the case here... On Wed, Dec 24, 2014 at 1:13 AM, Thanatermesis wrote: > If you run: > > echo $XDG_DATA_DIRS | tr ':' '\n' | sort > > you will see that you have a duplicated one > % echo $XDG_DATA_DIRS | tr ':' '\n' | sort /opt/e/share /opt/e/share/enlightenment /usr/local/share /usr/share > > So I did this commit http://pastebin.com/9BUnzrHu which works on both > e17 > and master branches, where it fixes the problem, as we can see in > https://www.enlightenment.org/ss/e-54998c1c35fdd0.34968942.jpg > > Lacking of time that somebody checks the commit before to do any push I > ended to pushing it only to my own remote (everybody on christmas? yeah i > should go too!) > > So... what do you think? I should push this commit? anything to change? > Did you have /usr as prefix for EFL but not for E? Also, you should remove 'p' in the first snprintf line :) So... is it really bad to have duplicates in XDG_DATA_DIRS? If it is, then something smarter than just checking for /usr should probably be implemented. Best regards, -- Jean-Philippe André -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] PATCH: duplicated XDG_DATA_DIRS fix
Hi, On Wed, Dec 31, 2014 at 3:04 AM, Davide Andreoli wrote: > 2014-12-30 16:57 GMT+01:00 Thanatermesis : > > > Back from some holidays (more or less) > > > > My previous patch was wrong, since strcmp returns the inverse of what I > > expected (zero if success), so this is the correct one: > > > > http://pastebin.com/xDj755cL > > > > Should I push it to master? > > > > This patch seems not the correct approach to me... why you don't add if the > prefix is /usr? > Because you are assuming /usr is the default on the user system? > > Also look at my $XDG_DATA_DIRS: > > /usr/local/share/enlightenment:/usr/local/share:/usr/local/share/:/usr/share/ > ... > > here /usr/local/share is added twice(with and without trailing slash), so > your patch will not solve my case. > > I think you should really check in another way :/ > Right, that was my suspicion, that assuming /usr was not the best idea. I guess maybe just strstr() over the the existing value so as to not prepend anything that's already there. Or prepend and remove the previous entry. Dunno. :) Best regards, > > > > > > > > > 2014-12-24 13:34 GMT+01:00 Thanatermesis : > > > > > > Not sure how you got /usr/share to be duplicated, it is not the case > > > here... > > > > > > That's exactly what my patch does :), as: > > > > > > > % echo $XDG_DATA_DIRS | tr ':' '\n' | sort > > > > /opt/e/share > > > > /opt/e/share/enlightenment > > > > /usr/local/share > > > > /usr/share > > > > > > for your case, since you don't have /usr as default prefix it doesn't > > bugs > > > to you, but /usr is the most common prefix, the bug happens only when > > the > > > default prefix is /usr, by adding it before is added statically (as > like > > in > > > your last line) > > > > > > > Also, you should remove 'p' in the first snprintf line :) > > > > > > right! corrected in another commit: http://pastebin.com/xrB51sXW > > > > > > > So... is it really bad to have duplicates in XDG_DATA_DIRS? > > > > > > first, .desktop files would appear in the wrong order (overwrite one by > > > other, priority listing of them), also it may probably increase twice > > > the amount of processed data (.desktop files scanning, which almost all > > are > > > in /usr/share), and there's also a small bug that icons changes from > one > > to > > > other very fastly when you do alt-tab, but i dont know from where this > > bug > > > comes from, it can be related :) > > > > > > > > > > > > 2014-12-24 2:16 GMT+01:00 Jean-Philippe André : > > > > > >> Hi, > > >> > > >> Not sure how you got /usr/share to be duplicated, it is not the case > > >> here... > > >> > > >> On Wed, Dec 24, 2014 at 1:13 AM, Thanatermesis < > > >> thanatermesis.e...@gmail.com > > >> > wrote: > > >> > > >> > If you run: > > >> > > > >> > echo $XDG_DATA_DIRS | tr ':' '\n' | sort > > >> > > > >> > you will see that you have a duplicated one > > >> > > > >> > > >> % echo $XDG_DATA_DIRS | tr ':' '\n' | sort > > >> /opt/e/share > > >> /opt/e/share/enlightenment > > >> /usr/local/share > > >> /usr/share > > >> > > >> > > >> > > > >> > So I did this commit http://pastebin.com/9BUnzrHu which works on > > both > > >> > e17 > > >> > and master branches, where it fixes the problem, as we can see in > > >> > https://www.enlightenment.org/ss/e-54998c1c35fdd0.34968942.jpg > > >> > > > >> > Lacking of time that somebody checks the commit before to do any > push > > I > > >> > ended to pushing it only to my own remote (everybody on christmas? > > yeah > > >> i > > >> > should go too!) > > >> > > > >> > So... what do you think? I should push this commit? anything to > > change? > > >> > > > >> > > >> > > >> Did you have /usr as prefix for EFL but not for E? > > >> Also, you should remove 'p' in the first snprintf line :) > > >> > > >> So... is it really
[EGIT] [core/efl] master 01/01: Evas fonts: Fix minor deviation in RLE font render
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a90876c337422d2da918152b048a0dc0965295d5 commit a90876c337422d2da918152b048a0dc0965295d5 Author: Jean-Philippe Andre Date: Tue Jan 6 19:15:07 2015 +0900 Evas fonts: Fix minor deviation in RLE font render So I've discovered some weird output values after drawing some text. The destination alpha would become 0xFE even when the back buffer had a background with 0xFF alpha. Example: Dest is 0xff00ff00 (green). Color is 0x (white). Current font alpha is 170 (0xaa). --> Output was 0xFEaaFEaa instead of 0xFFaaFFaa. This is because of some slightly invalid calculation when doing the font masking (mtab[v] = 0x55 above). Indeed, MUL_256 takes alpha values in the range [1-256] and not [0-256] as was assumed. --- src/lib/evas/common/evas_font_compress.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/evas/common/evas_font_compress.c b/src/lib/evas/common/evas_font_compress.c index 1cbd090..86babd9 100644 --- a/src/lib/evas/common/evas_font_compress.c +++ b/src/lib/evas/common/evas_font_compress.c @@ -488,7 +488,6 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, DATA32 *dst = dst_image->image.data; DATA32 coltab[16], col; DATA16 mtab[16], v; - DATA8 tmp; w = fgo->bitmap.width; h = fgo->bitmap.rows; // skip if totally clipped out @@ -533,8 +532,7 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, { v = (i << 4) | i; coltab[i] = MUL_SYM(v, col); - tmp = (coltab[i] >> 24); - mtab[i] = 256 - (tmp + (tmp >> 7)); + mtab[i] = 256 - (coltab[i] >> 24); } #ifdef BUILD_MMX if (evas_common_cpu_has_feature(CPU_FEATURE_MMX)) --
[EGIT] [core/efl] efl-1.12 01/01: Evas fonts: Fix minor deviation in RLE font render
cedric pushed a commit to branch efl-1.12. http://git.enlightenment.org/core/efl.git/commit/?id=1b862c14f134480c5090cec2033c53c4d969411d commit 1b862c14f134480c5090cec2033c53c4d969411d Author: Jean-Philippe Andre Date: Tue Jan 6 19:15:07 2015 +0900 Evas fonts: Fix minor deviation in RLE font render So I've discovered some weird output values after drawing some text. The destination alpha would become 0xFE even when the back buffer had a background with 0xFF alpha. Example: Dest is 0xff00ff00 (green). Color is 0x (white). Current font alpha is 170 (0xaa). --> Output was 0xFEaaFEaa instead of 0xFFaaFFaa. This is because of some slightly invalid calculation when doing the font masking (mtab[v] = 0x55 above). Indeed, MUL_256 takes alpha values in the range [1-256] and not [0-256] as was assumed. --- src/lib/evas/common/evas_font_compress.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/evas/common/evas_font_compress.c b/src/lib/evas/common/evas_font_compress.c index 1b8d631..f84824d 100644 --- a/src/lib/evas/common/evas_font_compress.c +++ b/src/lib/evas/common/evas_font_compress.c @@ -475,7 +475,6 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, DATA32 *dst = dst_image->image.data; DATA32 coltab[16], col; DATA16 mtab[16], v; - DATA8 tmp; w = fgo->bitmap.width; h = fgo->bitmap.rows; // skip if totally clipped out @@ -520,8 +519,7 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, { v = (i << 4) | i; coltab[i] = MUL_SYM(v, col); - tmp = (coltab[i] >> 24); - mtab[i] = 256 - (tmp + (tmp >> 7)); + mtab[i] = 256 - (coltab[i] >> 24); } #ifdef BUILD_MMX if (evas_common_cpu_has_feature(CPU_FEATURE_MMX)) --
[EGIT] [core/efl] efl-1.11 01/01: Evas fonts: Fix minor deviation in RLE font render
cedric pushed a commit to branch efl-1.11. http://git.enlightenment.org/core/efl.git/commit/?id=73d927498692c3563b0e1ad4e4506a581d4dd4b7 commit 73d927498692c3563b0e1ad4e4506a581d4dd4b7 Author: Jean-Philippe Andre Date: Tue Jan 6 19:15:07 2015 +0900 Evas fonts: Fix minor deviation in RLE font render So I've discovered some weird output values after drawing some text. The destination alpha would become 0xFE even when the back buffer had a background with 0xFF alpha. Example: Dest is 0xff00ff00 (green). Color is 0x (white). Current font alpha is 170 (0xaa). --> Output was 0xFEaaFEaa instead of 0xFFaaFFaa. This is because of some slightly invalid calculation when doing the font masking (mtab[v] = 0x55 above). Indeed, MUL_256 takes alpha values in the range [1-256] and not [0-256] as was assumed. --- src/lib/evas/common/evas_font_compress.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/evas/common/evas_font_compress.c b/src/lib/evas/common/evas_font_compress.c index 1b8d631..f84824d 100644 --- a/src/lib/evas/common/evas_font_compress.c +++ b/src/lib/evas/common/evas_font_compress.c @@ -475,7 +475,6 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, DATA32 *dst = dst_image->image.data; DATA32 coltab[16], col; DATA16 mtab[16], v; - DATA8 tmp; w = fgo->bitmap.width; h = fgo->bitmap.rows; // skip if totally clipped out @@ -520,8 +519,7 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, { v = (i << 4) | i; coltab[i] = MUL_SYM(v, col); - tmp = (coltab[i] >> 24); - mtab[i] = 256 - (tmp + (tmp >> 7)); + mtab[i] = 256 - (coltab[i] >> 24); } #ifdef BUILD_MMX if (evas_common_cpu_has_feature(CPU_FEATURE_MMX)) --
[EGIT] [core/efl] efl-1.10 01/01: Evas fonts: Fix minor deviation in RLE font render
cedric pushed a commit to branch efl-1.10. http://git.enlightenment.org/core/efl.git/commit/?id=58d65f2cc43b4208b67e29330f21ac0fe975edd2 commit 58d65f2cc43b4208b67e29330f21ac0fe975edd2 Author: Jean-Philippe Andre Date: Tue Jan 6 19:15:07 2015 +0900 Evas fonts: Fix minor deviation in RLE font render So I've discovered some weird output values after drawing some text. The destination alpha would become 0xFE even when the back buffer had a background with 0xFF alpha. Example: Dest is 0xff00ff00 (green). Color is 0x (white). Current font alpha is 170 (0xaa). --> Output was 0xFEaaFEaa instead of 0xFFaaFFaa. This is because of some slightly invalid calculation when doing the font masking (mtab[v] = 0x55 above). Indeed, MUL_256 takes alpha values in the range [1-256] and not [0-256] as was assumed. --- src/lib/evas/common/evas_font_compress.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/evas/common/evas_font_compress.c b/src/lib/evas/common/evas_font_compress.c index 1b8d631..f84824d 100644 --- a/src/lib/evas/common/evas_font_compress.c +++ b/src/lib/evas/common/evas_font_compress.c @@ -475,7 +475,6 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, DATA32 *dst = dst_image->image.data; DATA32 coltab[16], col; DATA16 mtab[16], v; - DATA8 tmp; w = fgo->bitmap.width; h = fgo->bitmap.rows; // skip if totally clipped out @@ -520,8 +519,7 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, { v = (i << 4) | i; coltab[i] = MUL_SYM(v, col); - tmp = (coltab[i] >> 24); - mtab[i] = 256 - (tmp + (tmp >> 7)); + mtab[i] = 256 - (coltab[i] >> 24); } #ifdef BUILD_MMX if (evas_common_cpu_has_feature(CPU_FEATURE_MMX)) --
[EGIT] [core/efl] efl-1.9 01/01: Evas fonts: Fix minor deviation in RLE font render
cedric pushed a commit to branch efl-1.9. http://git.enlightenment.org/core/efl.git/commit/?id=864c137471a45846764bc570067023a1d242d52c commit 864c137471a45846764bc570067023a1d242d52c Author: Jean-Philippe Andre Date: Tue Jan 6 19:15:07 2015 +0900 Evas fonts: Fix minor deviation in RLE font render So I've discovered some weird output values after drawing some text. The destination alpha would become 0xFE even when the back buffer had a background with 0xFF alpha. Example: Dest is 0xff00ff00 (green). Color is 0x (white). Current font alpha is 170 (0xaa). --> Output was 0xFEaaFEaa instead of 0xFFaaFFaa. This is because of some slightly invalid calculation when doing the font masking (mtab[v] = 0x55 above). Indeed, MUL_256 takes alpha values in the range [1-256] and not [0-256] as was assumed. --- src/lib/evas/common/evas_font_compress.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/evas/common/evas_font_compress.c b/src/lib/evas/common/evas_font_compress.c index 1c615f9..448716b 100644 --- a/src/lib/evas/common/evas_font_compress.c +++ b/src/lib/evas/common/evas_font_compress.c @@ -475,7 +475,6 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, DATA32 *dst = dst_image->image.data; DATA32 coltab[16], col; DATA16 mtab[16], v; - DATA8 tmp; w = fgo->bitmap.width; h = fgo->bitmap.rows; // skip if totally clipped out @@ -520,8 +519,7 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, { v = (i << 4) | i; coltab[i] = MUL_SYM(v, col); - tmp = (coltab[i] >> 24); - mtab[i] = 256 - (tmp + (tmp >> 7)); + mtab[i] = 256 - (coltab[i] >> 24); } #ifdef BUILD_MMX if (evas_common_cpu_has_feature(CPU_FEATURE_MMX)) --
Re: [E-devel] [EGIT] [core/efl] efl-1.9 01/01: Evas fonts: Fix minor deviation in RLE font render
Ah thanks for backporting, cedric. I should definitely have tagged this as @fix and backported :-/ On Tue, Jan 6, 2015 at 9:10 PM, Jean-Philippe ANDRÉ wrote: > cedric pushed a commit to branch efl-1.9. > > > http://git.enlightenment.org/core/efl.git/commit/?id=864c137471a45846764bc570067023a1d242d52c > > commit 864c137471a45846764bc570067023a1d242d52c > Author: Jean-Philippe Andre > Date: Tue Jan 6 19:15:07 2015 +0900 > > Evas fonts: Fix minor deviation in RLE font render > > So I've discovered some weird output values after drawing > some text. The destination alpha would become 0xFE even > when the back buffer had a background with 0xFF alpha. > > Example: > Dest is 0xff00ff00 (green). > Color is 0x (white). > Current font alpha is 170 (0xaa). > --> Output was 0xFEaaFEaa instead of 0xFFaaFFaa. > > This is because of some slightly invalid calculation > when doing the font masking (mtab[v] = 0x55 above). > > Indeed, MUL_256 takes alpha values in the range [1-256] > and not [0-256] as was assumed. > --- > src/lib/evas/common/evas_font_compress.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/src/lib/evas/common/evas_font_compress.c > b/src/lib/evas/common/evas_font_compress.c > index 1c615f9..448716b 100644 > --- a/src/lib/evas/common/evas_font_compress.c > +++ b/src/lib/evas/common/evas_font_compress.c > @@ -475,7 +475,6 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, > DATA32 *dst = dst_image->image.data; > DATA32 coltab[16], col; > DATA16 mtab[16], v; > - DATA8 tmp; > > w = fgo->bitmap.width; h = fgo->bitmap.rows; > // skip if totally clipped out > @@ -520,8 +519,7 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, >{ > v = (i << 4) | i; > coltab[i] = MUL_SYM(v, col); > - tmp = (coltab[i] >> 24); > - mtab[i] = 256 - (tmp + (tmp >> 7)); > + mtab[i] = 256 - (coltab[i] >> 24); >} > #ifdef BUILD_MMX > if (evas_common_cpu_has_feature(CPU_FEATURE_MMX)) > > -- > > > -- Jean-Philippe André -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[EGIT] [core/efl] master 01/01: tests: Remove file after Evas 3D save test
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a86f799542b8663a5a5e2f02ebc6b77efecdb29f commit a86f799542b8663a5a5e2f02ebc6b77efecdb29f Author: Jean-Philippe Andre Date: Wed Jan 7 15:01:00 2015 +0900 tests: Remove file after Evas 3D save test This should remove src/.eet and maybe src/.ply make distcheck would fail on my machine because src/.eet was not removed. --- src/tests/evas/evas_test_mesh.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/evas/evas_test_mesh.c b/src/tests/evas/evas_test_mesh.c index e510798..558dcfa 100644 --- a/src/tests/evas/evas_test_mesh.c +++ b/src/tests/evas/evas_test_mesh.c @@ -55,6 +55,7 @@ fail_if(res == 1); \ eo_del(mesh2); \ eo_del(mesh); \ +unlink(buffer); \ } static Evas_3D_Mesh_Frame * --
[EGIT] [core/efl] master 19/21: Evas masking: Fix invalid geometry after mask redraw
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f876cf31f8d6fd48f7602bd593c24c1a07138d8f commit f876cf31f8d6fd48f7602bd593c24c1a07138d8f Author: Jean-Philippe Andre Date: Tue Dec 23 18:57:45 2014 +0900 Evas masking: Fix invalid geometry after mask redraw The proper geometry should be set when rendering the mask, otherwise we can't create a new surface if it changed dimensions. --- src/lib/evas/canvas/evas_render.c | 4 src/modules/evas/engines/gl_common/evas_gl_font.c | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index 896a330..47f26cd 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -311,10 +311,6 @@ _evas_mask_redraw_set(Evas_Public_Data *e EINA_UNUSED, EINA_COW_WRITE_BEGIN(evas_object_mask_cow, obj->mask, Evas_Object_Mask_Data, mask) mask->redraw = EINA_TRUE; - mask->x = obj->cur->geometry.x; - mask->y = obj->cur->geometry.y; - mask->w = obj->cur->geometry.w; - mask->h = obj->cur->geometry.h; EINA_COW_WRITE_END(evas_object_mask_cow, obj->mask, mask); } diff --git a/src/modules/evas/engines/gl_common/evas_gl_font.c b/src/modules/evas/engines/gl_common/evas_gl_font.c index e43318a..773ac99 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_font.c +++ b/src/modules/evas/engines/gl_common/evas_gl_font.c @@ -68,7 +68,7 @@ evas_gl_font_texture_draw(void *context, void *surface EINA_UNUSED, void *draw_c int c, cx, cy, cw, ch; int i; int sx, sy, sw, sh; - double mmx, mmy, mmw, mmh; + double mmx = 0.0, mmy = 0.0, mmw = 0.0, mmh = 0.0; if (dc != gc->dc) return; tex = fg->ext_dat; --
[EGIT] [core/efl] master 17/21: Evas masking: Fix mask blend functions (SW engine)
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4bff14676ebe2ab981e9c10c2d6746cb3ec2737c commit 4bff14676ebe2ab981e9c10c2d6746cb3ec2737c Author: Jean-Philippe Andre Date: Mon Dec 22 20:29:27 2014 +0900 Evas masking: Fix mask blend functions (SW engine) The selected op func was not performing the correct operation, thus producing rendering artifacts. These functions should not be used anywhere except in case of masking... which was not an available option earlier. It was doing (wrong): dst = interp(mask, src, dst) Instead of (correct): dst = dst + (1 - mask) * src NOTE: This commit also disables MMX, SSE3 & NEON implementations of pixel_mask blend operations, since they are also broken. --- .../common/evas_op_blend/op_blend_master_sse3.c| 4 ++-- .../common/evas_op_blend/op_blend_pixel_mask_.c| 24 +- .../evas_op_blend/op_blend_pixel_mask_i386.c | 17 +++ .../evas_op_blend/op_blend_pixel_mask_neon.c | 9 .../evas_op_blend/op_blend_pixel_mask_sse3.c | 16 +++ src/lib/evas/common/evas_op_blend_main_.c | 4 ++-- 6 files changed, 43 insertions(+), 31 deletions(-) diff --git a/src/lib/evas/common/evas_op_blend/op_blend_master_sse3.c b/src/lib/evas/common/evas_op_blend/op_blend_master_sse3.c index 667838e..2947b8b 100644 --- a/src/lib/evas/common/evas_op_blend/op_blend_master_sse3.c +++ b/src/lib/evas/common/evas_op_blend/op_blend_master_sse3.c @@ -31,7 +31,7 @@ evas_common_op_blend_init_sse3(void) init_blend_pixel_span_funcs_sse3(); init_blend_pixel_color_span_funcs_sse3(); - init_blend_pixel_mask_span_funcs_sse3(); + init_blend_pixel_mask_span_funcs_sse3(); // FIXME init_blend_color_span_funcs_sse3(); init_blend_mask_color_span_funcs_sse3(); @@ -49,7 +49,7 @@ evas_common_op_blend_rel_init_sse3(void) #ifdef BUILD_SSE3 init_blend_rel_pixel_span_funcs_sse3(); init_blend_rel_pixel_color_span_funcs_sse3(); - init_blend_rel_pixel_mask_span_funcs_sse3(); + init_blend_rel_pixel_mask_span_funcs_sse3(); // FIXME init_blend_rel_color_span_funcs_sse3(); init_blend_rel_mask_color_span_funcs_sse3(); diff --git a/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_.c b/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_.c index 78ff716..2ac4f89 100644 --- a/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_.c +++ b/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_.c @@ -25,29 +25,7 @@ _op_blend_p_mas_dp(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) { }); } -static void -_op_blend_pas_mas_dp(DATA32 *s, DATA8 *m, DATA32 c EINA_UNUSED, DATA32 *d, int l) { - DATA32 *e; - int alpha; - UNROLL8_PLD_WHILE(d, l, e, - { -alpha = *m; -switch(alpha) - { - case 0: - break; - case 255: - *d = *s; - break; - default: - alpha++; - *d = INTERP_256(alpha, *s, *d); - break; - } -m++; s++; d++; - }); -} - +#define _op_blend_pas_mas_dp _op_blend_p_mas_dp #define _op_blend_pan_mas_dp _op_blend_pas_mas_dp #define _op_blend_p_mas_dpan _op_blend_p_mas_dp diff --git a/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_i386.c b/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_i386.c index 8c960d2..9494ce6 100644 --- a/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_i386.c +++ b/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_i386.c @@ -1,6 +1,10 @@ /* blend pixel x mask --> dst */ #ifdef BUILD_MMX + +// FIXME: These functions most likely don't perform the correct operation. +// Test them with masks and images. +#if 0 static void _op_blend_pas_mas_dp_mmx(DATA32 *s, DATA8 *m, DATA32 c EINA_UNUSED, DATA32 *d, int l) { DATA32 *e = d + l; @@ -62,8 +66,13 @@ _op_blend_pan_mas_dp_mmx(DATA32 *s, DATA8 *m, DATA32 c EINA_UNUSED, DATA32 *d, i m++; s++; d++; } } +#else +// FIXME +#define _op_blend_p_mas_dp_mmx NULL +#define _op_blend_pas_mas_dp_mmx _op_blend_p_mas_dp_mmx +#endif -#define _op_blend_p_mas_dp_mmx _op_blend_pas_mas_dp_mmx +#define _op_blend_pan_mas_dp_mmx _op_blend_pas_mas_dp_mmx #define _op_blend_p_mas_dpan_mmx _op_blend_p_mas_dp_mmx #define _op_blend_pan_mas_dpan_mmx _op_blend_pan_mas_dp_mmx @@ -128,9 +137,9 @@ init_blend_pixel_mask_pt_funcs_mmx(void) #ifdef BUILD_MMX -#define _op_blend_rel_p_mas_dpan_mmx _op_blend_p_mas_dpan_mmx -#define _op_blend_rel_pas_mas_dpan_mmx _op_blend_pas_mas_dpan_mmx -#define _op_blend_rel_pan_mas_dpan_mmx _op_blend_pan_mas_dpan_mmx +#define _op_blend_re
[EGIT] [core/efl] master 21/21: Evas masking: Add some test cases
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=21984b1d584abb66e3c575321117548655769097 commit 21984b1d584abb66e3c575321117548655769097 Author: Jean-Philippe Andre Date: Tue Jan 6 16:58:33 2015 +0900 Evas masking: Add some test cases Here are only 3 very basic test cases. One is a dumb set/get to check that image objects can be passed as clippers. The other one is a pixel verification test with extremely basic data (NEAREST scaling and just rectangles). It also compares text clipping and masking. The last one performs a very basic verification that masks of masks work. --- src/Makefile_Evas.am| 1 + src/tests/evas/evas_suite.c | 1 + src/tests/evas/evas_suite.h | 1 + src/tests/evas/evas_test_mask.c | 368 4 files changed, 371 insertions(+) diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index 4ff091c..1d8344f 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -1896,6 +1896,7 @@ tests/evas/evas_test_render_engines.c \ tests/evas/evas_test_filters.c \ tests/evas/evas_test_image.c \ tests/evas/evas_test_mesh.c \ +tests/evas/evas_test_mask.c \ tests/evas/evas_tests_helpers.h \ tests/evas/evas_suite.h diff --git a/src/tests/evas/evas_suite.c b/src/tests/evas/evas_suite.c index baa8ab8..5d37325 100644 --- a/src/tests/evas/evas_suite.c +++ b/src/tests/evas/evas_suite.c @@ -27,6 +27,7 @@ static const Evas_Test_Case etc[] = { { "Filters", evas_test_filters }, { "Images", evas_test_image_object }, { "Meshes", evas_test_mesh }, + { "Masking", evas_test_mask }, { NULL, NULL } }; diff --git a/src/tests/evas/evas_suite.h b/src/tests/evas/evas_suite.h index 4776508..645f758 100644 --- a/src/tests/evas/evas_suite.h +++ b/src/tests/evas/evas_suite.h @@ -12,5 +12,6 @@ void evas_test_render_engines(TCase *tc); void evas_test_filters(TCase *tc); void evas_test_image_object(TCase *tc); void evas_test_mesh(TCase *tc); +void evas_test_mask(TCase *tc); #endif /* _EVAS_SUITE_H */ diff --git a/src/tests/evas/evas_test_mask.c b/src/tests/evas/evas_test_mask.c new file mode 100644 index 000..1f05512 --- /dev/null +++ b/src/tests/evas/evas_test_mask.c @@ -0,0 +1,368 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef BUILD_ENGINE_BUFFER + +#include "evas_suite.h" +#include "Evas.h" +#include "Ecore_Evas.h" +#include "evas_tests_helpers.h" + +#define TEST_FONT_NAME "DejaVuSans,UnDotum" +#define TEST_FONT_SOURCE TESTS_SRC_DIR "/TestFont.eet" + +#define START_MASK_TEST(w, h) \ + Ecore_Evas *ee; Evas *e; \ + evas_init(); \ + ecore_evas_init(); \ + ee = ecore_evas_buffer_new(w, h); \ + ecore_evas_show(ee); \ + ecore_evas_manual_render_set(ee, EINA_TRUE); \ + e = ecore_evas_get(ee); \ + Eina_List *tofree = NULL; \ + do {} while (0) + +#define END_MASK_TEST() do { \ + Evas_Object *o; \ + EINA_LIST_FREE(tofree, o) { evas_object_del(o); } \ + ecore_evas_free(ee); \ + ecore_evas_shutdown(); \ + evas_shutdown(); \ + } while (0) + +#define AUTODEL(o) do { tofree = eina_list_prepend(tofree, o); } while (0) + +static int +_bgra_compare(unsigned int *data, unsigned int *ref, int w, int h) +{ + int i,j; + for (j = 0; j < h; j++) + { +#if 0 +printf("data: "); +for (i = 0; i < w; i++) printf("%#x ", data[i+j*w]); +printf("\nref: "); +for (i = 0; i < w; i++) printf("%#x ", ref[i+j*w]); +printf("\n\n"); +#endif +for (i = 0; i < w; i++) + if (data[i+j*w] != ref[i+j*w]) +{ + printf("Pixel %d differ: %#x vs. %#x\n", i+j*w, data[i+j*w], ref[i+j*w]); + fflush(stdout); + return 1; +} + } + return 0; +} + +// The usual useless unit test +START_TEST(evas_mask_test_setget) +{ + Evas *e = _setup_evas(); + Evas_Object *obj = NULL, *mask = NULL; + + obj = evas_object_text_add(e); + fail_if(evas_object_clip_get(obj) != NULL); + + mask = evas_object_image_filled_add(e); + evas_object_clip_set(obj, mask); + fail_if(evas_object_clip_get(obj) != mask); + + evas_object_clip_unset(obj); + fail_if(evas_object_clip_get(obj) != NULL); + + evas_object_del(mask); + evas_object_del(obj); + + evas_free(e); + evas_shutdown(); +} +END_TEST + +// This test is also very basic but will check the pixels +START_TEST(evas_mask_test_compare_clip) +{ + Evas_Object *obj, *mask, *rect, *bg, *clip, *text; + unsigned int *data, *refdata[3]; + const int W = 64; + const int H = 64; + int i, tw, th; + + static unsigned int mask_data[] = { + 0x, 0x, 0x, 0x, + 0x, 0x, 0x, 0x, + 0x, 0x, 0x, 0x, + 0x, 0x, 0x, 0x, + }; + + static unsigned int ref_data[2][16] = { + // blue masked with alpha 0xFF over gree
[EGIT] [core/efl] master 20/21: Evas masking: Minor fixes in GL masking
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=bb923d5586bc43aac7ab362da0b5991873bfab27 commit bb923d5586bc43aac7ab362da0b5991873bfab27 Author: Jean-Philippe Andre Date: Mon Jan 5 13:44:32 2015 +0900 Evas masking: Minor fixes in GL masking --- .../evas/engines/gl_common/evas_gl_common.h| 33 -- .../evas/engines/gl_common/evas_gl_context.c | 20 +++-- src/modules/evas/engines/gl_common/evas_gl_image.c | 16 ++- 3 files changed, 14 insertions(+), 55 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h b/src/modules/evas/engines/gl_common/evas_gl_common.h index 421bd14..456d42d 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_common.h +++ b/src/modules/evas/engines/gl_common/evas_gl_common.h @@ -630,39 +630,6 @@ struct _Evas_GL_Texture_Async_Preload Eina_Bool unpack_row_length; }; -#if 0 -extern Evas_GL_Program_Source shader_rect_frag_src; -extern Evas_GL_Program_Source shader_rect_vert_src; -extern Evas_GL_Program_Source shader_font_frag_src; -extern Evas_GL_Program_Source shader_font_vert_src; - -extern Evas_GL_Program_Source shader_img_frag_src; -extern Evas_GL_Program_Source shader_img_vert_src; -extern Evas_GL_Program_Source shader_img_nomul_frag_src; -extern Evas_GL_Program_Source shader_img_nomul_vert_src; -extern Evas_GL_Program_Source shader_img_bgra_frag_src; -extern Evas_GL_Program_Source shader_img_bgra_vert_src; -extern Evas_GL_Program_Source shader_img_bgra_nomul_frag_src; -extern Evas_GL_Program_Source shader_img_bgra_nomul_vert_src; -extern Evas_GL_Program_Source shader_img_mask_frag_src; -extern Evas_GL_Program_Source shader_img_mask_vert_src; - -extern Evas_GL_Program_Source shader_yuv_frag_src; -extern Evas_GL_Program_Source shader_yuv_vert_src; -extern Evas_GL_Program_Source shader_yuv_nomul_frag_src; -extern Evas_GL_Program_Source shader_yuv_nomul_vert_src; - -extern Evas_GL_Program_Source shader_yuy2_frag_src; -extern Evas_GL_Program_Source shader_yuy2_vert_src; -extern Evas_GL_Program_Source shader_yuy2_nomul_frag_src; -extern Evas_GL_Program_Source shader_yuy2_nomul_vert_src; - -extern Evas_GL_Program_Source shader_tex_frag_src; -extern Evas_GL_Program_Source shader_tex_vert_src; -extern Evas_GL_Program_Source shader_tex_nomul_frag_src; -extern Evas_GL_Program_Source shader_tex_nomul_vert_src; -#endif - /* GL_Common function that are used by gl_generic inherited module */ EAPI void evas_gl_common_image_all_unload(Evas_Engine_GL_Context *gc); EAPI void evas_gl_common_image_ref(Evas_GL_Image *im); diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c b/src/modules/evas/engines/gl_common/evas_gl_context.c index 2adc874..7141920 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_context.c +++ b/src/modules/evas/engines/gl_common/evas_gl_context.c @@ -1414,6 +1414,7 @@ static int _evas_gl_common_context_push(int rtype, Evas_Engine_GL_Context *gc, Evas_GL_Texture *tex, + Evas_GL_Texture *texm, GLuint prog, int x, int y, int w, int h, Eina_Bool blend, @@ -1442,6 +1443,7 @@ _evas_gl_common_context_push(int rtype, { if ((gc->pipe[i].region.type == rtype) && (!tex || gc->pipe[i].shader.cur_tex == current_tex) + && (!texm || gc->pipe[i].shader.cur_texm == texm->pt->texture) && (gc->pipe[i].shader.cur_prog == prog) && (gc->pipe[i].shader.smooth == smooth) && (gc->pipe[i].shader.blend == blend) @@ -1519,6 +1521,8 @@ evas_gl_common_context_line_push(Evas_Engine_GL_Context *gc, GLuint prog = gc->shared->shader[SHADER_RECT].prog; int pn = 0, i; + // FIXME: Line masking is not implemented + if (!(gc->dc->render_op == EVAS_RENDER_COPY) && (a < 255)) blend = EINA_TRUE; @@ -1910,7 +1914,7 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc, } pn = _evas_gl_common_context_push(RTYPE_IMAGE, - gc, tex, + gc, tex, mtex, prog, x, y, w, h, blend, @@ -1981,7 +1985,7 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc, PUSH_TEXSAM(pn, samx, samy); PUSH_TEXSAM(pn, samx, samy); PUSH_TEXSAM(pn, samx, samy); - + PUSH_TEXSAM(pn, samx, samy); PUSH_TEXSAM(pn, samx, samy); PUSH_TEXSAM(pn, samx, samy); @@ -2011,7 +2015,7 @@ evas_gl_common_context_font_push(Evas_Engine_GL_Context *gc, prog = gc->shared->shader[SHADER_FONT_MASK].prog; pn = _evas_gl_common_context_push(RTYPE_FONT, - gc, tex, +
[EGIT] [core/efl] master 11/21: Evas masking: Font masking for GL
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=1fac1dcf5730981fe4054efffdea05b18c3fb17e commit 1fac1dcf5730981fe4054efffdea05b18c3fb17e Author: Jean-Philippe Andre Date: Tue Nov 25 14:34:42 2014 +0900 Evas masking: Font masking for GL --- src/Makefile_Evas.am | 2 + .../evas/engines/gl_common/evas_gl_common.h| 7 ++ .../evas/engines/gl_common/evas_gl_context.c | 103 + src/modules/evas/engines/gl_common/evas_gl_font.c | 37 .../evas/engines/gl_common/shader/evas_gl_enum.x | 1 + .../engines/gl_common/shader/evas_gl_shaders.x | 59 +++- .../engines/gl_common/shader/font_mask_frag.shd| 17 .../engines/gl_common/shader/font_mask_vert.shd| 19 src/modules/evas/engines/gl_generic/evas_engine.c | 58 9 files changed, 299 insertions(+), 4 deletions(-) diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index 6208b66..a2f7431 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -599,6 +599,8 @@ modules/evas/engines/gl_common/evas_gl_3d_shader.c GL_SHADERS_GEN = \ modules/evas/engines/gl_common/shader/font_frag.shd \ modules/evas/engines/gl_common/shader/font_vert.shd \ +modules/evas/engines/gl_common/shader/font_mask_frag.shd \ +modules/evas/engines/gl_common/shader/font_mask_vert.shd \ modules/evas/engines/gl_common/shader/img_12_bgra_frag.shd \ modules/evas/engines/gl_common/shader/img_12_bgra_nomul_frag.shd \ modules/evas/engines/gl_common/shader/img_12_bgra_nomul_vert.shd \ diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h b/src/modules/evas/engines/gl_common/evas_gl_common.h index eda2b8b..c314e4d 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_common.h +++ b/src/modules/evas/engines/gl_common/evas_gl_common.h @@ -729,6 +729,13 @@ void evas_gl_common_context_font_push(Evas_Engine_GL_Context *gc, double sx, double sy, double sw, double sh, int x, int y, int w, int h, int r, int g, int b, int a); +void evas_gl_common_context_masked_font_push(Evas_Engine_GL_Context *gc, + Evas_GL_Texture *tex, + double sx, double sy, double sw, double sh, + int x, int y, int w, int h, + int r, int g, int b, int a, + Evas_GL_Texture *texa, + int mx, int my, int mw, int mh); void evas_gl_common_context_yuv_push(Evas_Engine_GL_Context *gc, Evas_GL_Texture *tex, double sx, double sy, double sw, double sh, diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c b/src/modules/evas/engines/gl_common/evas_gl_context.c index 08ccbb6..abe448e 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_context.c +++ b/src/modules/evas/engines/gl_common/evas_gl_context.c @@ -856,6 +856,9 @@ evas_gl_common_context_new(void) SHADER_TEXTURE_ADD(shared, IMG_MASK_NOMUL, tex); SHADER_TEXTURE_ADD(shared, IMG_MASK_NOMUL, texa); +SHADER_TEXTURE_ADD(shared, FONT_MASK, tex); +SHADER_TEXTURE_ADD(shared, FONT_MASK, texa); + if (gc->state.current.cur_prog == PRG_INVALID) glUseProgram(shared->shader[0].prog); else glUseProgram(gc->state.current.cur_prog); @@ -1900,6 +1903,106 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc, } void +evas_gl_common_context_masked_font_push(Evas_Engine_GL_Context *gc, +Evas_GL_Texture *tex, +double sx, double sy, double sw, double sh, +int x, int y, int w, int h, +int r, int g, int b, int a, +Evas_GL_Texture *texa, +int mx, int my, int mw, int mh) +{ + int pnum, nv, nc, nu, na, i; + GLfloat tx1, tx2, ty1, ty2, t2x1, t2x2, t2y1, t2y2; + GLuint prog = gc->shared->shader[SHADER_FONT_MASK].prog; + int pn = 0; + + pn = _evas_gl_common_context_push(RTYPE_FONT, + gc, tex, + prog, + x, y, w, h, + 1, + 0, + 0, 0, 0, 0, 0); + + gc->pipe[pn].region.type = RTYPE_FONT; + gc->pipe[pn].shader.cur_tex = tex->pt->texture; +
[EGIT] [core/efl] master 10/21: Evas masking: Implement image masking for GL engines
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=124ab102b7b3f5a2696fca5f797ce2001122c9a5 commit 124ab102b7b3f5a2696fca5f797ce2001122c9a5 Author: Jean-Philippe Andre Date: Mon Nov 24 20:24:25 2014 +0900 Evas masking: Implement image masking for GL engines --- src/Makefile_Evas.am | 7 +- .../evas/engines/gl_common/evas_gl_common.h| 9 ++ .../evas/engines/gl_common/evas_gl_context.c | 110 - src/modules/evas/engines/gl_common/evas_gl_image.c | 94 -- .../evas/engines/gl_common/shader/evas_gl_enum.x | 2 + .../engines/gl_common/shader/evas_gl_shaders.x | 100 +++ .../engines/gl_common/shader/img_mask_frag.shd | 18 .../gl_common/shader/img_mask_nomul_frag.shd | 17 .../gl_common/shader/img_mask_nomul_vert.shd | 16 +++ .../engines/gl_common/shader/img_mask_vert.shd | 19 10 files changed, 383 insertions(+), 9 deletions(-) diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index 272033d..6208b66 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -680,7 +680,12 @@ modules/evas/engines/gl_common/shader/yuv_vert.shd \ modules/evas/engines/gl_common/shader/yuy2_frag.shd \ modules/evas/engines/gl_common/shader/yuy2_nomul_frag.shd \ modules/evas/engines/gl_common/shader/yuy2_nomul_vert.shd \ -modules/evas/engines/gl_common/shader/yuy2_vert.shd +modules/evas/engines/gl_common/shader/yuy2_vert.shd \ +modules/evas/engines/gl_common/shader/img_mask_frag.shd \ +modules/evas/engines/gl_common/shader/img_mask_vert.shd \ +modules/evas/engines/gl_common/shader/img_mask_nomul_frag.shd \ +modules/evas/engines/gl_common/shader/img_mask_nomul_vert.shd \ +$(NULL) EXTRA_DIST += \ modules/evas/engines/gl_common/shader/gen_shaders.sh \ diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h b/src/modules/evas/engines/gl_common/evas_gl_common.h index 87ea366..eda2b8b 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_common.h +++ b/src/modules/evas/engines/gl_common/evas_gl_common.h @@ -762,6 +762,15 @@ void evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *g Eina_Bool smooth, Eina_Bool tex_only, Evas_Colorspace cspace); +void evas_gl_common_context_masked_image_push(Evas_Engine_GL_Context *gc, + Evas_GL_Texture *tex, + Evas_GL_Texture *mask_tex, + double sx, double sy, + double sw, double sh, + int x, int y, int w, int h, + int mx, int my, int mw, int mh, + int r, int g, int b, int a, + Eina_Bool smooth, Eina_Bool tex_only); int evas_gl_common_shader_program_init(Evas_GL_Shared *shared); void evas_gl_common_shader_program_init_done(void); diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c b/src/modules/evas/engines/gl_common/evas_gl_context.c index 32f10b8..08ccbb6 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_context.c +++ b/src/modules/evas/engines/gl_common/evas_gl_context.c @@ -851,6 +851,11 @@ evas_gl_common_context_new(void) SHADER_TEXTURE_ADD(shared, RGB_A_PAIR_NOMUL, tex); SHADER_TEXTURE_ADD(shared, RGB_A_PAIR_NOMUL, texa); +SHADER_TEXTURE_ADD(shared, IMG_MASK, tex); +SHADER_TEXTURE_ADD(shared, IMG_MASK, texa); +SHADER_TEXTURE_ADD(shared, IMG_MASK_NOMUL, tex); +SHADER_TEXTURE_ADD(shared, IMG_MASK_NOMUL, texa); + if (gc->state.current.cur_prog == PRG_INVALID) glUseProgram(shared->shader[0].prog); else glUseProgram(gc->state.current.cur_prog); @@ -2645,6 +2650,109 @@ evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc, } } +void +evas_gl_common_context_masked_image_push(Evas_Engine_GL_Context *gc, + Evas_GL_Texture *tex, + Evas_GL_Texture *mask_tex, + double sx, double sy, + double sw, double sh, + int x, int y, int w, int h, + int mx, int my, int mw, int mh, + int r, int g, int b, int a, + Eina_Bool smooth, Eina_Bool tex_only) +{ + // FIXME: How to implemen
[EGIT] [core/efl] master 18/21: Evas masking: Fix another set of rendering artifacts
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=592068108bdb2e08ef9229d2617818b9260a8526 commit 592068108bdb2e08ef9229d2617818b9260a8526 Author: Jean-Philippe Andre Date: Mon Dec 22 21:46:14 2014 +0900 Evas masking: Fix another set of rendering artifacts --- src/lib/evas/common/evas_scale_sample.c | 11 --- src/lib/evas/common/evas_scale_smooth_scaler_down.c | 8 ++-- src/lib/evas/common/evas_scale_smooth_scaler_up.c | 8 ++-- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/lib/evas/common/evas_scale_sample.c b/src/lib/evas/common/evas_scale_sample.c index 86b02d8..c888aa7 100644 --- a/src/lib/evas/common/evas_scale_sample.c +++ b/src/lib/evas/common/evas_scale_sample.c @@ -208,9 +208,13 @@ evas_common_scale_rgba_sample_draw(RGBA_Image *src, RGBA_Image *dst, int dst_cli } else { -func = evas_common_gfx_func_composite_pixel_mask_span_get(src->cache_entry.flags.alpha, src->cache_entry.flags.alpha_sparse, dst->cache_entry.flags.alpha, dst_clip_w, render_op); if (mul_col != 0x) - func2 = evas_common_gfx_func_composite_pixel_color_span_get(src->cache_entry.flags.alpha, src->cache_entry.flags.alpha_sparse, mul_col, dst->cache_entry.flags.alpha, dst_clip_w, render_op); + { + func = evas_common_gfx_func_composite_pixel_mask_span_get(src->cache_entry.flags.alpha, src->cache_entry.flags.alpha_sparse, dst->cache_entry.flags.alpha, dst_clip_w, render_op); + func2 = evas_common_gfx_func_composite_pixel_color_span_get(src->cache_entry.flags.alpha, src->cache_entry.flags.alpha_sparse, mul_col, dst->cache_entry.flags.alpha, dst_clip_w, EVAS_RENDER_COPY); + } +else + func = evas_common_gfx_func_composite_pixel_mask_span_get(src->cache_entry.flags.alpha, src->cache_entry.flags.alpha_sparse, dst->cache_entry.flags.alpha, dst_clip_w, render_op); } if ((dst_region_w == src_region_w) && (dst_region_h == src_region_h)) @@ -291,7 +295,8 @@ evas_common_scale_rgba_sample_draw(RGBA_Image *src, RGBA_Image *dst, int dst_cli } /* * blend here [clip_w *] buf -> dptr * */ - if (mul_col != 0x) func2(buf, NULL, mul_col, buf, dst_clip_w); + if (mul_col != 0x) +func2(buf, NULL, mul_col, buf, dst_clip_w); func(buf, mask, 0, dptr, dst_clip_w); dptr += dst_w; diff --git a/src/lib/evas/common/evas_scale_smooth_scaler_down.c b/src/lib/evas/common/evas_scale_smooth_scaler_down.c index 9d0bae3..9da3b0c 100644 --- a/src/lib/evas/common/evas_scale_smooth_scaler_down.c +++ b/src/lib/evas/common/evas_scale_smooth_scaler_down.c @@ -27,9 +27,13 @@ } else { -func = evas_common_gfx_func_composite_pixel_mask_span_get(src->cache_entry.flags.alpha, src->cache_entry.flags.alpha_sparse, dst->cache_entry.flags.alpha, dst_clip_w, render_op); if (mul_col != 0x) - func2 = evas_common_gfx_func_composite_pixel_color_span_get(src->cache_entry.flags.alpha, src->cache_entry.flags.alpha_sparse, mul_col, dst->cache_entry.flags.alpha, dst_clip_w, render_op); + { + func = evas_common_gfx_func_composite_pixel_mask_span_get(src->cache_entry.flags.alpha, src->cache_entry.flags.alpha_sparse, dst->cache_entry.flags.alpha, dst_clip_w, render_op); + func2 = evas_common_gfx_func_composite_pixel_color_span_get(src->cache_entry.flags.alpha, src->cache_entry.flags.alpha_sparse, mul_col, dst->cache_entry.flags.alpha, dst_clip_w, EVAS_RENDER_COPY); + } +else + func = evas_common_gfx_func_composite_pixel_mask_span_get(src->cache_entry.flags.alpha, src->cache_entry.flags.alpha_sparse, dst->cache_entry.flags.alpha, dst_clip_w, render_op); } /* scaling down vertically */ diff --git a/src/lib/evas/common/evas_scale_smooth_scaler_up.c b/src/lib/evas/common/evas_scale_smooth_scaler_up.c index 56060f8..3f1 100644 --- a/src/lib/evas/common/evas_scale_smooth_scaler_up.c +++ b/src/lib/evas/common/evas_scale_smooth_scaler_up.c @@ -43,9 +43,13 @@ } else { - func = evas_common_gfx_func_composite_pixel_mask_span_get(src->cache_entry.flags.alpha, src->cache_entry.flags.alpha_sparse, dst->cache_entry.flags.alpha, dst_clip_w, render_op); if (mul_col != 0x) - func2 = evas_common_gfx_func_composite_pixel_color_span_get(src->cache_entry.flags.alpha, src->cache_entry.flags.alpha_sparse, mul_col, dst->cache_entry.flags.alpha, dst_clip_w, render_op); + { + func = evas_common_gfx_func_composite_pixel_mask_span_get(src->cache_entry.flags.alpha, src->cache_entry.flags.alpha_sparse, dst->cache_entry.flags.alpha, dst_clip_w, render_op); + func2 = eva
[EGIT] [core/efl] master 02/21: Evas masking: Add clip_image_[un]set functions to draw context
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a9630a77b656ebf7e246296530de70852abf52d5 commit a9630a77b656ebf7e246296530de70852abf52d5 Author: Jean-Philippe Andre Date: Thu Nov 13 10:31:41 2014 +0900 Evas masking: Add clip_image_[un]set functions to draw context This allows passing a mask image to the render functions. @feature --- src/lib/evas/filters/evas_filter.c | 9 +++ src/lib/evas/filters/evas_filter_private.h | 2 + src/lib/evas/include/evas_private.h| 3 + .../evas/engines/software_generic/evas_engine.c| 72 +- 4 files changed, 83 insertions(+), 3 deletions(-) diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c index 3991f93..f7eba26 100644 --- a/src/lib/evas/filters/evas_filter.c +++ b/src/lib/evas/filters/evas_filter.c @@ -1537,6 +1537,9 @@ evas_filter_target_set(Evas_Filter_Context *ctx, void *draw_context, ctx->target.b == 255 && ctx->target.a == 255) ctx->target.color_use = EINA_FALSE; + ENFN->context_clip_image_get + (ENDT, draw_context, &ctx->target.mask, &ctx->target.mask_x, &ctx->target.mask_y); + if (ctx->gl_engine) { // Since GL has sync rendering, draw_context is safe to keep around @@ -1621,6 +1624,12 @@ _filter_target_render(Evas_Filter_Context *ctx) ENFN->context_multiplier_unset(ENDT, drawctx); } + if (ctx->target.mask) + ENFN->context_clip_image_set(ENDT, drawctx, + ctx->target.mask, ctx->target.mask_x, ctx->target.mask_y); + else + ENFN->context_clip_image_unset(ENDT, drawctx); + ENFN->image_draw(ENDT, drawctx, surface, image, 0, 0, src->w, src->h, ctx->target.x, ctx->target.y, src->w, src->h, diff --git a/src/lib/evas/filters/evas_filter_private.h b/src/lib/evas/filters/evas_filter_private.h index 6e0a799..c613be7 100644 --- a/src/lib/evas/filters/evas_filter_private.h +++ b/src/lib/evas/filters/evas_filter_private.h @@ -101,6 +101,8 @@ struct _Evas_Filter_Context int x, y; int cx, cy, cw, ch; // clip int r, g, b, a; // clip color + void *mask; // mask + int mask_x, mask_y; // mask offset Eina_Bool clip_use : 1; Eina_Bool color_use : 1; } target; diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index af4a325..bd61ee4 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1155,6 +1155,9 @@ struct _Evas_Func Eina_Bool (*canvas_alpha_get) (void *data, void *context); void (*context_free)(void *data, void *context); void (*context_clip_set)(void *data, void *context, int x, int y, int w, int h); + void (*context_clip_image_set) (void *data, void *context, void *surface, int x, int y); + void (*context_clip_image_unset)(void *data, void *context); + void (*context_clip_image_get) (void *data, void *context, void **surface, int *x, int *y); void (*context_clip_clip) (void *data, void *context, int x, int y, int w, int h); void (*context_clip_unset) (void *data, void *context); int (*context_clip_get)(void *data, void *context, int *x, int *y, int *w, int *h); diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c index 673924c..92272cd 100644 --- a/src/modules/evas/engines/software_generic/evas_engine.c +++ b/src/modules/evas/engines/software_generic/evas_engine.c @@ -417,6 +417,60 @@ eng_context_clip_set(void *data EINA_UNUSED, void *context, int x, int y, int w, } static void +eng_context_clip_image_unset(void *data EINA_UNUSED, void *context) +{ + RGBA_Draw_Context *ctx = context; + + if (ctx->clip.mask) + { +Image_Entry *ie = ctx->clip.mask; +#ifdef EVAS_CSERVE2 +if (evas_cserve2_use_get()) + evas_cache2_image_close(ie); +else +#endif + evas_cache_image_drop(ie); +// Is the above code safe? Hmmm... +//evas_unref_queue_image_put(EVAS???, &ctx->clip.ie->cache_entry); +ctx->clip.mask = NULL; + } +} + +static void +eng_context_clip_image_set(void *data EINA_UNUSED, void *context, void *surface, int x, int y) +{ + RGBA_Draw_Context *ctx = context; + + if (ctx->clip.mask && ctx->clip.mask != surface) + eng_context_clip_image_unset(data, context); + + ctx->clip.mask = surface; + ctx->clip.mask_x = x; + ctx->clip.mask_y = y; + + if (surface) + { +Image_Entry *ie = surface; +#ifdef EVAS_CSERVE2 +if (evas_cserve2_use_get()) + evas_cache2_image_ref(ie); +else +#endif + evas_cache_image_ref(ie); + } +} + +static void +eng_context_clip_image_get(void *data EINA_UNUSED, void *c