[EGIT] [core/elementary] master 01/01: elm_test: Fix bug in GLView test
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=8db552511bb7fb7db52b88a490d8e53cfc370703 commit 8db552511bb7fb7db52b88a490d8e53cfc370703 Author: Jean-Philippe AndreDate: Wed Oct 14 18:00:24 2015 +0900 elm_test: Fix bug in GLView test Scenario: const char * accel = accel_get(); accel_set("gl:depth"); Now accel may not be valid anymore since the original Eina_Stringshare might have been destroyed. So there was no point in saving the const char * pointer. It was not valid after the call to set(). This is a bit confusing here. Returning char* would be clear: the caller would own the data. --- src/bin/test_glview.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/test_glview.c b/src/bin/test_glview.c index ceaf7cc..31c76cf 100644 --- a/src/bin/test_glview.c +++ b/src/bin/test_glview.c @@ -624,7 +624,7 @@ test_glview(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in gldata_init(gld); // add a Z-depth buffer to the window and try to use GL - accel = elm_config_accel_preference_get(); + accel = eina_stringshare_add(elm_config_accel_preference_get()); elm_config_accel_preference_set("gl:depth"); // new window - do the usual and give it a name, title and delete handler @@ -633,6 +633,7 @@ test_glview(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in // restore previous accel preference elm_config_accel_preference_set(accel); + eina_stringshare_del(accel); bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); --
[EGIT] [core/efl] master 02/06: Evas GL: Minor changes inside glGetString
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ec7111938c80a28671793f586f62df1e02b39ec9 commit ec7111938c80a28671793f586f62df1e02b39ec9 Author: Jean-Philippe AndreDate: Wed Oct 14 17:27:23 2015 +0900 Evas GL: Minor changes inside glGetString --- src/modules/evas/engines/gl_common/evas_gl_api.c | 22 +- 1 file changed, 13 insertions(+), 9 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 f91fc35..a97204e 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api.c @@ -657,7 +657,7 @@ _evgl_glGetString(GLenum name) static char _version[128] = {0}; static char _glsl[128] = {0}; EVGL_Resource *rsc; - const GLubyte *ret; + const char *ret; /* We wrap two values here: * @@ -678,6 +678,10 @@ _evgl_glGetString(GLenum name) * --> crash moved to app side if they blindly call strstr() */ + /* NOTE: Please modify software_generic/evas_engine.c as well if you change +* this function! +*/ + if ((!(rsc = _evgl_tls_resource_get())) || !rsc->current_ctx) { ERR("Current context is NULL, not calling glGetString"); @@ -694,17 +698,17 @@ _evgl_glGetString(GLenum name) break; case GL_SHADING_LANGUAGE_VERSION: -ret = glGetString(GL_SHADING_LANGUAGE_VERSION); +ret = (const char *) glGetString(GL_SHADING_LANGUAGE_VERSION); if (!ret) return NULL; #ifdef GL_GLES -if (ret[18] != (GLubyte) '1') +if (ret[18] != '1') { // We try not to remove the vendor fluff - snprintf(_glsl, sizeof(_glsl), "OpenGL ES GLSL ES 1.00 Evas GL (%s)", ((char *) ret) + 18); + snprintf(_glsl, sizeof(_glsl), "OpenGL ES GLSL ES 1.00 Evas GL (%s)", ret + 18); _glsl[sizeof(_glsl) - 1] = '\0'; return (const GLubyte *) _glsl; } -return ret; +return (const GLubyte *) 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); @@ -713,17 +717,17 @@ _evgl_glGetString(GLenum name) #endif case GL_VERSION: -ret = glGetString(GL_VERSION); +ret = (const char *) glGetString(GL_VERSION); if (!ret) return NULL; #ifdef GL_GLES -if ((ret[10] != (GLubyte) '2') && (ret[10] != (GLubyte) '3')) +if ((ret[10] != '2') && (ret[10] != '3')) { // We try not to remove the vendor fluff - snprintf(_version, sizeof(_version), "OpenGL ES 2.0 Evas GL (%s)", ((char *) ret) + 10); + snprintf(_version, sizeof(_version), "OpenGL ES 2.0 Evas GL (%s)", ret + 10); _version[sizeof(_version) - 1] = '\0'; return (const GLubyte *) _version; } -return ret; +return (const GLubyte *) ret; #else // Desktop GL, we still keep the official name snprintf(_version, sizeof(_version), "OpenGL ES 2.0 Evas GL (%s)", (char *) ret); --
[EGIT] [core/efl] master 04/06: Evas GL: Add a test case for Evas GL (make check)
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=93298d6dc2360ef91009ef88a76e3cb0336c0235 commit 93298d6dc2360ef91009ef88a76e3cb0336c0235 Author: Jean-Philippe AndreDate: Wed Oct 14 17:30:25 2015 +0900 Evas GL: Add a test case for Evas GL (make check) For now this only covers SOME of Evas GL's functions. It will try to run with opengl_x11 and buffer (OSMesa). It'll also try to fail silently if the engine initialization failed, or if OSMesa could not be found. If the engines work, then Evas GL must work properly. --- src/Makefile_Evas.am | 1 + src/tests/evas/evas_suite.c | 1 + src/tests/evas/evas_suite.h | 1 + src/tests/evas/evas_test_evasgl.c | 250 ++ 4 files changed, 253 insertions(+) diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index 71cd597..0e08495 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -2127,6 +2127,7 @@ 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_test_evasgl.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 7b087bb..242215f 100644 --- a/src/tests/evas/evas_suite.c +++ b/src/tests/evas/evas_suite.c @@ -28,6 +28,7 @@ static const Evas_Test_Case etc[] = { { "Images", evas_test_image_object }, { "Meshes", evas_test_mesh }, { "Masking", evas_test_mask }, + { "Evas GL", evas_test_evasgl }, { NULL, NULL } }; diff --git a/src/tests/evas/evas_suite.h b/src/tests/evas/evas_suite.h index 645f758..574bdc2 100644 --- a/src/tests/evas/evas_suite.h +++ b/src/tests/evas/evas_suite.h @@ -13,5 +13,6 @@ 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); +void evas_test_evasgl(TCase *tc); #endif /* _EVAS_SUITE_H */ diff --git a/src/tests/evas/evas_test_evasgl.c b/src/tests/evas/evas_test_evasgl.c new file mode 100644 index 000..af840b5 --- /dev/null +++ b/src/tests/evas/evas_test_evasgl.c @@ -0,0 +1,250 @@ +/* Test Evas GL EAPIs. + * + * This will try with opengl_x11 and buffer (OSMesa) and silently fail if + * the engine or the GL library can't be initialized. This is to test Evas GL + * APIs when they can actually work, ie. when OSMesa exists or when the engine + * is GL. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include + +#define EFL_GFX_FILTER_BETA +#include "evas_suite.h" +#include "Evas.h" +#include "Evas_GL.h" +#include "Ecore_Evas.h" + +static int +_detect_osmesa(void) +{ + /* assume that if libOSMesa.so links, then we can create an Evas GL */ + void *lib = dlopen("libOSMesa.so", RTLD_NOW); + if (!lib) + { +printf("Could not find OSMesa! Skipping Evas GL tests.\n"); +return 0; + } + dlclose(lib); + return 1; +} + +#define START_EVASGL_TEST(engine, options) \ + Ecore_Evas *ee; Evas *evas; Evas_Object *im = NULL; \ + if (!strcmp(engine, "buffer") && !_detect_osmesa()) return; \ + putenv("EVAS_GL_API_DEBUG=1"); \ + evas_init(); \ + ecore_evas_init(); \ + ee = ecore_evas_new(engine, 0, 0, 1, 1, options); \ + if (!ee) { printf("Could not create ecore evas. Skipping Evas GL tests.\n"); \ + goto init_failed; } \ + ecore_evas_show(ee); \ + ecore_evas_manual_render_set(ee, EINA_TRUE); \ + evas = ecore_evas_get(ee); \ + im = evas_object_image_filled_add(evas); \ + evas_object_geometry_set(im, 0, 0, 1, 1); \ + evas_object_show(im); \ + ecore_evas_manual_render(ee); \ + do {} while (0) + +#define END_EVASGL_TEST() \ + init_failed: \ + evas_object_del(im); \ + ecore_evas_free(ee); \ + ecore_evas_shutdown(); \ + evas_shutdown(); \ + do {} while (0) + +static void +_test_evasgl_init(const char *engine, const char *options) +{ + START_EVASGL_TEST(engine, options); + Evas_GL_Context *ctx; + Evas_GL_Surface *sfc; + Evas_GL_Config *cfg; + Evas_GL_API *gl; + Evas_GL *evgl; + + fail_if(!(evgl = evas_gl_new(evas))); + fail_if(!(cfg = evas_gl_config_new())); + fail_if(!(sfc = evas_gl_surface_create(evgl, cfg, 1, 1))); + fail_if(!(ctx = evas_gl_context_create(evgl, NULL))); + + /* valid current states */ + fail_if(!evas_gl_make_current(evgl, sfc, ctx)); + fail_if(!evas_gl_make_current(evgl, NULL, NULL)); + fail_if(!evas_gl_make_current(evgl, NULL, ctx)); + + /* no context but surface: invalid */ + fprintf(stderr, " IGNORE ERRORS BEGIN \n"); + fail_if(evas_gl_make_current(evgl, sfc, NULL) != EINA_FALSE); + fprintf(stderr, " IGNORE ERRORS END \n"); + + /* API verification */ + fail_if(!(gl = evas_gl_api_get(evgl))); + + fail_if(!evas_gl_make_current(evgl, NULL, NULL)); +
[EGIT] [core/efl] master 01/03: Evas render: Fix proxy source_clip logic inversion
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=7b266b55188ebac499d70ffceb3b8c802bcdfbd0 commit 7b266b55188ebac499d70ffceb3b8c802bcdfbd0 Author: Jean-Philippe AndreDate: Tue Oct 13 20:33:57 2015 +0900 Evas render: Fix proxy source_clip logic inversion As spotted by @FurryMyad I inverted the logic for source_clip. This should restore the proper behaviour while keeping my previous fixes working. See D2940. --- src/lib/evas/canvas/evas_render.c| 20 +--- .../evas/engines/software_generic/evas_engine.c | 8 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index fdd0645..f81300b 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -1208,21 +1208,35 @@ _proxy_context_clip(Evas_Public_Data *evas, void *ctx, Evas_Proxy_Render_Data *p { const Evas_Coord_Rectangle *clip; Evas_Object_Protected_Data *clipper; + int cw, ch; /* cache.clip can not be relied on, since the evas is frozen, but we need * to set the clip. so we recurse from clipper to clipper until we reach * the source object's clipper */ - if (!proxy_render_data || proxy_render_data->source_clip) return EINA_TRUE; + if (!proxy_render_data) return EINA_TRUE; + if (proxy_render_data->source_clip) + { +/* trust cache.clip since we clip like the source */ +ENFN->context_clip_clip(ENDT, ctx, +obj->cur->cache.clip.x + off_x, +obj->cur->cache.clip.y + off_y, +obj->cur->cache.clip.w, obj->cur->cache.clip.h); +ENFN->context_clip_get(ENDT, ctx, NULL, NULL, , ); +return (cw && ch); + } + if (!obj || !obj->cur->clipper) return EINA_TRUE; clipper = obj->cur->clipper; if (!clipper->cur->visible) return EINA_FALSE; clip = >cur->geometry; ENFN->context_clip_clip(ENDT, ctx, clip->x + off_x, clip->y + off_y, clip->w, clip->h); + ENFN->context_clip_get(ENDT, ctx, NULL, NULL, , ); + if (!cw || !ch) return EINA_FALSE; /* stop if we found the source object's clipper */ - if (clipper == proxy_render_data->proxy_obj->cur->clipper) return EINA_TRUE; + if (clipper == proxy_render_data->src_obj->cur->clipper) return EINA_TRUE; /* recurse to the clipper itself */ return _proxy_context_clip(evas, ctx, proxy_render_data, clipper, off_x, off_y); @@ -1236,7 +1250,7 @@ _evas_render_mapped_context_clip_set(Evas_Public_Data *evas, Evas_Object *eo_obj if (proxy_render_data) proxy_src_clip = proxy_render_data->source_clip; - if (proxy_src_clip && !evas->is_frozen) + if (proxy_src_clip) { x = obj->cur->cache.clip.x; y = obj->cur->cache.clip.y; diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c index 5c860ae..3bde901 100644 --- a/src/modules/evas/engines/software_generic/evas_engine.c +++ b/src/modules/evas/engines/software_generic/evas_engine.c @@ -579,10 +579,10 @@ eng_context_clip_unset(void *data EINA_UNUSED, void *context) static int eng_context_clip_get(void *data EINA_UNUSED, void *context, int *x, int *y, int *w, int *h) { - *x = ((RGBA_Draw_Context *)context)->clip.x; - *y = ((RGBA_Draw_Context *)context)->clip.y; - *w = ((RGBA_Draw_Context *)context)->clip.w; - *h = ((RGBA_Draw_Context *)context)->clip.h; + if (x) *x = ((RGBA_Draw_Context *)context)->clip.x; + if (y) *y = ((RGBA_Draw_Context *)context)->clip.y; + if (w) *w = ((RGBA_Draw_Context *)context)->clip.w; + if (h) *h = ((RGBA_Draw_Context *)context)->clip.h; return ((RGBA_Draw_Context *)context)->clip.use; } --
[EGIT] [core/efl] master 01/01: Evas filters: Fix crash with async sw rendering
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6e04d407cf1eb9506866f72f0d71c76ec2b80bc4 commit 6e04d407cf1eb9506866f72f0d71c76ec2b80bc4 Author: Jean-Philippe AndreDate: Wed Oct 7 18:08:56 2015 +0900 Evas filters: Fix crash with async sw rendering If the filtered object (text or image object) was deleted, its output image (cached inside the filter data) would be freed immediately. This could cause crashes in case of async rendering. @fix --- src/lib/evas/canvas/evas_filter_mixin.c | 8 +++- src/lib/evas/include/evas_private.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_filter_mixin.c b/src/lib/evas/canvas/evas_filter_mixin.c index 934a8c6..154c6dc 100644 --- a/src/lib/evas/canvas/evas_filter_mixin.c +++ b/src/lib/evas/canvas/evas_filter_mixin.c @@ -254,6 +254,7 @@ evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj, fcow = FCOW_BEGIN(pd); fcow->output = filter_output; fcow->changed = EINA_FALSE; +fcow->async = do_async; if (!ok) fcow->invalid = EINA_TRUE; FCOW_END(fcow, pd); @@ -518,7 +519,12 @@ _evas_filter_destructor(Eo *eo_obj, Evas_Filter_Data *pd) if (evas_object_filter_cow_default == pd->data) return; if (pd->data->output) - ENFN->image_free(ENDT, pd->data->output); + { +if (!pd->data->async) + ENFN->image_free(ENDT, pd->data->output); +else + evas_unref_queue_image_put(obj->layer->evas, pd->data->output); + } eina_hash_free(pd->data->sources); EINA_INLIST_FOREACH_SAFE(pd->data->data, il, db) { diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index 8c57805..0aa28d1 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1206,6 +1206,7 @@ struct _Evas_Object_Filter_Data } state; Eina_Boolchanged : 1; Eina_Boolinvalid : 1; // Code parse failed + Eina_Boolasync : 1; }; struct _Evas_Object_Func --
[EGIT] [core/efl] efl-1.15 01/01: Evas filters: Fix crash with async sw rendering
jpeg pushed a commit to branch efl-1.15. http://git.enlightenment.org/core/efl.git/commit/?id=42beea0ca57594759bd526afd4db62906728b1e7 commit 42beea0ca57594759bd526afd4db62906728b1e7 Author: Jean-Philippe AndreDate: Wed Oct 7 18:08:56 2015 +0900 Evas filters: Fix crash with async sw rendering If the filtered object (text or image object) was deleted, its output image (cached inside the filter data) would be freed immediately. This could cause crashes in case of async rendering. @fix --- src/lib/evas/canvas/evas_filter_mixin.c | 8 +++- src/lib/evas/include/evas_private.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_filter_mixin.c b/src/lib/evas/canvas/evas_filter_mixin.c index 934a8c6..154c6dc 100644 --- a/src/lib/evas/canvas/evas_filter_mixin.c +++ b/src/lib/evas/canvas/evas_filter_mixin.c @@ -254,6 +254,7 @@ evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj, fcow = FCOW_BEGIN(pd); fcow->output = filter_output; fcow->changed = EINA_FALSE; +fcow->async = do_async; if (!ok) fcow->invalid = EINA_TRUE; FCOW_END(fcow, pd); @@ -518,7 +519,12 @@ _evas_filter_destructor(Eo *eo_obj, Evas_Filter_Data *pd) if (evas_object_filter_cow_default == pd->data) return; if (pd->data->output) - ENFN->image_free(ENDT, pd->data->output); + { +if (!pd->data->async) + ENFN->image_free(ENDT, pd->data->output); +else + evas_unref_queue_image_put(obj->layer->evas, pd->data->output); + } eina_hash_free(pd->data->sources); EINA_INLIST_FOREACH_SAFE(pd->data->data, il, db) { diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index 01b4340..730eae3 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1194,6 +1194,7 @@ struct _Evas_Object_Filter_Data } state; Eina_Boolchanged : 1; Eina_Boolinvalid : 1; // Code parse failed + Eina_Boolasync : 1; }; struct _Evas_Object_Func --
[EGIT] [core/efl] master 01/03: EDC Doc: Some fixes
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=12f9fea2a4d4d641a09fd6563a83b925d62e4868 commit 12f9fea2a4d4d641a09fd6563a83b925d62e4868 Author: Jean-Philippe AndreDate: Fri Oct 2 18:14:25 2015 +0900 EDC Doc: Some fixes We need to move this doc to the wiki and complete it :) --- src/bin/edje/edje_cc_handlers.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 156a15b..e75f0cd 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -126,7 +126,16 @@ *@ref sec_collections_group_programs "Programs" * * @ref sec_collections_group_script "Script" - * @ref sec_collections_group_program_sequence "Sequence" + * @ref sec_collections_group_programs_program "Program" + * + *@ref sec_collections_group_script "Script" + *@ref sec_collections_group_program_sequence "Sequence" + * + * @ref sec_collections_group_script "Script" + * + * + * @ref sec_collections_group_script "Script" + * @ref sec_toplevel_fonts "Fonts" * *@ref sec_collections_group_physics "Physics" * --
[EGIT] [core/efl] master 03/03: Evas textblock: Force relayout during proxy render
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b031bbee9bf0b66bbe125abfaf066cd90042879a commit b031bbee9bf0b66bbe125abfaf066cd90042879a Author: Jean-Philippe AndreDate: Tue Oct 6 20:18:32 2015 +0900 Evas textblock: Force relayout during proxy render If the textblock object was not visible in the main canvas, but still needs to be rendered in a proxy surface, then _relayout may not have been called. This forces generation of paragraphs based on the current geometry. This patch is ugly. I know. This is evas render :) --- src/lib/evas/canvas/evas_object_textblock.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index ce419c2..ca37af4 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -11566,6 +11566,17 @@ evas_object_textblock_render(Evas_Object *eo_obj EINA_UNUSED, {0, 1, 2, 1, 0} }; + /* [FIXME!!!] rare case when relayout was not called: cache.clip made +* the object not visible (eg. clipped out), but it is actually visible +* in this context (eg. inside a proxy) - UGLY DIRTY FIX */ + if (obj->layer->evas->is_frozen && + (o->changed || o->content_changed || o->format_changed || o->obstacle_changed)) + _relayout_if_needed(eo_obj, o); + + /* If there are no paragraphs and thus there are no lines, +* there's nothing left to do. */ + if (!o->paragraphs) return; + /* render object to surface with context, and offxet by x,y */ ENFN->context_multiplier_unset(output, context); ENFN->context_multiplier_set(output, context, 0, 0, 0, 0); @@ -11577,9 +11588,6 @@ evas_object_textblock_render(Evas_Object *eo_obj EINA_UNUSED, obj->cur->geometry.w, obj->cur->geometry.h); clip = ENFN->context_clip_get(output, context, , , , ); - /* If there are no paragraphs and thus there are no lines, -* there's nothing left to do. */ - if (!o->paragraphs) return; ENFN->context_color_set(output, context, 0, 0, 0, 0); ca = cr = cg = cb = 0; --
[EGIT] [core/efl] master 03/03: Evas GL: Fix render: force pixel_get if dirty
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b38f8a3f39008845ac42ee04a83cf76c23b281c0 commit b38f8a3f39008845ac42ee04a83cf76c23b281c0 Author: Jean-Philippe AndreDate: Fri Oct 2 16:51:43 2015 +0900 Evas GL: Fix render: force pixel_get if dirty All examples and docs point to using only the dirty flag in order to trigger a redraw of an Evas GL surface. The commit 21c43528234 broke this behaviour (for a good reason, but not related to Evas GL). This is a compatibility fix. --- src/lib/evas/canvas/evas_object_image.c | 13 + 1 file changed, 13 insertions(+) diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index b366831..76c1009 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -3751,6 +3751,19 @@ evas_object_image_render_pre(Evas_Object *eo_obj, evas_object_render_pre_prev_cur_add(>clip_changes, eo_obj, obj); if (!o->pixels->pixel_updates) goto done; } +if (o->dirty_pixels && ENFN->image_native_get) + { + /* Evas GL surfaces have historically required only the dirty + * pixel to trigger a redraw (call to pixels_get). Other kinds + * of surfaces must add data update regions. */ + Evas_Native_Surface *ns; + ns = ENFN->image_native_get(ENDT, o->engine_data); + if (ns && (ns->type == EVAS_NATIVE_SURFACE_EVASGL)) + { + evas_object_render_pre_prev_cur_add(>clip_changes, eo_obj, obj); + if (!o->pixels->pixel_updates) goto done; + } + } if (o->cur->frame != o->prev->frame) { evas_object_render_pre_prev_cur_add(>clip_changes, eo_obj, obj); --
[EGIT] [core/efl] master 01/03: Evas image: Simplify updates if adding whole region at once
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2317bb83fc830e302d23047dc7ab06e61333a4dc commit 2317bb83fc830e302d23047dc7ab06e61333a4dc Author: Jean-Philippe AndreDate: Fri Oct 2 16:32:05 2015 +0900 Evas image: Simplify updates if adding whole region at once --- src/lib/evas/canvas/evas_object_image.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index ee177c2..b366831 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -1505,7 +1505,8 @@ _evas_image_data_update_add(Eo *eo_obj, Evas_Image_Data *o, int x, int y, int w, return; } } - if (cnt >= 512) + if ((cnt >= 512) || + (((x == 0) && (y == 0) && (w == o->cur->image.w) && (h == o->cur->image.h { // too many update rects - just make a single blob update EINA_COW_PIXEL_WRITE_BEGIN(o, pixi_write) { --
[EGIT] [core/efl] master 02/03: Evas GL: Add new API to get current Evas GL
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=90b96b07d9d39bb98f7d362fbfdd386deceefa84 commit 90b96b07d9d39bb98f7d362fbfdd386deceefa84 Author: Jean-Philippe AndreDate: Fri Oct 2 15:15:40 2015 +0900 Evas GL: Add new API to get current Evas GL While this seems to go against the rest of the API (because we always pass in the Evas GL object), there is no way right now fully restore a context if there are multiple Evas GL objects. For instance, an app can use Evas GL from an Elm GLView, and also use Cairo with another Evas GL at the same time. In that case Cairo needs to restore the previous Evas GL but the library had no way of getting the current Evas GL. This is the equivalent of eglGetCurrentDisplay(). @feature --- src/lib/evas/Evas_GL.h| 19 ++- src/lib/evas/canvas/evas_gl.c | 44 ++- 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/Evas_GL.h b/src/lib/evas/Evas_GL.h index a032eaf..0a4aa70 100644 --- a/src/lib/evas/Evas_GL.h +++ b/src/lib/evas/Evas_GL.h @@ -847,7 +847,7 @@ EAPI Evas_GL_Context *evas_gl_current_context_get (Evas_GL *evas_gl) EIN /** * @brief Returns the Evas GL surface object in use or set by @ref evas_gl_make_current * - * @param evas_gl The given Evas_GL object + * @param[in] evas_gl The given Evas_GL object * * @return The current surface for the calling thread, or @c NULL in case of * failure and when there is no current surface in this thread. @@ -862,6 +862,23 @@ EAPI Evas_GL_Context *evas_gl_current_context_get (Evas_GL *evas_gl) EIN */ EAPI Evas_GL_Surface *evas_gl_current_surface_get (Evas_GL *evas_gl) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); +/** + * @brief Get current Evas GL + * + * @param[out] context Optional return value for the current context + * @param[out] surface Optional return value for the current surface + * + * @return The current Evas GL, ie. the last Evas GL passed to evas_gl_make_current + * + * @see evas_gl_make_current + * + * @note This can be used to restore a previous context, for instance if you + * are writing a library that needs to work transparently with Evas GL, + * and may not have control over the other Evas GL objects. + * + * @since 1.16 + */ +EAPI Evas_GL *evas_gl_current_evas_gl_get (Evas_GL_Context **context, Evas_GL_Surface **surface) EINA_WARN_UNUSED_RESULT; /*- diff --git a/src/lib/evas/canvas/evas_gl.c b/src/lib/evas/canvas/evas_gl.c index 5b539e4..7e9c4e7 100644 --- a/src/lib/evas/canvas/evas_gl.c +++ b/src/lib/evas/canvas/evas_gl.c @@ -5,6 +5,9 @@ typedef struct _Evas_GL_TLS_data Evas_GL_TLS_data; +/* since 1.16: store current evas gl - this TLS is never destroyed */ +static Eina_TLS _current_evas_gl_key = 0; + struct _Evas_GL { DATA32 magic; @@ -126,6 +129,16 @@ evas_gl_new(Evas *e) return NULL; MAGIC_CHECK_END(); + if (!_current_evas_gl_key) + { +if (!eina_tls_new(&_current_evas_gl_key)) + { + ERR("Error creating tls key for current Evas GL"); + return NULL; + } +eina_tls_set(_current_evas_gl_key, NULL); + } + evas_gl = calloc(1, sizeof(Evas_GL)); if (!evas_gl) return NULL; @@ -136,6 +149,7 @@ evas_gl_new(Evas *e) if (!evas_gl->evas->engine.func->gl_context_create) { ERR("Evas GL engine not available."); +eo_data_unref(e, evas_gl->evas); free(evas_gl); return NULL; } @@ -144,6 +158,7 @@ evas_gl_new(Evas *e) if (eina_tls_new(&(evas_gl->resource_key)) == EINA_FALSE) { ERR("Error creating tls key"); +eo_data_unref(e, evas_gl->evas); free(evas_gl); return NULL; } @@ -167,9 +182,13 @@ evas_gl_free(Evas_GL *evas_gl) while (evas_gl->contexts) evas_gl_context_destroy(evas_gl, evas_gl->contexts->data); - // Destroy tls + // Destroy private tls _evas_gl_internal_tls_destroy(evas_gl); + // Reset current evas gl tls + if (_current_evas_gl_key && (evas_gl == eina_tls_get(_current_evas_gl_key))) + eina_tls_set(_current_evas_gl_key, NULL); + eo_data_unref(evas_gl->evas->evas, evas_gl->evas); evas_gl->magic = 0; LKD(evas_gl->lck); @@ -452,6 +471,9 @@ evas_gl_make_current(Evas_GL *evas_gl, Evas_GL_Surface *surf, Evas_GL_Context *c return EINA_FALSE; } + if (_current_evas_gl_key) + eina_tls_set(_current_evas_gl_key, evas_gl); + return ret; } @@ -531,6 +553,26 @@ evas_gl_current_surface_get(Evas_GL *evas_gl) return NULL; } +EAPI Evas_GL * +evas_gl_current_evas_gl_get(Evas_GL_Context **context, Evas_GL_Surface **surface) +{ + Evas_GL *evasgl = NULL; + + if (_current_evas_gl_key) +
[EGIT] [core/efl] master 01/01: edje_cc: Check default state as well
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ad268c1d94b0dd54ce31cb665f0be4c2ed8b4452 commit ad268c1d94b0dd54ce31cb665f0be4c2ed8b4452 Author: Jean-Philippe AndreDate: Thu Oct 1 21:28:32 2015 +0900 edje_cc: Check default state as well Strangely only the other states were checked for errors. Errors include: - no name for state, or "description with missing state" - invalid clip_to Also improve the error message a bit --- src/bin/edje/edje_cc_out.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c index 5c79ee8..d8f6d55 100644 --- a/src/bin/edje/edje_cc_out.c +++ b/src/bin/edje/edje_cc_out.c @@ -554,8 +554,10 @@ check_state(Edje_Part_Collection *pc, Edje_Part *ep, Edje_Part_Description_Commo if (ed->clip_to_id != -1 && (pc->parts[ed->clip_to_id]->type != EDJE_PART_TYPE_RECTANGLE) && (pc->parts[ed->clip_to_id]->type != EDJE_PART_TYPE_IMAGE)) - error_and_abort(ef, "Collection %i: description.clip_to point to a non RECT/IMAGE part '%s' !", - pc->id, pc->parts[ed->clip_to_id]->name); + error_and_abort(ef, "Collection %i: part: '%s' state: '%s' %g clip_to points to " + "a non RECT/IMAGE part '%s'!", + pc->id, ep->name, ed->state.name, ed->state.value, + pc->parts[ed->clip_to_id]->name); check_nameless_state(pc, ep, ed, ef); } @@ -570,6 +572,7 @@ check_part(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef) error_and_abort(ef, "Collection %i: default description missing " "for part \"%s\"", pc->id, ep->name); + check_state(pc, ep, ep->default_desc, ef); for (i = 0; i < ep->other.desc_count; ++i) check_state(pc, ep, ep->other.desc[i], ef); --
[EGIT] [core/efl] master 07/10: Edje: Add test case for SNAPSHOT
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=35fe059ec8091a7635117abfddb5ed3f83e2101e commit 35fe059ec8091a7635117abfddb5ed3f83e2101e Author: Jean-Philippe AndreDate: Mon Sep 7 19:08:50 2015 +0900 Edje: Add test case for SNAPSHOT This is mostly an edje_cc compilation test. --- src/Makefile_Edje.am | 8 +++-- src/tests/edje/data/test_snapshot.edc | 61 +++ src/tests/edje/edje_test_edje.c | 25 ++ 3 files changed, 92 insertions(+), 2 deletions(-) diff --git a/src/Makefile_Edje.am b/src/Makefile_Edje.am index 6e99c85..1e5059f 100644 --- a/src/Makefile_Edje.am +++ b/src/Makefile_Edje.am @@ -254,6 +254,7 @@ tests/edje/data/test_layout.edc \ tests/edje/data/test_parens.edc \ tests/edje/data/test_masking.edc \ tests/edje/data/test_filters.edc \ +tests/edje/data/test_snapshot.edc \ tests/edje/data/filter.lua @@ -295,6 +296,7 @@ EDJE_DATA_FILES = tests/edje/data/test_layout.edc \ tests/edje/data/test_parens.edc \ tests/edje/data/test_masking.edc \ tests/edje/data/test_filters.edc \ + tests/edje/data/test_snapshot.edc \ tests/edje/data/filter.lua edjedatafilesdir = $(datadir)/edje/data @@ -302,13 +304,15 @@ edjedatafiles_DATA = tests/edje/data/test_layout.edj \ tests/edje/data/complex_layout.edj \ tests/edje/data/test_parens.edj \ tests/edje/data/test_masking.edj \ - tests/edje/data/test_filters.edj + tests/edje/data/test_filters.edj \ + tests/edje/data/test_snapshot.edj CLEANFILES += tests/edje/data/test_layout.edj \ tests/edje/data/complex_layout.edj \ tests/edje/data/test_parens.edj \ tests/edje/data/test_masking.edj \ - tests/edje/data/test_filters.edj + tests/edje/data/test_filters.edj \ + tests/edje/data/test_snapshot.edj endif diff --git a/src/tests/edje/data/test_snapshot.edc b/src/tests/edje/data/test_snapshot.edc new file mode 100644 index 000..a68c649 --- /dev/null +++ b/src/tests/edje/data/test_snapshot.edc @@ -0,0 +1,61 @@ +collections { + filters { + filter { + name: "filter"; + script { +padding_set(0) +blur { 10 } + } + } + } + images { + // found in tests/emotion/data + image: "e_logo.png" COMP; + } + group { name: "test_group"; + filters { + filter.file: "filter.lua"; + } + parts { + part { name: "background"; +type: RECT; +description { state: "default" 0.0; + color: 33 32 32 255; + rel1.relative: 0 0; + rel2.relative: 1 1; + max: 250 250; +} + } + image { "img"; +desc { "default"; + image.normal: "e_logo.png"; + fill.type: TILE; + rel.to: "background"; +} + } + part { name: "snap"; +type: SNAPSHOT; +desc { "default"; + rel.to: "background"; + rel1.relative: 0.25 0.25; + rel2.relative: 0.75 0.75; + filter.code: "filter"; +} +desc { "hid"; inherit: "default"; hid; +} + } + } + programs.program { + source: "*"; + signal: "mouse,in"; + action: STATE_SET "hid" 0.0; + targets: "snap"; + } + programs.program { + source: "*"; + signal: "mouse,out"; + action: STATE_SET "default" 0.0; + targets: "snap"; + } + } +} diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c index bf32f6d..43eacdc 100644 --- a/src/tests/edje/edje_test_edje.c +++ b/src/tests/edje/edje_test_edje.c @@ -243,6 +243,30 @@ START_TEST(edje_test_filters) } END_TEST +START_TEST(edje_test_snapshot) +{ + Evas *evas = EDJE_TEST_INIT_EVAS(); + const Evas_Object *sub; + Evas_Object *obj, *src = NULL; + Eina_Bool b; + + setenv("EVAS_DATA_DIR", EVAS_DATA_DIR, 1); + + obj = edje_object_add(evas); + fail_unless(edje_object_file_set(obj, test_layout_get("test_snapshot.edj"), "test_group")); + + evas_object_resize(obj, 200, 200); + + /* check value of no_render flag as seen from evas land */ + sub = edje_object_part_object_get(obj, "snap"); + fail_if(!eo_do_ret(sub, b, evas_obj_image_snapshot_get())); + + // TODO: Verify that evas snapshot actually works (and has a filter) + + EDJE_TEST_FREE_EVAS(); +} +END_TEST + void edje_test_edje(TCase *tc) { tcase_add_test(tc, edje_test_edje_init); @@ -253,4 +277,5 @@ void edje_test_edje(TCase *tc) tcase_add_test(tc, edje_test_calculate_parens);
[EGIT] [core/efl] master 02/10: Edje: Fix filters for IMAGE parts inherited states
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=99b1c7622ba3ee0358d491d048f115eed3031d34 commit 99b1c7622ba3ee0358d491d048f115eed3031d34 Author: Jean-Philippe AndreDate: Tue Aug 18 21:07:53 2015 +0900 Edje: Fix filters for IMAGE parts inherited states --- src/bin/edje/edje_cc_handlers.c | 12 1 file changed, 12 insertions(+) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 5a56fb2..18adacb 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -7089,6 +7089,18 @@ st_collections_group_parts_part_description_inherit(void) ied->image.tweens[i] = iid_new; } + /* Filters stuff */ + ied->filter.code = STRDUP(ied->filter.code); + if (ied->filter.code) +{ + Eina_List *list, *l; + const char *name; + list = ied->filter.sources; + ied->filter.sources = NULL; + EINA_LIST_FOREACH(list, l, name) + ied->filter.sources = eina_list_append(ied->filter.sources, STRDUP(name)); +} + break; } case EDJE_PART_TYPE_PROXY: --
[EGIT] [core/efl] master 01/10: Edje: Move internal struct filter around (refactor)
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c0f887b42965121a0964d3b8a319cafb8b33d1fb commit c0f887b42965121a0964d3b8a319cafb8b33d1fb Author: Jean-Philippe AndreDate: Tue Aug 18 21:05:51 2015 +0900 Edje: Move internal struct filter around (refactor) --- src/bin/edje/edje_cc_handlers.c | 22 +++--- src/lib/edje/edje_calc.c| 12 ++-- src/lib/edje/edje_data.c| 12 ++-- src/lib/edje/edje_private.h | 5 +++-- 4 files changed, 26 insertions(+), 25 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 7b22c6b..5a56fb2 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -7048,15 +7048,15 @@ st_collections_group_parts_part_description_inherit(void) ted->text.font.str = STRDUP(ted->text.font.str); /* Filters stuff */ - ted->text.filter.code = STRDUP(ted->text.filter.code); - if (ted->text.filter.code) + ted->filter.code = STRDUP(ted->filter.code); + if (ted->filter.code) { Eina_List *list, *l; const char *name; - list = ted->text.filter.sources; - ted->text.filter.sources = NULL; + list = ted->filter.sources; + ted->filter.sources = NULL; EINA_LIST_FOREACH(list, l, name) - ted->text.filter.sources = eina_list_append(ted->text.filter.sources, STRDUP(name)); + ted->filter.sources = eina_list_append(ted->filter.sources, STRDUP(name)); } data_queue_copied_part_nest_lookup(pc, &(tparent->text.id_source), &(ted->text.id_source), >text.id_source_part); @@ -11896,9 +11896,9 @@ st_collections_group_parts_part_description_filter_code(void) check_arg_count(1); if (current_part->type == EDJE_PART_TYPE_TEXT) - filter = &(((Edje_Part_Description_Text *)current_desc)->text.filter); + filter = &(((Edje_Part_Description_Text *)current_desc)->filter); else if (current_part->type == EDJE_PART_TYPE_IMAGE) - filter = &(((Edje_Part_Description_Image *)current_desc)->image.filter); + filter = &(((Edje_Part_Description_Image *)current_desc)->filter); else { ERR("parse error %s:%i. filter set for non-TEXT and non-IMAGE part.", @@ -11937,9 +11937,9 @@ st_collections_group_parts_part_description_filter_source(void) "abcdefghijklmnopqrstuvwxyzABCDEFGHJIKLMNOPQRSTUVWXYZ0123456789_"; if (current_part->type == EDJE_PART_TYPE_TEXT) - filter = &(((Edje_Part_Description_Text *)current_desc)->text.filter); + filter = &(((Edje_Part_Description_Text *)current_desc)->filter); else if (current_part->type == EDJE_PART_TYPE_IMAGE) - filter = &(((Edje_Part_Description_Image *)current_desc)->image.filter); + filter = &(((Edje_Part_Description_Image *)current_desc)->filter); else { ERR("parse error %s:%i. filter set for non-TEXT and non-IMAGE part.", @@ -12030,9 +12030,9 @@ st_collections_group_parts_part_description_filter_data(void) unsigned k; if (current_part->type == EDJE_PART_TYPE_TEXT) - filter = &(((Edje_Part_Description_Text *)current_desc)->text.filter); + filter = &(((Edje_Part_Description_Text *)current_desc)->filter); else if (current_part->type == EDJE_PART_TYPE_IMAGE) - filter = &(((Edje_Part_Description_Image *)current_desc)->image.filter); + filter = &(((Edje_Part_Description_Image *)current_desc)->filter); else { ERR("parse error %s:%i. filter set for non-TEXT and non-IMAGE part.", diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index dcf868a..234c8a3 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -2465,17 +2465,17 @@ _edje_part_recalc_single_filter(Edje *ed, { Edje_Part_Description_Text *chosen_edt = (Edje_Part_Description_Text *) chosen_desc; Edje_Part_Description_Text *edt = (Edje_Part_Description_Text *) desc; -filter = _edt->text.filter; -prev_sources = edt->text.filter.sources; -filter_sources = chosen_edt->text.filter.sources; +filter = _edt->filter; +prev_sources = edt->filter.sources; +filter_sources = chosen_edt->filter.sources; } else if (ep->part->type == EDJE_PART_TYPE_IMAGE) { Edje_Part_Description_Image *chosen_edi = (Edje_Part_Description_Image *) chosen_desc; Edje_Part_Description_Image *edi = (Edje_Part_Description_Image *) desc; -filter = _edi->image.filter; -prev_sources = edi->image.filter.sources; -filter_sources = chosen_edi->image.filter.sources; +filter = _edi->filter; +prev_sources = edi->filter.sources; +filter_sources = chosen_edi->filter.sources;
[EGIT] [core/efl] master 09/10: Evas filters: Fix handling of FILL for image filters
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=52e4bbda7b90271f1bafceb4263d68f45fedda2c commit 52e4bbda7b90271f1bafceb4263d68f45fedda2c Author: Jean-Philippe AndreDate: Thu Oct 1 19:59:22 2015 +0900 Evas filters: Fix handling of FILL for image filters Note: Image filters still need a LOT of work to be usable. --- src/lib/evas/canvas/evas_object_image.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 3fd09fc..ee177c2 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -159,7 +159,7 @@ static void evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_ int x, int y, Eina_Bool do_async); static void _evas_image_render(Eo *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, - int x, int y, Eina_Bool do_async); + int x, int y, int l, int t, int r, int b, Eina_Bool do_async); static void evas_object_image_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); static void evas_object_image_render_pre(Evas_Object *eo_obj, @@ -3183,6 +3183,8 @@ _evas_image_evas_filter_input_render(Eo *eo_obj, Evas_Image_Data *o, { l = 0; t = 0; +r = 0; +b = 0; } if (!surface) @@ -3198,7 +3200,8 @@ _evas_image_evas_filter_input_render(Eo *eo_obj, Evas_Image_Data *o, ENFN->context_render_op_set(output, context, EVAS_RENDER_BLEND); _evas_image_render(eo_obj, obj, output, context, surface, - l - obj->cur->geometry.x, t - obj->cur->geometry.y, do_async); + l - obj->cur->geometry.x, t - obj->cur->geometry.y, + l, t, r, b, do_async); if (!input_stolen) { @@ -3280,12 +3283,13 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v return; } - _evas_image_render(eo_obj, obj, output, context, surface, x, y, do_async); + _evas_image_render(eo_obj, obj, output, context, surface, x, y, 0, 0, 0, 0, do_async); } static void _evas_image_render(Eo *eo_obj, Evas_Object_Protected_Data *obj, - void *output, void *context, void *surface, int x, int y, Eina_Bool do_async) + void *output, void *context, void *surface, int x, int y, + int l, int t, int r, int b, Eina_Bool do_async) { Evas_Image_Data *o = obj->private_data; int imagew, imageh, uvw, uvh; @@ -3358,7 +3362,6 @@ _evas_image_render(Eo *eo_obj, Evas_Object_Protected_Data *obj, if (pixels) { Evas_Coord idw, idh, idx, idy; -int l = 0, r = 0, t = 0, b = 0; int ix, iy, iw, ih; if ((obj->map->cur.map) && (obj->map->cur.map->count > 3) && (obj->map->cur.usemap)) --
[EGIT] [core/efl] master 03/10: Edje: Add support for filters to PROXY parts
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=31edfbb817d24dc11224e6f68e6dcd12282ca5f8 commit 31edfbb817d24dc11224e6f68e6dcd12282ca5f8 Author: Jean-Philippe AndreDate: Tue Aug 18 21:14:11 2015 +0900 Edje: Add support for filters to PROXY parts Same syntax as for IMAGE and TEXT: description.filter --- src/bin/edje/edje_cc_handlers.c | 8 +++- src/lib/edje/edje_calc.c| 14 +- src/lib/edje/edje_data.c| 3 +++ src/lib/edje/edje_private.h | 2 +- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 18adacb..b4530c9 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -11911,9 +11911,11 @@ st_collections_group_parts_part_description_filter_code(void) filter = &(((Edje_Part_Description_Text *)current_desc)->filter); else if (current_part->type == EDJE_PART_TYPE_IMAGE) filter = &(((Edje_Part_Description_Image *)current_desc)->filter); + else if (current_part->type == EDJE_PART_TYPE_PROXY) + filter = &(((Edje_Part_Description_Proxy *)current_desc)->filter); else { -ERR("parse error %s:%i. filter set for non-TEXT and non-IMAGE part.", +ERR("parse error %s:%i. filter only supported for: TEXT, IMAGE, PROXY.", file_in, line - 1); exit(-1); } @@ -11952,6 +11954,8 @@ st_collections_group_parts_part_description_filter_source(void) filter = &(((Edje_Part_Description_Text *)current_desc)->filter); else if (current_part->type == EDJE_PART_TYPE_IMAGE) filter = &(((Edje_Part_Description_Image *)current_desc)->filter); + else if (current_part->type == EDJE_PART_TYPE_PROXY) + filter = &(((Edje_Part_Description_Proxy *)current_desc)->filter); else { ERR("parse error %s:%i. filter set for non-TEXT and non-IMAGE part.", @@ -12045,6 +12049,8 @@ st_collections_group_parts_part_description_filter_data(void) filter = &(((Edje_Part_Description_Text *)current_desc)->filter); else if (current_part->type == EDJE_PART_TYPE_IMAGE) filter = &(((Edje_Part_Description_Image *)current_desc)->filter); + else if (current_part->type == EDJE_PART_TYPE_PROXY) + filter = &(((Edje_Part_Description_Proxy *)current_desc)->filter); else { ERR("parse error %s:%i. filter set for non-TEXT and non-IMAGE part.", diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index 234c8a3..3312007 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -2460,7 +2460,7 @@ _edje_part_recalc_single_filter(Edje *ed, Evas_Object *obj = ep->object; Eina_List *li1, *li2; - /* handle TEXT and IMAGE part types here */ + /* handle TEXT, IMAGE, PROXY part types here */ if (ep->part->type == EDJE_PART_TYPE_TEXT) { Edje_Part_Description_Text *chosen_edt = (Edje_Part_Description_Text *) chosen_desc; @@ -2477,6 +2477,14 @@ _edje_part_recalc_single_filter(Edje *ed, prev_sources = edi->filter.sources; filter_sources = chosen_edi->filter.sources; } + else if (ep->part->type == EDJE_PART_TYPE_PROXY) + { +Edje_Part_Description_Proxy *chosen_edp = (Edje_Part_Description_Proxy *) chosen_desc; +Edje_Part_Description_Proxy *edp = (Edje_Part_Description_Proxy *) desc; +filter = _edp->filter; +prev_sources = edp->filter.sources; +filter_sources = chosen_edp->filter.sources; + } else { CRI("Invalid call to filter recalc"); @@ -2851,6 +2859,10 @@ _edje_part_recalc_single(Edje *ed, _edje_part_recalc_single_filter(ed, ep, desc, chosen_desc, pos); } + else if (ep->part->type == EDJE_PART_TYPE_PROXY) + { +_edje_part_recalc_single_filter(ed, ep, desc, chosen_desc, pos); + } /* remember what our size is BEFORE we go limit it */ params->req.x = TO_INT(params->eval.x); diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c index ef6ac47..acad419 100644 --- a/src/lib/edje/edje_data.c +++ b/src/lib/edje/edje_data.c @@ -1021,6 +1021,9 @@ _edje_edd_init(void) EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.type", proxy.fill.type, EET_T_CHAR); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.source_visible", proxy.source_visible, EET_T_CHAR); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.source_clip", proxy.source_clip, EET_T_CHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.filter.code", filter.code, EET_T_STRING); // @since 1.16 + EET_DATA_DESCRIPTOR_ADD_LIST_STRING(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy,
[EGIT] [core/efl] master 10/10: Edje: Turn SNAPSHOT objects into filled images for now
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a449bfc555abe1d21c5e0afd97ef423e2821e585 commit a449bfc555abe1d21c5e0afd97ef423e2821e585 Author: Jean-Philippe AndreDate: Thu Oct 1 20:01:52 2015 +0900 Edje: Turn SNAPSHOT objects into filled images for now Without that, the image has no fill information. Fill properties may need to be added to SNAPHOT parts but the default behaviour should make sense. Before this patch you just get a black rectangle. Considering how image filters currently work, marking snapshots as filled by default is not the best solution (need padding_set(0) to render nicely). --- src/lib/edje/edje_load.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c index 2ab9862..e9fcfa3 100644 --- a/src/lib/edje/edje_load.c +++ b/src/lib/edje/edje_load.c @@ -711,7 +711,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch case EDJE_PART_TYPE_PROXY: case EDJE_PART_TYPE_IMAGE: case EDJE_PART_TYPE_SNAPSHOT: - rp->object = evas_object_image_add(ed->base->evas); + rp->object = evas_object_image_filled_add(ed->base->evas); if (ep->type == EDJE_PART_TYPE_SNAPSHOT) evas_object_image_snapshot_set(rp->object, EINA_TRUE); break; --
[EGIT] [core/efl] master 04/10: Edje: Fix IMAGE filters
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a181c32cbe03562c148cf31465317df365f9111d commit a181c32cbe03562c148cf31465317df365f9111d Author: Jean-Philippe AndreDate: Tue Aug 18 21:35:55 2015 +0900 Edje: Fix IMAGE filters Some invalid logic made filters work only in a rare situation. @fix --- src/lib/edje/edje_calc.c | 35 ++- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index 3312007..2da8cb8 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -2834,29 +2834,30 @@ _edje_part_recalc_single(Edje *ed, if (lminh > minh) minh = lminh; } } - else if ((ep->part->type == EDJE_PART_TYPE_IMAGE) && -(chosen_desc->min.limit || chosen_desc->max.limit)) + else if (ep->part->type == EDJE_PART_TYPE_IMAGE) { -Evas_Coord w, h; +if (chosen_desc->min.limit || chosen_desc->max.limit) + { + Evas_Coord w, h; -/* We only need pos to find the right image that would be displayed */ -/* Yes, if someone set aspect preference to SOURCE and also max,min + /* We only need pos to find the right image that would be displayed */ + /* Yes, if someone set aspect preference to SOURCE and also max,min to SOURCE, it will be under efficient, but who cares at the moment. */ -_edje_real_part_image_set(ed, ep, NULL, pos); -evas_object_image_size_get(ep->object, , ); + _edje_real_part_image_set(ed, ep, NULL, pos); + evas_object_image_size_get(ep->object, , ); -if (chosen_desc->min.limit) - { - if (w > minw) minw = w; - if (h > minh) minh = h; - } -if (chosen_desc->max.limit) - { - if ((maxw <= 0) || (w < maxw)) maxw = w; - if ((maxh <= 0) || (h < maxh)) maxh = h; + if (chosen_desc->min.limit) + { + if (w > minw) minw = w; + if (h > minh) minh = h; + } + if (chosen_desc->max.limit) + { + if ((maxw <= 0) || (w < maxw)) maxw = w; + if ((maxh <= 0) || (h < maxh)) maxh = h; + } } - _edje_part_recalc_single_filter(ed, ep, desc, chosen_desc, pos); } else if (ep->part->type == EDJE_PART_TYPE_PROXY) --
[EGIT] [core/efl] master 08/10: Edje: Fix invalid loading of snapshot parts
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=1bb294ba1c3e41f8e6bb4d3b8c23f0c58dee4cf9 commit 1bb294ba1c3e41f8e6bb4d3b8c23f0c58dee4cf9 Author: Jean-Philippe AndreDate: Tue Sep 15 18:10:51 2015 +0900 Edje: Fix invalid loading of snapshot parts --- src/lib/edje/edje_calc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index ac444f0..e2a662f 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -328,9 +328,9 @@ case EDJE_PART_TYPE_##Short: \ case EDJE_PART_TYPE_SNAPSHOT: desc_rtl = eina_mempool_malloc(ce->mp_rtl.SNAPSHOT, - sizeof (Edje_Part_Description_Common)); + sizeof (Edje_Part_Description_Snapshot)); ce->count.SNAPSHOT++; -memsize = sizeof(Edje_Part_Description_Common); +memsize = sizeof(Edje_Part_Description_Snapshot); break; case EDJE_PART_TYPE_SWALLOW: @@ -4302,6 +4302,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta case EDJE_PART_TYPE_TEXTBLOCK: case EDJE_PART_TYPE_BOX: case EDJE_PART_TYPE_TABLE: + case EDJE_PART_TYPE_SNAPSHOT: evas_object_color_set(ep->object, (pf->color.r * pf->color.a) / 255, (pf->color.g * pf->color.a) / 255, --
[EGIT] [core/efl] master 05/10: Edje tests: Add PROXY part to the filters test case
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6b7e4087d2eec005f9f5e1dc20b54d525700a7df commit 6b7e4087d2eec005f9f5e1dc20b54d525700a7df Author: Jean-Philippe AndreDate: Tue Aug 18 21:37:42 2015 +0900 Edje tests: Add PROXY part to the filters test case Only compilation is tested here. Use edje_player to check the resulting edj if you wanna see what happens. --- src/tests/edje/data/test_filters.edc | 46 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/src/tests/edje/data/test_filters.edc b/src/tests/edje/data/test_filters.edc index 6b3b5e6..e1f8b57 100644 --- a/src/tests/edje/data/test_filters.edc +++ b/src/tests/edje/data/test_filters.edc @@ -29,7 +29,9 @@ collections { filter { name: "filter3"; script { -blend {} +if not a then a = 255 end +fill { color = (color('lime') * a) } +blend { color = (color('red') * a) } } } } @@ -53,7 +55,7 @@ collections { } part { name: "mask"; type: IMAGE; -no_render: 1; +no_render: 1; description { state: "default" 0.0; rel1.relative: 0 0; rel2.relative: 1 1; @@ -62,9 +64,43 @@ collections { image.normal: "pnl.png"; } } - part { name: "text"; + proxy { "prxy"; +desc { "default"; + filter { + code: "filter3"; + data: "a" "96"; + } + max: 64 -1; + align: 1 0.5; + source: "mask"; + fill { + type: TILE; + origin { + relative: 0 0; + offset: 0 0; + } + size { + relative: 1 1; + offset: -1 -1; + } + } +} + } + image { +"img"; +desc { + "default"; + image.normal: "pnl.png"; + max: 64 -1; + align: 0 0.5; + filter.code: "filter3"; +} + } + part { +name: "text"; type: TEXT; -description { state: "default" 0.0; +description { + state: "default" 0.0; rel1.relative: 0 0; rel2.relative: 1 1; rel1.to: "background"; @@ -78,7 +114,7 @@ collections { filter { code: "filterfile"; source: "mask"; - data: "mycolor" "#f0f8"; + data: "mycolor" "#f0f8"; data: "cc" "color_class('cc1')"; } color: 255 80 0 200; --
[EGIT] [core/efl] master 01/01: edje_cc: Add "norender; " as lazEDC for "no_render: 1; "
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9c5e873c6834f3374946ff02546ec97b5b86f88f commit 9c5e873c6834f3374946ff02546ec97b5b86f88f Author: Jean-Philippe AndreDate: Thu Oct 1 22:20:48 2015 +0900 edje_cc: Add "norender;" as lazEDC for "no_render: 1;" --- src/bin/edje/edje_cc_handlers.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 2ccedb1..190c3e0 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -1078,6 +1078,7 @@ New_Statement_Handler statement_handlers_short_single[] = {"collections.group.parts.part.noprecise", st_collections_group_parts_part_noprecise}, {"collections.group.parts.part.scale", st_collections_group_parts_part_scale}, {"collections.group.parts.part.noscale", st_collections_group_parts_part_noscale}, + {"collections.group.parts.part.norender", st_collections_group_parts_part_no_render}, {"collections.group.parts.part.description.vis", st_collections_group_parts_part_description_vis}, {"collections.group.parts.part.description.hid", st_collections_group_parts_part_description_hid}, {"collections.group.mouse", st_collections_group_mouse}, @@ -5773,9 +5774,10 @@ st_collections_group_parts_part_clip_to_id(void) static void st_collections_group_parts_part_no_render(void) { - check_arg_count(1); - - current_part->no_render = parse_bool(0); + if (check_range_arg_count(0, 1) == 1) + current_part->no_render = parse_bool(0); + else /* lazEDC form */ + current_part->no_render = EINA_TRUE; } /** --
[EGIT] [core/efl] master 01/01: edje_cc: Allow PROXY as clipper (clip_to and desc.clip_to)
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8e004030470a89e34582ea4f20d9648547b0697f commit 8e004030470a89e34582ea4f20d9648547b0697f Author: Jean-Philippe AndreDate: Thu Oct 1 21:58:18 2015 +0900 edje_cc: Allow PROXY as clipper (clip_to and desc.clip_to) This arbitrary limitation can now be lifted since masking is well supported (ie. clip_to can point to an IMAGE rather than a RECT). @feature --- src/bin/edje/edje_cc_out.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c index d8f6d55..2a31b3f 100644 --- a/src/bin/edje/edje_cc_out.c +++ b/src/bin/edje/edje_cc_out.c @@ -553,7 +553,8 @@ check_state(Edje_Part_Collection *pc, Edje_Part *ep, Edje_Part_Description_Commo /* FIXME: When smart masks are supported, remove this check */ if (ed->clip_to_id != -1 && (pc->parts[ed->clip_to_id]->type != EDJE_PART_TYPE_RECTANGLE) && - (pc->parts[ed->clip_to_id]->type != EDJE_PART_TYPE_IMAGE)) + (pc->parts[ed->clip_to_id]->type != EDJE_PART_TYPE_IMAGE) && + (pc->parts[ed->clip_to_id]->type != EDJE_PART_TYPE_PROXY)) error_and_abort(ef, "Collection %i: part: '%s' state: '%s' %g clip_to points to " "a non RECT/IMAGE part '%s'!", pc->id, ep->name, ed->state.name, ed->state.value, @@ -600,7 +601,8 @@ check_part(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef) /* FIXME: When smart masks are supported, remove this check */ if (ep->clip_to_id != -1 && (pc->parts[ep->clip_to_id]->type != EDJE_PART_TYPE_RECTANGLE) && - (pc->parts[ep->clip_to_id]->type != EDJE_PART_TYPE_IMAGE)) + (pc->parts[ep->clip_to_id]->type != EDJE_PART_TYPE_IMAGE) && + (pc->parts[ep->clip_to_id]->type != EDJE_PART_TYPE_PROXY)) error_and_abort(ef, "Collection %i: clip_to point to a non RECT/IMAGE part '%s' !", pc->id, pc->parts[ep->clip_to_id]->name); } --
[EGIT] [core/efl] master 01/03: edje_cc: Add "render" keyword for lazEDC
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6882bb63286da1a50d112a95cbab2e3cdfc1a369 commit 6882bb63286da1a50d112a95cbab2e3cdfc1a369 Author: Jean-Philippe AndreDate: Fri Oct 2 12:13:56 2015 +0900 edje_cc: Add "render" keyword for lazEDC Since @zmike also thought this could be useful, let's add it. --- src/bin/edje/edje_cc_handlers.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 190c3e0..7ae4007 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -268,6 +268,7 @@ static void st_collections_group_parts_part_pointer_mode(void); static void st_collections_group_parts_part_precise_is_inside(void); static void st_collections_group_parts_part_use_alternate_font_metrics(void); static void st_collections_group_parts_part_clip_to_id(void); +static void st_collections_group_parts_part_render(void); static void st_collections_group_parts_part_no_render(void); static void st_collections_group_parts_part_source(void); static void st_collections_group_parts_part_source2(void); @@ -1052,6 +1053,8 @@ New_Statement_Handler statement_handlers_short[] = norepeat; -> repeat_events: 0; precise; -> precise_is_inside: 1; noprecise; -> precise_is_inside: 0; + render; -> no_render: 0; + norender; -> no_render: 1; scale; -> scale: 1; noscale; -> scale: 0; desc { @@ -1078,6 +1081,7 @@ New_Statement_Handler statement_handlers_short_single[] = {"collections.group.parts.part.noprecise", st_collections_group_parts_part_noprecise}, {"collections.group.parts.part.scale", st_collections_group_parts_part_scale}, {"collections.group.parts.part.noscale", st_collections_group_parts_part_noscale}, + {"collections.group.parts.part.render", st_collections_group_parts_part_render}, {"collections.group.parts.part.norender", st_collections_group_parts_part_no_render}, {"collections.group.parts.part.description.vis", st_collections_group_parts_part_description_vis}, {"collections.group.parts.part.description.hid", st_collections_group_parts_part_description_hid}, @@ -5780,6 +5784,12 @@ st_collections_group_parts_part_no_render(void) current_part->no_render = EINA_TRUE; } +static void +st_collections_group_parts_part_render(void) +{ + current_part->no_render = EINA_FALSE; +} + /** @page edcref @property --
[EGIT] [core/efl] master 03/03: Edje tests: Test inheritance of flag no_render
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=73f9ca62970062b08efce3c09613f7a30657dd9e commit 73f9ca62970062b08efce3c09613f7a30657dd9e Author: Jean-Philippe AndreDate: Fri Oct 2 12:21:56 2015 +0900 Edje tests: Test inheritance of flag no_render --- src/tests/edje/data/test_filters.edc | 12 src/tests/edje/edje_test_edje.c | 6 ++ 2 files changed, 18 insertions(+) diff --git a/src/tests/edje/data/test_filters.edc b/src/tests/edje/data/test_filters.edc index e1f8b57..a526758 100644 --- a/src/tests/edje/data/test_filters.edc +++ b/src/tests/edje/data/test_filters.edc @@ -64,6 +64,18 @@ collections { image.normal: "pnl.png"; } } + part { +"mask2"; +inherit: "mask"; +render; +desc { "default"; + rel1.relative: 0.0 0.8; +} + } + part { +"mask3"; +inherit: "mask"; + } proxy { "prxy"; desc { "default"; filter { diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c index 43eacdc..6cc6cb0 100644 --- a/src/tests/edje/edje_test_edje.c +++ b/src/tests/edje/edje_test_edje.c @@ -226,6 +226,12 @@ START_TEST(edje_test_filters) sub = edje_object_part_object_get(obj, "mask"); fail_if(!eo_do_ret(sub, b, evas_obj_no_render_get())); + /* check no_render inheritance */ + sub = edje_object_part_object_get(obj, "mask2"); + fail_if(eo_do_ret(sub, b, evas_obj_no_render_get())); + sub = edje_object_part_object_get(obj, "mask3"); + fail_if(!eo_do_ret(sub, b, evas_obj_no_render_get())); + /* text part: check filter status */ text = edje_object_part_object_get(obj, "text"); fail_if(!text); --
[EGIT] [core/efl] master 02/03: edje_cc: Fix inheritance of "no_render" flag
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=60d77cf853dac901f92c75a37e42413051df9394 commit 60d77cf853dac901f92c75a37e42413051df9394 Author: Jean-Philippe AndreDate: Fri Oct 2 12:17:34 2015 +0900 edje_cc: Fix inheritance of "no_render" flag @fix --- src/bin/edje/edje_cc_handlers.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 7ae4007..156a15b 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -3488,6 +3488,7 @@ _part_copy(Edje_Part *ep, Edje_Part *ep2) ep->cursor_mode = ep2->cursor_mode; ep->multiline = ep2->multiline; ep->access = ep2->access; + ep->no_render = ep2->no_render; ep->dragable.x = ep2->dragable.x; ep->dragable.step_x = ep2->dragable.step_x; ep->dragable.count_x = ep2->dragable.count_x; --
[EGIT] [core/efl] efl-1.15 01/01: edje_cc: Fix inheritance of "no_render" flag
jpeg pushed a commit to branch efl-1.15. http://git.enlightenment.org/core/efl.git/commit/?id=3feae5456ed0cdea251ceb439deac9ef43342029 commit 3feae5456ed0cdea251ceb439deac9ef43342029 Author: Jean-Philippe AndreDate: Fri Oct 2 12:17:34 2015 +0900 edje_cc: Fix inheritance of "no_render" flag @fix --- src/bin/edje/edje_cc_handlers.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 9f2e21b..08615b4 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -3473,6 +3473,7 @@ _part_copy(Edje_Part *ep, Edje_Part *ep2) ep->cursor_mode = ep2->cursor_mode; ep->multiline = ep2->multiline; ep->access = ep2->access; + ep->no_render = ep2->no_render; ep->dragable.x = ep2->dragable.x; ep->dragable.step_x = ep2->dragable.step_x; ep->dragable.count_x = ep2->dragable.count_x; --
[EGIT] [core/efl] master 01/01: edje_cc: Fix TEXT part validation for aliased parts
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=7c8ca6b752b3f584b84aac78d8ee28bf6a6f562a commit 7c8ca6b752b3f584b84aac78d8ee28bf6a6f562a Author: Jean-Philippe AndreDate: Thu Oct 1 17:34:20 2015 +0900 edje_cc: Fix TEXT part validation for aliased parts Not 100% sure of this fix but it "works". This is just compile-time safety checking code after all, so it won't impact any existing application. This fixes commit dbf7a0e368097bec555. Tested with empc. Thanks @zmike for the report and test case. --- src/bin/edje/edje_cc_out.c | 80 ++ 1 file changed, 67 insertions(+), 13 deletions(-) diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c index c0264e6..5c79ee8 100644 --- a/src/bin/edje/edje_cc_out.c +++ b/src/bin/edje/edje_cc_out.c @@ -382,32 +382,86 @@ check_image_part_desc(Edje_Part_Collection *pc, Edje_Part *ep, } } +static Edje_Part_Collection * +_source_group_find(const char *source) +{ + Edje_Part_Collection *pc2; + Eina_List *l; + if (!source) return NULL; + EINA_LIST_FOREACH(edje_collections, l, pc2) + { +if (!strcmp(pc2->part, source)) + return pc2; + } + return NULL; +} + +static Edje_Part * +_aliased_text_part_find(Edje_Part_Collection *pc, +int id_source, const char *id_source_part) +{ + Edje_Part_Collection *group; + unsigned int i; + + if (!pc->parts[id_source]->source) + return NULL; + + group = _source_group_find(pc->parts[id_source]->source); + if (!group) return NULL; + + for (i = 0; i < group->parts_count; i++) + { +if (!strcmp(group->parts[i]->name, id_source_part)) + return group->parts[i]; + } + return NULL; +} + static void check_text_part_desc(Edje_Part_Collection *pc, Edje_Part *ep, - Edje_Part_Description_Text *epd, Eet_File *ef) + Edje_Part_Description_Text *epd, Eet_File *ef) { + Edje_Part *ep2; + if (epd->text.id_source != -1) { -if ((pc->parts[epd->text.id_source]->type != EDJE_PART_TYPE_TEXT) && -(pc->parts[epd->text.id_source]->type != EDJE_PART_TYPE_TEXTBLOCK)) +if ((pc->parts[epd->text.id_source]->type == EDJE_PART_TYPE_TEXT) || +(pc->parts[epd->text.id_source]->type == EDJE_PART_TYPE_TEXTBLOCK)) + return; + +if (epd->text.id_source_part) { - error_and_abort(ef, "Collection \"%s\" Part \"%s\" Description \"%s\" [%.3f]: " - "text.source point to a non TEXT part \"%s\"!", - pc->part, ep->name,epd->common.state.name, - epd->common.state.value, pc->parts[epd->text.id_source]->name); + ep2 = _aliased_text_part_find(pc, epd->text.id_source, epd->text.id_source_part); + if (ep2 && ((ep2->type == EDJE_PART_TYPE_TEXT) || + (ep2->type == EDJE_PART_TYPE_TEXTBLOCK))) + return; } + +error_and_abort(ef, "Collection \"%s\" Part \"%s\" Description \"%s\" [%.3f]: " +"text.source point to a non TEXT part \"%s\"!", +pc->part, ep->name, epd->common.state.name, +epd->common.state.value, pc->parts[epd->text.id_source]->name); } if (epd->text.id_text_source != -1) { -if ((pc->parts[epd->text.id_text_source]->type != EDJE_PART_TYPE_TEXT) && -(pc->parts[epd->text.id_text_source]->type != EDJE_PART_TYPE_TEXTBLOCK)) + +if ((pc->parts[epd->text.id_text_source]->type == EDJE_PART_TYPE_TEXT) || +(pc->parts[epd->text.id_text_source]->type == EDJE_PART_TYPE_TEXTBLOCK)) + return; + +if (epd->text.id_text_source_part) { - error_and_abort(ef, "Collection \"%s\" Part \"%s\" Description \"%s\" [%.3f]: " - "text.text_source point to a non TEXT part \"%s\"!", - pc->part, ep->name,epd->common.state.name, - epd->common.state.value, pc->parts[epd->text.id_text_source]->name); + ep2 = _aliased_text_part_find(pc, epd->text.id_text_source, epd->text.id_text_source_part); + if (ep2 && ((ep2->type == EDJE_PART_TYPE_TEXT) || + (ep2->type == EDJE_PART_TYPE_TEXTBLOCK))) + return; } + +error_and_abort(ef, "Collection \"%s\" Part \"%s\" Description \"%s\" [%.3f]: " +"text.text_source point to a non TEXT part \"%s\"!", +pc->part, ep->name,epd->common.state.name, +epd->common.state.value, pc->parts[epd->text.id_text_source]->name); } } --
[EGIT] [core/efl] master 01/01: evas_render: Fix invalid clip
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8fe237c08897de07bb9563bfe6dfaf385a0d8244 commit 8fe237c08897de07bb9563bfe6dfaf385a0d8244 Author: Jean-Philippe AndreDate: Tue Sep 15 18:23:27 2015 +0900 evas_render: Fix invalid clip Test case: elementary_test -to "Evas Map 3D" The cube was clipped to its top-left corner. What's really weird is that this code patch is for non-mapped objects. --- src/lib/evas/canvas/evas_render.c | 4 1 file changed, 4 deletions(-) diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index aee5a13..772be0e 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -1730,11 +1730,7 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, } else { - const Evas_Coord_Rectangle *clip = >cur->geometry; - ctx = ENFN->context_dup(ENDT, context); - ENFN->context_clip_clip(ENDT, ctx, clip->x + off_x, clip->y + off_y, clip->w, clip->h); - if (obj->cur->clipper) { Evas_Object_Protected_Data *clipper = obj->cur->clipper; --
[EGIT] [core/efl] master 03/09: Evas masking: Fix potential invalid access to mask image
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d69f9e0b84f0e3827fbee328fc4a6a46e499faf6 commit d69f9e0b84f0e3827fbee328fc4a6a46e499faf6 Author: Jean-Philippe AndreDate: Mon Aug 31 17:28:58 2015 +0900 Evas masking: Fix potential invalid access to mask image After clip_image_get, the old mask may be replaced by a new one, and unref'ed, but it is later on set back as the context mask image. Maybe it's possible that there was 0 reference and the image got freed in between. No idea how to test this. @fix --- src/lib/evas/canvas/evas_render.c | 4 src/lib/evas/filters/evas_filter.c | 10 +- src/lib/evas/include/evas_private.h | 2 +- src/modules/evas/engines/gl_generic/evas_engine.c | 8 +++- src/modules/evas/engines/software_generic/evas_engine.c | 16 +++- 5 files changed, 36 insertions(+), 4 deletions(-) diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index 0618e1a..faa56c5 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -1559,6 +1559,8 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, e->engine.func->context_clip_unset(e->engine.data.output, context); e->engine.func->context_clip_image_set (e->engine.data.output, context, oldm_sfc, oldm_x, oldm_y, e, do_async); + /* unref image since clip_image_get refs it */ + if (oldm_sfc) e->engine.func->image_free(e->engine.data.output, oldm_sfc); } // FIXME: needs to cache these maps and @@ -1694,6 +1696,8 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, e->engine.func->context_clip_unset(e->engine.data.output, ctx); e->engine.func->context_clip_image_set (e->engine.data.output, ctx, oldm_sfc, oldm_x, oldm_y, e, do_async); + /* unref image since clip_image_get refs it */ + if (oldm_sfc) e->engine.func->image_free(e->engine.data.output, oldm_sfc); } if (!use_mapped_ctx) e->engine.func->context_free(e->engine.data.output, ctx); diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c index 5499608..bd2ccfc 100644 --- a/src/lib/evas/filters/evas_filter.c +++ b/src/lib/evas/filters/evas_filter.c @@ -263,6 +263,9 @@ evas_filter_context_destroy(Evas_Filter_Context *ctx) EINA_INLIST_FREE(ctx->commands, cmd) _command_del(ctx, cmd); + if (ctx->target.mask) + ctx->evas->engine.func->image_free(ctx->evas->engine.data.output, ctx->target.mask); + free(ctx); } @@ -1497,6 +1500,8 @@ Eina_Bool evas_filter_target_set(Evas_Filter_Context *ctx, void *draw_context, void *surface, int x, int y) { + void *mask = NULL; + EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, EINA_FALSE); ctx->target.bufid = evas_filter_buffer_image_new(ctx, surface); @@ -1513,7 +1518,10 @@ evas_filter_target_set(Evas_Filter_Context *ctx, void *draw_context, ctx->target.color_use = EINA_FALSE; ENFN->context_clip_image_get - (ENDT, draw_context, >target.mask, >target.mask_x, >target.mask_y); + (ENDT, draw_context, , >target.mask_x, >target.mask_y); + if (ctx->target.mask) + ctx->evas->engine.func->image_free(ctx->evas->engine.data.output, ctx->target.mask); + ctx->target.mask = mask; if (ctx->gl_engine) { diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index f4e019e..f513be4 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1268,7 +1268,7 @@ struct _Evas_Func 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, Evas_Public_Data *evas, Eina_Bool do_async); 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_image_get) (void *data, void *context, void **surface, int *x, int *y); /* incref surface if not NULL */ 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/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c index 8211bb6..9d93c43 100644 --- a/src/modules/evas/engines/gl_generic/evas_engine.c +++ b/src/modules/evas/engines/gl_generic/evas_engine.c @@
[EGIT] [core/efl] master 05/09: evas: Add internal context_dup function
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=69cbbc2184050330c4a70b2432001be717e20a4b commit 69cbbc2184050330c4a70b2432001be717e20a4b Author: Jean-Philippe AndreDate: Thu Sep 3 12:03:23 2015 +0900 evas: Add internal context_dup function This will simplify some code related to clipping and masking. --- src/lib/evas/common/evas_draw.h| 1 + src/lib/evas/common/evas_draw_main.c | 26 ++ src/lib/evas/include/evas_private.h| 1 + src/modules/evas/engines/gl_generic/evas_engine.c | 13 +++ .../evas/engines/software_generic/evas_engine.c| 21 + 5 files changed, 62 insertions(+) diff --git a/src/lib/evas/common/evas_draw.h b/src/lib/evas/common/evas_draw.h index 10cb26f..0beb84c 100644 --- a/src/lib/evas/common/evas_draw.h +++ b/src/lib/evas/common/evas_draw.h @@ -5,6 +5,7 @@ EAPI void evas_common_draw_init (void); EAPI RGBA_Draw_Context *evas_common_draw_context_new (void); +EAPI RGBA_Draw_Context *evas_common_draw_context_dup (RGBA_Draw_Context *dc); EAPI void evas_common_draw_context_free (RGBA_Draw_Context *dc); EAPI void evas_common_draw_context_font_ext_set (RGBA_Draw_Context *dc, void *data, diff --git a/src/lib/evas/common/evas_draw_main.c b/src/lib/evas/common/evas_draw_main.c index 01ba20c..5830d70 100644 --- a/src/lib/evas/common/evas_draw_main.c +++ b/src/lib/evas/common/evas_draw_main.c @@ -11,6 +11,20 @@ evas_common_draw_context_cutouts_new(void) return rects; } +static void +evas_common_draw_context_cutouts_dup(Cutout_Rects *rects2, const Cutout_Rects *rects) +{ + if (!rects) return; + rects2->active = rects->active; + rects2->max = rects->max; + if (rects->max > 0) + { +const size_t sz = sizeof(Cutout_Rect) * rects->max; +rects2->rects = malloc(sz); +memcpy(rects2->rects, rects->rects, sz); + } +} + EAPI void evas_common_draw_context_cutouts_free(Cutout_Rects* rects) { @@ -81,6 +95,18 @@ evas_common_draw_context_new(void) return dc; } +EAPI RGBA_Draw_Context * +evas_common_draw_context_dup(RGBA_Draw_Context *dc) +{ + RGBA_Draw_Context *dc2; + + if (!dc) return evas_common_draw_context_new(); + dc2 = calloc(1, sizeof(RGBA_Draw_Context)); + memcpy(dc2, dc, sizeof(RGBA_Draw_Context)); + evas_common_draw_context_cutouts_dup(>cutout, >cutout); + return dc2; +} + EAPI void evas_common_draw_context_free(RGBA_Draw_Context *dc) { diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index f513be4..80c04a0 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1263,6 +1263,7 @@ struct _Evas_Func void (*output_dump) (void *data); void *(*context_new)(void *data); + void *(*context_dup)(void *data, void *context); 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); diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c index 9d93c43..0153c80 100644 --- a/src/modules/evas/engines/gl_generic/evas_engine.c +++ b/src/modules/evas/engines/gl_generic/evas_engine.c @@ -2182,6 +2182,18 @@ eng_context_free(void *data, void *context) evas_common_draw_context_free(context); } +static void * +eng_context_dup(void *data EINA_UNUSED, void *context) +{ + RGBA_Draw_Context *ctx; + + ctx = evas_common_draw_context_dup(context); + if (ctx->clip.mask) + evas_gl_common_image_ref(ctx->clip.mask); + + return ctx; +} + static void eng_context_3d_use(void *data) { @@ -2565,6 +2577,7 @@ module_open(Evas_Module *em) ORD(context_clip_image_set); ORD(context_clip_image_unset); ORD(context_clip_image_get); + ORD(context_dup); ORD(context_free); ORD(rectangle_draw); diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c index 3315fef..3291b2a 100644 --- a/src/modules/evas/engines/software_generic/evas_engine.c +++ b/src/modules/evas/engines/software_generic/evas_engine.c @@ -438,6 +438,26 @@ eng_context_new(void *data EINA_UNUSED) return evas_common_draw_context_new(); } +static void * +eng_context_dup(void *data EINA_UNUSED, void *context) +{ + RGBA_Draw_Context *ctx; + + ctx = evas_common_draw_context_dup(context); + if (ctx->clip.mask) + { +Image_Entry *im = ctx->clip.mask; +#ifdef EVAS_CSERVE2 +if
[EGIT] [core/efl] master 07/09: evas_render: simplify masking and clipping in general
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f654a3b300c220b376f6400a3499de7bfbeb2c81 commit f654a3b300c220b376f6400a3499de7bfbeb2c81 Author: Jean-Philippe AndreDate: Thu Sep 3 14:06:36 2015 +0900 evas_render: simplify masking and clipping in general Use context_dup to inherit from previous contexts in a clean manner. This removes the need for restoring the previous clip information. Plus, this commit removes lines of code so it must be good, right? --- src/lib/evas/canvas/evas_render.c | 105 + src/lib/evas/include/evas_common_private.h | 2 +- 2 files changed, 33 insertions(+), 74 deletions(-) diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index 15a011c..3ff1986 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -1250,13 +1250,10 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, Evas_Proxy_Render_Data *proxy_render_data, int level, Eina_Bool use_mapped_ctx, Eina_Bool do_async) { - void *ctx; - Eina_Bool restore_image_clip = EINA_FALSE, old_use_clip = EINA_FALSE; - int oldm_x = 0, oldm_y = 0, ocx = 0, ocy = 0, ocw = 0, och = 0; Evas_Object_Protected_Data *obj2; Eina_Bool clean_them = EINA_FALSE; Eina_Bool proxy_src_clip = EINA_TRUE; - void *oldm_sfc = NULL; + void *ctx; //Don't Render if the source is invisible. if (!proxy_render_data) @@ -1493,7 +1490,11 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, } EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write); } -ENFN->context_clip_unset(ENDT, context); + +/* duplicate context and reset clip */ +ctx = ENFN->context_dup(ENDT, context); +ENFN->context_clip_unset(ENDT, ctx); + if (obj->map->surface) { if (obj->cur->clipper) @@ -1508,7 +1509,7 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, } EINA_COW_STATE_WRITE_END(obj, state_write, cur); } - _evas_render_mapped_context_clip_set(evas, eo_obj, obj, context, + _evas_render_mapped_context_clip_set(evas, eo_obj, obj, ctx, proxy_render_data, off_x, off_y); @@ -1525,45 +1526,27 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, if (mask->mask->surface) { -restore_image_clip = EINA_TRUE; -ENFN->context_clip_image_get - (ENDT, context, - _sfc, _x, _y); -old_use_clip = ENFN->context_clip_get - (ENDT, context, - , , , ); -ENFN->context_clip_image_set - (ENDT, context, - mask->mask->surface, - mask->cur->geometry.x + off_x, - mask->cur->geometry.y + off_y, - evas, do_async); +ENFN->context_clip_image_set(ENDT, ctx, mask->mask->surface, + mask->cur->geometry.x + off_x, + mask->cur->geometry.y + off_y, + evas, do_async); } } } } -//if (surface == ENFN) - ENFN->context_clip_clip(ENDT, context, ecx, ecy, ecw, ech); +//if (surface == ENFN) +ENFN->context_clip_clip(ENDT, ctx, ecx, ecy, ecw, ech); if (obj->cur->cache.clip.visible || !proxy_src_clip) { - ENFN->context_multiplier_unset(ENDT, context); - ENFN->context_render_op_set(ENDT, context, obj->cur->render_op); + ENFN->context_multiplier_unset(ENDT, ctx); + ENFN->context_render_op_set(ENDT, ctx, obj->cur->render_op); evas_draw_image_map_async_check (obj, ENDT, ctx, surface, obj->map->surface, obj->map->spans, obj->map->cur.map->smooth, 0, do_async); } -if (restore_image_clip) - { - if (old_use_clip) - ENFN->context_clip_set(ENDT, context, ocx, ocy, ocw, och); - else - ENFN->context_clip_unset(ENDT, context); - ENFN->context_clip_image_set(ENDT, context, oldm_sfc, oldm_x, oldm_y, evas, do_async); -
[EGIT] [core/efl] master 04/09: evas_render: moar debug (REND_DBG)
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=bcbf7d14e66b7438a7756198d2d6a84c9df672b5 commit bcbf7d14e66b7438a7756198d2d6a84c9df672b5 Author: Jean-Philippe AndreDate: Tue Sep 1 20:47:40 2015 +0900 evas_render: moar debug (REND_DBG) --- src/lib/evas/canvas/evas_render.c | 44 +++ 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index faa56c5..371c8f4 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -20,6 +20,7 @@ #ifdef REND_DBG static FILE *dbf = NULL; +static int __RD_level = 0; static void rend_dbg(const char *txt) @@ -39,6 +40,7 @@ rend_dbg(const char *txt) #define RD(, args...) \ do { \ char __tmpbuf[4096]; int __tmpi; \ + __RD_level = ; \ if () { \ for (__tmpi = 0; __tmpi < * 2; __tmpi++) \ __tmpbuf[__tmpi] = ' '; \ @@ -51,6 +53,7 @@ rend_dbg(const char *txt) #define IFRD(ifcase, , args...) \ if (ifcase) { \ char __tmpbuf[4096]; int __tmpi; \ + __RD_level = ; \ if () { \ for (__tmpi = 0; __tmpi < * 2; __tmpi++) \ __tmpbuf[__tmpi] = ' '; \ @@ -1273,7 +1276,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, RD(0, ", ctx:%p, sfc:%p, offset:%i,%i, %s, use_mapped_ctx:%d, %s)\n", context, surface, off_x, off_y, mapped ? "mapped" : "normal", use_mapped_ctx, do_async ? "async" : "sync"); RD(level, " obj: '%s' %s", obj->type, obj->is_smart ? "(smart) " : ""); - if (obj->name) RD(0, " '%s'\n", obj->name); + if (obj->name) RD(0, "'%s'\n", obj->name); else RD(0, "\n"); if (obj->cur->clipper) { @@ -1285,6 +1288,10 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, obj->cur->clipper->cur->geometry.x, obj->cur->clipper->cur->geometry.y, obj->cur->clipper->cur->geometry.w, obj->cur->clipper->cur->geometry.h); } + + RD(level, " geom: %d,%d %dx%d, cache.clip: (vis: %d) %d,%d %dx%d\n", + obj->cur->geometry.x, obj->cur->geometry.y, obj->cur->geometry.w, obj->cur->geometry.h, + obj->cur->cache.clip.visible, obj->cur->cache.clip.x, obj->cur->cache.clip.y, obj->cur->cache.clip.w, obj->cur->cache.clip.h); #endif if (mapped) @@ -1294,6 +1301,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, RD(level, " is mask: redraw:%d sfc:%p\n", obj->mask->redraw, obj->mask->surface); if (!use_mapped_ctx || (surface != obj->mask->surface)) { + RD(level, " not rendering mask surface\n"); RD(level, "}\n"); return clean_them; } @@ -1304,6 +1312,9 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, if ((!evas_object_is_visible(eo_obj, obj)) || (obj->clip.clipees) || (obj->cur->have_clipees) || (obj->no_render)) { + IFRD(obj->no_render, level, " proxy_src_clip + no_render\n"); + IFRD(obj->clip.clipees || obj->cur->have_clipees, level, " proxy_src_clip + has clippees\n"); + IFRD(!evas_object_is_visible(eo_obj, obj), level, " not visible\n"); RD(level, "}\n"); return clean_them; } @@ -1311,12 +1322,15 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, else if (!evas_object_is_proxy_visible(eo_obj, obj) || (obj->clip.clipees) || (obj->cur->have_clipees)) { + IFRD(!evas_object_is_proxy_visible(eo_obj, obj), level, " proxy not visible\n"); + IFRD(obj->clip.clipees || obj->cur->have_clipees, level, " has clippees\n"); RD(level, "}\n"); return clean_them; } else if (obj->no_render && (!use_mapped_ctx || (surface != obj->proxy->surface))) { - RD(level, " no render\n}\n"); + RD(level, " no_render\n"); + RD(level, "}\n"); return clean_them; } } @@ -1324,6 +1338,9 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, (_evas_render_can_render(eo_obj, obj )) { +IFRD(!evas_object_is_active(eo_obj, obj), level, " not active\n"); +IFRD(!_evas_render_can_render(eo_obj, obj), level, " can't render\n"); +IFRD(obj->clip.clipees, level, " has clippees\n"); RD(level, "}\n"); return clean_them; } @@ -1581,8 +1598,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, if (mapped) { - RD(level, " draw child of mapped obj: '%s'%s\n", -obj->type, obj->is_smart ? " (smart)" : ""); + RD(level, " draw child
[EGIT] [core/efl] master 02/09: Evas masking: Make sure to check alloc before freeing old image
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b6abbf12774811591f6a8af545fd28329271b83e commit b6abbf12774811591f6a8af545fd28329271b83e Author: Jean-Philippe AndreDate: Mon Aug 31 16:46:19 2015 +0900 Evas masking: Make sure to check alloc before freeing old image Okay, I'm being paranoid and this can't possibly happen (calloc fail? yeh) but this makes sure we don't return NULL after freeing the original image. --- src/modules/evas/engines/gl_generic/evas_engine.c | 32 +++ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c index fabd6e0..8211bb6 100644 --- a/src/modules/evas/engines/gl_generic/evas_engine.c +++ b/src/modules/evas/engines/gl_generic/evas_engine.c @@ -1229,7 +1229,7 @@ eng_image_scaled_update(void *data EINA_UNUSED, void *scaled, void *image, Eina_Bool smooth, Eina_Bool alpha, Evas_Colorspace cspace EINA_UNUSED) { - Evas_GL_Image *dst = scaled; + Evas_GL_Image *dst = scaled, *newdst; Evas_GL_Image *src = image; Evas_Engine_GL_Context *gc; Eina_Bool reffed = EINA_FALSE; @@ -1266,6 +1266,9 @@ eng_image_scaled_update(void *data EINA_UNUSED, void *scaled, void *image, return NULL; } + newdst = calloc(1, sizeof(Evas_GL_Image)); + if (!newdst) return NULL; + if (dst) { if (dst->scaled.origin == src) @@ -1283,24 +1286,21 @@ eng_image_scaled_update(void *data EINA_UNUSED, void *scaled, void *image, evas_gl_common_image_free(dst); } - dst = calloc(1, sizeof(Evas_GL_Image)); - if (!dst) return NULL; - - dst->references = 1; - dst->gc = gc; - dst->cs.space = src->cs.space; - dst->alpha = alpha; - dst->w = dst_w; - dst->h = dst_h; - dst->tex = src->tex; - dst->tex->references++; - dst->tex_only = 1; + newdst->references = 1; + newdst->gc = gc; + newdst->cs.space = src->cs.space; + newdst->alpha = alpha; + newdst->w = dst_w; + newdst->h = dst_h; + newdst->tex = src->tex; + newdst->tex->references++; + newdst->tex_only = 1; if (!reffed) src->references++; - dst->scaled.origin = src; - dst->scaled.smooth = smooth; + newdst->scaled.origin = src; + newdst->scaled.smooth = smooth; - return dst; + return newdst; } static void --
[EGIT] [core/efl] master 09/09: evas_render: Fix some clipping issues inside proxy
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ef0ec6bed335175d74e64c99d68e07a97110c86d commit ef0ec6bed335175d74e64c99d68e07a97110c86d Author: Jean-Philippe AndreDate: Thu Sep 3 17:38:48 2015 +0900 evas_render: Fix some clipping issues inside proxy Inside a proxy, clipping information might be wrong since the source object may be at a different position than within the proxy. If source_clip is not set, then we need to discard all clips that are outside the proxy context. So we just propagate the clip information inside the current draw context, and even recurse from clipper to clipper to find the final state of clipping. Map and proxies and others (who said masks?) should definitely rely more on the same model. This code is not a mess. At all. You gotta love evas_render. --- src/lib/evas/canvas/evas_canvas3d_texture.c | 1 + src/lib/evas/canvas/evas_render.c | 123 ++-- src/lib/evas/include/evas_private.h | 1 + 3 files changed, 102 insertions(+), 23 deletions(-) diff --git a/src/lib/evas/canvas/evas_canvas3d_texture.c b/src/lib/evas/canvas/evas_canvas3d_texture.c index 58c1e28..e01762d 100644 --- a/src/lib/evas/canvas/evas_canvas3d_texture.c +++ b/src/lib/evas/canvas/evas_canvas3d_texture.c @@ -137,6 +137,7 @@ _texture_proxy_subrender(Evas_Canvas3D_Texture *obj) .eo_proxy = NULL, .proxy_obj = NULL, .eo_src = pd->source, + .src_obj = source, .source_clip = EINA_FALSE }; diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index c4fd0ac..37b4a15 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -1203,6 +1203,31 @@ _evas_render_can_use_overlay(Evas_Public_Data *e, Evas_Object *eo_obj) return EINA_TRUE; } +static Eina_Bool +_proxy_context_clip(Evas_Public_Data *evas, void *ctx, Evas_Proxy_Render_Data *proxy_render_data, Evas_Object_Protected_Data *obj, int off_x, int off_y) +{ + const Evas_Coord_Rectangle *clip; + Evas_Object_Protected_Data *clipper; + + /* cache.clip can not be relied on, since the evas is frozen, but we need +* to set the clip. so we recurse from clipper to clipper until we reach +* the source object's clipper */ + + if (!proxy_render_data || proxy_render_data->source_clip) return EINA_TRUE; + if (!obj || !obj->cur->clipper) return EINA_TRUE; + + clipper = obj->cur->clipper; + if (!clipper->cur->visible) return EINA_FALSE; + clip = >cur->geometry; + ENFN->context_clip_clip(ENDT, ctx, clip->x + off_x, clip->y + off_y, clip->w, clip->h); + + /* stop if we found the source object's clipper */ + if (clipper == proxy_render_data->proxy_obj->cur->clipper) return EINA_TRUE; + + /* recurse to the clipper itself */ + return _proxy_context_clip(evas, ctx, proxy_render_data, clipper, off_x, off_y); +} + static void _evas_render_mapped_context_clip_set(Evas_Public_Data *evas, Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *ctx, Evas_Proxy_Render_Data *proxy_render_data, int off_x, int off_y) { @@ -1253,9 +1278,9 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, Eina_Bool proxy_src_clip = EINA_TRUE; void *ctx; - //Don't Render if the source is invisible. if (!proxy_render_data) { +/* don't render if the source is invisible */ if ((evas_object_is_source_invisible(eo_obj, obj))) return clean_them; } @@ -1264,6 +1289,10 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, evas_object_clip_recalc(obj); + /* leave early if clipper is not visible */ + if (obj->cur->clipper && !obj->cur->clipper->cur->visible) + return clean_them; + #ifdef REND_DBG RD(level, "{\n"); RD(level, " evas_render_mapped(evas:%p, obj:%p", evas, obj); @@ -1500,6 +1529,7 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, /* duplicate context and reset clip */ ctx = ENFN->context_dup(ENDT, context); ENFN->context_clip_unset(ENDT, ctx); +//ENFN->context_multiplier_unset(ENDT, ctx); // this probably should be here, too if (obj->map->surface) { @@ -1611,6 +1641,18 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, evas, do_async); } } + else if (!proxy_src_clip) +{ + if (!_proxy_context_clip(evas, ctx, proxy_render_data, obj, off_x, off_y)) + return clean_them; +} + +#ifdef REND_DBG + int _c, _cx, _cy, _cw, _ch; + _c = ENFN->context_clip_get(ENDT, ctx, &_cx, &_cy, &_cw,
[EGIT] [core/efl] master 08/09: evas_render: print out context clip with REND_DBG
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4ac9d2af547a9a38c65eca945d73b2916fe48614 commit 4ac9d2af547a9a38c65eca945d73b2916fe48614 Author: Jean-Philippe AndreDate: Thu Sep 3 16:36:32 2015 +0900 evas_render: print out context clip with REND_DBG --- src/lib/evas/canvas/evas_render.c | 45 --- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index 3ff1986..c4fd0ac 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -1204,7 +1204,7 @@ _evas_render_can_use_overlay(Evas_Public_Data *e, Evas_Object *eo_obj) } static void -_evas_render_mapped_context_clip_set(Evas_Public_Data *e, Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *ctx, Evas_Proxy_Render_Data *proxy_render_data, int off_x, int off_y) +_evas_render_mapped_context_clip_set(Evas_Public_Data *evas, Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *ctx, Evas_Proxy_Render_Data *proxy_render_data, int off_x, int off_y) { int x, y, w, h; Eina_Bool proxy_src_clip = EINA_TRUE; @@ -1224,8 +1224,7 @@ _evas_render_mapped_context_clip_set(Evas_Public_Data *e, Evas_Object *eo_obj, E obj->cur->clipper->cur->cache.clip.w, obj->cur->clipper->cur->cache.clip.h); -e->engine.func->context_clip_set(e->engine.data.output, - ctx, x + off_x, y + off_y, w, h); +ENFN->context_clip_set(ENDT, ctx, x + off_x, y + off_y, w, h); } else { @@ -1236,8 +1235,7 @@ _evas_render_mapped_context_clip_set(Evas_Public_Data *e, Evas_Object *eo_obj, E y = obj->cur->clipper->cur->geometry.y + off_y; w = obj->cur->clipper->cur->geometry.w; h = obj->cur->clipper->cur->geometry.h; - e->engine.func->context_clip_set(e->engine.data.output, ctx, x, y, - w, h); + ENFN->context_clip_clip(ENDT, ctx, x, y, w, h); } } } @@ -1289,6 +1287,11 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, RD(level, " geom: %d,%d %dx%d, cache.clip: (vis: %d) %d,%d %dx%d\n", obj->cur->geometry.x, obj->cur->geometry.y, obj->cur->geometry.w, obj->cur->geometry.h, obj->cur->cache.clip.visible, obj->cur->cache.clip.x, obj->cur->cache.clip.y, obj->cur->cache.clip.w, obj->cur->cache.clip.h); + { + int _c, _cx, _cy, _cw, _ch; + _c = ENFN->context_clip_get(ENDT, context, &_cx, &_cy, &_cw, &_ch); + RD(level, " context clip: [%d] %d,%d %dx%d\n", _c, _cx, _cy, _cw, _ch); + } #endif if (mapped) @@ -1467,6 +1470,11 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, obj->cur->geometry.h); ENFN->context_clip_set(ENDT, ctx, x, y, w, h); +#ifdef REND_DBG + int _c, _cx, _cy, _cw, _ch; + _c = ENFN->context_clip_get(ENDT, ctx, &_cx, &_cy, &_cw, &_ch); + RD(level, " draw mapped obj: render(clip: [%d] %d,%d %dx%d)\n", _c, _cx, _cy, _cw, _ch); +#endif obj->func->render(eo_obj, obj, obj->private_data, ENDT, ctx, obj->map->surface, off_x2, off_y2, @@ -1476,8 +1484,6 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, rendered = EINA_TRUE; } -RD(level, " draw map\n"); - if (rendered) { EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write) @@ -1540,6 +1546,11 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, { ENFN->context_multiplier_unset(ENDT, ctx); ENFN->context_render_op_set(ENDT, ctx, obj->cur->render_op); +#ifdef REND_DBG + int _c, _cx, _cy, _cw, _ch; + _c = ENFN->context_clip_get(ENDT, ctx, &_cx, &_cy, &_cw, &_ch); + RD(level, " draw image map(clip: [%d] %d,%d %dx%d)\n", _c, _cx, _cy, _cw, _ch); +#endif evas_draw_image_map_async_check (obj, ENDT, ctx, surface, obj->map->surface, obj->map->spans, @@ -1566,7 +1577,7 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, if (mapped) { - RD(level, " draw child of mapped obj\n"); + RD(level, " child of mapped obj\n"); if (use_mapped_ctx) ctx = ENFN->context_dup(ENDT, context); @@ -1653,7 +1664,11 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, } } } - RD(level, " render()\n"); +#ifdef REND_DBG + int _c,
[EGIT] [core/efl] master 01/09: Evas: Remove useless include
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b7ce5d9c47d34dd18b1cb15676f4894e5769d42a commit b7ce5d9c47d34dd18b1cb15676f4894e5769d42a Author: Jean-Philippe AndreDate: Thu Aug 27 17:14:03 2015 +0900 Evas: Remove useless include config.h is already included in the private headers, and should be included first anyways. --- src/modules/evas/engines/gl_common/evas_gl_common.h | 1 - 1 file changed, 1 deletion(-) 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 d6bf39e..0ff6d04 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_common.h +++ b/src/modules/evas/engines/gl_common/evas_gl_common.h @@ -3,7 +3,6 @@ #include "evas_common_private.h" #include "evas_private.h" -#include "config.h" #include #include --
[EGIT] [core/efl] master 01/01: Evas filters: Fix build for Jenkins gcc_x32
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2472dfdb240731084ba65ce3075da5548af1c459 commit 2472dfdb240731084ba65ce3075da5548af1c459 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Fri Aug 21 11:06:50 2015 +0900 Evas filters: Fix build for Jenkins gcc_x32 Disable bit32 library if it's not available. We should probably either ship it or disable it altogether for the filters. Hmm. --- src/lib/evas/filters/evas_filter_parser.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c index a2f43f8..2d02afa 100644 --- a/src/lib/evas/filters/evas_filter_parser.c +++ b/src/lib/evas/filters/evas_filter_parser.c @@ -2397,7 +2397,9 @@ static const luaL_Reg lj_lib_load[] = { { LUA_STRLIBNAME, luaopen_string }, { LUA_MATHLIBNAME,luaopen_math }, { LUA_DBLIBNAME, luaopen_debug }, +#ifdef LUA_BITLIBNAME { LUA_BITLIBNAME, luaopen_bit }, +#endif #ifdef LUA_JITLIBNAME { LUA_JITLIBNAME, luaopen_jit }, #endif --
[EGIT] [core/efl] master 01/01: Evas filters: Fix char buffer size
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=50e91e53219a31c967e1c702073c6f960b175c90 commit 50e91e53219a31c967e1c702073c6f960b175c90 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Thu Aug 20 11:37:22 2015 +0900 Evas filters: Fix char buffer size Thanks Coverity. Fixes CID 1316684 --- src/lib/evas/filters/evas_filter_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c index f7639554..a2f43f8 100644 --- a/src/lib/evas/filters/evas_filter_parser.c +++ b/src/lib/evas/filters/evas_filter_parser.c @@ -776,7 +776,7 @@ _buffer_add(Evas_Filter_Program *pgm, const char *name, Eina_Bool alpha, buf-manual = manual; if (!name) { -char bufname[32]; +char bufname[64]; _buffer_name_format(bufname, pgm, src); buf-name = eina_stringshare_add(bufname); } --
[EGIT] [core/efl] master 06/08: Evas GL: Simplify previous commit
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=af37cc2be463ab17f4f358025b624c931598706c commit af37cc2be463ab17f4f358025b624c931598706c Author: Jean-Philippe Andre jp.an...@samsung.com Date: Tue Aug 18 17:59:21 2015 +0900 Evas GL: Simplify previous commit Also generate the debug functions for GLES 3 --- src/modules/evas/engines/gl_common/evas_gl_api.c | 912 + .../evas/engines/gl_common/evas_gl_api_gles3_def.h | 182 ++-- 2 files changed, 136 insertions(+), 958 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 b8c7240..a20eb52 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api.c @@ -1000,9 +1000,16 @@ _evgl_glViewport(GLint x, GLint y, GLsizei width, GLsizei height) // Open GLES 2.0 APIs #define _EVASGL_FUNCTION_PRIVATE_BEGIN(ret, name, param1, param2) \ - static ret evgl_##name param1 { EVGL_FUNC_BEGIN(); return _evgl_##name param2; } +static ret evgl_##name param1 { \ + EVGL_FUNC_BEGIN(); \ + return _evgl_##name param2; \ +} + #define _EVASGL_FUNCTION_BEGIN(ret, name, param1, param2) \ - static ret evgl_##name param1 { EVGL_FUNC_BEGIN(); return name param2; } +static ret evgl_##name param1 { \ + EVGL_FUNC_BEGIN(); \ + return name param2; \ +} #include evas_gl_api_def.h @@ -1011,15 +1018,47 @@ _evgl_glViewport(GLint x, GLint y, GLsizei width, GLsizei height) //-// // Open GLES 3.0 APIs -//#define _CHECK_NULL(ret, name) if (!_gles3_api.##name) return (ret)0 #define _EVASGL_FUNCTION_BEGIN(ret, name, param1, param2) \ - static ret evgl_gles3_##name param1 {\ -if (!_gles3_api.name) return (ret)0;\ -return _gles3_api.name param2; } +static ret evgl_gles3_##name param1 { \ + if (!_gles3_api.name) return (ret)0; \ + return _gles3_api.name param2; \ +} + +#define _EVASGL_FUNCTION_BEGIN_VOID(name, param1, param2) \ +static void evgl_gles3_##name param1 { \ + if (!_gles3_api.name) return; \ + _gles3_api.name param2; \ +} + +#include evas_gl_api_gles3_def.h + +#undef _EVASGL_FUNCTION_BEGIN +#undef _EVASGL_FUNCTION_BEGIN_VOID + + +//-// +// Open GLES 3.0 APIs DEBUG +#define _EVASGL_FUNCTION_BEGIN(ret, name, param1, param2) \ +static ret _evgld_##name param1 { \ + EVGLD_FUNC_BEGIN(); \ + if (!_gles3_api.name) return (ret)0; \ + ret a = _gles3_api.name param2; \ + EVGLD_FUNC_END(); \ + return a; \ +} + +#define _EVASGL_FUNCTION_BEGIN_VOID(name, param1, param2) \ +static void _evgld_##name param1 { \ + EVGLD_FUNC_BEGIN(); \ + if (!_gles3_api.name) return; \ + _gles3_api.name param2; \ + EVGLD_FUNC_END(); \ +} #include evas_gl_api_gles3_def.h #undef _EVASGL_FUNCTION_BEGIN +#undef _EVASGL_FUNCTION_BEGIN_VOID //-// // Debug Evas GL APIs @@ -2142,867 +2181,6 @@ _evgld_glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean nor } //-// -// Open GLES 3.0 APIs - -void -_evgld_glReadBuffer(GLenum mode) -{ - EVGLD_FUNC_BEGIN(); - evgl_gles3_glReadBuffer(mode); - EVGLD_FUNC_END(); -} - -void -_evgld_glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices) -{ - EVGLD_FUNC_BEGIN(); - evgl_gles3_glDrawRangeElements(mode, start, end, count, type, indices); - EVGLD_FUNC_END(); -} - -void -_evgld_glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) -{ - EVGLD_FUNC_BEGIN(); - evgl_gles3_glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels); - EVGLD_FUNC_END(); -} - -void -_evgld_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) -{ - EVGLD_FUNC_BEGIN(); - evgl_gles3_glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); - EVGLD_FUNC_END(); -} - -void -_evgld_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) -{ - EVGLD_FUNC_BEGIN(); - evgl_gles3_glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height); - EVGLD_FUNC_END(); -} - -void -_evgld_glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) -{ - EVGLD_FUNC_BEGIN(); - evgl_gles3_glCompressedTexImage3D(target, level, internalformat, width, height, depth,
[EGIT] [core/efl] master 01/08: Evas filters: Fix for Lua 5.3 (with --enable-lua-old)
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6124d0733657e425001ce51f526aea3bb8dc54e7 commit 6124d0733657e425001ce51f526aea3bb8dc54e7 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Mon Aug 17 20:02:53 2015 +0900 Evas filters: Fix for Lua 5.3 (with --enable-lua-old) Tested with LuaJIT, Lua 5.2 and Lua 5.3. @fix --- src/lib/evas/filters/evas_filter_parser.c | 73 +-- src/lib/evas/filters/lua/color.lua| 6 +-- 2 files changed, 62 insertions(+), 17 deletions(-) diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c index 3846c11..ffab2de 100644 --- a/src/lib/evas/filters/evas_filter_parser.c +++ b/src/lib/evas/filters/evas_filter_parser.c @@ -2,6 +2,14 @@ #include stdarg.h +// Lua breaks API all the time +#ifdef ENABLE_LUA_OLD +// For 5.2 -- 5.1 compatibility +# define LUA_COMPAT_ALL +// For 5.3 -- 5.1 compatibility +# define LUA_COMPAT_5_1 +#endif + #include lua.h #include lualib.h #include lauxlib.h @@ -705,7 +713,7 @@ _lua_implicit_metatable_drop(lua_State *L, const char *name) if (lua_istable(L, 1) lua_getmetatable(L, 1)) { luaL_getmetatable(L, name); -if (lua_equal(L, -1, -2)) +if (lua_rawequal(L, -1, -2)) { lua_remove(L, 1); ret = 1; @@ -1869,7 +1877,11 @@ _lua_convert_color(lua_State *L) lua_pushvalue(L, -2); //+1 (mt) lua_pushvalue(L, top); //+1 (argument) if (lua_pcall(L, 2, 1, top + 1) != 0) - return EINA_FALSE; + { +ERR(Failed to call metamethod __call: %s, lua_tostring(L, -1)); +lua_settop(L, top); +return EINA_FALSE; + } lua_insert(L, top); lua_settop(L, top); return EINA_TRUE; @@ -1931,7 +1943,7 @@ _lua_parameter_parse(Evas_Filter_Program *pgm, lua_State *L, { luaL_getmetatable(L, _lua_color_meta); lua_getmetatable(L, i); -if (!lua_isnil(L, -1) lua_equal(L, -2, -1)) +if (!lua_isnil(L, -1) lua_rawequal(L, -2, -1)) { // this is a color already cid = i; @@ -2265,8 +2277,7 @@ _lua_import_class(lua_State *L, const char *name, char **code) lua_rawget(L, -3); //-1/+1 if (lua_isfunction(L, -1)) { - lua_getglobal(L, _G); //+1 - if (lua_pcall(L, 1, 0, -3) != 0) //-2 + if (lua_pcall(L, 0, 0, -2) != 0) //-1 { ERR(Failed to register globals for '%s': %s, name, lua_tostring(L, -1)); lua_pop(L, 1); @@ -2337,6 +2348,37 @@ _lua_class_create(lua_State *L, const char *name, lua_setglobal(L, name); } +#if LUA_VERSION_NUM 502 +// From LuaJIT/src/lib_init.c +// Prevent loading package, IO and OS libs (mini-sandbox) +static const luaL_Reg lj_lib_load[] = { + { , luaopen_base }, + //{ LUA_LOADLIBNAME,luaopen_package }, + { LUA_TABLIBNAME, luaopen_table }, + //{ LUA_IOLIBNAME, luaopen_io }, + //{ LUA_OSLIBNAME, luaopen_os }, + { LUA_STRLIBNAME, luaopen_string }, + { LUA_MATHLIBNAME,luaopen_math }, + { LUA_DBLIBNAME, luaopen_debug }, + { LUA_BITLIBNAME, luaopen_bit }, +#ifdef LUA_JITLIBNAME + { LUA_JITLIBNAME, luaopen_jit }, +#endif + { NULL, NULL } +}; + +static void +_luaL_openlibs(lua_State *L) +{ + const luaL_Reg *lib; + for (lib = lj_lib_load; lib-func; lib++) { +lua_pushcfunction(L, lib-func); +lua_pushstring(L, lib-name); +lua_call(L, 1, 0); + } +} +#endif + static lua_State * _lua_state_create(Evas_Filter_Program *pgm) { @@ -2349,17 +2391,20 @@ _lua_state_create(Evas_Filter_Program *pgm) return NULL; } - luaopen_base(L); - luaopen_table(L); - luaopen_string(L); - luaopen_math(L); - luaopen_debug(L); +#if LUA_VERSION_NUM = 502 + luaL_requiref(L, , luaopen_base, 1); + luaL_requiref(L, table, luaopen_table, 1); + luaL_requiref(L, string, luaopen_string, 1); + luaL_requiref(L, math, luaopen_math, 1); + luaL_requiref(L, debug, luaopen_debug, 1); +#else + _luaL_openlibs(L); +#endif lua_settop(L, 0); // Implement print - lua_getglobal(L, _G); - luaL_register(L, NULL, printlib); - lua_pop(L, 1); + lua_pushcfunction(L, _lua_print); + lua_setglobal(L, print); // Add backtrace error function lua_pushcfunction(L, _lua_backtrace); @@ -2431,7 +2476,7 @@ _lua_backtrace(lua_State *L) if (!lua_isstring(L, 1)) /* 'message' not a string? */ return 1; /* keep it intact */ ERR(Lua error: %s, lua_tolstring(L, 1, NULL)); - lua_getfield(L, LUA_GLOBALSINDEX, debug); + lua_getglobal(L, debug); if (!lua_istable(L, -1)) { lua_pop(L, 1); diff --git a/src/lib/evas/filters/lua/color.lua b/src/lib/evas/filters/lua/color.lua index b4bcd4b..14468d0 100644 ---
[EGIT] [core/efl] master 07/08: Evas GL: Add EVGL_FUNC_BEGIN() to GLES 3 functions as well
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=371e4becd65ee9e3a14d872d5f4fccc6bb5b4430 commit 371e4becd65ee9e3a14d872d5f4fccc6bb5b4430 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Tue Aug 18 18:16:10 2015 +0900 Evas GL: Add EVGL_FUNC_BEGIN() to GLES 3 functions as well This call ensures that the context is current (context restore). --- src/modules/evas/engines/gl_common/evas_gl_api.c | 2 ++ 1 file changed, 2 insertions(+) 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 a20eb52..7af887d 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api.c @@ -1020,12 +1020,14 @@ static ret evgl_##name param1 { \ // Open GLES 3.0 APIs #define _EVASGL_FUNCTION_BEGIN(ret, name, param1, param2) \ static ret evgl_gles3_##name param1 { \ + EVGL_FUNC_BEGIN(); \ if (!_gles3_api.name) return (ret)0; \ return _gles3_api.name param2; \ } #define _EVASGL_FUNCTION_BEGIN_VOID(name, param1, param2) \ static void evgl_gles3_##name param1 { \ + EVGL_FUNC_BEGIN(); \ if (!_gles3_api.name) return; \ _gles3_api.name param2; \ } --
[EGIT] [core/efl] master 03/08: Evas filters: Fix massive memleak with async sw render
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8e9ab6440fd89b6c35d419a7198ca0b9ccc1ff61 commit 8e9ab6440fd89b6c35d419a7198ca0b9ccc1ff61 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Tue Aug 18 15:11:23 2015 +0900 Evas filters: Fix massive memleak with async sw render Oooops, the flag stolen meant that we don't hold any reference on this buffer anymore, which meant we should not increase the refcount here! @fix --- src/lib/evas/filters/evas_filter.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c index 75e36a4..5499608 100644 --- a/src/lib/evas/filters/evas_filter.c +++ b/src/lib/evas/filters/evas_filter.c @@ -503,7 +503,7 @@ _filter_buffer_data_set(Evas_Filter_Context *ctx, int bufid, void *data, fb-h = h; fb-backing = _rgba_image_alloc(fb, data); - fb-allocated = (!data (fb-backing != NULL)); + fb-allocated = (fb-backing != NULL); return fb-allocated; } @@ -606,14 +606,12 @@ evas_filter_buffer_backing_steal(Evas_Filter_Context *ctx, int bufid) buffer = _filter_buffer_get(ctx, bufid); if (!buffer) return NULL; + // we don't hold any reference on this buffer anymore buffer-stolen = EINA_TRUE; if (ctx-gl_engine) return buffer-glimage; - if (ctx-async buffer-backing) - buffer-backing-cache_entry.references++; - return buffer-backing; } --
[EGIT] [core/efl] master 04/08: Evas filters: Fix proxy buffer size in Lua
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8c8d254fbc8fbbe9be3660a2a0862035fc8983f0 commit 8c8d254fbc8fbbe9be3660a2a0862035fc8983f0 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Tue Aug 18 16:58:41 2015 +0900 Evas filters: Fix proxy buffer size in Lua In order to do that, avoid creating multiple Buffer instances when pointing to the same proxy source. This fixes buffer.width and buffer.height in Lua. --- src/lib/evas/filters/evas_filter_parser.c | 83 ++- 1 file changed, 60 insertions(+), 23 deletions(-) diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c index ffab2de..f7639554 100644 --- a/src/lib/evas/filters/evas_filter_parser.c +++ b/src/lib/evas/filters/evas_filter_parser.c @@ -725,16 +725,43 @@ _lua_implicit_metatable_drop(lua_State *L, const char *name) // End of all lua metamethods and stuff +static inline void +_buffer_name_format(char *name /*[64]*/, Evas_Filter_Program *pgm, const char *src) +{ + unsigned i; + + if (src) + { +// Cleanup name and avoid overriding existing globals +snprintf(name, 64, __source_%s, src); +name[63] = '\0'; +for (i = 0; name[i]; i++) + { + if (!isdigit(name[i]) !isalpha(name[i])) + name[i] = '_'; + } + } + else + { +sprintf(name, __buffer_%02d, ++pgm-last_bufid); + } +} + static Buffer * _buffer_add(Evas_Filter_Program *pgm, const char *name, Eina_Bool alpha, const char *src, Eina_Bool manual) { Buffer *buf; - if (_buffer_get(pgm, name)) + buf = _buffer_get(pgm, name); + if (buf) { -ERR(Buffer '%s' already exists, name); -return NULL; +if (!src) + { + ERR(Buffer '%s' already exists, name); + return NULL; + } +else return buf; } if (alpha src) @@ -750,7 +777,7 @@ _buffer_add(Evas_Filter_Program *pgm, const char *name, Eina_Bool alpha, if (!name) { char bufname[32]; -snprintf(bufname, sizeof(bufname), __buffer%02d, ++pgm-last_bufid); +_buffer_name_format(bufname, pgm, src); buf-name = eina_stringshare_add(bufname); } else @@ -829,9 +856,10 @@ _buffer_instruction_parse_run(lua_State *L, Evas_Filter_Program *pgm, Evas_Filter_Instruction *instr) { - char bufname[32] = {0}; - const char *src, *rgba; + char bufname[64] = {0}; + const char *src, *type; Eina_Bool ok, alpha = EINA_FALSE; + Buffer *buf; EINA_SAFETY_ON_NULL_RETURN_VAL(pgm, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(instr, EINA_FALSE); @@ -839,20 +867,25 @@ _buffer_instruction_parse_run(lua_State *L, // FIXME: Buffers are still referred to internally by name. // This is pretty bad with the switch to Lua. - rgba = _instruction_param_gets(instr, type, NULL); + type = _instruction_param_gets(instr, type, NULL); src = _instruction_param_gets(instr, src, NULL); - alpha = (rgba !strcasecmp(rgba, alpha)); + alpha = (type !strcasecmp(type, alpha)); - snprintf(bufname, sizeof(bufname), __buffer%02d, ++pgm-last_bufid); - ok = (_buffer_add(pgm, bufname, alpha, src, EINA_TRUE) != NULL); + if (src) + { +if (alpha) WRN(Proxy buffers can't be alpha. Disarding alpha flag.); +alpha = EINA_FALSE; + } - if (!ok) return EINA_FALSE; + _buffer_name_format(bufname, pgm, src); + buf = _buffer_add(pgm, bufname, alpha, src, EINA_TRUE); + if (!buf) return EINA_FALSE; lua_getglobal(L, bufname); instr-return_count = 1; - return ok; + return EINA_TRUE; } static int @@ -2305,22 +2338,26 @@ _filter_program_buffers_set(Evas_Filter_Program *pgm) // Register proxies if (pgm-proxies) { -Eina_Iterator *it = eina_hash_iterator_key_new(pgm-proxies); -const char *source; +Eina_Iterator *it = eina_hash_iterator_tuple_new(pgm-proxies); +Eina_Hash_Tuple *tup; -EINA_ITERATOR_FOREACH(it, source) +EINA_ITERATOR_FOREACH(it, tup) { - // Cleanup name and avoid overriding existing globals + const char *source = tup-key; char name[64]; - unsigned i; - snprintf(name, 64, __source_%s, source); - name[63] = '\0'; - for (i = 0; name[i]; i++) + Buffer *buf; + + _buffer_name_format(name, pgm, source); + buf = _buffer_add(pgm, name, EINA_FALSE, source, EINA_FALSE); + if (buf) { - if (!isdigit(name[i]) !isalpha(name[i])) -name[i] = '_'; + Evas_Filter_Proxy_Binding *bind = tup-data; + Evas_Object_Protected_Data *obj; + + obj =
[EGIT] [core/efl] master 02/08: Evas: Add debug env var EVAS_IMAGE_NO_MMAP
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ea001c3ec1fb6cfb01a794fc9a56c2609488f8f8 commit ea001c3ec1fb6cfb01a794fc9a56c2609488f8f8 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Tue Aug 18 11:27:17 2015 +0900 Evas: Add debug env var EVAS_IMAGE_NO_MMAP Looking for image buffer memory leaks with Valgrind is impossible when all images are mmaped. This is intended as a DEBUG environment variable only. --- src/lib/evas/common/evas_image_main.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/lib/evas/common/evas_image_main.c b/src/lib/evas/common/evas_image_main.c index 9c7f9df..5cf5335 100644 --- a/src/lib/evas/common/evas_image_main.c +++ b/src/lib/evas/common/evas_image_main.c @@ -28,6 +28,7 @@ static Evas_Cache_Image * eci = NULL; static Evas_Cache2 * eci2 = NULL; #endif static intreference = 0; +static intevas_image_no_mmap = -1; /* static RGBA_Image *evas_rgba_line_buffer = NULL; */ @@ -125,6 +126,14 @@ _evas_common_rgba_image_surface_size(unsigned int w, unsigned int h, int siz, block_size = 8; Eina_Bool reset_borders = EINA_TRUE; + if (EINA_UNLIKELY(evas_image_no_mmap == -1)) + { +const char *s = getenv(EVAS_IMAGE_NO_MMAP); +evas_image_no_mmap = s (atoi(s)); +if (evas_image_no_mmap) + WRN(EVAS_IMAGE_NO_MMAP is set, use this only for debugging purposes!); + } + switch (cspace) { case EVAS_COLORSPACE_GRY8: siz = w * h * sizeof(DATA8); break; @@ -162,7 +171,8 @@ _evas_common_rgba_image_surface_size(unsigned int w, unsigned int h, if (b) *b = 0; } - if (siz PAGE_SIZE) return siz; + if ((siz PAGE_SIZE) || evas_image_no_mmap) + return siz; return ALIGN_TO_PAGE(siz); @@ -187,7 +197,7 @@ _evas_common_rgba_image_surface_mmap(Image_Entry *ie, unsigned int w, unsigned i if (siz 0) return NULL; - if (siz PAGE_SIZE) + if ((siz PAGE_SIZE) || evas_image_no_mmap) return malloc(siz); if (siz ((HUGE_PAGE_SIZE * 75) / 100)) @@ -211,7 +221,7 @@ _evas_common_rgba_image_surface_munmap(void *data, unsigned int w, unsigned int size_t siz; siz = _evas_common_rgba_image_surface_size(w, h, cspace, NULL, NULL, NULL, NULL); - if (siz PAGE_SIZE) + if ((siz PAGE_SIZE) || evas_image_no_mmap) free(data); else munmap(data, siz); --
[EGIT] [core/enlightenment] enlightenment-0.17 80/85: Mixer: Fix crash when closing mixer settings
cedric pushed a commit to branch enlightenment-0.17. http://git.enlightenment.org/core/enlightenment.git/commit/?id=56421ea30a26224e67929766ebc18a9d2f24de5f commit 56421ea30a26224e67929766ebc18a9d2f24de5f Author: Jean-Philippe Andre jp.an...@samsung.com Date: Wed Jan 15 12:36:27 2014 +0900 Mixer: Fix crash when closing mixer settings app can already be NULL at this point, when called from _cb_win_del(). --- src/modules/mixer/app_mixer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/mixer/app_mixer.c b/src/modules/mixer/app_mixer.c index 1131cbd..68ae3f4 100644 --- a/src/modules/mixer/app_mixer.c +++ b/src/modules/mixer/app_mixer.c @@ -490,6 +490,9 @@ _create_ui(E_Dialog *dialog, E_Mixer_App_Dialog_Data *app) static void _mixer_app_dialog_del(E_Dialog *dialog, E_Mixer_App_Dialog_Data *app) { + if (!app) + return; + if (app-del.func) app-del.func(dialog, app-del.data); --
[EGIT] [core/efl] master 01/02: eina/btlog: Fix some Coverity issues
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=7bfecbdaf2a9cf4ebc73fc35d459ab549bd56313 commit 7bfecbdaf2a9cf4ebc73fc35d459ab549bd56313 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Fri Jul 31 15:46:08 2015 +0900 eina/btlog: Fix some Coverity issues CID 1297406 CID 1297408 CID 1297409 --- src/bin/eina/eina_btlog.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin/eina/eina_btlog.c b/src/bin/eina/eina_btlog.c index 2f46e1e..d3cbf77 100644 --- a/src/bin/eina/eina_btlog.c +++ b/src/bin/eina/eina_btlog.c @@ -66,7 +66,7 @@ path_split(const char *path, char **dir, char **file) return; } *dir = malloc(p - path + 1); - if (!dir) + if (!*dir) { *dir = NULL; *file = NULL; @@ -90,8 +90,8 @@ _addr2line(const char *bin_dir, const char *bin_name, unsigned long long addr, bin_dir, bin_name, addr); p = popen(buf, r); if (!p) return EINA_FALSE; - fscanf(p, %s\n, buf); - if (fscanf(p, %s\n, func) == 1) + if ((fscanf(p, %4095s\n, buf) == 1) + (fscanf(p, %4095s\n, func) == 1)) { if (fscanf(p, %[^:]:%i\n, buf, line) == 2) { --
[EGIT] [core/efl] master 01/01: evas/gl_drm: Fix compilation with mesa 10.6.3 on Debian
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8310b0dec7859029995a73b6dc486b0ac3f70b41 commit 8310b0dec7859029995a73b6dc486b0ac3f70b41 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Thu Jul 30 14:41:48 2015 +0900 evas/gl_drm: Fix compilation with mesa 10.6.3 on Debian Thanks @aerodynamik for the report. Fixes T2616 --- src/modules/evas/engines/gl_drm/evas_outbuf.c | 34 --- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/src/modules/evas/engines/gl_drm/evas_outbuf.c b/src/modules/evas/engines/gl_drm/evas_outbuf.c index 2c41a2a..2b1dcbc 100644 --- a/src/modules/evas/engines/gl_drm/evas_outbuf.c +++ b/src/modules/evas/engines/gl_drm/evas_outbuf.c @@ -5,6 +5,11 @@ static Outbuf *_evas_gl_drm_window = NULL; static EGLContext context = EGL_NO_CONTEXT; static int win_count = 0; +#ifdef EGL_MESA_platform_gbm +static PFNEGLGETPLATFORMDISPLAYEXTPROC dlsym_eglGetPlatformDisplayEXT = NULL; +static PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC dlsym_eglCreatePlatformWindowSurfaceEXT = NULL; +#endif + static void _evas_outbuf_gbm_surface_destroy(Outbuf *ob) { @@ -148,6 +153,23 @@ _evas_outbuf_make_current(void *data, void *doit) } static Eina_Bool +_evas_outbuf_init(void) +{ + static int _init = 0; + if (_init) return EINA_TRUE; +#ifdef EGL_MESA_platform_gbm + dlsym_eglGetPlatformDisplayEXT = (PFNEGLGETPLATFORMDISPLAYEXTPROC) + eglGetProcAddress(eglGetPlatformDisplayEXT); + EINA_SAFETY_ON_NULL_RETURN_VAL(dlsym_eglGetPlatformDisplayEXT, EINA_FALSE); + dlsym_eglCreatePlatformWindowSurfaceEXT = (PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) + eglGetProcAddress(eglCreatePlatformWindowSurfaceEXT); + EINA_SAFETY_ON_NULL_RETURN_VAL(dlsym_eglCreatePlatformWindowSurfaceEXT, EINA_FALSE); +#endif + _init = 1; + return EINA_TRUE; +} + +static Eina_Bool _evas_outbuf_egl_setup(Outbuf *ob) { int ctx_attr[3]; @@ -158,6 +180,12 @@ _evas_outbuf_egl_setup(Outbuf *ob) const GLubyte *vendor, *renderer, *version, *glslversion; Eina_Bool blacklist = EINA_FALSE; + if (!_evas_outbuf_init()) + { +ERR(Could not initialize engine!); +return EINA_FALSE; + } + /* setup gbm egl surface */ ctx_attr[0] = EGL_CONTEXT_CLIENT_VERSION; ctx_attr[1] = 2; @@ -189,7 +217,7 @@ _evas_outbuf_egl_setup(Outbuf *ob) #ifdef EGL_MESA_platform_gbm ob-egl.disp = - eglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_MESA, ob-info-info.gbm, NULL); + dlsym_eglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_MESA, ob-info-info.gbm, NULL); #else ob-egl.disp = eglGetDisplay((EGLNativeDisplayType)ob-info-info.gbm); #endif @@ -255,8 +283,8 @@ _evas_outbuf_egl_setup(Outbuf *ob) #ifdef EGL_MESA_platform_gbm ob-egl.surface[0] = - eglCreatePlatformWindowSurfaceEXT(ob-egl.disp, ob-egl.config, - ob-surface, NULL); + dlsym_eglCreatePlatformWindowSurfaceEXT(ob-egl.disp, ob-egl.config, + ob-surface, NULL); #else ob-egl.surface[0] = eglCreateWindowSurface(ob-egl.disp, ob-egl.config, --
[EGIT] [core/efl] master 01/01: Evas filters: Fix make doc, check when EFL is not installed
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b8a2a9b3c023d159d11243654fcd33c1b31e55fb commit b8a2a9b3c023d159d11243654fcd33c1b31e55fb Author: Jean-Philippe Andre jp.an...@samsung.com Date: Wed Jul 29 20:00:35 2015 +0900 Evas filters: Fix make doc, check when EFL is not installed Thanks @aerodynamik for even giving the proper environment variable to set :) Fixes T2614 --- doc/previews/Makefile.am | 2 +- src/Makefile_Edje.am | 1 + src/tests/edje/edje_test_edje.c| 4 src/tests/evas/evas_test_filters.c | 4 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/previews/Makefile.am b/doc/previews/Makefile.am index f7c405b..ba952dd 100644 --- a/doc/previews/Makefile.am +++ b/doc/previews/Makefile.am @@ -55,7 +55,7 @@ previews-data: preview_text_filter if [ -e ${top_srcdir}/doc/previews/filter_$${a}.sh ] ; then \ source ${top_srcdir}/doc/previews/filter_$${a}.sh ; \ fi ; \ - $(top_builddir)/doc/previews/preview_text_filter $${TEXT} $${FILTER} $(DATADIR)/filter_$${a}.png $${FONT} $${SIZE} ; \ + EVAS_DATA_DIR=$(top_srcdir)/src/lib/evas $(top_builddir)/doc/previews/preview_text_filter $${TEXT} $${FILTER} $(DATADIR)/filter_$${a}.png $${FONT} $${SIZE} ; \ cp $(DATADIR)/filter_$${a}.png $(HTMLDIR)/ ; \ done diff --git a/src/Makefile_Edje.am b/src/Makefile_Edje.am index 3b4c79b..6675d6d 100644 --- a/src/Makefile_Edje.am +++ b/src/Makefile_Edje.am @@ -278,6 +278,7 @@ tests/edje/edje_suite.h tests_edje_edje_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ $(EDJE_COMMON_CPPFLAGS) \ +-DTESTS_SRC_DIR=\$(top_srcdir)/src/tests/edje\ \ -DTESTS_BUILD_DIR=\$(top_builddir)/src/tests/edje\ \ @CHECK_CFLAGS@ tests_edje_edje_suite_LDADD = @CHECK_LIBS@ $(USE_EDJE_BIN_LIBS) diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c index d68a5d9..bf32f6d 100644 --- a/src/tests/edje/edje_test_edje.c +++ b/src/tests/edje/edje_test_edje.c @@ -13,6 +13,8 @@ #include edje_suite.h #include edje_tests_helpers.h +#define EVAS_DATA_DIR TESTS_SRC_DIR /../../lib/evas + START_TEST(edje_test_edje_init) { int ret; @@ -213,6 +215,8 @@ START_TEST(edje_test_filters) const char *prg, *name; Eina_Bool b; + setenv(EVAS_DATA_DIR, EVAS_DATA_DIR, 1); + obj = edje_object_add(evas); fail_unless(edje_object_file_set(obj, test_layout_get(test_filters.edj), test_group)); diff --git a/src/tests/evas/evas_test_filters.c b/src/tests/evas/evas_test_filters.c index 82d73e5..ea27256 100644 --- a/src/tests/evas/evas_test_filters.c +++ b/src/tests/evas/evas_test_filters.c @@ -17,10 +17,12 @@ #define TEST_FONT_NAME DejaVuSans,UnDotum #define TEST_FONT_SOURCE TESTS_SRC_DIR /TestFont.eet +#define EVAS_DATA_DIR TESTS_SRC_DIR /../../lib/evas #define START_FILTER_TEST() \ Ecore_Evas *ee; Evas *evas; \ Evas_Object *to; \ + setenv(EVAS_DATA_DIR, EVAS_DATA_DIR, 1); \ evas_init(); \ ecore_evas_init(); \ ee = ecore_evas_buffer_new(1, 1); \ @@ -67,6 +69,8 @@ START_TEST(evas_filter_parser) // itself is full featured. Let's just ensure that our main functions exist // and that calling them (kinda) works. + setenv(EVAS_DATA_DIR, EVAS_DATA_DIR, 1); + #define CHECK_FILTER(_a, _v) do { \ pgm = evas_filter_program_new(evas_suite, EINA_TRUE); \ if (evas_filter_program_parse(pgm, _a) != _v) \ --
[EGIT] [core/elementary] master 02/02: elm_external: shutdown elm after del callback
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=c665493038fcc2fb672ac4918af971e77b5d7e05 commit c665493038fcc2fb672ac4918af971e77b5d7e05 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Wed Jul 29 22:13:07 2015 +0900 elm_external: shutdown elm after del callback This fixes a crash in edje_inspector as: - delete callback is called on the object -- this unloaded elm - destructor is called on the object -- this did some elm stuff, in particular read the config from _elm_config (now NULL). Instead, shutdown elm after del, during free. Also reset hash pointer to NULL after free. --- src/edje_externals/elm.c | 12 +--- src/lib/elm_config.c | 3 +-- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/edje_externals/elm.c b/src/edje_externals/elm.c index d85165d..9f6b872 100644 --- a/src/edje_externals/elm.c +++ b/src/edje_externals/elm.c @@ -31,15 +31,6 @@ external_elm_shutdown(void) elm_shutdown(); } -static void -_external_obj_del(void *data EINA_UNUSED, Evas *evas EINA_UNUSED, - Evas_Object *obj, void *event_info EINA_UNUSED) -{ - evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL, - _external_obj_del); - external_elm_shutdown(); -} - void external_signal(void *data EINA_UNUSED, Evas_Object *obj, const char *sig, const char *source) @@ -106,6 +97,7 @@ _external_signal_proxy_free_cb(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED) { Elm_External_Signals_Proxy_Context *ctxt = data; + external_elm_shutdown(); free(ctxt); } @@ -201,8 +193,6 @@ external_signals_proxy(Evas_Object *obj, Evas_Object *edje, const char *part_nam evas_object_smart_callback_add (obj, d-name, _external_signal_proxy_cb, ctxt); } - evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, - _external_obj_del, NULL); } void diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c index 90fe31a..7349a3c 100644 --- a/src/lib/elm_config.c +++ b/src/lib/elm_config.c @@ -3574,6 +3574,5 @@ _elm_config_shutdown(void) _desc_shutdown(); - if (_elm_key_bindings) - eina_hash_free(_elm_key_bindings); + ELM_SAFE_FREE(_elm_key_bindings, eina_hash_free); } --
[EGIT] [core/efl] master 02/05: Evas filters: Disable debug code path
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f9c7d25b0845ab0c99cee402700d046ae318da39 commit f9c7d25b0845ab0c99cee402700d046ae318da39 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Tue Jul 28 11:27:08 2015 +0900 Evas filters: Disable debug code path --- src/lib/evas/filters/evas_filter_parser.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c index bb3f38b..ce5fa1d 100644 --- a/src/lib/evas/filters/evas_filter_parser.c +++ b/src/lib/evas/filters/evas_filter_parser.c @@ -2208,10 +2208,10 @@ static inline void _lua_import_path_get(char *path, size_t len, const char *name) { const char *pfx = _evas_module_datadir_get(); - struct stat st; size_t r; -//#ifdef FILTERS_DEBUG +#ifdef FILTERS_DEBUG + struct stat st; // This is a hack to fetch the most recent file from source if (stat(path, st) == -1) { @@ -2231,7 +2231,7 @@ _lua_import_path_get(char *path, size_t len, const char *name) free(src); if (!stat(path, st)) return; } -//#endif +#endif r = snprintf(path, len - 1, %s/filters/lua/%s.lua, pfx ? pfx : ., name); if (r = len) path[len - 1] = '\0'; --
[EGIT] [core/efl] master 04/05: Evas filters: Fix order of header file includes
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=fbd0a516072403eac1a3c81ead04e73f9e63cb23 commit fbd0a516072403eac1a3c81ead04e73f9e63cb23 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Tue Jul 28 15:13:59 2015 +0900 Evas filters: Fix order of header file includes This fixes filters on Ubuntu 32 bits. This was one hell of a weird bug to track down. Everything worked like a charm on my 64 bit machines, but filters would simply fail for no good reason: a safety check sees a NULL pointer when clearly it was properly allocated. Just after entering a function, the content of an RGBA_Image would change, even though there was no memory write there. This made the image data pointer NULL, and filters would fail miserably. So I printed out the contents of the RGBA_Image, they changed. But the memory itself had not changed. The size of the struct itself had changed when jumping from one file to another! But its definition had not! Non-sense! Unless of course a system header file was included before config.h and ino_t or off_t would switch between 32 and 64 bits... @fix --- src/lib/evas/filters/evas_filter_blur.c | 6 +++--- src/lib/evas/filters/evas_filter_bump.c | 4 ++-- src/lib/evas/filters/evas_filter_parser.c | 8 ++-- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/lib/evas/filters/evas_filter_blur.c b/src/lib/evas/filters/evas_filter_blur.c index 4c375a7..fd444cc 100644 --- a/src/lib/evas/filters/evas_filter_blur.c +++ b/src/lib/evas/filters/evas_filter_blur.c @@ -1,9 +1,9 @@ -#include math.h -#include time.h - #include evas_filter.h #include evas_filter_private.h +#include math.h +#include time.h + static int _box_blur_auto_radius(int *radii, int r) { diff --git a/src/lib/evas/filters/evas_filter_bump.c b/src/lib/evas/filters/evas_filter_bump.c index 60a9798..6155e65 100644 --- a/src/lib/evas/filters/evas_filter_bump.c +++ b/src/lib/evas/filters/evas_filter_bump.c @@ -1,10 +1,10 @@ /* Simple bump map algorithms for the software engine */ -#include math.h - #include evas_filter_private.h #include evas_blend_private.h +#include math.h + #ifdef CLAMP # undef CLAMP #endif diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c index ce5fa1d..e5fef55 100644 --- a/src/lib/evas/filters/evas_filter_parser.c +++ b/src/lib/evas/filters/evas_filter_parser.c @@ -1,15 +1,11 @@ +#include evas_filter_private.h + #include stdarg.h #include lua.h #include lualib.h #include lauxlib.h -#include evas_filter_private.h - -#if LUA_VERSION_NUM == 502 -# define LUA52 1 -#endif - #define FILTERS_LEGACY_COMPAT #define EVAS_FILTER_MODE_GROW (EVAS_FILTER_MODE_LAST+1) --
[EGIT] [core/efl] master 03/05: Evas filters: Fix COW usage in filter mixin
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0058cd08f4adfc0db4d29355d055d1748d28b903 commit 0058cd08f4adfc0db4d29355d055d1748d28b903 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Tue Jul 28 14:17:53 2015 +0900 Evas filters: Fix COW usage in filter mixin --- src/lib/evas/canvas/evas_filter_mixin.c | 141 +--- 1 file changed, 76 insertions(+), 65 deletions(-) diff --git a/src/lib/evas/canvas/evas_filter_mixin.c b/src/lib/evas/canvas/evas_filter_mixin.c index ffc8dfa..934a8c6 100644 --- a/src/lib/evas/canvas/evas_filter_mixin.c +++ b/src/lib/evas/canvas/evas_filter_mixin.c @@ -76,6 +76,9 @@ _filter_source_hash_free_cb(void *data) free(pb); } +#define FCOW_BEGIN(_pd) eina_cow_write(evas_object_filter_cow, (const Eina_Cow_Data**)(_pd-data)) +#define FCOW_END(_fcow, _pd) eina_cow_done(evas_object_filter_cow, (const Eina_Cow_Data**)(_pd-data), _fcow, EINA_TRUE) + Eina_Bool evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, @@ -90,8 +93,8 @@ evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj, void *drawctx; Eina_Bool ok; void *previous = pd-data-output; -Evas_Object_Filter_Data *fcow = - eina_cow_write(evas_object_filter_cow, (const Eina_Cow_Data**)(pd-data)); +Evas_Object_Filter_Data *fcow; +void *filter_output; /* NOTE: Filter rendering is now done ENTIRELY on CPU. * So we rely on cache/cache2 to allocate a real image buffer, @@ -120,37 +123,43 @@ evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj, else ENFN-context_multiplier_unset(output, context); -if (!fcow-chain) +if (!pd-data-chain) { Evas_Filter_Program *pgm; - pgm = evas_filter_program_new(fcow-name, alpha); - evas_filter_program_source_set_all(pgm, fcow-sources); - evas_filter_program_data_set_all(pgm, fcow-data); + pgm = evas_filter_program_new(pd-data-name, alpha); + evas_filter_program_source_set_all(pgm, pd-data-sources); + evas_filter_program_data_set_all(pgm, pd-data-data); evas_filter_program_state_set(pgm, eo_obj, obj, - fcow-state.cur.name, fcow-state.cur.value, - fcow-state.next.name, fcow-state.next.value, - fcow-state.pos); - if (!evas_filter_program_parse(pgm, fcow-code)) + pd-data-state.cur.name, pd-data-state.cur.value, + pd-data-state.next.name, pd-data-state.next.value, + pd-data-state.pos); + if (!evas_filter_program_parse(pgm, pd-data-code)) { ERR(Filter program parsing failed); evas_filter_program_del(pgm); - fcow-invalid = EINA_TRUE; - eina_cow_done(evas_object_filter_cow, (const Eina_Cow_Data**)(pd-data), -fcow, EINA_TRUE); + if (!pd-data-invalid) +{ + fcow = FCOW_BEGIN(pd); + fcow-invalid = EINA_TRUE; + FCOW_END(fcow, pd); +} + return EINA_FALSE; } + fcow = FCOW_BEGIN(pd); fcow-chain = pgm; fcow-invalid = EINA_FALSE; + FCOW_END(fcow, pd); } -else if (previous !fcow-changed) +else if (previous !pd-data-changed) { Eina_Bool redraw; - redraw = evas_filter_program_state_set(fcow-chain, eo_obj, obj, -fcow-state.cur.name, fcow-state.cur.value, -fcow-state.next.name, fcow-state.next.value, -fcow-state.pos); + redraw = evas_filter_program_state_set(pd-data-chain, eo_obj, obj, +pd-data-state.cur.name, pd-data-state.cur.value, +pd-data-state.next.name, pd-data-state.next.value, +pd-data-state.pos); if (redraw) DBG(Filter redraw by state change!); else if (obj-changed) @@ -161,13 +170,13 @@ evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj, } // Scan proxies to find if any changed - if (!redraw fcow-sources) + if (!redraw pd-data-sources) {
[EGIT] [core/efl] master 01/01: Evas filters: Set state.next to nil when not in transition
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ff6dbb17e32f6fc19253282a7bdfbeb797d952b0 commit ff6dbb17e32f6fc19253282a7bdfbeb797d952b0 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Thu Jul 23 20:07:36 2015 +0900 Evas filters: Set state.next to nil when not in transition This is what the doc says and makes more sense. That was some kind of inverted logic. --- src/lib/evas/filters/evas_filter_parser.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c index c278687..0ea62a1 100644 --- a/src/lib/evas/filters/evas_filter_parser.c +++ b/src/lib/evas/filters/evas_filter_parser.c @@ -2616,16 +2616,16 @@ _filter_program_state_set(Evas_Filter_Program *pgm) lua_setfield(L, -2, name); lua_setfield(L, -2, cur); } - lua_newtable(L); // next - { - if (pgm-state.next.name) + if (pgm-state.next.name) +{ + lua_newtable(L); // next { SETFIELD(value, pgm-state.next.value); lua_pushstring(L, pgm-state.next.name); lua_setfield(L, -2, name); } - lua_setfield(L, -2, next); - } + lua_setfield(L, -2, next); +} lua_newtable(L); // text { SETCOLOR(outline, JOINC(text.outline)); --
[EGIT] [core/efl] master 01/03: Evas GL: Add missing call in case of direct rendering
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=fcde390fa4c39271b2202bac62141e4fc4b0d464 commit fcde390fa4c39271b2202bac62141e4fc4b0d464 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Mon Jul 20 15:24:04 2015 +0900 Evas GL: Add missing call in case of direct rendering I spotted this by looking at the code in a different branch (that was tested on real hardware). --- src/lib/evas/canvas/evas_object_image.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 2825abd..8956f81 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -3116,7 +3116,10 @@ evas_process_dirty_pixels(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, if (direct_override !direct_force_off) { // always use direct rendering - ENFN-gl_get_pixels_set(output, o-pixels-func.get_pixels, o-pixels-func.get_pixels_data, eo_obj); + 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); + if (ENFN-gl_image_direct_set) +ENFN-gl_image_direct_set(output, o-engine_data, EINA_TRUE); } else { --
[EGIT] [core/efl] master 01/05: Evas GL: Fix evasglImageDestroy() from non-evasgl threads
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=576f2ccab7d3f83cff00d08c6610f3fd97375f1d commit 576f2ccab7d3f83cff00d08c6610f3fd97375f1d Author: Jean-Philippe Andre jp.an...@samsung.com Date: Mon Jul 13 13:51:10 2015 +0900 Evas GL: Fix evasglImageDestroy() from non-evasgl threads If the TLS variable was not initialized, Evas GL can't get a pointer to a valid EGLDisplay which is required by eglImageDestroy. So, we keep track of the dpy used at creation time and use that if we're in another thread. --- src/lib/evas/Evas_GL.h | 3 ++ .../evas/engines/gl_common/evas_gl_api_ext.c | 34 ++ 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/lib/evas/Evas_GL.h b/src/lib/evas/Evas_GL.h index 255ccfc..f25cd50 100644 --- a/src/lib/evas/Evas_GL.h +++ b/src/lib/evas/Evas_GL.h @@ -4143,6 +4143,9 @@ struct _Evas_GL_API * Destroy an image created by either @ref evasglCreateImage or @ref evasglCreateImageForContext. * * Requires the @c EVAS_GL_image extension. +* +* @note Unlike in pure EGL, the display pointer needs not be passed in, as +* Evas GL will use the same EGLDisplay as used in the create function. */ void (*evasglDestroyImage) (EvasGLImage image); 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 ea74dd4..ef5ee4f 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 @@ -116,6 +116,13 @@ struct wl_resource; // Evas extensions from EGL extensions #ifdef GL_GLES #define EGLDISPLAY_GET() _evgl_egl_display_get(__FUNCTION__) + +// this struct defines an EvasGLImage when using EGL +typedef struct _EvasGLImage { + EGLDisplay dpy; + EGLImageKHR img; +} EvasGLImage_EGL; + static EGLDisplay _evgl_egl_display_get(const char *function) { @@ -153,7 +160,9 @@ static void * _evgl_eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, int target, void* buffer, const int *attrib_list) { + EvasGLImage_EGL *img; int *attribs = NULL; + void *eglimg; /* Convert 0 terminator into a EGL_NONE terminator */ if (attrib_list) @@ -177,7 +186,13 @@ _evgl_eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, *a = EGL_NONE; } - return EXT_FUNC_EGL(eglCreateImage)(dpy, ctx, target, buffer, attribs); + eglimg = EXT_FUNC_EGL(eglCreateImage)(dpy, ctx, target, buffer, attribs); + if (!eglimg) return NULL; + + img = calloc(1, sizeof(EvasGLImage_EGL)); + img-dpy = dpy; + img-img = eglimg; + return img; } static void * @@ -215,20 +230,29 @@ static void evgl_evasglDestroyImage(EvasGLImage image) { EGLDisplay dpy = EGLDISPLAY_GET(); - if (!dpy) return; - EXT_FUNC_EGL(eglDestroyImage)(dpy, image); + EvasGLImage_EGL *img = image; + + if (dpy) + EXT_FUNC_EGL(eglDestroyImage)(dpy, img-img); + else + EXT_FUNC_EGL(eglDestroyImage)(img-dpy, img-img); + free(img); } static void evgl_glEvasGLImageTargetTexture2D(GLenum target, EvasGLImage image) { - EXT_FUNC(glEGLImageTargetTexture2DOES)(target, image); + EvasGLImage_EGL *img = image; + + EXT_FUNC(glEGLImageTargetTexture2DOES)(target, img-img); } static void evgl_glEvasGLImageTargetRenderbufferStorage(GLenum target, EvasGLImage image) { - EXT_FUNC(glEGLImageTargetRenderbufferStorageOES)(target, image); + EvasGLImage_EGL *img = image; + + EXT_FUNC(glEGLImageTargetRenderbufferStorageOES)(target, img-img); } static EvasGLSync --
[EGIT] [core/elementary] master 01/01: glview: pass render_op flag to the child surface
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=39a42ff559f2558a243de42eab47acbba10a3095 commit 39a42ff559f2558a243de42eab47acbba10a3095 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Mon Jul 13 17:02:32 2015 +0900 glview: pass render_op flag to the child surface Without this, apps can't set a GLView to be in COPY mode. COPY mode allows the glview to poke holes in the backbuffer of the window, without the need for other objects below (eg. a transparent rectangle in COPY mode). --- src/lib/elm_glview.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/elm_glview.c b/src/lib/elm_glview.c index 8530c54..2bc87f1 100644 --- a/src/lib/elm_glview.c +++ b/src/lib/elm_glview.c @@ -114,6 +114,9 @@ static Eina_Bool _render_cb(void *obj) { ELM_GLVIEW_DATA_GET(obj, sd); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); + + evas_object_render_op_set(wd-resize_obj, evas_object_render_op_get(obj)); // Do a make current if (!evas_gl_make_current(sd-evasgl, sd-surface, sd-context)) --
[EGIT] [core/efl] master 04/05: Evas GL: Fix glClear(0, 0, 0, 0) with DR and COPY
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9db20800a2c0e517977226cd8f23d9ac49c6547a commit 9db20800a2c0e517977226cd8f23d9ac49c6547a Author: Jean-Philippe Andre jp.an...@samsung.com Date: Fri Jul 10 12:37:27 2015 +0900 Evas GL: Fix glClear(0,0,0,0) with DR and COPY When glClear is called in direct rendering move (DR), we usually have to skip the call altogether because clearing out transparency would erase the pixels in the evas backbuffer. This means Evas would not be able to blend an RGBA GLView on top of other objects. But COPY mode should allow Evas GL to poke holes in a window backbuffer. Thanks @spacegrapher for the review :) NOTE: Elm GLView also needs to pass the render op to its Evas.Image. @fix --- src/modules/evas/engines/gl_common/evas_gl_api.c | 4 +++- src/modules/evas/engines/gl_common/evas_gl_core.c | 4 +++- src/modules/evas/engines/gl_common/evas_gl_core.h | 2 +- src/modules/evas/engines/gl_common/evas_gl_core_private.h | 1 + src/modules/evas/engines/gl_generic/evas_engine.c | 1 + 5 files changed, 9 insertions(+), 3 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 2d75586..8597bf8 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api.c @@ -366,8 +366,10 @@ _evgl_glClear(GLbitfield mask) /* Skip glClear() if clearing with transparent color * Note: There will be side effects if the object itself is not * marked as having an alpha channel! + * COPY mode forces the normal behaviour of glClear(). */ - if (ctx-current_sfc-alpha (mask GL_COLOR_BUFFER_BIT)) + if (ctx-current_sfc-alpha !rsc-direct.render_op_copy + (mask GL_COLOR_BUFFER_BIT)) { if ((rsc-clear_color.a == 0) (rsc-clear_color.r == 0) 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 33ef45a..809c63d 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_core.c +++ b/src/modules/evas/engines/gl_common/evas_gl_core.c @@ -2744,7 +2744,7 @@ void evgl_direct_info_set(int win_w, int win_h, int rot, int img_x, int img_y, int img_w, int img_h, int clip_x, int clip_y, int clip_w, int clip_h, - void *surface) + int render_op, void *surface) { EVGL_Resource *rsc; EVGL_Surface *sfc = surface; @@ -2783,6 +2783,8 @@ evgl_direct_info_set(int win_w, int win_h, int rot, rsc-direct.clip.y = clip_y; rsc-direct.clip.w = clip_w; rsc-direct.clip.h = clip_h; + +rsc-direct.render_op_copy = (render_op == EVAS_RENDER_COPY); } else { diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.h b/src/modules/evas/engines/gl_common/evas_gl_core.h index cf2b325..991cae6 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_core.h +++ b/src/modules/evas/engines/gl_common/evas_gl_core.h @@ -73,7 +73,7 @@ void evgl_direct_override_get(Eina_Bool *override, Eina_Bool *force_off) void evgl_direct_info_set(int win_w, int win_h, int rot, int img_x, int img_y, int img_w, int img_h, int clip_x, int clip_y, int clip_w, int clip_h, - void *surface); + int render_op, void *surface); void evgl_direct_info_clear(void); void evgl_get_pixels_pre(void); void evgl_get_pixels_post(void); 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 8b1adc2..6498b1a 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 @@ -289,6 +289,7 @@ struct _EVGL_Resource Eina_Boolenabled : 1; Eina_Boolin_get_pixels : 1; +Eina_Boolrender_op_copy : 1; } direct; struct { GLclampf r, g, b, a; diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c index 280a5f3..473f3f6 100644 --- a/src/modules/evas/engines/gl_generic/evas_engine.c +++ b/src/modules/evas/engines/gl_generic/evas_engine.c @@ -1060,6 +1060,7 @@ eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, gl_context-dc-clip.y, gl_context-dc-clip.w, gl_context-dc-clip.h, + gl_context-dc-render_op,
[EGIT] [core/efl] master 05/05: Evas filters: Fix color value for invisible
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=040945e3336506b80b113ba5384d6246f95c156e commit 040945e3336506b80b113ba5384d6246f95c156e Author: Jean-Philippe Andre jp.an...@samsung.com Date: Tue Jul 14 13:49:51 2015 +0900 Evas filters: Fix color value for invisible Since the filters default to alpha = 255 the actual value of invisible / transparent was black. --- src/lib/evas/filters/lua/color.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/filters/lua/color.lua b/src/lib/evas/filters/lua/color.lua index fc60d8e..b4bcd4b 100644 --- a/src/lib/evas/filters/lua/color.lua +++ b/src/lib/evas/filters/lua/color.lua @@ -91,8 +91,8 @@ __color = { grey = 0xFF808080, silver = 0xFFC0C0C0, olive = 0xFF808000, - invisible = 0x, - transparent = 0x + invisible = '#', + transparent = '#' }, __methods = { --
[EGIT] [core/efl] master 02/05: eina_module: Raise dlopen() error messages to WRN when file exists
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c7e0c1b3400e788e4b09435b1a83a7513cb119f0 commit c7e0c1b3400e788e4b09435b1a83a7513cb119f0 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Mon Jul 13 14:08:08 2015 +0900 eina_module: Raise dlopen() error messages to WRN when file exists Failing to load a module that does not exist is indeed not an error, but failing to load a module that exists on disk happened probably because of an error like symbol not found. Considering eina_module is most likely used by EFL itself, I believe an internal linking failure is a warning worth reporting. --- src/lib/eina/eina_module.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/eina/eina_module.c b/src/lib/eina/eina_module.c index 7c421e3..1c2075a 100644 --- a/src/lib/eina/eina_module.c +++ b/src/lib/eina/eina_module.c @@ -330,8 +330,13 @@ EAPI Eina_Bool eina_module_load(Eina_Module *m) if (!dl_handle) { -DBG(could not dlopen(\%s\, %s): %s, m-file, dlerror(), -(flag == RTLD_NOW) ? RTLD_NOW : RTLD_LAZY); +struct stat st; +if (!stat(m-file, st)) + WRN(could not dlopen(\%s\, %s): %s, m-file, dlerror(), + (flag == RTLD_NOW) ? RTLD_NOW : RTLD_LAZY); +else + DBG(could not dlopen(\%s\, %s): %s, m-file, dlerror(), + (flag == RTLD_NOW) ? RTLD_NOW : RTLD_LAZY); return EINA_FALSE; } --
[EGIT] [core/efl] master 03/05: Evas GL: Fix internal function pointer
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b439fafa17e000986dce027a0f6cf59cf2c0d644 commit b439fafa17e000986dce027a0f6cf59cf2c0d644 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Mon Jul 13 16:04:45 2015 +0900 Evas GL: Fix internal function pointer evas_gl_native_context_get is an internal function passed around from an evas engine to evas_gl so that we can implement evasglCreateImageForContext without exposing any evas engine internal structure to evas_gl. It's all a ittle bit ugly but the previous solution with dlsym(DEFAULT) didn't work. --- src/lib/evas/canvas/evas_gl.c | 24 +++--- src/lib/evas/include/evas_private.h| 2 +- src/modules/evas/engines/gl_common/evas_gl_core.c | 9 src/modules/evas/engines/gl_common/evas_gl_core.h | 2 +- src/modules/evas/engines/gl_generic/evas_engine.c | 5 +++-- .../evas/engines/software_generic/evas_engine.c| 4 ++-- 6 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/lib/evas/canvas/evas_gl.c b/src/lib/evas/canvas/evas_gl.c index 1552e59..68ac0ec 100644 --- a/src/lib/evas/canvas/evas_gl.c +++ b/src/lib/evas/canvas/evas_gl.c @@ -326,6 +326,15 @@ evas_gl_surface_destroy(Evas_GL *evas_gl, Evas_GL_Surface *surf) surf = NULL; } +// Internal function - called from evas_gl_core.c +static void * +evas_gl_native_context_get(void *context) +{ + Evas_GL_Context *ctx = context; + if (!ctx) return NULL; + return ctx-data; +} + EAPI Evas_GL_Context * evas_gl_context_version_create(Evas_GL *evas_gl, Evas_GL_Context *share_ctx, Evas_GL_Context_Version version) @@ -356,10 +365,9 @@ evas_gl_context_version_create(Evas_GL *evas_gl, Evas_GL_Context *share_ctx, // Call engine-gl_create_context ctx-version = version; - if (share_ctx) - ctx-data = evas_gl-evas-engine.func-gl_context_create(evas_gl-evas-engine.data.output, share_ctx-data, version); - else - ctx-data = evas_gl-evas-engine.func-gl_context_create(evas_gl-evas-engine.data.output, NULL, version); + ctx-data = evas_gl-evas-engine.func-gl_context_create + (evas_gl-evas-engine.data.output, share_ctx ? share_ctx-data : NULL, + version, evas_gl_native_context_get); // Set a few variables if (!ctx-data) @@ -644,11 +652,3 @@ evas_gl_surface_query(Evas_GL *evas_gl, Evas_GL_Surface *surface, int attribute, return evas_gl-evas-engine.func-gl_surface_query (evas_gl-evas-engine.data.output, surface-data, attribute, value); } - -// Internal function - called from evas_gl_core.c -EAPI void * -_evas_gl_native_context_get(Evas_GL_Context *ctx) -{ - if (!ctx) return NULL; - return ctx-data; -} diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index 04b59ef..ecb8b8c 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1370,7 +1370,7 @@ struct _Evas_Func void *(*gl_surface_create)(void *data, void *config, int w, int h); void *(*gl_pbuffer_surface_create)(void *data, void *config, int w, int h, int const *attrib_list); int (*gl_surface_destroy)(void *data, void *surface); - void *(*gl_context_create)(void *data, void *share_context, int version); + void *(*gl_context_create)(void *data, void *share_context, int version, void *(*native_context_get)(void *ctx)); int (*gl_context_destroy)(void *data, void *context); int (*gl_make_current) (void *data, void *surface, void *context); const char *(*gl_string_query)(void *data, int name); 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 7ebee74..33ef45a 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_core.c +++ b/src/modules/evas/engines/gl_common/evas_gl_core.c @@ -1681,9 +1681,6 @@ evgl_engine_init(void *eng_data, const EVGL_Interface *efunc) } DBG(TLS KEY created: %d, evgl_engine-resource_key); - // Link to evas_gl.c (this doesn't look great) - glsym_evas_gl_native_context_get = dlsym(RTLD_DEFAULT, _evas_gl_native_context_get); - evgl_engine-safe_extensions = eina_hash_string_small_new(NULL); // Surface Caps @@ -2073,11 +2070,15 @@ evgl_surface_destroy(void *eng_data, EVGL_Surface *sfc) void * evgl_context_create(void *eng_data, EVGL_Context *share_ctx, -Evas_GL_Context_Version version) +Evas_GL_Context_Version version, +void *(*native_context_get)(void *)) { EVGL_Context *ctx = NULL; EVGL_Resource *rsc = NULL; + // A little bit ugly. But it works even when dlsym(DEFAULT) doesn't work. + glsym_evas_gl_native_context_get = native_context_get; + // Check the input if (!evgl_engine) { diff
[EGIT] [core/efl] master 01/01: Ector: Fix potential build errors with double typedef
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=83f4ee89d0104f9e46f57fa0dcca08cecefa514c commit 83f4ee89d0104f9e46f57fa0dcca08cecefa514c Author: Jean-Philippe Andre jp.an...@samsung.com Date: Thu Jul 16 11:39:38 2015 +0900 Ector: Fix potential build errors with double typedef Depending on the compiler and its version, having twice a typedef on the same name may lead to a build failure. Thanks @mythri for the report. --- src/lib/ector/software/Ector_Software.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/lib/ector/software/Ector_Software.h b/src/lib/ector/software/Ector_Software.h index 7d003cc..ec074be 100644 --- a/src/lib/ector/software/Ector_Software.h +++ b/src/lib/ector/software/Ector_Software.h @@ -3,7 +3,13 @@ #include Ector.h +#ifndef _ECTOR_SOFTWARE_SURFACE_EO_CLASS_TYPE +#define _ECTOR_SOFTWARE_SURFACE_EO_CLASS_TYPE + typedef Eo Ector_Software_Surface; + +#endif + typedef struct _Software_Rasterizer Software_Rasterizer; #include software/ector_software_surface.eo.h --
[EGIT] [core/efl] master 01/01: Ector: Another build fix for @mythri
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=028cf2c9a4e5b4ed7fda838add57616ae4584350 commit 028cf2c9a4e5b4ed7fda838add57616ae4584350 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Thu Jul 16 19:35:48 2015 +0900 Ector: Another build fix for @mythri --- src/lib/ector/cairo/Ector_Cairo.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/lib/ector/cairo/Ector_Cairo.h b/src/lib/ector/cairo/Ector_Cairo.h index e368ca2..351a2f5 100644 --- a/src/lib/ector/cairo/Ector_Cairo.h +++ b/src/lib/ector/cairo/Ector_Cairo.h @@ -3,7 +3,13 @@ #include Ector.h +#ifndef _ECTOR_CAIRO_SURFACE_EO_CLASS_TYPE +#define _ECTOR_CAIRO_SURFACE_EO_CLASS_TYPE + typedef Eo Ector_Cairo_Surface; + +#endif + typedef struct _cairo_t cairo_t; #include cairo/ector_cairo_surface.eo.h --
[EGIT] [core/efl] master 01/02: Ectore: And more build fixes for @mythri! :)
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c73d14036506076a32fe2e842eb4e60d01203258 commit c73d14036506076a32fe2e842eb4e60d01203258 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Thu Jul 16 20:02:47 2015 +0900 Ectore: And more build fixes for @mythri! :) --- src/lib/ector/software/ector_software_private.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/ector/software/ector_software_private.h b/src/lib/ector/software/ector_software_private.h index 2e1ca1c..c91d1d4 100644 --- a/src/lib/ector/software/ector_software_private.h +++ b/src/lib/ector/software/ector_software_private.h @@ -100,7 +100,7 @@ typedef struct _Span_Data }; } Span_Data; -typedef struct _Software_Rasterizer +struct _Software_Rasterizer { SW_FT_Raster raster; SW_FT_Strokerstroker; @@ -109,7 +109,7 @@ typedef struct _Software_Rasterizer Eina_Matrix3*transform; Eina_Rectangle system_clip; -} Software_Rasterizer; +}; struct _Ector_Software_Surface_Data { --
[EGIT] [core/efl] master 01/03: Evas GL: Fix sync, wlbuffer and image egl ext functions
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8942c0c29bc0f58c8821136c03b6cbff9b5b13c8 commit 8942c0c29bc0f58c8821136c03b6cbff9b5b13c8 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Thu Jul 16 22:25:36 2015 +0900 Evas GL: Fix sync, wlbuffer and image egl ext functions Before this patch, those EGL/EvasGL functions can not work without a current context. But EGL does not require any current context for those to work, or at least, this should be left to the driver to decide. Evas GL was only able to get a pointer to the display if a context was current. The display pointer should be infered from Evas_GL unless we can find a current display. EGL does not require a context to be current in most of these function calls. This should bring evasgl a little bit closer to EGL in terms of behaviour (those are EGL-only extensions, btw). Thanks @spacegrapher for the quick review @fix --- src/lib/evas/canvas/evas_gl.c | 15 +++- src/lib/evas/include/evas_private.h| 2 +- .../evas/engines/gl_common/evas_gl_api_ext.c | 97 -- src/modules/evas/engines/gl_common/evas_gl_core.c | 19 - src/modules/evas/engines/gl_common/evas_gl_core.h | 2 +- .../evas/engines/gl_common/evas_gl_core_private.h | 1 + src/modules/evas/engines/gl_generic/evas_engine.c | 5 +- .../evas/engines/software_generic/evas_engine.c| 3 +- 8 files changed, 91 insertions(+), 53 deletions(-) diff --git a/src/lib/evas/canvas/evas_gl.c b/src/lib/evas/canvas/evas_gl.c index 68ac0ec..5b539e4 100644 --- a/src/lib/evas/canvas/evas_gl.c +++ b/src/lib/evas/canvas/evas_gl.c @@ -326,7 +326,7 @@ evas_gl_surface_destroy(Evas_GL *evas_gl, Evas_GL_Surface *surf) surf = NULL; } -// Internal function - called from evas_gl_core.c +// Internal functions - called from evas_gl_core.c static void * evas_gl_native_context_get(void *context) { @@ -335,6 +335,17 @@ evas_gl_native_context_get(void *context) return ctx-data; } +static void * +evas_gl_engine_data_get(void *evgl) +{ + Evas_GL *evasgl = evgl; + + if (!evasgl) return NULL; + if (!evasgl-evas) return NULL; + + return evasgl-evas-engine.data.output; +} + EAPI Evas_GL_Context * evas_gl_context_version_create(Evas_GL *evas_gl, Evas_GL_Context *share_ctx, Evas_GL_Context_Version version) @@ -367,7 +378,7 @@ evas_gl_context_version_create(Evas_GL *evas_gl, Evas_GL_Context *share_ctx, ctx-version = version; ctx-data = evas_gl-evas-engine.func-gl_context_create (evas_gl-evas-engine.data.output, share_ctx ? share_ctx-data : NULL, - version, evas_gl_native_context_get); + version, evas_gl_native_context_get, evas_gl_engine_data_get); // Set a few variables if (!ctx-data) diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index ecb8b8c..2e54ab0 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1370,7 +1370,7 @@ struct _Evas_Func void *(*gl_surface_create)(void *data, void *config, int w, int h); void *(*gl_pbuffer_surface_create)(void *data, void *config, int w, int h, int const *attrib_list); int (*gl_surface_destroy)(void *data, void *surface); - void *(*gl_context_create)(void *data, void *share_context, int version, void *(*native_context_get)(void *ctx)); + void *(*gl_context_create)(void *data, void *share_context, int version, void *(*native_context_get)(void *ctx), void *(*engine_data_get)(void *evasgl)); int (*gl_context_destroy)(void *data, void *context); int (*gl_make_current) (void *data, void *surface, void *context); const char *(*gl_string_query)(void *data, int name); 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 ef5ee4f..0f91566 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 @@ -115,7 +115,7 @@ struct wl_resource; // Evas extensions from EGL extensions #ifdef GL_GLES -#define EGLDISPLAY_GET() _evgl_egl_display_get(__FUNCTION__) +#define EGLDISPLAY_GET(a) _evgl_egl_display_get(__FUNCTION__, a) // this struct defines an EvasGLImage when using EGL typedef struct _EvasGLImage { @@ -124,13 +124,21 @@ typedef struct _EvasGLImage { } EvasGLImage_EGL; static EGLDisplay -_evgl_egl_display_get(const char *function) +_evgl_egl_display_get(const char *function, Evas_GL *evgl) { EGLDisplay dpy = EGL_NO_DISPLAY; EVGL_Resource *rsc; + if (!evgl_engine || !evgl_engine-funcs || !evgl_engine-funcs-display_get) + { +ERR(%s: Invalid Engine... (Can't acccess EGL Display)\n, function); +
[EGIT] [core/efl] master 03/03: Evas GL: Some documentation on sync objects
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6c3793390f1504225016bef0603d2c774b2b0e72 commit 6c3793390f1504225016bef0603d2c774b2b0e72 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Fri Jul 17 13:47:30 2015 +0900 Evas GL: Some documentation on sync objects --- src/lib/evas/Evas_GL.h | 95 -- 1 file changed, 84 insertions(+), 11 deletions(-) diff --git a/src/lib/evas/Evas_GL.h b/src/lib/evas/Evas_GL.h index 83890d5..a032eaf 100644 --- a/src/lib/evas/Evas_GL.h +++ b/src/lib/evas/Evas_GL.h @@ -3815,6 +3815,7 @@ typedef unsigned long long EvasGLTime; #define EVAS_GL_KHR_wait_sync 1 /** + * @anchor evasgl_sync_values * @name Constants used to define and wait for Sync objects. * @{ */ @@ -4461,30 +4462,102 @@ EvasGLImage *img = glapi-evasglCreateImageForContext /** * @name Evas GL Sync object functions * @since_tizen 2.3 +* @since 1.12 * @{ */ + /** * @anchor evasglCreateSync -* @brief Requires the extension @c EGL_KHR_fence_sync, similar to eglCreateSyncKHR. +* @brief Create a synchronization primitive which can be tested or waited upon. +* +* @note Requires the extension @c EGL_KHR_fence_sync, similar to eglCreateSyncKHR. +* +* @param evas_gl The current Evas_GL connection +* @param type One of: @c EVAS_GL_SYNC_FENCE or @c EVAS_GL_SYNC_REUSABLE +* @param attrib_list Optional attributes list, terminated by @c EVAS_GL_NONE +* The supported attributes depend on the driver extensions, +* please refer to the EGL specifications for more information. +* +* @return A new sync object (EvasGLSync) +* @since 1.12 */ EvasGLSync (*evasglCreateSync) (Evas_GL *evas_gl, unsigned int type, const int *attrib_list); - /** @anchor evasglDestroySync -* @brief Requires the extension @c EGL_KHR_fence_sync, similar to eglDestroySyncKHR. + /** +* @anchor evasglDestroySync +* @brief Destroys a sync object created by @c evasglCreateSync. +* +* @note Requires the extension @c EGL_KHR_fence_sync, similar to eglDestroySyncKHR. +* +* @param evas_gl The current Evas_GL connection +* @param syncA valid sync object created by @c evasglCreateSync +* +* @return @c EINA_TRUE in case of success, @c EINA_FALSE in case of failure +* (in which case evas_gl_error_get() should return an error code) +* @since 1.12 */ Eina_Bool(*evasglDestroySync) (Evas_GL *evas_gl, EvasGLSync sync); - /** @anchor evasglClientWaitSync -* @brief Requires the extension @c EGL_KHR_fence_sync, similar to eglClientWaitSyncKHR. + + /** +* @anchor evasglClientWaitSync +* @brief Block and wait until for sync object is signaled or timeout is reached +* +* @param evas_gl The current Evas_GL connection +* @param syncA valid sync object created by evasglCreateSync +* @param timeout A relative timeout in nanoseconds +* +* @note Requires the extension @c EGL_KHR_reusable_sync, similarly to eglClientWaitSyncKHR. +* +* @return @c EVAS_GL_TIMEOUT_EXPIRED if the sync failed and timeout was reached, +* @c EVAS_GL_CONDITION_SATISFIED if the sync was signaled, +* or 0 in case of failure (in which case evas_gl_error_get() should return an error code) +* @since 1.12 */ int (*evasglClientWaitSync) (Evas_GL *evas_gl, EvasGLSync sync, int flags, EvasGLTime timeout); - /** @anchor evasglSignalSync -* @brief Requires the extension @c EGL_KHR_reusable_sync, similar to eglSignalSyncKHR. + + /** +* @anchor evasglSignalSync +* @brief Signal a sync object, unlocking all threads waiting on it +* +* @param evas_gl The current Evas_GL connection +* @param syncA valid sync object created by evasglCreateSync +* +* @note Requires the extension @c EGL_KHR_reusable_sync or @c EGL_KHR_wait_sync, similarly to eglSignalSyncKHR. +* +* @return @c EINA_TRUE in case of success, or +* @c EINA_FALSE in case of failure (in which case evas_gl_error_get() should return an error code) +* @since 1.12 */ Eina_Bool(*evasglSignalSync) (Evas_GL *evas_gl, EvasGLSync sync, unsigned mode); - /** @anchor evasglGetSyncAttrib -* @brief Requires the extension @c EGL_KHR_fence_sync, similar to eglGetSyncAttribKHR. + + /** +* @anchor evasglGetSyncAttrib +* @brief Query a sync object for its properties +* +* @param evas_gl The current Evas_GL connection +* @param syncA valid sync object created by evasglCreateSync +* @param attribute Which attribute to query, can be one of: @c EVAS_GL_SYNC_STATUS, @c EVAS_GL_SYNC_TYPE or @c EVAS_GL_SYNC_CONDITION +* @param value Return value or the query, see @ref evasgl_sync_values
[EGIT] [core/efl] master 02/02: Evas masking: Fix rendering of masks that belong to a proxied smart object
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=326dc3850b8bf20348464e07a46b228314c3dc93 commit 326dc3850b8bf20348464e07a46b228314c3dc93 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Wed Jul 15 16:41:59 2015 +0900 Evas masking: Fix rendering of masks that belong to a proxied smart object This is a complex situation: - Smart object A contains image I - A is proxied into an image B - B is marked as source_invisible, which means A is invisible - Mask M is applied to image I - Mask M is ALSO a smart child of A Because of all that, mask M could not be rendered into its private mask surface, as it was falling under the case of parent_src_invisible. This patch checks that the object is not a mask during the parent_src_invisible check. @fix --- src/lib/evas/include/evas_inline.x | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/evas/include/evas_inline.x b/src/lib/evas/include/evas_inline.x index 83fa4b4..4614737 100644 --- a/src/lib/evas/include/evas_inline.x +++ b/src/lib/evas/include/evas_inline.x @@ -118,6 +118,7 @@ evas_object_is_source_invisible(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Pro return obj-parent_cache.src_invisible; if ((obj-proxy-proxies || obj-proxy-proxy_textures) obj-proxy-src_invisible) return 1; if (!obj-smart.parent) return 0; + if (obj-mask-is_mask) return 0; Evas_Object_Protected_Data *smart_parent_pd = eo_data_scope_get(obj-smart.parent, EVAS_OBJECT_CLASS); obj-parent_cache.src_invisible = --
[EGIT] [core/efl] master 01/02: Evas filters: Fix parsing of curve() with a function
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=218b3a40f923fabd131872f294de4b02efe0aa01 commit 218b3a40f923fabd131872f294de4b02efe0aa01 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Wed Jul 15 14:09:49 2015 +0900 Evas filters: Fix parsing of curve() with a function If the points argument was a function, there was a Lua call stack error, making the filter fail. --- src/lib/evas/filters/evas_filter_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c index d6d1e35..c278687 100644 --- a/src/lib/evas/filters/evas_filter_parser.c +++ b/src/lib/evas/filters/evas_filter_parser.c @@ -1277,7 +1277,7 @@ _lua_curve_points_func(lua_State *L, int i, Evas_Filter_Program *pgm EINA_UNUSED if (n -1) n = 0; if (n 255) n = 255; } - lua_pop(L, 1); + lua_pop(L, 2); values[k] = (int) n; } else --
[EGIT] [core/efl] master 01/01: Evas: Fix no_render flag when in a map
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=29de62cd1388930d4299f88ed24bdf47c3c9b0c7 commit 29de62cd1388930d4299f88ed24bdf47c3c9b0c7 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Wed Jul 15 17:51:18 2015 +0900 Evas: Fix no_render flag when in a map no_render objects would still show up in a map surface because of a different logic. --- src/lib/evas/canvas/evas_render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index e820288..e1a077e 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -1280,7 +1280,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, else if (proxy_src_clip) { if ((!evas_object_is_visible(eo_obj, obj)) || (obj-clip.clipees) - || (obj-cur-have_clipees)) + || (obj-cur-have_clipees) || (obj-no_render)) { RD(level, }\n); return clean_them; --
[EGIT] [core/elementary] master 01/02: Window: Set urgent flag only when not already set
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=72de26e9a367b9bff327192a473979d4fc3ca584 commit 72de26e9a367b9bff327192a473979d4fc3ca584 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Mon Jul 6 12:28:02 2015 +0900 Window: Set urgent flag only when not already set cat binary_file_with_lots_of_BEL in terminology would slow down everything because of the urgent flag (and talking to X). --- src/lib/elm_win.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c index 05ed910..f52732e 100644 --- a/src/lib/elm_win.c +++ b/src/lib/elm_win.c @@ -4451,6 +4451,8 @@ _elm_win_profile_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd) EOLIAN static void _elm_win_urgent_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool urgent) { + if (sd-urgent == urgent) + return; sd-urgent = urgent; TRAP(sd, urgent_set, urgent); #ifdef HAVE_ELEMENTARY_X --
[EGIT] [core/efl] master 01/01: Evas.Image: Fix legacy EAPI name
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=45cef3e0a5c7be5f9e527eecdd40e59c79cc4b68 commit 45cef3e0a5c7be5f9e527eecdd40e59c79cc4b68 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Mon Jul 6 14:22:45 2015 +0900 Evas.Image: Fix legacy EAPI name Thanks @kuuko for the report. Sorry for the breakage of Python apps. --- src/lib/evas/canvas/evas_object_image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index aee6260..a346e21 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -1601,7 +1601,7 @@ _evas_image_efl_image_smooth_scale_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data * /* deprecated */ EAPI void -_evas_image_reload(Eo *eo_obj) +evas_object_image_reload(Eo *eo_obj) { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); Evas_Image_Data *o; --
[EGIT] [core/efl] master 01/02: Evas.Image: Simplify logic (trivial change)
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=225b33451b1d659e87233028cc17e2f48e74e797 commit 225b33451b1d659e87233028cc17e2f48e74e797 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Thu Jul 2 15:41:06 2015 +0900 Evas.Image: Simplify logic (trivial change) --- src/lib/evas/canvas/evas_object_image.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index b0d1c05..aee6260 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -1535,15 +1535,15 @@ _evas_image_alpha_set(Eo *eo_obj, Evas_Image_Data *o, Eina_Bool has_alpha) o-preloading = EINA_FALSE; ENFN-image_data_preload_cancel(ENDT, o-engine_data, eo_obj); } - if (((has_alpha) (o-cur-has_alpha)) || - ((!has_alpha) (!o-cur-has_alpha))) + + has_alpha = !!has_alpha; + if (has_alpha == o-cur-has_alpha) return; - if (o-cur-has_alpha != has_alpha) - { -EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) - state_write-has_alpha = has_alpha; -EINA_COW_IMAGE_STATE_WRITE_END(o, state_write); - } + + EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) + state_write-has_alpha = has_alpha; + EINA_COW_IMAGE_STATE_WRITE_END(o, state_write); + if (o-engine_data) { int stride = 0; --
[EGIT] [core/efl] master 02/03: Edje: Embed verbatim scripts for Efl.Gfx.Filters
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6ca02cbfe898799c9276fdb52971f7697b16cac9 commit 6ca02cbfe898799c9276fdb52971f7697b16cac9 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Tue Jun 30 19:26:20 2015 +0900 Edje: Embed verbatim scripts for Efl.Gfx.Filters This is now like the other embedded scripts, where a verbatim string is parsed. The syntax is now: filters { filter { name: filter0; file: filter.lua; } filter { name: filter1; script { blend {} } } filter.file: file.lua; // name is file.lua } Thanks @raster for the quick review. --- src/bin/edje/edje_cc_handlers.c | 191 --- src/lib/edje/edje_load.c | 6 -- src/lib/edje/edje_private.h | 4 +- src/tests/edje/data/test_filters.edc | 28 +++-- 4 files changed, 178 insertions(+), 51 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 18701a2..9f2e21b 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -213,8 +213,10 @@ static void st_color_class_color2(void); static void st_color_class_color3(void); static void st_color_class_desc(void); -static void st_filters_filter_inline(void); +static void ob_filters_filter(void); +static void ob_filters_filter_script(void); static void st_filters_filter_file(void); +static void st_filters_filter_name(void); static void ob_collections(void); static void st_collections_base_scale(void); @@ -625,10 +627,8 @@ static void st_collections_group_nobroadcast(void); } #define FILTERS_STATEMENTS(PREFIX) \ - {PREFIXfilters, NULL}, \ - {PREFIXfilters.filter, NULL}, \ - {PREFIXfilters.filter.inline, st_filters_filter_inline}, \ - {PREFIXfilters.filter.file, st_filters_filter_file}, + {PREFIXfilters.filter.file, st_filters_filter_file}, \ + {PREFIXfilters.filter.name, st_filters_filter_name}, New_Statement_Handler statement_handlers[] = { @@ -1119,6 +1119,9 @@ New_Object_Handler object_handlers[] = {color_classes, NULL}, {color_classes.color_class, ob_color_class}, {spectra, NULL}, + {filters, NULL}, + {filters.filter, ob_filters_filter}, + {filters.filter.script, ob_filters_filter_script}, {collections, ob_collections}, {collections.externals, NULL}, /* dup */ {collections.set, ob_images_set}, /* dup */ @@ -1142,6 +1145,9 @@ New_Object_Handler object_handlers[] = {collections.vibrations, NULL}, {collections.group.vibrations, NULL}, /* dup */ {collections.vibrations.sample, NULL}, + {collections.filters, NULL}, + {collections.filters.filter, ob_filters_filter}, /* dup */ + {collections.filters.filter.script, ob_filters_filter_script}, /* dup */ {collections.group.vibrations.sample, NULL}, /* dup */ {collections.group, ob_collections_group}, {collections.group.data, NULL}, @@ -1160,6 +1166,9 @@ New_Object_Handler object_handlers[] = {collections.group.styles.style, ob_styles_style}, /* dup */ {collections.group.color_classes, NULL}, /* dup */ {collections.group.color_classes.color_class, ob_color_class}, /* dup */ + {collections.group.filters, NULL}, + {collections.group.filters.filter, ob_filters_filter}, /* dup */ + {collections.group.filters.filter.script, ob_filters_filter_script}, /* dup */ {collections.group.parts, NULL}, {collections.group.parts.set, ob_images_set}, /* dup */ {collections.group.parts.set.image, ob_images_set_image}, /* dup */ @@ -4311,7 +4320,7 @@ st_collections_group_data_item(void) // collections // collections.group filters { -filter.inline: key Lua script here; +filter.script: key Lua script here; filter.file: other filename.lua; .. } @@ -4343,30 +4352,73 @@ st_collections_group_data_item(void) @endproperty */ -// ensure order so we could do binary search later on -// since this here happens at build time, we don't care about very hi-perf +static Edje_Gfx_Filter *current_filter = NULL; + static void -_filters_filter_insert(const char *name, const char *script) +_filters_filter_sort(void) { - Edje_Gfx_Filter *array; - int k, i; + Edje_Gfx_Filter *array, current; + int new_pos, i, cur_pos; - if (!edje_file-filter_dir) - edje_file-filter_dir = mem_alloc(sizeof(Edje_Gfx_Filter_Directory)); + if (!current_filter) + return; - for (k = 0; k edje_file-filter_dir-filters_count; k++) + if (!current_filter-name) { -int cmp = strcmp(name, edje_file-filter_dir-filters[k].name); -if (!cmp) +ERR(parse error %s:%i. Filter has no name., +file_in, line - 1); +exit(-1); + } + + array = edje_file-filter_dir-filters; +
[EGIT] [core/efl] master 01/03: Evas: Make Evas.Image.save() work with all images
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=161822418ab141a442a7d678adbcb0221e76eda9 commit 161822418ab141a442a7d678adbcb0221e76eda9 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Tue Jun 30 15:37:55 2015 +0900 Evas: Make Evas.Image.save() work with all images This includes proxies, 3d scenes and normal images. There is still a problem as the GL engine returns NULL on data_get. This kinda goes against the EO API declaration as eo_obj is used as a mutable argument, but internal data was already modified before this patch. TODO: Draw maps, filters, etc... in a dedicated surface to save them as they truly are (ie. filtered images). --- src/lib/evas/canvas/evas_object_image.c | 71 - 1 file changed, 61 insertions(+), 10 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 83b3ee7..4fe6e14 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -197,6 +197,7 @@ static void _proxy_unset(Evas_Object *proxy, Evas_Object_Protected_Data *obj, Ev static void _proxy_set(Evas_Object *proxy, Evas_Object *src); static void _proxy_error(Evas_Object *proxy, void *context, void *output, void *surface, int x, int y, Eina_Bool do_async); +static void _3d_render(Evas *eo_e, Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o, Evas_Canvas3D_Scene *scene); static void _3d_set(Evas_Object *eo_obj, Evas_Canvas3D_Scene *scene); static void _3d_unset(Evas_Object *eo_obj, Evas_Object_Protected_Data *image, Evas_Image_Data *o); @@ -1628,10 +1629,64 @@ _evas_image_efl_file_save(const Eo *eo_obj, Evas_Image_Data *o, const char *file int quality = 80, compress = 9, ok = 0; char *encoding = NULL; RGBA_Image *im; - if (!o-engine_data) return 0; + Eina_Bool putback = EINA_FALSE; + int imagew, imageh; + void *pixels; + Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); + Evas_Object_Protected_Data *source = (o-cur-source ? eo_data_scope_get(o-cur-source, EVAS_OBJECT_CLASS) : NULL); + evas_object_async_block(obj); - o-engine_data = ENFN-image_data_get(ENDT, o-engine_data, 0, data, o-load_error); + + if (o-cur-scene) + { +_3d_render(obj-layer-evas-evas, (Eo *) eo_obj, obj, o, o-cur-scene); +pixels = obj-data_3d-surface; +imagew = obj-data_3d-w; +imageh = obj-data_3d-h; + } + else if (!o-cur-source) + { +// pixels = evas_process_dirty_pixels(eo_obj, obj, o, output, surface, o-engine_data); +pixels = o-engine_data; +imagew = o-cur-image.w; +imageh = o-cur-image.h; +putback = EINA_TRUE; + } + else if (source-proxy-surface !source-proxy-redraw) + { +pixels = source-proxy-surface; +imagew = source-proxy-w; +imageh = source-proxy-h; + } + else if (source-type == o_type +((Evas_Image_Data *)eo_data_scope_get(o-cur-source, MY_CLASS))-engine_data) + { +Evas_Image_Data *oi; +oi = eo_data_scope_get(o-cur-source, MY_CLASS); +pixels = oi-engine_data; +imagew = oi-cur-image.w; +imageh = oi-cur-image.h; + } + else + { +o-proxyrendering = EINA_TRUE; +evas_render_proxy_subrender(obj-layer-evas-evas, o-cur-source, +(Eo *) eo_obj, obj, EINA_FALSE); +pixels = source-proxy-surface; +imagew = source-proxy-w; +imageh = source-proxy-h; +o-proxyrendering = EINA_FALSE; + } + + pixels = ENFN-image_data_get(ENDT, pixels, 0, data, o-load_error); + + if (!pixels) + { +WRN(Could not get image pixels.); +return EINA_FALSE; + } + if (flags) { char *p, *pp; @@ -1652,19 +1707,14 @@ _evas_image_efl_file_save(const Eo *eo_obj, Evas_Image_Data *o, const char *file } } im = (RGBA_Image*) evas_cache_image_data(evas_common_image_cache_get(), -o-cur-image.w, -o-cur-image.h, -data, -o-cur-has_alpha, +imagew, imageh, data, o-cur-has_alpha, EVAS_COLORSPACE_ARGB); if (im) { if (o-cur-cspace == EVAS_COLORSPACE_ARGB) im-image.data = data; else - im-image.data = evas_object_image_data_convert_internal(o, - data, - EVAS_COLORSPACE_ARGB); + im-image.data = evas_object_image_data_convert_internal(o, data, EVAS_COLORSPACE_ARGB);
[EGIT] [core/efl] master 04/04: Evas.Image: Deprecate some functions and remove from Eo
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=32dc8f092c7f0906b75c950df137da5f3e18a468 commit 32dc8f092c7f0906b75c950df137da5f3e18a468 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Thu Jul 2 14:26:44 2015 +0900 Evas.Image: Deprecate some functions and remove from Eo This patch deprecates the following functions: - evas_object_image_data_convert - evas_object_image_pixels_import - evas_object_image_reload I could not find any place where they are used. The old documentation is kept in the header, but not as a doxygen anymore. --- src/lib/evas/Evas_Legacy.h | 37 +++ src/lib/evas/canvas/evas_image.eo | 37 --- src/lib/evas/canvas/evas_object_image.c | 39 ++--- 3 files changed, 68 insertions(+), 45 deletions(-) diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h index d8581d5..2f6fa55 100644 --- a/src/lib/evas/Evas_Legacy.h +++ b/src/lib/evas/Evas_Legacy.h @@ -2917,6 +2917,43 @@ EAPI void evas_object_image_size_set(Evas_Object *obj, int w, int h); */ EAPI void evas_object_image_size_get(const Evas_Object *obj, int *w, int *h); +/* + * Converts the raw image data of the given image object to the + * specified colorspace. + * + * Note that this function does not modify the raw image data. If the + * requested colorspace is the same as the image colorspace nothing is + * done and @c NULL is returned. You should use + * evas_object_image_colorspace_get() to check the current image + * colorspace. + * + * See @ref evas_object_image_colorspace_get. + * + * @return data A newly allocated data in the format specified by to_cspace. + * + * @param[in] to_cspace The colorspace to which the image raw data will be converted. + */ +/** @deprecated evas_object_image_data_convert */ +EAPI void *evas_object_image_data_convert(Evas_Object *obj, Evas_Colorspace to_cspace) EINA_WARN_UNUSED_RESULT EINA_DEPRECATED; + +/* + * Import pixels from given source to a given canvas image object. + * + * This function imports pixels from a given source to a given canvas image. + * + * @param[in] pixels The pixel's source to be imported. + */ +/** @deprecated evas_object_image_pixels_import */ +EAPI Eina_Bool evas_object_image_pixels_import(Evas_Object *obj, Evas_Pixel_Import_Source *pixels) EINA_ARG_NONNULL(2) EINA_DEPRECATED; + +/* + * Reload an image object's image data. + * + * This function reloads the image data bound to image object @p obj. + */ +/** @deprecated evas_object_image_reload */ +EAPI void evas_object_image_reload(Evas_Object *obj) EINA_DEPRECATED; + #include canvas/evas_image.eo.legacy.h /** diff --git a/src/lib/evas/canvas/evas_image.eo b/src/lib/evas/canvas/evas_image.eo index cec824a..53c9076 100644 --- a/src/lib/evas/canvas/evas_image.eo +++ b/src/lib/evas/canvas/evas_image.eo @@ -879,43 +879,6 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Gfx.Fill, Efl.Gfx.View, /*@ Cancel preloading an image object's image data in the background */ legacy: null; } - data_convert { - /*@ - Converts the raw image data of the given image object to the - specified colorspace. - - Note that this function does not modify the raw image data. If the - requested colorspace is the same as the image colorspace nothing is - done and @c NULL is returned. You should use - evas_object_image_colorspace_get() to check the current image - colorspace. - - See @ref evas_object_image_colorspace_get. - - @return data A newly allocated data in the format specified by to_cspace. */ - - return: void * @warn_unused; - params { -@in to_cspace: Evas_Colorspace; /*@ The colorspace to which the image raw data will be converted. */ - } - } - pixels_import { - /*@ - Import pixels from given source to a given canvas image object. - - This function imports pixels from a given source to a given canvas image. */ - - return: bool; - params { -@in pixels: Evas_Pixel_Import_Source * @nonull; /*@ The pixel's source to be imported. */ - } - } - reload { - /*@ - Reload an image object's image data. - - This function reloads the image data bound to image object @p obj. */ - } } implements { Eo.Base.constructor; diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 221ed08..b0d1c05 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -1209,16 +1209,23 @@ _evas_image_load_error_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) return o-load_error; } -EOLIAN static void* -_evas_image_data_convert(Eo *eo_obj, Evas_Image_Data *o, Evas_Colorspace
[EGIT] [core/efl] master 03/04: Evas: Replace image_map_surface_free by common image_free
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b5c9350805e350f7d7e5b0daeb8b02a5fc42b456 commit b5c9350805e350f7d7e5b0daeb8b02a5fc42b456 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Thu Jul 2 12:04:02 2015 +0900 Evas: Replace image_map_surface_free by common image_free Those two functions were doing exactly the same thing[1], which is free an image, so this commit only attempts to simplify the code a little bit. [1] Actually image_map_surface_free() might even not have worked properly with cserve2 sw (calling unload instead of close). --- src/lib/evas/canvas/evas_canvas3d_texture.c | 6 ++ src/lib/evas/canvas/evas_clip.c | 3 +-- src/lib/evas/canvas/evas_map.c | 4 ++-- src/lib/evas/canvas/evas_object_image.c | 6 +++--- src/lib/evas/canvas/evas_object_main.c | 8 src/lib/evas/canvas/evas_render.c | 16 src/lib/evas/include/evas_private.h | 1 - src/modules/evas/engines/gl_cocoa/evas_engine.c | 7 --- src/modules/evas/engines/gl_generic/evas_engine.c | 10 -- src/modules/evas/engines/software_generic/evas_engine.c | 14 -- 10 files changed, 20 insertions(+), 55 deletions(-) diff --git a/src/lib/evas/canvas/evas_canvas3d_texture.c b/src/lib/evas/canvas/evas_canvas3d_texture.c index 51e034f..58c1e28 100644 --- a/src/lib/evas/canvas/evas_canvas3d_texture.c +++ b/src/lib/evas/canvas/evas_canvas3d_texture.c @@ -31,8 +31,7 @@ _texture_proxy_unset(Evas_Canvas3D_Texture_Data *texture) proxy_src-surface != NULL) { Evas_Public_Data *e = src-layer-evas; - e-engine.func-image_map_surface_free(e-engine.data.output, -proxy_src-surface); + e-engine.func-image_free(e-engine.data.output, proxy_src-surface); proxy_src-surface = NULL; } @@ -91,8 +90,7 @@ _texture_proxy_subrender(Evas_Canvas3D_Texture *obj) 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); + e-engine.func-image_free(e-engine.data.output, proxy_write-surface); proxy_write-surface = NULL; } diff --git a/src/lib/evas/canvas/evas_clip.c b/src/lib/evas/canvas/evas_clip.c index cf5b1cc..e560a78 100644 --- a/src/lib/evas/canvas/evas_clip.c +++ b/src/lib/evas/canvas/evas_clip.c @@ -201,8 +201,7 @@ _evas_object_clip_mask_unset(Evas_Object_Protected_Data *obj) mask-is_alpha = EINA_FALSE; if (mask-surface) { - obj-layer-evas-engine.func-image_map_surface_free -(obj-layer-evas-engine.data.output, mask-surface); + obj-layer-evas-engine.func-image_free(obj-layer-evas-engine.data.output, mask-surface); mask-surface = NULL; } mask-w = 0; diff --git a/src/lib/evas/canvas/evas_map.c b/src/lib/evas/canvas/evas_map.c index bd7e51b..53c18fc 100644 --- a/src/lib/evas/canvas/evas_map.c +++ b/src/lib/evas/canvas/evas_map.c @@ -494,7 +494,7 @@ _evas_object_map_enable_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bo { EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj-map, Evas_Object_Map_Data, map_write) { - obj-layer-evas-engine.func-image_map_surface_free + obj-layer-evas-engine.func-image_free (obj-layer-evas-engine.data.output, map_write-surface); map_write-surface = NULL; @@ -548,7 +548,7 @@ _evas_object_map_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, const Evas_Map { EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj-map, Evas_Object_Map_Data, map_write) { - obj-layer-evas-engine.func-image_map_surface_free + obj-layer-evas-engine.func-image_free (obj-layer-evas-engine.data.output, map_write-surface); map_write-surface = NULL; diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index e18c58f..221ed08 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -2427,8 +2427,8 @@ _proxy_unset(Evas_Object *proxy, Evas_Object_Protected_Data *cur_proxy, Evas_Ima if (eina_list_count(proxy_source_write-proxies) == 0) { if (proxy_source_write-surface) - cur_proxy-layer-evas-engine.func-image_map_surface_free(cur_proxy-layer-evas-engine.data.output, -
[EGIT] [core/efl] master 02/04: Evas gl_cocoa: remove code duplicated from gl_generic
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=681c8b0ec25a0a00325d32aa0f0178434bb54ae7 commit 681c8b0ec25a0a00325d32aa0f0178434bb54ae7 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Thu Jul 2 11:56:36 2015 +0900 Evas gl_cocoa: remove code duplicated from gl_generic Remove the two functions: - image_data_get - image_data_put --- src/modules/evas/engines/gl_cocoa/evas_engine.c | 146 1 file changed, 146 deletions(-) diff --git a/src/modules/evas/engines/gl_cocoa/evas_engine.c b/src/modules/evas/engines/gl_cocoa/evas_engine.c index 5aab2c2..06d2f40 100644 --- a/src/modules/evas/engines/gl_cocoa/evas_engine.c +++ b/src/modules/evas/engines/gl_cocoa/evas_engine.c @@ -691,150 +691,6 @@ eng_image_dirty_region(void *data, void *image, int x, int y, int w, int h) return image; } -static void * -eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data, int *err) -{ - Render_Engine *re; - Evas_GL_Image *im; - int error; - - re = (Render_Engine *)data; - if (!image) - { - *image_data = NULL; -if (err) *err = EVAS_LOAD_ERROR_GENERIC; - return NULL; - } - im = image; - if (im-native.data) - { -*image_data = NULL; -if (err) *err = EVAS_LOAD_ERROR_NONE; -return im; - } - if ((im-tex) (im-tex-pt) (im-tex-pt-dyn.data)) - { -*image_data = im-tex-pt-dyn.data; -if (err) *err = EVAS_LOAD_ERROR_NONE; -return im; - } - eng_window_use(re-win); - error = evas_cache_image_load_data(im-im-cache_entry); - evas_gl_common_image_alloc_ensure(im); - switch (im-cs.space) - { - case EVAS_COLORSPACE_ARGB: - if (to_write) - { -if (im-references 1) - { - Evas_GL_Image *im_new; - - im_new = evas_gl_common_image_new_from_copied_data - (im-gc, im-im-cache_entry.w, im-im-cache_entry.h, - im-im-image.data, - eng_image_alpha_get(data, image), - eng_image_colorspace_get(data, image)); - if (!im_new) - { - *image_data = NULL; - if (err) *err = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; - return im; - } - evas_gl_common_image_free(im); - im = im_new; - } -else - evas_gl_common_image_dirty(im, 0, 0, 0, 0); - } - *image_data = im-im-image.data; - break; - case EVAS_COLORSPACE_YCBCR422P601_PL: - case EVAS_COLORSPACE_YCBCR422P709_PL: - case EVAS_COLORSPACE_YCBCR422601_PL: - case EVAS_COLORSPACE_YCBCR420NV12601_PL: - case EVAS_COLORSPACE_YCBCR420TM12601_PL: - *image_data = im-cs.data; - break; - default: - abort(); - break; - } - if (err) *err = error; - return im; -} - -static void * -eng_image_data_put(void *data, void *image, DATA32 *image_data) -{ - Render_Engine *re; - Evas_GL_Image *im, *im2; - - re = (Render_Engine *)data; - if (!image) return NULL; - im = image; - if (im-native.data) return image; - eng_window_use(re-win); - evas_gl_common_image_alloc_ensure(im); - if ((im-tex) (im-tex-pt) (im-tex-pt-dyn.data)) - { -if (im-tex-pt-dyn.data == image_data) - { - return image; - } -else - { -int w, h; - -w = im-im-cache_entry.w; -h = im-im-cache_entry.h; -im2 = eng_image_new_from_data(data, w, h, image_data, - eng_image_alpha_get(data, image), - eng_image_colorspace_get(data, image)); -if (!im2) return im; -evas_gl_common_image_free(im); -im = im2; - evas_gl_common_image_dirty(im, 0, 0, 0, 0); - return im; - } - } - switch (im-cs.space) - { - case EVAS_COLORSPACE_ARGB: - if (image_data != im-im-image.data) - { -int w, h; - -w = im-im-cache_entry.w; -h = im-im-cache_entry.h; -im2 = eng_image_new_from_data(data, w, h, image_data, - eng_image_alpha_get(data, image), - eng_image_colorspace_get(data, image)); -if (!im2) return im; -evas_gl_common_image_free(im); -im = im2; - } -break; - case EVAS_COLORSPACE_YCBCR422P601_PL: - case EVAS_COLORSPACE_YCBCR422P709_PL: -if (image_data != im-cs.data) - { -if (im-cs.data) - { - if (!im-cs.no_free) free(im-cs.data); - } -im-cs.data = image_data; -
[EGIT] [core/efl] master 01/04: Evas: Implement image_data_get for FBO images
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=fd4e133cc1af3351b79946cfb1bc6d79feec9d30 commit fd4e133cc1af3351b79946cfb1bc6d79feec9d30 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Thu Jul 2 11:52:16 2015 +0900 Evas: Implement image_data_get for FBO images --- src/lib/evas/canvas/evas_object_image.c| 62 + src/lib/evas/include/evas_private.h| 2 +- src/modules/evas/engines/gl_generic/evas_engine.c | 149 + .../evas/engines/software_generic/evas_engine.c| 17 ++- 4 files changed, 135 insertions(+), 95 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 7134783..e18c58f 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -1216,6 +1216,8 @@ _evas_image_data_convert(Eo *eo_obj, Evas_Image_Data *o, Evas_Colorspace to_cspa DATA32 *data; void* result = NULL; + // FIXME: This function is not really useful, and can't work with GL. + evas_object_async_block(obj); if ((o-preloading) (o-engine_data)) { @@ -1227,7 +1229,7 @@ _evas_image_data_convert(Eo *eo_obj, Evas_Image_Data *o, Evas_Colorspace to_cspa o-pixels-video.update_pixels(o-pixels-video.data, eo_obj, o-pixels-video); if (o-cur-cspace == to_cspace) return NULL; data = NULL; - o-engine_data = ENFN-image_data_get(ENDT, o-engine_data, 0, data, o-load_error); + o-engine_data = ENFN-image_data_get(ENDT, o-engine_data, 0, data, o-load_error, NULL); result = evas_object_image_data_convert_internal(o, data, to_cspace); if (o-engine_data) { @@ -1324,6 +1326,8 @@ EOLIAN static void* _evas_image_data_get(const Eo *eo_obj, Evas_Image_Data *_pd EINA_UNUSED, Eina_Bool for_writing) { Evas_Image_Data *o = (Evas_Image_Data *) _pd; + int stride = 0; + void *pixels; DATA32 *data; if (!o-engine_data) return NULL; @@ -1338,27 +1342,24 @@ _evas_image_data_get(const Eo *eo_obj, Evas_Image_Data *_pd EINA_UNUSED, Eina_Bo ENFN-image_scale_hint_set(ENDT, o-engine_data, o-scale_hint); if (ENFN-image_content_hint_set) ENFN-image_content_hint_set(ENDT, o-engine_data, o-content_hint); - o-engine_data = ENFN-image_data_get(ENDT, o-engine_data, for_writing, data, o-load_error); + pixels = ENFN-image_data_get(ENDT, o-engine_data, for_writing, data, o-load_error, NULL); /* if we fail to get engine_data, we have to return NULL */ - if (!o-engine_data) return NULL; + if (!pixels) return NULL; - if (o-engine_data) - { -int stride = 0; - -if (ENFN-image_stride_get) - ENFN-image_stride_get(ENDT, o-engine_data, stride); -else - stride = o-cur-image.w * 4; + o-engine_data = pixels; + if (ENFN-image_stride_get) + ENFN-image_stride_get(ENDT, o-engine_data, stride); + else + stride = o-cur-image.w * 4; -if (o-cur-image.stride != stride) - { - EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) - state_write-image.stride = stride; - EINA_COW_IMAGE_STATE_WRITE_END(o, state_write); - } + if (o-cur-image.stride != stride) + { +EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) + state_write-image.stride = stride; +EINA_COW_IMAGE_STATE_WRITE_END(o, state_write); } + o-pixels_checked_out++; if (for_writing) { @@ -1628,8 +1629,8 @@ _evas_image_efl_file_save(const Eo *eo_obj, Evas_Image_Data *o, const char *file DATA32 *data = NULL; int quality = 80, compress = 9, ok = 0; char *encoding = NULL; - RGBA_Image *im; - Eina_Bool putback = EINA_FALSE; + Image_Entry *ie; + Eina_Bool putback = EINA_FALSE, tofree = EINA_FALSE; int imagew, imageh; void *pixels; @@ -1679,7 +1680,7 @@ _evas_image_efl_file_save(const Eo *eo_obj, Evas_Image_Data *o, const char *file o-proxyrendering = EINA_FALSE; } - pixels = ENFN-image_data_get(ENDT, pixels, 0, data, o-load_error); + pixels = ENFN-image_data_get(ENDT, pixels, 0, data, o-load_error, tofree); if (!pixels) { @@ -1706,11 +1707,12 @@ _evas_image_efl_file_save(const Eo *eo_obj, Evas_Image_Data *o, const char *file else break; } } - im = (RGBA_Image*) evas_cache_image_data(evas_common_image_cache_get(), -imagew, imageh, data, o-cur-has_alpha, -EVAS_COLORSPACE_ARGB); - if (im) + ie = evas_cache_image_data(evas_common_image_cache_get(), + imagew, imageh, data, o-cur-has_alpha, + EVAS_COLORSPACE_ARGB); + if (ie) { +RGBA_Image *im = (RGBA_Image *) ie; if (o-cur-cspace == EVAS_COLORSPACE_ARGB) im-image.data = data; else @@ -1722,10 +1724,12 @@
[EGIT] [core/efl] master 01/01: Evas filters: Force filter redraw if object changed
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=7ea52e1bd8b5be7a4e348f31c670436f0a6a4c53 commit 7ea52e1bd8b5be7a4e348f31c670436f0a6a4c53 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Tue Jun 30 11:45:55 2015 +0900 Evas filters: Force filter redraw if object changed Somehow I broke this when introducing the eo mixin. This is what broke @cedric's work on the snapshot widget! TODO: Verify that the contents changed, and not just X,Y. --- src/lib/evas/canvas/evas_filter_mixin.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/lib/evas/canvas/evas_filter_mixin.c b/src/lib/evas/canvas/evas_filter_mixin.c index b2433b8..ffc8dfa 100644 --- a/src/lib/evas/canvas/evas_filter_mixin.c +++ b/src/lib/evas/canvas/evas_filter_mixin.c @@ -153,6 +153,12 @@ evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj, fcow-state.pos); if (redraw) DBG(Filter redraw by state change!); + else if (obj-changed) + { + // FIXME: Check that something else than X,Y changed! + redraw = EINA_TRUE; + DBG(Filter redraw by object content change!); + } // Scan proxies to find if any changed if (!redraw fcow-sources) --
[EGIT] [core/efl] master 03/08: Edje: Add proper filters section in the EDJ file
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3648b0e25203a2ce269b586b4a499468fa07bbda commit 3648b0e25203a2ce269b586b4a499468fa07bbda Author: Jean-Philippe Andre jp.an...@samsung.com Date: Mon Jun 29 16:47:00 2015 +0900 Edje: Add proper filters section in the EDJ file Don't [ab]use the file data section for filter scripts, instead create a proper section for them. The rest of the behaviour stays the same. --- src/bin/edje/edje_cc_handlers.c | 157 src/lib/edje/edje_calc.c| 29 src/lib/edje/edje_data.c| 15 src/lib/edje/edje_private.h | 16 4 files changed, 204 insertions(+), 13 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 4c7955f..0c14255 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -65,6 +65,7 @@ * li@ref sec_toplevel_data Data/li * li@ref sec_toplevel_color_classes Color Classes/li * li@ref sec_toplevel_styles Styles/li + * li@ref sec_collections_group_filter Filters/li !-- dup -- */ul *li@ref sec_collections Collections/li *ul @@ -72,6 +73,7 @@ * ul *li@ref sec_collections_sounds_sample Sample/li * /ul + * li@ref sec_collections_group_filter Filters/li * li@ref sec_collections_vibrations Vibrations/li * ul *li@ref sec_collections_vibrations_sample Sample/li @@ -81,6 +83,7 @@ *li@ref sec_collections_group_script Script/li *li@ref sec_collections_group_limits Limits/li *li@ref sec_collections_group_data Data/li + *li@ref sec_collections_group_filter Filters/li *li@ref sec_collections_group_parts Parts/li *ul * li@ref sec_collections_group_parts_part Part/li @@ -209,6 +212,9 @@ static void st_color_class_color2(void); static void st_color_class_color3(void); static void st_color_class_desc(void); +static void st_filters_filter_inline(void); +static void st_filters_filter_file(void); + static void ob_collections(void); static void st_collections_base_scale(void); @@ -617,6 +623,12 @@ static void st_collections_group_nobroadcast(void); ed-type_node.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_QUATERNION; \ } +#define FILTERS_STATEMENTS(PREFIX) \ + {PREFIXfilters, NULL}, \ + {PREFIXfilters.filter, NULL}, \ + {PREFIXfilters.filter.inline, st_filters_filter_inline}, \ + {PREFIXfilters.filter.file, st_filters_filter_file}, + New_Statement_Handler statement_handlers[] = { {externals.external, st_externals_external}, @@ -624,6 +636,7 @@ New_Statement_Handler statement_handlers[] = FONT_STYLE_CC_STATEMENTS() {data.item, st_data_item}, {data.file, st_data_file}, + FILTERS_STATEMENTS() {collections.externals.external, st_externals_external}, /* dup */ IMAGE_STATEMENTS(collections.) IMAGE_SET_STATEMENTS(collections) @@ -643,6 +656,7 @@ New_Statement_Handler statement_handlers[] = {collections.group.sounds.tone, st_collections_group_sound_tone}, /* dup */ {collections.vibrations.sample.name, st_collections_group_vibration_sample_name}, {collections.vibrations.sample.source, st_collections_group_vibration_sample_source}, + FILTERS_STATEMENTS(collections.) /* dup */ {collections.group.vibrations.sample.name, st_collections_group_vibration_sample_name}, /* dup */ {collections.group.vibrations.sample.source, st_collections_group_vibration_sample_source}, /* dup */ {collections.group.name, st_collections_group_name}, @@ -903,6 +917,7 @@ New_Statement_Handler statement_handlers[] = {collections.group.physics.world.z, st_collections_group_physics_world_z}, {collections.group.physics.world.depth, st_collections_group_physics_world_depth}, #endif + FILTERS_STATEMENTS(collections.group.) /* dup */ PROGRAM_STATEMENTS(collections.group.parts.part.description) PROGRAM_STATEMENTS(collections.group.parts.part) PROGRAM_STATEMENTS(collections.group.parts) @@ -4283,6 +4298,148 @@ st_collections_group_data_item(void) eina_hash_direct_add(pc-data, key, es); } +/** @edcsubsection{collections_group_filter, + * Group.Filter} */ + +/** +@page edcref +@block +filters +@context +filters { +filter { +inline: key Lua script here; +file: key Lua script filename; +.. +} +} +@description +The filter block lets you embed filter scripts into an EDC group, +that can then be referred to in a @ref sec_collections_group_parts_description_filter Text.Filter +or @ref collections_group_parts_description_filter Image.Filter statement. + +In a similar way to the @ref sec_collections_group_data
[EGIT] [core/efl] master 07/08: doc: Fixup EDC documentation about filters examples
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4e6e7def006605666213c49089e09654bab691e7 commit 4e6e7def006605666213c49089e09654bab691e7 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Mon Jun 29 19:52:56 2015 +0900 doc: Fixup EDC documentation about filters examples --- src/bin/edje/edje_cc_handlers.c| 92 +- src/examples/evas/filters/filter_blend.lua | 2 +- src/examples/evas/filters/filter_blur.lua | 2 +- src/examples/evas/filters/filter_bump.lua | 2 +- src/examples/evas/filters/filter_grow.lua | 2 +- 5 files changed, 56 insertions(+), 44 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 762b713..18701a2 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -65,7 +65,7 @@ * li@ref sec_toplevel_data Data/li * li@ref sec_toplevel_color_classes Color Classes/li * li@ref sec_toplevel_styles Styles/li - * li@ref sec_collections_group_filter Filters/li !-- dup -- + * li@ref sec_collections_group_filters Filters/li */ul *li@ref sec_collections Collections/li *ul @@ -73,7 +73,7 @@ * ul *li@ref sec_collections_sounds_sample Sample/li * /ul - * li@ref sec_collections_group_filter Filters/li + * li@ref sec_collections_group_filters Filters/li * li@ref sec_collections_vibrations Vibrations/li * ul *li@ref sec_collections_vibrations_sample Sample/li @@ -83,7 +83,7 @@ *li@ref sec_collections_group_script Script/li *li@ref sec_collections_group_limits Limits/li *li@ref sec_collections_group_data Data/li - *li@ref sec_collections_group_filter Filters/li + *li@ref sec_collections_group_filters Filters/li *li@ref sec_collections_group_parts Parts/li *ul * li@ref sec_collections_group_parts_part Part/li @@ -119,6 +119,7 @@ * li@ref sec_collections_group_parts_description_perspective Perspective/li * li@ref sec_collections_group_parts_descriptions_params Params/li * li@ref sec_collections_group_parts_description_links Links/li + * li@ref sec_collections_group_parts_description_filter Filter/li */ul * /ul */ul @@ -4298,25 +4299,26 @@ st_collections_group_data_item(void) eina_hash_direct_add(pc-data, key, es); } -/** @edcsubsection{collections_group_filter, - * Group.Filter} */ +/** @edcsubsection{collections_group_filters, + * Group.Filters} */ /** @page edcref @block filters @context +// (toplevel) +// collections +// collections.group filters { -filter { -inline: key Lua script here; -file: key Lua script filename; -.. -} +filter.inline: key Lua script here; +filter.file: other filename.lua; +.. } @description The filter block lets you embed filter scripts into an EDC group, -that can then be referred to in a @ref sec_collections_group_parts_description_filter Text.Filter -or @ref collections_group_parts_description_filter Image.Filter statement. +that can then be referred to in the @ref sec_collections_group_parts_description_filter Text.Filter +or @ref sec_collections_group_parts_description_filter Image.Filter statements. In a similar way to the toplevel @ref sec_toplevel_data Data section, it is possible to embed filters from a external file inside the final EDJ. @@ -11714,43 +11716,52 @@ st_collections_group_parts_part_description_perspective_focal(void) current_desc-persp.focal = parse_int_range(0, 1, 0x7fff); } + /** @edcsubsection{collections_group_parts_description_filter, * Group.Parts.Part.Description.Filter} */ /** @page edcref - +@block +filter @context part { -type: [TEXT or IMAGE]; +type: [IMAGE or TEXT]; +.. description { .. filter { -code: blend {} -- ... -// or: -code: data name; -source: part1 buf; -source: part2 otherbuf; -source: part3; + code: blend {}; + // or: + code: filter_name; + source: part1 buf; + source: part2 otherbuf; + source: part3; + .. + data: the_answer 42; + data: something anything; + data: mycc color_class('my_color_class'); + .. } -// or, for
[EGIT] [core/efl] master 02/08: doc: EDC reference: Add specific doc for group.data
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a31222ae6f11932bcfa964db0e1576d02d6d1d7c commit a31222ae6f11932bcfa964db0e1576d02d6d1d7c Author: Jean-Philippe Andre jp.an...@samsung.com Date: Fri Jun 26 11:48:57 2015 +0900 doc: EDC reference: Add specific doc for group.data Group.data does not support file, only item. This doc explains that. Should Group.Data support file instead? --- src/bin/edje/edje_cc_handlers.c | 31 ++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 114a085..4c7955f 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -80,7 +80,7 @@ * ul *li@ref sec_collections_group_script Script/li *li@ref sec_collections_group_limits Limits/li - *li@ref sec_toplevel_data Data/li + *li@ref sec_collections_group_data Data/li *li@ref sec_collections_group_parts Parts/li *ul * li@ref sec_collections_group_parts_part Part/li @@ -4229,6 +4229,35 @@ ob_collections_group_lua_script(void) } } +/** @edcsubsection{collections_group_data, + * Group.Data} */ + +/** +@page edcref +@block +data +@context +data { +item: key value; +.. +} +@description +The data block is used to pass arbitrary parameters from the theme to +the application. Unlike the toplevel data block, this block Group.Data +can only store inline items (not files). +See also the toplevel @ref sec_toplevel_data Data section. +@endblock + +@property +item +@parameters +[parameter name] [parameter value] +@effect +Defines a new parameter, the value will be the string specified next to +it. +@endproperty +*/ + static void st_collections_group_data_item(void) { --
[EGIT] [core/efl] master 05/08: Edje: Use bsearch() to find filters as fast as possible
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6e294890546b14cc1bfd6839a07cde5ce8fb7e12 commit 6e294890546b14cc1bfd6839a07cde5ce8fb7e12 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Mon Jun 29 17:51:42 2015 +0900 Edje: Use bsearch() to find filters as fast as possible edje_cc ensures that the filters are in order by name --- src/lib/edje/edje_calc.c| 37 - src/lib/edje/edje_private.h | 2 +- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index b45de76..bf0e182 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -2405,26 +2405,37 @@ _edje_part_recalc_single_map(Edje *ed, EINA_COW_CALC_MAP_END(params, params_write); } +static int +_filter_bsearch_cmp(const void *a, const void *b) +{ + const Edje_Gfx_Filter *filter = b; + const char *key = a; + + return strcmp(key, filter-name); +} + static inline const char * _edje_filter_get(Edje *ed, Edje_Part_Description_Spec_Filter *filter) { - int k; if (!filter-code) return NULL; if (EINA_UNLIKELY(!filter-checked_data)) { -// FIXME: bisect search instead of linear search +Edje_Gfx_Filter *found; + filter-checked_data = EINA_TRUE; -if (ed-file-filter_dir) - for (k = 0; k = ed-file-filter_dir-filters_count; k++) -{ - if (!strcmp(filter-code, ed-file-filter_dir-filters[k].name)) - { -filter-name = ed-file-filter_dir-filters[k].name; -filter-code = ed-file-filter_dir-filters[k].script; -filter-no_free = EINA_TRUE; -return filter-code; - } -} +if (!ed-file-filter_dir) + return filter-code; + +found = bsearch(filter-code, (ed-file-filter_dir-filters[0]), +ed-file-filter_dir-filters_count, +sizeof(Edje_Gfx_Filter), _filter_bsearch_cmp); +if (found) + { + filter-name = found-name; + filter-code = found-script; + filter-no_free = EINA_TRUE; + return filter-code; + } } return filter-code; } diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h index bc53874..e3c55fe 100644 --- a/src/lib/edje/edje_private.h +++ b/src/lib/edje/edje_private.h @@ -731,7 +731,7 @@ struct _Edje_Gfx_Filter struct _Edje_Gfx_Filter_Directory { - Edje_Gfx_Filter *filters; /* array */ + Edje_Gfx_Filter *filters; /* sorted array (by strcmp() on name) */ int filters_count; }; --
[EGIT] [core/efl] master 01/08: Edje: Use array instead of hash for filters data
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b676dcf9982292c08227f7133fb97d4bf31b7ebe commit b676dcf9982292c08227f7133fb97d4bf31b7ebe Author: Jean-Philippe Andre jp.an...@samsung.com Date: Fri Jun 26 10:40:27 2015 +0900 Edje: Use array instead of hash for filters data Yeah that was totally overkill and pure laziness on my side. Despite having the EO API for the filters still in beta, I want to the EDC API and EDJ binary formats to stay compatible, so let's get it right before the release :) --- src/bin/edje/edje_cc_handlers.c | 24 ++-- src/lib/edje/edje_calc.c| 35 +-- src/lib/edje/edje_data.c| 14 +++--- src/lib/edje/edje_private.h | 13 - 4 files changed, 54 insertions(+), 32 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 7834ffb..114a085 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -11703,8 +11703,10 @@ st_collections_group_parts_part_description_filter_source(void) static void st_collections_group_parts_part_description_filter_data(void) { + Edje_Part_Description_Spec_Filter_Data *array; Edje_Part_Description_Spec_Filter *filter; char *name, *value; + unsigned k; if (current_part-type == EDJE_PART_TYPE_TEXT) filter = (((Edje_Part_Description_Text *)current_desc)-text.filter); @@ -11719,19 +11721,21 @@ st_collections_group_parts_part_description_filter_data(void) check_arg_count(2); - if (!filter-data) - filter-data = eina_hash_string_small_new(EINA_FREE_CB(free)); - name = parse_str(0); value = parse_str(1); - if (eina_hash_find(filter-data, name)) - { -ERR(parse error %s:%i. filter.data '%s' already exists in this context, -file_in, line - 1, name); -exit(-1); - } + for (k = 0; k filter-data_count; k++) + if (!strcmp(filter-data[k].name, name)) + { + ERR(parse error %s:%i. filter.data '%s' already exists in this context, + file_in, line - 1, name); + exit(-1); + } - eina_hash_add(filter-data, name, value); + filter-data_count++; + array = realloc(filter-data, sizeof(Edje_Part_Description_Spec_Filter_Data) * filter-data_count); + array[filter-data_count - 1].name = name; + array[filter-data_count - 1].value = value; + filter-data = array; } /** @edcsubsection{collections_group_parts_descriptions_params, diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index b0db961..c72bba7 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -2480,27 +2480,27 @@ _edje_part_recalc_single_filter(Edje *ed, /* pass extra data items */ if (filter-data) { - Eina_Iterator *it = eina_hash_iterator_tuple_new(filter-data); - Eina_Hash_Tuple *tup; - EINA_ITERATOR_FOREACH(it, tup) + unsigned int k; + for (k = 0; k filter-data_count; k++) { - const char *name = tup-key; - char *value = tup-data; - if (!value) + Edje_Part_Description_Spec_Filter_Data *data = (filter-data[k]); + if (data-invalid_cc) + continue; + if (!data-value) { -efl_gfx_filter_data_set(name, NULL, EINA_FALSE); +efl_gfx_filter_data_set(data-name, NULL, EINA_FALSE); } - else if (!strncmp(value, color_class(', sizeof(color_class(') - 1)) + else if (!strncmp(data-value, color_class(', sizeof(color_class(') - 1)) { /* special handling for color classes even tho they're not that great */ char *ccname, *buffer, *r; Edje_Color_Class *cc; -ccname = strdup(value + sizeof(color_class(') - 1); +ccname = strdup(data-value + sizeof(color_class(') - 1); if (ccname) { r = strchr(ccname, '\''); - if (r) + if (r (r[1] == ')') (r[2] == '\0')) { *r = '\0'; cc = _edje_color_class_find(ed, ccname); @@ -2511,33 +2511,32 @@ _edje_part_recalc_single_filter(Edje *ed, r2=%d,g2=%d,b2=%d,a2=%d, r3=%d,g3=%d,b3=%d,a3=%d}; int len = sizeof(fmt) + 20; - len += strlen(name); + len +=
[EGIT] [core/efl] master 08/08: Evas filters: Fix color(0xrrggbb) to be opaque by default
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6980cb2c709ff69133f24549fd9f44fe42993ed4 commit 6980cb2c709ff69133f24549fd9f44fe42993ed4 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Tue Jun 30 10:33:29 2015 +0900 Evas filters: Fix color(0xrrggbb) to be opaque by default For compatibility with previous behaviour and with what the doc says, make sure default alpha is 255 and not 0. This way color(0) is black and not transparent --- src/lib/evas/filters/lua/color.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/filters/lua/color.lua b/src/lib/evas/filters/lua/color.lua index 3fb1e9b..fc60d8e 100644 --- a/src/lib/evas/filters/lua/color.lua +++ b/src/lib/evas/filters/lua/color.lua @@ -147,7 +147,7 @@ __color = { -- input single value 0xAARRGGBB if ((B == nil) and (type(A) == 'number')) then -A = math.floor(A) -- % 0x1 +A = math.floor(A) if ((A 0) or (A 0x)) then error('Invalid color value: ' .. string.format(0x%x, A)) end @@ -155,6 +155,7 @@ __color = { self.r = math.floor((A / 0x1) % 0x100) self.g = math.floor((A / 0x100) % 0x100) self.b = math.floor(A % 0x100) +if (self.a == 0) then self.a = 255 end return self end --
[EGIT] [core/efl] master 06/08: Edje: Fix test case (after syntax change)
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d4de36a43ab4fdd5ab16fca246ed4b93495846c8 commit d4de36a43ab4fdd5ab16fca246ed4b93495846c8 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Mon Jun 29 19:06:26 2015 +0900 Edje: Fix test case (after syntax change) Filters now belong to one of the filters sections: - filters - collections.filters - collections.group.filters --- src/tests/edje/data/test_filters.edc | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/tests/edje/data/test_filters.edc b/src/tests/edje/data/test_filters.edc index df84c48..2c31955 100644 --- a/src/tests/edje/data/test_filters.edc +++ b/src/tests/edje/data/test_filters.edc @@ -1,6 +1,3 @@ -data { - file: filterfile filter.lua; -} color_classes { color_class { name: cc1; @@ -9,12 +6,25 @@ color_classes { color3: 0 0 255 255; } } +filters { + // some unused filters + filter.file: filter0 filter.lua; + filter.inline: filter1 blend {}; +} collections { + filters { + // some unused filters + filter.file: filter2 filter.lua; + filter.inline: filter3 blend {}; + } images { // found in tests/emotion/data image: pnl.png COMP; } group { name: test_group; + filters { + filter.file: filterfile filter.lua; + } parts { part { name: background; type: RECT; @@ -47,6 +57,7 @@ collections { text: FILTER; font: Sans; size: 48; + ellipsis: -1; } filter { code: filterfile; --
[EGIT] [core/efl] master 04/08: Edje: Replace index() by strchr()
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=fc36eedadd1670cbe7b65b781bb53e45436ace42 commit fc36eedadd1670cbe7b65b781bb53e45436ace42 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Mon Jun 29 17:00:57 2015 +0900 Edje: Replace index() by strchr() Thanks vtorri for pointing out the build break on windows and that index() is deprecated. --- src/bin/edje/edje_cc_handlers.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 0c14255..762b713 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -4318,7 +4318,7 @@ st_collections_group_data_item(void) that can then be referred to in a @ref sec_collections_group_parts_description_filter Text.Filter or @ref collections_group_parts_description_filter Image.Filter statement. -In a similar way to the @ref sec_collections_group_data Group.Data blocks, +In a similar way to the toplevel @ref sec_toplevel_data Data section, it is possible to embed filters from a external file inside the final EDJ. Please also refer to @ref evasfiltersref Evas filters reference. @@ -11796,11 +11796,11 @@ st_collections_group_parts_part_description_filter_source(void) Edje_Part_Description_Spec_Filter *filter; Edje_Part_Collection *pc; char *name, *part, *str; - size_t sn = 0, sp; + size_t sn = 0, sp, k; int *part_key; int args; - static const char *allowed_name_chars = + static const char allowed_name_chars[] = abcdefghijklmnopqrstuvwxyzABCDEFGHJIKLMNOPQRSTUVWXYZ0123456789_; if (current_part-type == EDJE_PART_TYPE_TEXT) @@ -11826,7 +11826,7 @@ st_collections_group_parts_part_description_filter_source(void) if (name) sn = strlen(name); if (!name || (strspn(name, allowed_name_chars) != sn)) { - ERR(parse error %s:%i. invalid name for a filter buffer: %s, + ERR(parse error %s:%i. invalid name for a filter buffer: '%s', file_in, line - 1, name); exit(-1); } @@ -11841,12 +11841,11 @@ st_collections_group_parts_part_description_filter_source(void) if (!name) { // name = part so we replace all invalid chars by '_' - size_t k; name = strdup(part); sn = strlen(name); for (k = 0; k sn; k++) { - if (!index(allowed_name_chars, name[k])) + if (!strchr(allowed_name_chars, name[k])) name[k] = '_'; } } --
[EGIT] [core/efl] master 01/01: Edje tests: Fix compilation warning
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8ba212c3b6264096dda8757fe72cd016d68d9137 commit 8ba212c3b6264096dda8757fe72cd016d68d9137 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Fri Jun 26 09:09:03 2015 +0900 Edje tests: Fix compilation warning Thanks Stefan for the report. I don't really like putting all those -DBLA_BETA or #define BLA_BETA everywhere, though. Maybe the @beta flag is not required since the EO APIs are still beta? See: 04466193558ed23f4af3da4a5381aa75ea6e13e5 --- src/tests/edje/edje_test_edje.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c index 4c80b36..d68a5d9 100644 --- a/src/tests/edje/edje_test_edje.c +++ b/src/tests/edje/edje_test_edje.c @@ -5,6 +5,8 @@ #include unistd.h #include stdio.h +#define EFL_GFX_FILTER_BETA + #include Eina.h #include Edje.h --
[EGIT] [core/efl] master 01/38: Evas render: Fix rendering of objects with no_render
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8c473648461f48ee07a9d8efa0e5b8ee9b1e43ca commit 8c473648461f48ee07a9d8efa0e5b8ee9b1e43ca Author: Jean-Philippe Andre jp.an...@samsung.com Date: Tue Jun 16 19:20:57 2015 +0900 Evas render: Fix rendering of objects with no_render Well yeah, those objects should still be rendered in their proxy or mask surface :) --- src/lib/evas/canvas/evas_render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index ed75d0a..98658d4 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -1270,7 +1270,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, RD(level, }\n); return clean_them; } -else if (obj-no_render) +else if (obj-no_render (!use_mapped_ctx || (surface != obj-proxy-surface))) { RD(level, no render\n}\n); return clean_them; --
[EGIT] [core/efl] master 23/38: Evas filters: EO-ify the filters API
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=64fd278c62e3286c453885216d2d0c86a01ce9fc commit 64fd278c62e3286c453885216d2d0c86a01ce9fc Author: Jean-Philippe Andre jp.an...@samsung.com Date: Wed Jun 17 16:26:30 2015 +0900 Evas filters: EO-ify the filters API This creates the new interface Efl.Gfx.Filter And the implementation is a mixin (evas_filter_mixin.c): Evas.Filter All the filter rendering code has now been moved to this new file. TODO: Merge image filtering. --- doc/previews/preview_text_filter.c | 2 +- src/Makefile_Efl.am | 4 +- src/Makefile_Evas.am | 8 +- src/lib/edje/edje_calc.c | 36 +- src/lib/edje/edje_private.h | 2 +- src/lib/edje/edje_text.c | 2 +- src/lib/efl/Efl.h| 1 + src/lib/efl/interfaces/efl_gfx_filter.eo | 73 src/lib/efl/interfaces/efl_interfaces_main.c | 2 + src/lib/evas/canvas/evas_filter.eo | 66 +++ src/lib/evas/canvas/evas_filter_mixin.c | 512 ++ src/lib/evas/canvas/evas_object_main.c | 2 +- src/lib/evas/canvas/evas_object_text.c | 609 +-- src/lib/evas/canvas/evas_text.eo | 67 +-- src/lib/evas/include/evas_private.h | 3 + src/tests/evas/evas_test_filters.c | 8 +- 16 files changed, 796 insertions(+), 601 deletions(-) diff --git a/doc/previews/preview_text_filter.c b/doc/previews/preview_text_filter.c index 864342b..24c51cd 100644 --- a/doc/previews/preview_text_filter.c +++ b/doc/previews/preview_text_filter.c @@ -111,7 +111,7 @@ main(int argc, char **argv) evas_object_color_set(o, 255, 255, 255, 255); evas_object_show(o); - eo_do(o, evas_obj_text_filter_program_set(filter)); + eo_do(o, efl_gfx_filter_program_set(filter)); ecore_evas_manual_render(wpd.ee); evas_object_geometry_get(o, NULL, NULL, w, h); diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am index 5d45ae0..ad49f47 100644 --- a/src/Makefile_Efl.am +++ b/src/Makefile_Efl.am @@ -13,7 +13,9 @@ efl_eolian_files = \ lib/efl/interfaces/efl_gfx_gradient_base.eo \ lib/efl/interfaces/efl_gfx_gradient_linear.eo \ lib/efl/interfaces/efl_gfx_gradient_radial.eo \ - lib/efl/interfaces/efl_model_base.eo + lib/efl/interfaces/efl_gfx_filter.eo \ + lib/efl/interfaces/efl_model_base.eo \ + $(NULL) efl_eolian_files_h = $(efl_eolian_files:%.eo=%.eo.h) efl_eolian_files_c = $(efl_eolian_files:%.eo=%.eo.c) diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index ef59a2f..cfba9b6 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -40,7 +40,9 @@ evas_eolian_files = \ lib/evas/canvas/efl_vg_root_node.eo \ lib/evas/canvas/efl_vg_gradient.eo \ lib/evas/canvas/efl_vg_gradient_radial.eo \ - lib/evas/canvas/efl_vg_gradient_linear.eo + lib/evas/canvas/efl_vg_gradient_linear.eo \ + lib/evas/canvas/evas_filter.eo \ + $(NULL) evas_eolian_type_files = \ lib/evas/canvas/evas_types.eot @@ -520,7 +522,9 @@ lib/evas/common/evas_op_sub/op_sub_pixel_mask_i386.c ### Evas filters -lib_evas_libevas_la_SOURCES += lib/evas/filters/evas_filter.c \ +lib_evas_libevas_la_SOURCES += \ +lib/evas/canvas/evas_filter_mixin.c \ +lib/evas/filters/evas_filter.c \ lib/evas/filters/evas_filter_blend.c \ lib/evas/filters/evas_filter_blur.c \ lib/evas/filters/evas_filter_bump.c \ diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index 30478a6..a1cd9c1 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -1603,7 +1603,7 @@ _edje_part_recalc_single_text(FLOAT_T sc EINA_UNUSED, Edje_Part_Description_Text *chosen_desc, Edje_Calc_Params *params, int *minw, int *minh, - int *maxw, int *maxh, double pos) + int *maxw, int *maxh) #define RECALC_SINGLE_TEXT_USING_APPLY 1 #if RECALC_SINGLE_TEXT_USING_APPLY /* @@ -1634,7 +1634,7 @@ _edje_part_recalc_single_text(FLOAT_T sc EINA_UNUSED, free(sfont); params-type.text.size = size; /* XXX TODO used by further calcs, go inside recalc_apply? */ - _edje_text_recalc_apply(ed, ep, params, chosen_desc, EINA_TRUE, pos); + _edje_text_recalc_apply(ed, ep, params, chosen_desc, EINA_TRUE); if ((!chosen_desc) || ((!chosen_desc-text.min_x) (!chosen_desc-text.min_y) @@ -2406,6 +2406,7 @@ _edje_part_recalc_single_map(Edje *ed, static inline const char * _edje_filter_get(Edje *ed, Edje_Part_Description_Spec_Filter *filter) { + if (!filter-code) return NULL; if (EINA_UNLIKELY(!filter-checked_data)) { Edje_String *st; @@ -2433,7 +2434,6 @@ _edje_part_recalc_single_filter(Edje *ed, const
[EGIT] [core/efl] master 37/38: Evas filters: Use smooth scaling by default for proxies
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=14c14349604cea5c7bcd00c634b8416613f08a23 commit 14c14349604cea5c7bcd00c634b8416613f08a23 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Thu Jun 25 15:02:44 2015 +0900 Evas filters: Use smooth scaling by default for proxies Is it too slow? Then I guess a new API option will be required. --- src/lib/evas/filters/evas_filter_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/filters/evas_filter_utils.c b/src/lib/evas/filters/evas_filter_utils.c index 088cb53..c643c67 100644 --- a/src/lib/evas/filters/evas_filter_utils.c +++ b/src/lib/evas/filters/evas_filter_utils.c @@ -58,7 +58,7 @@ evas_filter_buffer_scaled_get(Evas_Filter_Context *ctx, dc.sli.h = 1; dc.render_op = EVAS_RENDER_COPY; - ok = evas_common_scale_rgba_in_to_out_clip_sample + ok = evas_common_scale_rgba_in_to_out_clip_smooth (s, d, dc, 0, 0, src-w, src-h, 0, 0, w, h); if (!ok) { --
[EGIT] [core/efl] master 15/38: Evas filters: Implement Lua classes for colors buffer
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f3e16bc4854268cecc19a38671c6f68071b7955b commit f3e16bc4854268cecc19a38671c6f68071b7955b Author: Jean-Philippe Andre jp.an...@samsung.com Date: Thu Jun 4 19:42:38 2015 +0900 Evas filters: Implement Lua classes for colors buffer Reuse previous code for buffer. Keeps API stability. The new class color is here for a more convenient color representation. This way, colors can be represented in more natural ways like: {r,g,b[,a]}, 0xaarrggbb, red, #rrggbb Class color is implemented in pure Lua, and adds a .lua file to Evas' share folder. --- src/Makefile_Evas.am | 8 + src/lib/evas/file/evas_module.c| 10 + src/lib/evas/filters/evas_filter.c | 1 + src/lib/evas/filters/evas_filter_parser.c | 581 - src/lib/evas/filters/evas_filter_private.h | 2 + src/lib/evas/filters/lua/color.lua | 302 +++ src/lib/evas/include/evas_private.h| 1 + 7 files changed, 638 insertions(+), 267 deletions(-) diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index 941e1d2..ef59a2f 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -2204,3 +2204,11 @@ installed_evasluadir = $(datadir)/elua/modules/evas nodist_installed_evaslua_DATA = $(generated_evas_lua_all) endif + +# Evas filters Lua stuff +evas_filters_lua = \ +lib/evas/filters/lua/color.lua \ +$(NULL) + +installed_evasfiltersdir = $(datadir)/evas/filters/lua +dist_installed_evasfilters_DATA = $(evas_filters_lua) diff --git a/src/lib/evas/file/evas_module.c b/src/lib/evas/file/evas_module.c index ead2612..bafc6e7 100644 --- a/src/lib/evas/file/evas_module.c +++ b/src/lib/evas/file/evas_module.c @@ -680,6 +680,16 @@ _evas_module_libdir_get(void) return eina_prefix_lib_get(pfx); } +const char * +_evas_module_datadir_get(void) +{ + if (!pfx) pfx = eina_prefix_new + (NULL, _evas_module_libdir_get, EVAS, evas, checkme, + PACKAGE_BIN_DIR, PACKAGE_LIB_DIR, PACKAGE_DATA_DIR, PACKAGE_DATA_DIR); + if (!pfx) return NULL; + return eina_prefix_data_get(pfx); +} + EAPI const char * evas_cserve_path_get(void) { diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c index 1e369f0..d420929 100644 --- a/src/lib/evas/filters/evas_filter.c +++ b/src/lib/evas/filters/evas_filter.c @@ -2002,6 +2002,7 @@ void evas_filter_shutdown() { if ((--init_cnt) 0) return; + evas_filter_parser_shutdown(); eina_log_domain_unregister(_evas_filter_log_dom); _evas_filter_log_dom = 0; } diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c index c5f409d..8992dcb 100644 --- a/src/lib/evas/filters/evas_filter_parser.c +++ b/src/lib/evas/filters/evas_filter_parser.c @@ -215,35 +215,6 @@ @since 1.9 */ -// Map of the most common HTML color names -static struct -{ - const char *name; - DATA32 value; -} color_map[] = -{ - { white, 0x }, - { black, 0xFF00 }, - { red, 0x }, - { green, 0xFF008000 }, - { blue, 0xFFFF }, - { darkblue, 0xFFA0 }, - { yellow, 0xFF00 }, - { magenta, 0x00FF }, - { cyan, 0xFF00 }, - { orange, 0xA500 }, - { purple, 0xFF800080 }, - { brown, 0xFFA52A2A }, - { maroon, 0xFF80 }, - { lime, 0xFF00FF00 }, - { gray, 0xFF808080 }, - { grey, 0xFF808080 }, - { silver, 0xFFC0C0C0 }, - { olive, 0xFF808000 }, - { invisible, 0x }, - { transparent, 0x } -}; - static struct { const char *name; @@ -265,9 +236,15 @@ static struct { stretch_xy, EVAS_FILTER_FILL_MODE_STRETCH_XY } }; -static const char *_lua_buffer_meta = Filter.buffer; +static const char *_lua_buffer_meta = buffer; +static const char *_lua_color_meta = color; +#define _lua_methods_table __methods +#define _lua_register_func __register +#define _lua_errfunc_name __backtrace static Evas_Filter_Fill_Mode _fill_mode_get(Evas_Filter_Instruction *instr); +static Eina_Bool _lua_instruction_run(lua_State *L, Evas_Filter_Instruction *instr); +static int _lua_backtrace(lua_State *L); typedef enum { @@ -618,46 +595,6 @@ _bool_parse(const char *str, Eina_Bool *b) #define PARSE_CHECK(a) do { if (!(a)) { ERR(Parsing failed because '%s' is false at %s:%d, #a, __FUNCTION__, __LINE__); PARSE_ABORT(); goto end; } } while (0) -static Eina_Bool -_color_parse(const char *word, DATA32 *color) -{ - DATA32 value; - Eina_Bool success = EINA_FALSE; - - PARSE_CHECK(word *word); - - errno = 0; - if (*word == '#') - { -unsigned char a, r, g, b; -int slen = strlen(word); -PARSE_CHECK(evas_common_format_color_parse(word, slen, r, g, b, a)); -value = ARGB_JOIN(a, r, g, b); - } - else - { -unsigned int k; -for (k = 0; k (sizeof(color_map) / sizeof(color_map[0])); k++) - { -
[EGIT] [core/efl] master 17/38: Evas filters: Fix blur from rgba to alpha
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f57929bf6ed4f9e0d20de2c90be663c48cfadd29 commit f57929bf6ed4f9e0d20de2c90be663c48cfadd29 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Mon Jun 15 17:43:39 2015 +0900 Evas filters: Fix blur from rgba to alpha --- src/lib/evas/filters/evas_filter.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c index dc022a3..7ad2878 100644 --- a/src/lib/evas/filters/evas_filter.c +++ b/src/lib/evas/filters/evas_filter.c @@ -931,14 +931,9 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, void *drawctx, goto fail; } - if (!in-alpha_only out-alpha_only) - { -/* FIXME: Add temporary buffer + blend */ -ERR(Input is RGBA but output is Alpha only. Unsupported config for blur.); -goto fail; - } - else if ((blend || (in-alpha_only !out-alpha_only)) || -(!blend !in-alpha_only !out-alpha_only (color != 0x))) + if ((blend || (in-alpha_only !out-alpha_only)) || +(!blend !in-alpha_only !out-alpha_only (color != 0x)) || +(!in-alpha_only out-alpha_only)) { XDBG(Adding extra blending step %d -- %d (%s -- %s), in-id, out-id, in-alpha_only ? Alpha : RGBA, --
[EGIT] [core/efl] master 25/38: Evas filters: Complete support for image filtering
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=29402b2ce965c83cdcbfa29ac08b918ab01d95d2 commit 29402b2ce965c83cdcbfa29ac08b918ab01d95d2 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Thu Jun 18 21:45:21 2015 +0900 Evas filters: Complete support for image filtering Reusing the new EO mixin, complete the support for image filtering. This now adds support for edje state inside the image filter. --- src/lib/evas/canvas/evas_filter.eo | 6 + src/lib/evas/canvas/evas_filter_mixin.c | 18 +- src/lib/evas/canvas/evas_image.eo | 65 +--- src/lib/evas/canvas/evas_object_image.c | 559 src/lib/evas/canvas/evas_object_text.c | 31 +- src/lib/evas/canvas/evas_text.eo| 3 +- 6 files changed, 166 insertions(+), 516 deletions(-) diff --git a/src/lib/evas/canvas/evas_filter.eo b/src/lib/evas/canvas/evas_filter.eo index 7f6bdcb..2750e10 100644 --- a/src/lib/evas/canvas/evas_filter.eo +++ b/src/lib/evas/canvas/evas_filter.eo @@ -32,10 +32,15 @@ mixin Evas.Filter (Efl.Gfx.Filter) This should be called at the beginning of a parent's class destructor. ]] } + input_alpha { + [[Called by Evas.Filter to determine whether the input is alpha or rgba.]] + return: bool; + } input_render { [[Called by Evas.Filter when the parent class must render the input. ; ]] + return: bool; [[Indicates success from the object render function.]] params { filter: void*; [[Evas_Filter_Context]] drawctx: void*; @@ -60,6 +65,7 @@ mixin Evas.Filter (Efl.Gfx.Filter) Efl.Gfx.Filter.padding.get; Efl.Gfx.Filter.source_set; Efl.Gfx.Filter.source_get; + @virtual .input_alpha; @virtual .input_render; @virtual .dirty; } diff --git a/src/lib/evas/canvas/evas_filter_mixin.c b/src/lib/evas/canvas/evas_filter_mixin.c index 20aa8cc..243b359 100644 --- a/src/lib/evas/canvas/evas_filter_mixin.c +++ b/src/lib/evas/canvas/evas_filter_mixin.c @@ -222,21 +222,9 @@ evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj, if (fcow-output != previous) evas_filter_buffer_backing_release(filter, previous); +// Request rendering from the object itself (child class) evas_filter_program_padding_get(fcow-chain, l, r, t, b); eo_do(eo_obj, evas_filter_input_render(filter, drawctx, l, r, t, b, do_async)); -#warning TODO: draw text into input buffer -#if 0 -// Render text to input buffer -EINA_INLIST_FOREACH(EINA_INLIST_GET(pd-items), it) - if ((pd-font) (it-text_props.len 0)) -{ - evas_filter_font_draw(filter, drawctx, EVAS_FILTER_BUFFER_INPUT_ID, pd-font, - sl + it-x, - st + (int) pd-max_ascent, - it-text_props, - do_async); -} -#endif ENFN-context_free(ENDT, drawctx); @@ -268,6 +256,7 @@ _evas_filter_efl_gfx_filter_program_set(Eo *eo_obj, Evas_Filter_Data *pd, { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); Evas_Filter_Program *pgm = NULL; + Eina_Bool alpha; if (!pd) return; if (pd-data-code == code) return; @@ -280,7 +269,8 @@ _evas_filter_efl_gfx_filter_program_set(Eo *eo_obj, Evas_Filter_Data *pd, evas_filter_program_del(fcow-chain); if (code) { - pgm = evas_filter_program_new(Evas_Text, EINA_TRUE); + alpha = eo_do_ret(eo_obj, alpha, evas_filter_input_alpha()); + pgm = evas_filter_program_new(Evas.Filter, alpha); evas_filter_program_source_set_all(pgm, fcow-sources); evas_filter_program_state_set(pgm, eo_obj, obj, fcow-state.cur.name, fcow-state.cur.value, diff --git a/src/lib/evas/canvas/evas_image.eo b/src/lib/evas/canvas/evas_image.eo index 38231e3..9d387b5 100644 --- a/src/lib/evas/canvas/evas_image.eo +++ b/src/lib/evas/canvas/evas_image.eo @@ -1,4 +1,4 @@ -class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Gfx.Fill, Efl.Gfx.View) +class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Gfx.Fill, Efl.Gfx.View, Evas.Filter) { legacy_prefix: evas_object_image; eo_prefix: evas_obj_image; @@ -756,61 +756,6 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Gfx.Fill, Efl.Gfx.View) scene: Evas.Canvas3D.Scene *; /*@ 3D scene on an image object. */ } } - @property filter_program { - set { -/*@ Set an Evas filter program on this Text Object. - -If the program fails to compile (syntax error, invalid -buffer name, etc...), the standard text effects will be -applied instead
[EGIT] [core/efl] master 03/38: Evas filters: Add internal function _program_run
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2faaef966e41b35656fd77be94701009ad183c42 commit 2faaef966e41b35656fd77be94701009ad183c42 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Mon May 18 17:35:49 2015 +0900 Evas filters: Add internal function _program_run This will allow changing the state of the filter and re-run it without re-creating the Lua_State object. This is to handle size, color, animation state and scale changes (amongst other things). --- src/lib/evas/canvas/evas_object_image.c | 2 +- src/lib/evas/canvas/evas_object_text.c| 8 ++-- src/lib/evas/filters/evas_filter.c| 16 +++ src/lib/evas/filters/evas_filter_parser.c | 76 --- src/lib/evas/include/evas_filter.h| 4 +- 5 files changed, 86 insertions(+), 20 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index b2f8b95..a272206 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -3315,7 +3315,7 @@ start_draw: if (!ok) goto state_write; evas_filter_context_proxy_render_all(filter, eo_obj, EINA_FALSE); - ok = evas_filter_context_buffers_allocate_all(filter, W, H); + ok = evas_filter_context_buffers_allocate_all(filter); if (!ok) goto state_write; if (ENFN-gl_surface_read_pixels) diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index d7ee55e..42620cb 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -1760,7 +1760,6 @@ evas_object_text_render(Evas_Object *eo_obj, * image to GL. */ - W = obj-cur-geometry.w; H = obj-cur-geometry.h; X = obj-cur-geometry.x; @@ -1837,6 +1836,7 @@ evas_object_text_render(Evas_Object *eo_obj, } filter = evas_filter_context_new(obj-layer-evas, do_async); +evas_filter_program_run(fcow-chain); ok = evas_filter_context_program_use(filter, fcow-chain); if (!filter || !ok) { @@ -1856,7 +1856,7 @@ evas_object_text_render(Evas_Object *eo_obj, ENFN-context_color_set(ENDT, filter_ctx, 255, 255, 255, 255); // Allocate all buffers now -evas_filter_context_buffers_allocate_all(filter, W, H); +evas_filter_context_buffers_allocate_all(filter); evas_filter_target_set(filter, context, surface, X + x, Y + y); // Steal output and release previous @@ -2379,7 +2379,6 @@ EOLIAN static void _evas_text_filter_program_set(Eo *eo_obj, Evas_Text_Data *o, const char *arg) { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); - Evas_Filter_Program *pgm = NULL; if (!o) return; @@ -2393,8 +2392,9 @@ _evas_text_filter_program_set(Eo *eo_obj, Evas_Text_Data *o, const char *arg) evas_filter_program_del(fcow-chain); if (arg) { - pgm = evas_filter_program_new(Evas_Text: Filter Program, EINA_TRUE); + pgm = evas_filter_program_new(Evas_Text, EINA_TRUE); evas_filter_program_source_set_all(pgm, fcow-sources); + evas_filter_program_state_set(pgm, obj-cur-geometry.w, obj-cur-geometry.h); if (!evas_filter_program_parse(pgm, arg)) { ERR(Parsing failed!); diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c index 0f24870..523018f 100644 --- a/src/lib/evas/filters/evas_filter.c +++ b/src/lib/evas/filters/evas_filter.c @@ -22,6 +22,8 @@ # include evas_cs2_private.h #endif +#define _assert(a) if (!(a)) CRI(Failed on %s, #a); + static void _buffer_free(Evas_Filter_Buffer *fb); static void _command_del(Evas_Filter_Context *ctx, Evas_Filter_Command *cmd); static RGBA_Image *_rgba_image_alloc(Evas_Filter_Buffer const *fb, void *data); @@ -205,13 +207,13 @@ evas_filter_context_proxy_render_all(Evas_Filter_Context *ctx, Eo *eo_obj, { // TODO: Lock current object as proxyrendering (see image obj) source = eo_data_scope_get(fb-source, EVAS_OBJECT_CLASS); + _assert(fb-w == source-cur-geometry.w); + _assert(fb-h == source-cur-geometry.h); if (source-proxy-surface !source-proxy-redraw) { DBG(Source already rendered: '%s' of type '%s', fb-source_name, eo_class_name_get(eo_class_get(fb-source))); _filter_buffer_backing_free(fb); - fb-w = source-cur-geometry.w; - fb-h = source-cur-geometry.h; if (!ctx-gl_engine) { fb-backing = source-proxy-surface; @@ -232,8 +234,6 @@ evas_filter_context_proxy_render_all(Evas_Filter_Context *ctx, Eo *eo_obj,
[EGIT] [core/efl] master 22/38: Edje: Factorise filter code for TEXT and IMAGE
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a18107309dc5233e76b77016b6eb3ef09ddf25ec commit a18107309dc5233e76b77016b6eb3ef09ddf25ec Author: Jean-Philippe Andre jp.an...@samsung.com Date: Wed Jun 17 13:49:18 2015 +0900 Edje: Factorise filter code for TEXT and IMAGE TODO: eo-ify the filter API properly and stabilize it. --- src/lib/edje/edje_calc.c | 166 ++- src/lib/edje/edje_data.c | 2 + src/lib/edje/edje_text.c | 104 - 3 files changed, 167 insertions(+), 105 deletions(-) diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index c1e7e1b..30478a6 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -2403,6 +2403,165 @@ _edje_part_recalc_single_map(Edje *ed, EINA_COW_CALC_MAP_END(params, params_write); } +static inline const char * +_edje_filter_get(Edje *ed, Edje_Part_Description_Spec_Filter *filter) +{ + if (EINA_UNLIKELY(!filter-checked_data)) + { +Edje_String *st; +filter-checked_data = 1; +st = eina_hash_find(ed-file-data, filter-code); +if (st) + { + eina_stringshare_del(filter-code); + filter-code = st-str; + filter-no_free = 1; + } + } + return filter-code; +} + +static void +_edje_part_recalc_single_filter(Edje *ed, +Edje_Real_Part *ep, +Edje_Part_Description_Common *desc, +Edje_Part_Description_Common *chosen_desc, +double pos) +{ + Edje_Part_Description_Spec_Filter *filter; + Eina_List *filter_sources = NULL, *prev_sources = NULL; + const char *src1, *src2, *part, *code; + Evas_Object *obj = ep-object; + Eina_List *li1, *li2; + Eina_Bool im = 0; + + /* handle TEXT and IMAGE part types here */ + if (ep-part-type == EDJE_PART_TYPE_TEXT) + { +Edje_Part_Description_Text *chosen_edt = (Edje_Part_Description_Text *) chosen_desc; +Edje_Part_Description_Text *edt = (Edje_Part_Description_Text *) desc; +filter = chosen_edt-text.filter; +if (edt-text.filter.sources != filter-sources) + { + prev_sources = ep-typedata.text-filter.sources; + filter_sources = edt-text.filter.sources; + } +#if 0 +// old form +if (ep-typedata.text-filter.code) + filter = ep-typedata.text-filter; +else + filter = chosen_edt-text.filter; +if (ep-typedata.text-filter.sources != chosen_edt-text.filter.sources) + { + prev_sources = ep-typedata.text-filter.sources; + filter_sources = chosen_edt-text.filter.sources; + //ep-typedata.text-filter.sources = chosen_edt-text.filter.sources; + } +#endif + } + else if (ep-part-type == EDJE_PART_TYPE_IMAGE) + { +Edje_Part_Description_Image *chosen_edi = (Edje_Part_Description_Image *) chosen_desc; +Edje_Part_Description_Image *edi = (Edje_Part_Description_Image *) desc; +filter = chosen_edi-image.filter; +if (edi-image.filter.sources != filter-sources) + { + prev_sources = edi-image.filter.sources; + filter_sources = chosen_edi-image.filter.sources; + } +im = 1; + } + else + { +CRI(Invalid call to filter recalc); +return; + } + + // FIXME: Implement proper EO interface/mixin and remove this ugly thing +#define efl_gfx_filter_program_set(...) do { \ + if (!im) evas_obj_text_filter_program_set(__VA_ARGS__); \ + else evas_obj_text_filter_program_set(__VA_ARGS__); } while (0) +#define efl_gfx_filter_source_set(...) do { \ + if (!im) evas_obj_text_filter_source_set(__VA_ARGS__); \ + else evas_obj_image_filter_source_set(__VA_ARGS__); } while (0) +#define efl_gfx_filter_state_set(...) do { \ + if (!im) evas_obj_text_filter_state_set(__VA_ARGS__); \ + /* else evas_obj_image_filter_state_set(__VA_ARGS__); */ } while (0) + // End of pure ugliness + + /* common code below */ + code = _edje_filter_get(ed, filter); + if (!code) + { +eo_do(obj, efl_gfx_filter_program_set(NULL)); +return; + } + + eo_do(obj, + efl_gfx_filter_program_set(code); + if (prev_sources != filter_sources) + { + /* remove sources that are not there anymore + * this O(n^2) loop assumes a very small number of sources */ + EINA_LIST_FOREACH(prev_sources, li1, src1) +{ + Eina_Bool found = 0; + EINA_LIST_FOREACH(filter_sources, li2, src2) + { +if (!strcmp(src1, src2)) + { + found = 1; + break; + } +
[EGIT] [core/efl] master 34/38: Evas filters: Add @protected tag where applicable
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c86a5edc9f4dbee7660166309d441790e9149e80 commit c86a5edc9f4dbee7660166309d441790e9149e80 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Tue Jun 23 17:25:44 2015 +0900 Evas filters: Add @protected tag where applicable The Evas.Filter interface is basically just an internal thing. --- src/lib/evas/canvas/evas_filter.eo | 14 +++--- src/lib/evas/canvas/evas_filter_mixin.c | 2 ++ src/lib/evas/canvas/evas_object_image.c | 2 ++ src/lib/evas/canvas/evas_object_text.c | 2 ++ 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/lib/evas/canvas/evas_filter.eo b/src/lib/evas/canvas/evas_filter.eo index b461de9..5f8442f 100644 --- a/src/lib/evas/canvas/evas_filter.eo +++ b/src/lib/evas/canvas/evas_filter.eo @@ -3,7 +3,7 @@ mixin Evas.Filter (Efl.Gfx.Filter) // Evas internal implementation legacy_prefix: null; methods { - @property changed { + @property changed @protected { set { [[Marks this filter as changed.]] } @@ -11,7 +11,7 @@ mixin Evas.Filter (Efl.Gfx.Filter) val: bool; } } - @property invalid { + @property invalid @protected { set { [[Marks this filter as invalid.]] } @@ -19,24 +19,24 @@ mixin Evas.Filter (Efl.Gfx.Filter) val: bool; } } - constructor { + constructor @protected { [[Initialize the Evas.Filter mixin. Should be called in a parent's class constructor. ]] } - destructor { + destructor @protected { [[Release all data held by this Evas.Filter. This may include image buffers allocated by the Evas engine. This should be called at the beginning of a parent's class destructor. ]] } - input_alpha { + input_alpha @protected { [[Called by Evas.Filter to determine whether the input is alpha or rgba.]] return: bool; } - input_render { + input_render @protected { [[Called by Evas.Filter when the parent class must render the input. ; ]] @@ -51,7 +51,7 @@ mixin Evas.Filter (Efl.Gfx.Filter) do_async: bool; } } - dirty { + dirty @protected { [[Called when the filter changes must trigger a redraw of the object. Virtual, to be implemented in the parent class. diff --git a/src/lib/evas/canvas/evas_filter_mixin.c b/src/lib/evas/canvas/evas_filter_mixin.c index 70e37b0..046683b 100644 --- a/src/lib/evas/canvas/evas_filter_mixin.c +++ b/src/lib/evas/canvas/evas_filter_mixin.c @@ -1,3 +1,5 @@ +#define EVAS_FILTER_PROTECTED + #include evas_common_private.h #include evas_private.h #include ../../lib/efl/interfaces/efl_gfx_filter.eo.h diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 0446ede..807f27c 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -1,3 +1,5 @@ +#define EVAS_FILTER_PROTECTED + #include evas_common_private.h #include sys/types.h diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 21b91d9..1113791 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -1,3 +1,5 @@ +#define EVAS_FILTER_PROTECTED + #include evas_common_private.h /* Includes evas_bidi_utils stuff. */ #include evas_private.h --
[EGIT] [core/efl] master 19/38: Edje/evas filters: Add filter.source support
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d00378edcf08deb6a34eeb9833a4d521ed6cca27 commit d00378edcf08deb6a34eeb9833a4d521ed6cca27 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Tue Jun 16 14:50:43 2015 +0900 Edje/evas filters: Add filter.source support This should preserve ABI stability with earlier versions of edje_cc while still providing more advanced control over proxy bindings for evas filters from EDC. Also fix proxy binding for filters. @feature --- src/bin/edje/edje_cc_handlers.c | 194 ++ src/lib/edje/edje_private.h | 2 +- src/lib/edje/edje_text.c | 65 -- src/lib/evas/canvas/evas_object_text.c| 38 +++--- src/lib/evas/filters/evas_filter_parser.c | 2 +- 5 files changed, 197 insertions(+), 104 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 2268190..53bf91e 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -362,6 +362,7 @@ static void st_collections_group_parts_part_description_text_source(void); static void st_collections_group_parts_part_description_text_text_source(void); static void st_collections_group_parts_part_description_text_ellipsis(void); static void st_collections_group_parts_part_description_text_filter(void); +static void st_collections_group_parts_part_description_text_filter_source(void); static void st_collections_group_parts_part_description_box_layout(void); static void st_collections_group_parts_part_description_box_align(void); static void st_collections_group_parts_part_description_box_padding(void); @@ -814,6 +815,8 @@ New_Statement_Handler statement_handlers[] = {collections.group.parts.part.description.text.elipsis, st_collections_group_parts_part_description_text_ellipsis}, {collections.group.parts.part.description.text.ellipsis, st_collections_group_parts_part_description_text_ellipsis}, {collections.group.parts.part.description.text.filter, st_collections_group_parts_part_description_text_filter}, + {collections.group.parts.part.description.text.filter.code, st_collections_group_parts_part_description_text_filter}, /* dup */ + {collections.group.parts.part.description.text.filter.source, st_collections_group_parts_part_description_text_filter_source}, {collections.group.parts.part.description.box.layout, st_collections_group_parts_part_description_box_layout}, {collections.group.parts.part.description.box.align, st_collections_group_parts_part_description_box_align}, {collections.group.parts.part.description.box.padding, st_collections_group_parts_part_description_box_padding}, @@ -6696,15 +6699,18 @@ st_collections_group_parts_part_description_inherit(void) ted-text.domain = STRDUP(ted-text.domain); ted-text.text_class = STRDUP(ted-text.text_class); ted-text.font.str = STRDUP(ted-text.font.str); - ted-text.filter.code = STRDUP(ted-text.filter.code); - { - Eina_List *l; - Eina_Stringshare *name; - static int part_key = 0; - EINA_LIST_FOREACH(ted-text.filter.sources, l, name) - data_queue_part_lookup(pc, name, part_key); - } + /* Filters stuff */ + ted-text.filter.code = STRDUP(ted-text.filter.code); + if (ted-text.filter.code) +{ + Eina_List *list, *l; + const char *name; + list = ted-text.filter.sources; + ted-text.filter.sources = NULL; + EINA_LIST_FOREACH(list, l, name) + ted-text.filter.sources = eina_list_append(ted-text.filter.sources, STRDUP(name)); +} data_queue_copied_part_nest_lookup(pc, (tparent-text.id_source), (ted-text.id_source), ted-text.id_source_part); data_queue_copied_part_nest_lookup(pc, (tparent-text.id_text_source), (ted-text.id_text_source), ted-text.id_text_source_part); @@ -8979,31 +8985,88 @@ st_collections_group_parts_part_description_text_ellipsis(void) /** @page edcref +@context +part { +type: TEXT; // or IMAGE +description { +.. +text { +.. +filter { +code: blend {} -- ... +source: part1 buf; +source: part2 otherbuf; +source: part3; +} +// or as short form: +filter: blend {} -- ... +} +.. +} +} @property -filter +filter.code @parameters [filter program as a string]
[EGIT] [core/efl] master 30/38: Edje tests: Add test case for embedded text filters
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6ca1ce305bc9043561f040d52c85dd2781aaec4d commit 6ca1ce305bc9043561f040d52c85dd2781aaec4d Author: Jean-Philippe Andre jp.an...@samsung.com Date: Tue Jun 23 12:38:32 2015 +0900 Edje tests: Add test case for embedded text filters --- src/Makefile_Edje.am | 15 ++--- src/tests/edje/data/filter.lua | 14 src/tests/edje/data/test_filters.edc | 62 src/tests/edje/edje_test_edje.c | 35 4 files changed, 122 insertions(+), 4 deletions(-) diff --git a/src/Makefile_Edje.am b/src/Makefile_Edje.am index 596a02b..17e1cbc 100644 --- a/src/Makefile_Edje.am +++ b/src/Makefile_Edje.am @@ -284,22 +284,29 @@ tests/edje/data/%.edj: tests/edje/data/%.edc bin/edje/edje_cc${EXEEXT} $(AM_V_EDJ) \ $(MKDIR_P) tests/edje/data; \ $(EDJE_CC) $(EDJE_CC_FLAGS) -id $(srcdir)/tests/edje/data \ - -id $(srcdir)/tests/emotion/data $ $@ + -id $(srcdir)/tests/emotion/data \ + -dd $(srcdir)/tests/edje/data \ + $ $@ EDJE_DATA_FILES = tests/edje/data/test_layout.edc \ tests/edje/data/complex_layout.edc \ tests/edje/data/test_parens.edc \ - tests/edje/data/test_masking.edc + tests/edje/data/test_masking.edc \ + tests/edje/data/test_filters.edc \ + tests/edje/data/filter.lua edjedatafilesdir = $(datadir)/edje/data edjedatafiles_DATA = tests/edje/data/test_layout.edj \ tests/edje/data/complex_layout.edj \ tests/edje/data/test_parens.edj \ - tests/edje/data/test_masking.edj + tests/edje/data/test_masking.edj \ + tests/edje/data/test_filters.edj + CLEANFILES += tests/edje/data/test_layout.edj \ tests/edje/data/complex_layout.edj \ tests/edje/data/test_parens.edj \ - tests/edje/data/test_masking.edj + tests/edje/data/test_masking.edj \ + tests/edje/data/test_filters.edj endif diff --git a/src/tests/edje/data/filter.lua b/src/tests/edje/data/filter.lua new file mode 100644 index 000..2ada51b --- /dev/null +++ b/src/tests/edje/data/filter.lua @@ -0,0 +1,14 @@ +-- Evas filter program + +a = buffer { 'alpha' } +b = buffer { src = 'mask' } + +padding_set(10) + +grow { 5, dst = a } +blur { 6, src = a, color = state.color, ox = 1, oy = 1 } +blur { 2, color = color({cc.r, cc.g, cc.b, cc.a }) } +blend { color = mycolor, ox = 1, oy = 1 } + +mask { src = input, mask = b, color = 'cyan', fillmode = 'stretch_y_repeat_x' } + diff --git a/src/tests/edje/data/test_filters.edc b/src/tests/edje/data/test_filters.edc new file mode 100644 index 000..df84c48 --- /dev/null +++ b/src/tests/edje/data/test_filters.edc @@ -0,0 +1,62 @@ +data { + file: filterfile filter.lua; +} +color_classes { + color_class { + name: cc1; + color: 0 0 255 255; + color2: 0 255 255 255; + color3: 0 0 255 255; + } +} +collections { + images { + // found in tests/emotion/data + image: pnl.png COMP; + } + group { name: test_group; + parts { + part { name: background; +type: RECT; +description { state: default 0.0; + color: 33 32 32 255; + rel1.relative: 0 0; + rel2.relative: 1 1; + max: 200 200; +} + } + part { name: mask; +type: IMAGE; +no_render: 1; +description { state: default 0.0; + rel1.relative: 0 0; + rel2.relative: 1 1; + rel.to: text; + max: 999 50; + image.normal: pnl.png; +} + } + part { name: text; +type: TEXT; +description { state: default 0.0; + rel1.relative: 0 0; + rel2.relative: 1 1; + rel1.to: background; + rel2.to: background; + text { + text: FILTER; + font: Sans; + size: 48; + } + filter { + code: filterfile; + source: mask; + data: mycolor #f0f8; + data: cc color_class('cc1'); + } + color: 255 80 0 200; +} + } + } + } +} diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c index 88cc3fc..4c80b36 100644 --- a/src/tests/edje/edje_test_edje.c +++ b/src/tests/edje/edje_test_edje.c @@ -203,6 +203,40 @@ START_TEST(edje_test_masking) } END_TEST +START_TEST(edje_test_filters) +{ + Evas *evas = EDJE_TEST_INIT_EVAS(); + const Evas_Object *text, *sub; + Evas_Object *obj, *src = NULL; + const char *prg, *name; + Eina_Bool b;
[EGIT] [core/efl] master 27/38: Edje evas filters: Add extra data from EDC to Lua program
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0e8f890dfbdb188d02857b2bcf64d35089f3a297 commit 0e8f890dfbdb188d02857b2bcf64d35089f3a297 Author: Jean-Philippe Andre jp.an...@samsung.com Date: Mon Jun 22 21:52:16 2015 +0900 Edje evas filters: Add extra data from EDC to Lua program This also supports color classes (really rough implementation for now, but the API should remain stable). @feature --- src/bin/edje/edje_cc_handlers.c | 52 ++ src/lib/edje/edje_calc.c | 61 +++ src/lib/edje/edje_data.c | 2 + src/lib/edje/edje_private.h | 1 + src/lib/efl/interfaces/efl_gfx_filter.eo | 9 + src/lib/evas/canvas/evas_filter_mixin.c | 30 +++ src/lib/evas/canvas/evas_object_main.c| 2 +- src/lib/evas/filters/evas_filter_parser.c | 26 + src/lib/evas/include/evas_filter.h| 1 + src/lib/evas/include/evas_private.h | 1 + 10 files changed, 184 insertions(+), 1 deletion(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 8954f08..f6458f8 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -396,6 +396,7 @@ static void st_collections_group_parts_part_description_mesh_assembly(void); static void st_collections_group_parts_part_description_mesh_geometry(void); static void st_collections_group_parts_part_description_filter_code(void); static void st_collections_group_parts_part_description_filter_source(void); +static void st_collections_group_parts_part_description_filter_data(void); #ifdef HAVE_EPHYSICS static void st_collections_group_parts_part_description_physics_mass(void); @@ -849,6 +850,7 @@ New_Statement_Handler statement_handlers[] = {collections.group.parts.part.description.mesh.geometry, st_collections_group_parts_part_description_mesh_geometry}, {collections.group.parts.part.description.filter.code, st_collections_group_parts_part_description_filter_code}, {collections.group.parts.part.description.filter.source, st_collections_group_parts_part_description_filter_source}, + {collections.group.parts.part.description.filter.data, st_collections_group_parts_part_description_filter_data}, #ifdef HAVE_EPHYSICS {collections.group.parts.part.description.physics.mass, st_collections_group_parts_part_description_physics_mass}, @@ -11649,6 +11651,56 @@ st_collections_group_parts_part_description_filter_source(void) free(name); } +/** +@page edcref + +@property +filter.data +@parameters +[name] [content] +@effect +Pass extra data to the Lua filter program. This can be used to pass +extra colors from a color_class using the following syntax: + filter.data: mycc color_class('my_color_class'); +If not a color class, the data will simply be set as a string attached +to the global variable 'name' in the Lua program. +For more information, please refer to the page Evas filters reference. +@see evasfiltersref +@endproperty +*/ +static void +st_collections_group_parts_part_description_filter_data(void) +{ + Edje_Part_Description_Spec_Filter *filter; + char *name, *value; + + if (current_part-type == EDJE_PART_TYPE_TEXT) + filter = (((Edje_Part_Description_Text *)current_desc)-text.filter); + else if (current_part-type == EDJE_PART_TYPE_IMAGE) + filter = (((Edje_Part_Description_Image *)current_desc)-image.filter); + else + { +ERR(parse error %s:%i. filter set for non-TEXT and non-IMAGE part., +file_in, line - 1); +exit(-1); + } + + check_arg_count(2); + + if (!filter-data) + filter-data = eina_hash_string_small_new(EINA_FREE_CB(free)); + + name = parse_str(0); + value = parse_str(1); + if (eina_hash_find(filter-data, name)) + { +ERR(parse error %s:%i. filter.data '%s' already exists in this context, +file_in, line - 1, name); +exit(-1); + } + + eina_hash_add(filter-data, name, value); +} /** @edcsubsection{collections_group_parts_descriptions_params, * Group.Parts.Part.Description.Params} */ diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index 48a4d81..b506ef1 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -2535,6 +2535,67 @@ _edje_part_recalc_single_filter(Edje *ed, efl_gfx_filter_state_set(chosen_desc-state.name, chosen_desc-state.value, NULL, 0.0, pos); } + /* pass extra data items */ + if (filter-data) + { + Eina_Iterator *it = eina_hash_iterator_tuple_new(filter-data); + Eina_Hash_Tuple *tup; + EINA_ITERATOR_FOREACH(it, tup) +{ + const char