We must unset it, so the Evas engine knows that it has to do all the
setup to destroy the EGL surfaces associated with it. And in the case of
an ecore_evas_show, recreate everything again.
When an Ecore_Evas is hidden, it will destroy the buffer swapper. When
it's shown again, it will try to attach a new buffer, that can be same
buffer. If that global var is still pointing to the old buffer, it can
match to it again and avoid sending a new buffer. So, just put this sent
buffer var in the buffer swapper, and it will get set to NULL when the
swapper is destroyed and created again.
This should fix an intermitent problem of ecore_evas_show() not always
working after an ecore_evas_hide() on the wayland_shm engine.
This reverts commit 1319733cae.
Let's revert this patch and lower the recursion number.
As we released efl 1.8, let's find the root causes of the problem and fix them.
I already told this revert to raster so I am not mean :)
Summary: Adding an option to use a cubic-bezier curve in edje transitions.
Reviewers: Sachiel, cedric, raster
Reviewed By: raster
CC: raster
Differential Revision: https://phab.enlightenment.org/D319
Summary:
Hello guys,
We are now working on a accessibility support for elementary (ATSPI2) and we need following function to correctly register application.
Reviewers: cedric, raster, lucasdemarchi
Reviewed By: raster
Differential Revision: https://phab.enlightenment.org/D327
The previous workaround used to send a mouse up event to the
application, using the pointer enter callback to determine when an
implicit grab has finished. This was "simulating" a mouse up event when
the surface move or resize finished.
However, this doesn't work for touch-based move. The pointer enter isn't
emitted, because the wl_touch interface doesn't have the concept of a
pointer.
Changing this code to make it more similar to what Weston's toytoolkit
does, the mouse up event is sent as soon as the move or resize grab
starts. After that, the compositor takes care of the move/resize almost
entirely.
Should fix T468.
down_info is a struct that stores some information about the current
pressed touch events. It should be used for that specific touch point,
instead of the generic input info, when sending a mouse_up event.
This happen because proxy was already freed and we try print some information
about the proxy in error message.
This fix: https://phab.enlightenment.org/T543
Summary:
Block SIGCHLD during select().
This fixes a bug with edje_cc when EVAS_CSERVE2=1: Fixes T464.
select() used to return prematurately with EINTR because the
app received some unexpected signals. In particular SIGCHLD
is received when a child terminates, but this is not a reason
to cancel the image load.
In theory, all blocked signals in pselect() should be pending
until pselect returns, so any SIGCHLD should still trigger
the app's signal handler.
Reviewers: cedric
CC: raster, cedric
Maniphest Tasks: T464
Differential Revision: https://phab.enlightenment.org/D357
I have no idea how the previous formula was supposed to work at all, but
this one is the same as our alignof code to make sure we do allocate to
the really nearest size and don't do over allocation. Additionnaly it works.
eina_array_remove() didnt ever realloc down unless we went to 0
members. this wasn't very good as you'd expect the array to be reduced
in size if enough items were removed. not only that the old code was
stupid and ALWAYS malloc()ed a new array of the exact same size and
copied items over in the most complex way possible, then freed the old
one. this would have added overhead wherever used (evas_render) that
should not have been there.
this is based on the idea in a patch from
Viacheslav Lvov <v.lvov@samsung.com>, but this is a re-do of it
entirely, reducing the codebase massively even compared to the patch
and making it much simpler to read, maintain, actually reduce memory
and cut overhead.
According to clang static analyzer it is possible to find a path where
buf and svr->buf are pointing to the same array, better be safe than sorry.
Arguably this code could be more readable if it was using Eina_Binbuf.
this fixes T580 ... or SHOULD fix it. there is recursion detection
code now and it properly follows symlinks and dirs. it also properly
updates the file monitor tree for both icons and desktops and it only
monitors dirs, not files (as a dir picks up changes to child data).
tested and it seems not to recurse into self-referencing symlinks
(once it detects the loop) and detects changes nicely in all my tests.
evas_image_load.c's list was updated to match the generic
loaders, in 38dd405712.
The list used by cserve should be the same. Actually, there
should be a common function instead of code duplication here.
The maximum index of tagname is 7, and preedit_type_size is equal to 8.
Checking "attr->preedit_type <= preedit_type_size" implies that the value of "attr->preedit_type" may be up to 8
This patch fixes CID 1039308
Fix phab T392.
Notice that it should reopen T359, as it wasn't really fixed, but a
rotation with resize was being used when a non-resized rotation was
requested. The cause of the "protruding surfaces" is likely the fact
that Elementary is setting the opaque regions manually, instead of
leaving it to Ecore_Evas. This must be fixed either inside Elementary
itself, or adding the "surface extents" (shadow/non-visible surface
parts) info to Ecore_Evas too.
This means unref will really free the object instead of just let it
linger in memory once the object is unrefed.
This is also correct because once detached from the canvas, Evas has
nothing to do with the object and it shouldn't need the manual free
anymore.
This fixes the infinite loop while deleting canvases with still
referenced objects.
The canvas should not assume it can get rid of all of the objects. Some
objects might be referenced. I also added a printf to let the user know
about it.
This fixes T565.
When the ecore_animator_source_set() is called with different sources repeatedly, sometimes internal timer is not deleted and this leads animator misbehavior.
Especially when the source is changed from ECORE_ANIMATOR_SOURCE_TIMER to ECORE_ANIMATOR_SOURCE_CUSTOM before the SOURCE_TIMER's internal timer is deleted, this problem occurs.
In this case, even though _end_tick() is called in ecore_animator_source_set(), the SOURCE_TIMER's timer is not deleted because the source is already changed to CUSTOM.
So we should delete the internal timer in _end_tick() in all cases.
bug T569 still shows that we have cases where, during e shutdown, we
still get eo_data_scope_get() return NULL for a parent object.
whatever this is, segfaulting is much worse than protecting and
marching on. so protect
This should fix the test hangs on Jenkins. Fixed them for me.
The problem was, that the timeout was not handled correctly.
The server object was deleted, but the mainloop was not stopped.
Whites at the end of lines ending with whites should not be cut, but
should be wrapped (there's no legal line break there).
Thanks to Shilpa Singh for reporting.
Previously, if you were hold down shift for 1-2 seconds and then press
a key, you would get superfluous key repeats (even tho you released
the printable key). This was because the "key repeat" code was not
checking for the same key before (re)starting the repeat timer.
This fixes the repeating key issue by checking if the key pressed is
different than the one already pressed. If so, it will (re)start the
timer. If it is not different, then the timer is already running and
we don't need to do anything.
Fixes T552
Signed-off-by: Chris Michael <cp.michael@samsung.com>
values.
Previously, the keyname and key fields of the Ecore_Event_Key
structure were being filled in with the capitalized version of the
key. This is due to xkb_keysym_get_name always returning keys with the
modifier applied. There is no actual function in xkbcommon to Not do
this :/ so we have to manually check if Shift is pressed, and if so
then we need to convert the key to lowercase.
Fixes T550
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This makes the clipper colors correct and also gets rid of the
following error message spam:
ERR..._color_set() Evas only handles pre multiplied colors!
Fixes T557
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
The subsurface protocol was moved into Wayland Core
around v1.3.90 (i.e. v1.4.0).
Test if subsurface protocol is part of wayland-client.h.
If not, we include our own copy of the protocol header.
Also, some whitespace cleanup in ecore_wl.c.
Tested with Wayland 1.3.0 and 1.3.90 (master:360dca5).
Fixes T529
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Perhaps they are insane, but as the comments imply it defines
USE_HARFBUZZ which is needed afterwards. You just broke everything. I
know it's a mess there, but it's a mess that works. Your change doesn't.
This reverts commit d4b9e3b287.
Before this patch, we were unconditionnaly destroying the Eina_File if that one
did change on disk. We also make sure that we remove the right entry from the cache
if the file did change there.
This is an extension to raster's 0355a6a296
(eo - fix _parent_set in base clase when old_parent_pd is NULL).
I also added an error message in case this check fails.
The lock on the main hash was taken to late (after we took the decision
to remove the targeted Eina_File from the cache), this means it was possible
to get an Eina_File from the cache that was going to be removed. This patch
attempt to fix that potential race condition.
Hopefully should fix T461.
Summary:
Function returns boolean value, docs said it can return int.
I had fixed that.
Reviewers: cedric, raster
Reviewed By: raster
CC: cedric
Differential Revision: https://phab.enlightenment.org/D342
The order was messed up when inserting a few formats in the
markup_append/prepend functions without any characters between them.
For example, inserting "<b><i>" would result in "<i><b>" being inserted.
Thanks to YoungBok Shin for reporting this.
Send events to properly focused surface.
Fill in missing parts of the event structures (ev->root, ev->multi).
Signed-off-by: Chris Michael <cp.michael@samsung.com>
cw/cy are never used inside the "dosel" block, so no need to fetch
geometry and calculate difference here (already fetched below when
needed anyway).
Signed-off-by: Chris Michael <cp.michael@samsung.com>
When deleting the drag, free any dupped strings.
Hopefully this fixes Phab Ticket T471. Don't know for sure as I cannot
reproduce the crash here :/
Signed-off-by: Chris Michael <cp.michael@samsung.com>
this makes evas ane ecore_fb agree on how to address the fb device.
this fixes terminology in fb on optimus (dual gpu) setups where you may
have to declare the exact fb to use (there are 2 of them, not just
fb0) and makes things consistent at least. this also should fix T253
This reduces code duplication for ecore_evas resize routines inside
wayland engines by using a common _ecore_evas_wl_common_resize
function as the resize code for both engines was the same anyway.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
[Problem] When glTextureDelete is called in image_cache_flush(), it sometimes doesn't work.
[Cause] glTextureDelete is called with the wrong eglContext.
[Solution] Call eng_window_use() in image_cache_flush() and image_cache_set() to use the correct eglContext.
Change-Id: Id7ab1aaeb456be6dbc5f09cb2731ace5399a5dce
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
them else wayland segfaults (internal wayland code does no safety
checks). Also, Fix some formatting while I am here...
Signed-off-by: Chris Michael <cp.michael@samsung.com>
In evas_gl_api_ext_def.h there're calls such as:
_EVASGL_EXT_DRVNAME(EGL_KHR_image_base)
The macro is defined in evas_gl_api_ext.c as:
(strstr(glexts, #name) != NULL || strstr(glueexts, #name) != NULL)
if (_EVASGL_EXT_CHECK_SUPPORT(name)) *ext_support = 1;
But EGL_KHR_image_base is itself a macro, which is defined
in EGL/eglext.h like this:
Thus, the _EVASGL_EXT_CHECK_SUPPORT macro will unwrap into:
(strstr(glexts, "1") != NULL || strstr(glueexts, "1") != NULL)
instead of intended:
(strstr(glexts, "EGL_KHR_image_base") != NULL ||
strstr(glueexts, "EGL_KHR_image_base") != NULL)
This patch fixes this by applying stringification earlier in
_EVASGL_EXT_DRVNAME
Bugfix reported by jinhyung.jo@samsung.com
NOTE: EINA_VALUE_TYPE_DISPATCH_RETURN macro is a bit weird, it does
use external variable not passed to the macro and half of the parameter
given to it are just ignored...
Summary:
Even if the anchor name is null, it will be appended to "anchors".
There are many null checking for name of anchor.
So it should be checked in geometry_get functions.
Test Plan:
Test with text "<a href =abc>We can't find name in this case</a>".
This text makes break the application. Because of a space between "href" and "=".
The name of anchor will be saved as null in "anchors".
Reviewers: woohyun, tasn, cedric
CC: cedric, raster
Differential Revision: https://phab.enlightenment.org/D318
Summary:
Selection handlers are now implemented in elementary. So, we should remove them from edje.
The BLOCK_HANDLE mode should be removed also.
Reviewers: cedric, tasn
CC: cedric, raster
Differential Revision: https://phab.enlightenment.org/D312
This adds support for Windows logo, caps lock, num lock, scroll lock
and AltGr as keyboard modifiers
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Fix deffect with a missing tokken 'name' in the program description block when
generated by edje_cc.
Reviewers: cedric, seoz
CC: cedric
Differential Revision: https://phab.enlightenment.org/D323
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
Function edje_edit_save_all cause lots of SPANK SPANK, because
eet_dictionary_free is trying to delete string that is actually not a stringshare.
Reviewers: cedric, seoz, raster
Reviewed By: cedric
CC: reutskiy.v.v, cedric
Differential Revision: https://phab.enlightenment.org/D322
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
inexistant DNS, or having a DNS resolution error, there isnt any event
generated for the application to know.
This is not a complete fix has you need to fix a timeout value for it to
happen, but still, it makes it possible to work around it.
More work is needed on this.
In the case we didn't define the file to save to, fopen would have
been called with a NULL parameter. The result of that call is not
really defined and could have led to some crash at some point.
Summary:
When building applications with -Wcast-align on ARM, there are following warnings.
increases required alignment of target type warnings. This impact eina_hash_murmur3.
Reviewers: cedric, seoz
Reviewed By: cedric
CC: cedric
Differential Revision: https://phab.enlightenment.org/D317
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
string identifying the build (vendor, maintainer, etc). It defines
EFL_BUILD_ID with default to "none". It can be used by applications
or for bug reports by including Efl_Config.h
Differential Revision: https://phab.enlightenment.org/D288
Fix deffect with a missing tokken 'state' in the first description block when
generated by edje_cc (It is perfectly valid to not specify the first description
name as it will always be "default").
Reviewers: cedric, seoz
Reviewed By: cedric
Differential Revision: https://phab.enlightenment.org/D310
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
I added EET_DATA_DESCRIPTOR_ADD_MAPPING_BASIC because I need basic types in unions, and EET_DATA_DESCRIPTOR_ADD_MAPPING is only for structs.
I also modified the example with a float and a string.
Reviewers: cedric
Reviewed By: cedric
Differential Revision: https://phab.enlightenment.org/D313
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
Update the data_process_lookups function.
Earlier images are not deleted, but his name was
removed from the list, and it was possible to
access the image by id. Now all unused images
are deleted.
Reviewers: cedric, seoz
Differential Revision: https://phab.enlightenment.org/D309
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
This reverts commit eb6af1f1ff.
This commit was making the code much more complex than required. Let's make
eina_cow_free set the value back to its default.
Note that eina_file_dup is const from the caller perspective as it
will return a fresh "non const" Eina_File that it will be able to
manipulate as it like.
many valgrind complaints on e shutdown are there regarding accessing
cow sections, lists and object elements during shutdown. this plugs
theses little holes to avoid the invalid accesses and thus avoids
potential crashes.
Summary:
Make the following function return Eina_Bool so the caller can detect errors :
List of updated functions:
edje_edit_script_set
edje_edit_script_program_set
Reviewers: cedric, seoz, raster
Reviewed By: raster
CC: reutskiy.v.v
Differential Revision: https://phab.enlightenment.org/D307
but this is not finished. this needs proper fixing. this is a quick
patch for just the worst. the real solution is discussed here:
https://phab.enlightenment.org/T457
These two APIs will save the title and class_name inside
Ecore_Wl_Window, so if they are called before the shell surface is
created, the stored names will be used later when the window is finally
shown (shell surface is created).
This way we are also hiding the shell surface from ecore_evas modules.
Make the following function return Eina_Bool so the caller can detect errors :
edje_edit_part_mouse_events_set
edje_edit_part_repeat_events_set
edje_edit_part_ignore_flags_set
edje_edit_part_scale_set
Reviewers: cedric, seoz
Reviewed By: cedric
CC: reutskiy.v.v
Differential Revision: https://phab.enlightenment.org/D303
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
Make the following function return Eina_Bool so the caller can detect errors :
List of updated functions:
edje_edit_state_align_x_set
edje_edit_state_align_y_set
edje_edit_state_aspect_min_set
edje_edit_state_aspect_max_set
edje_edit_state_aspect_pref_set
edje_edit_state_fill_origin_relative_x_set
edje_edit_state_fill_origin_relative_y_set
edje_edit_state_fill_origin_offset_x_set
edje_edit_state_fill_origin_offset_y_set
edje_edit_state_fill_size_relative_x_set
edje_edit_state_fill_size_relative_y_set
edje_edit_state_fill_size_offset_x_set
edje_edit_state_fill_size_offset_y_set
Reviewers: cedric, seoz
Reviewed By: cedric
CC: reutskiy.v.v
Differential Revision: https://phab.enlightenment.org/D300
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
Render operation are not well tested. It appears that it was never properly setted
on a textblock, this would lead to see it rendered with the render operation of another
object.
Test Plan:
Add some rectangle object with textblock object.
The textblock style should be set to "backing=on backing_color=#ffffffff".
Set render operation to some rectangle with "evas_object_render_op_set(rect, EVAS_RENDER_COPY)".
Check the textblock.
Reviewers: woohyun, cedric, raster
Reviewed By: cedric
CC: cedric
Differential Revision: https://phab.enlightenment.org/D277
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
Make the following functions return Eina_Bool so the caller can detect errors:
edje_edit_state_visible_set
edje_edit_state_color_class_set
Removed unnecessary check in edje_edit_state_image_border_fill_set.
Reviewers: cedric, seoz
Reviewed By: cedric
CC: reutskiy.v.v
Differential Revision: https://phab.enlightenment.org/D305
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
With Eina_File we now can pass an efficient handler accross library boundary. Edje
and all underlayer already use it to avoid race condition when setting an Edje object.
Elementary and Enlightenment are still exposed to some potential race condition when
an Edje file is modified underneath there feet. With the following set of function it
should now be possible to avoid those race condition to:
edje_mmap_data_get
edje_mmap_collection_list
edje_mmap_collection_list_free
edje_mmap_group_exists
This is a configure event info, so put it in the right place. Some
places adding edges info were also removed, which means that they were
redundant.
Tested with <Meta> + middle click resize, and with window border resize,
on all the edges. Apparently, nothing breaks.
It's mostly only used inside ecore_wayland library anyway.
The only bit needed outside of the library is the "seat" pointer, but a
new function was added to retrieve such pointer from Ecore_Wl_Input.
This struct is only used inside ecore_wayland itself, so there's no real
reason to expose it. Apparently, hiding it doesn't break anything,
except for the ecore_imf wayland module, which was easily fixed.
If anyone notices a breakage, please let me know.
Previously, a "maximize" of an efl client would not actually resize to
the provided size as it would account for framespace width & height.
This fixes that so now "maximize" is Actually maximized.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
needed.
NB: Currently, this will only work for fullscreen or maximized states
as other ones like sticky, withdrawn, iconic, etc, etc are not
supported via wayland protocol yet.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This should reduce the code size of evil and reduce maintainance as
mingw does now take care of it.
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
Make the following functions return Eina_Bool so the caller can detect errors:
edje_edit_state_font_set
edje_edit_part_effect_set
Also deleted duplicate of the "edje_edit_state_font_set" function in Edje_Edit.h
Moved some defines (EDJE_TEXT_EFFECT_MASK_BASIC, EDJE_TEXT_EFFECT_MASK_SHADOW_DIRECTION etc),
so doxygen generation was fixed.
Also added link (see also) in "edje_edit_part_effect_set" to the Edje_Text_Effect enum.
Reviewers: cedric, seoz
CC: reutskiy.v.v
Differential Revision: https://phab.enlightenment.org/D302
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
Because of unconditional return in function, a huge part of its body was
skipped making this function useless. Looked like a typo or missed merge.
Reviewers: cedric, seoz
CC: seoz
Differential Revision: https://phab.enlightenment.org/D281
Signed-off-by: Cedric Bail <cedric.bail@free.fr>
Make the following function return Eina_Bool so the caller can detect errors :
List of updated functions:
edje_edit_state_min_h_set
edje_edit_state_min_w_set
edje_edit_state_max_h_set
edje_edit_state_max_w_set
Reviewers: cedric, seoz
CC: reutskiy.v.v
Differential Revision: https://phab.enlightenment.org/D299
Signed-off-by: Cedric Bail <cedric.bail@free.fr>
Make the following function return Eina_Bool so that the caller can detect errors :
edje_edit_group_min_w_set
edje_edit_group_min_h_set
edje_edit_group_max_w_set
edje_edit_group_max_h_set
Reviewers: cedric, seoz
CC: reutskiy.v.v
Differential Revision: https://phab.enlightenment.org/D291
Signed-off-by: Cedric Bail <cedric.bail@free.fr>
This patch make the following function return Eina_Bool so the caller can detect errors.
edje_edit_style_tag_value_set
edje_edit_style_tag_name_set
edje_edit_style_tag_del
Reviewers: cedric, seoz
Reviewed By: cedric
CC: reutskiy.v.v, seoz
Differential Revision: https://phab.enlightenment.org/D294
Signed-off-by: Cedric Bail <cedric.bail@free.fr>
This patch make the following function return Eina_Bool so the caller can
detect errors.
edje_edit_state_image_set
edje_edit_state_image_border_set
edje_edit_state_image_border_fill_set
Reviewers: cedric, seoz
CC: reutskiy.v.v
Differential Revision: https://phab.enlightenment.org/D295
Signed-off-by: Cedric Bail <cedric.bail@free.fr>
Make the following function return an Eina_Bool so the caller can detect
errors if it want :
edje_edit_state_rel1_relative_x_set
edje_edit_state_rel1_relative_y_set
edje_edit_state_rel2_relative_x_set
edje_edit_state_rel2_relative_y_set
edje_edit_state_rel1_offset_x_set
edje_edit_state_rel1_offset_y_set
edje_edit_state_rel2_offset_x_set
edje_edit_state_rel2_offset_y_set
edje_edit_state_rel1_to_x_set
edje_edit_state_rel1_to_y_set
edje_edit_state_rel2_to_x_set
edje_edit_state_rel2_to_y_set
Reviewers: cedric, seoz
CC: reutskiy.v.v
Differential Revision: https://phab.enlightenment.org/D296
Signed-off-by: Cedric Bail <cedric.bail@free.fr>
This patch start returning Eina_Bool for the following color setters to be
able to detect errors when calling them.
edje_edit_state_color_set
edje_edit_state_color2_set
edje_edit_state_color3_set
Reviewers: cedric, seoz
Reviewed By: cedric
CC: reutskiy.v.v
Differential Revision: https://phab.enlightenment.org/D297
Signed-off-by: Cedric Bail <cedric.bail@free.fr>
This patch start returning Eina_Bool for state's min and max value setters, so
we can now catch error when calling those function.
edje_edit_state_min_h_set
edje_edit_state_min_w_set
edje_edit_state_max_h_set
edje_edit_state_max_w_set
Reviewers: cedric, seoz
Reviewed By: cedric
CC: reutskiy.v.v
Differential Revision: https://phab.enlightenment.org/D298
Signed-off-by: Cedric Bail <cedric.bail@free.fr>
In shutdown, I've encountered an infinite loop.
It SHOULD NOT possibly happen, but somehow some image
was marked as delete_me=1 but still present in the LRU.
Since cserve2 uses inotify to track image file updates,
it will drop its references to a specific file and all
the associated images.
Fix some logic in the deletion code.
after several days of beating head on desk, i gave up trying to find
the exact cause of some gifs not rendering right as animated gifs due
to the loader. it had something to do with dispose mode handling and
which frame it was applied to. i noticed the structure made it also
hard to fix, so this re-structures the entire thing with cleaner code,
less code AND more comments, with a limited memory cache (512k) for
previous frames per image (to avoid eating up huge memory blobs for
big/long animations - though at the expense of cpu), and with some
notes for future fixes - like fixing the "load 2 copies of the same
animated gif" issue... that's another day.
this does fix https://phab.enlightenment.org/T443 along with many
other things.
Summary: This patch start returning Eina_Bool for deleting style from edje edit object to catch those error.
Reviewers: cedric
CC: reutskiy.v.v, seoz
Differential Revision: https://phab.enlightenment.org/D290
This centralizes the place where we have to wait for the init to have
finished before first using the compositor. It's also part of the later
step of hiding Ecore_Wl_* private structs.
Nothing extraordinary here.
Most potential crashes are extremely unlikely.
- Fix CID 1113444
- Fix CID 1113442
- Fix CID 1113441 (Logically dead code, can not be NULL)
- Fix CID 1113440: Explicit null dereferenced
This is actually an impossible situation.
Fixed by checking for nullity and printing out some error
messages instead of just crashing.
- Fix CID 1113439: Dereference after null check
Logically impossible code as both idxpath and datapath
must be either set or null at the same time.
Change the if logic to tell Coverity there's no bug.
- Fix CID 1113438 (Argument cannot be negative)
Fix wrong check of return value from shm_open.
- Fix CID 1113437 (Argument cannot be negative)
Fix wrong check of return value from shm_open.
- Fix CID 1113436 (Dereference null return value)
This case really shouldn't happen.
But the extra check does not hurt.
- Fix CID 1113435 (Dereference before null check)
Check for nullity after map open.
- Fix CID 1113434 (Extra sizeof expression)
Debug buggy debug tool :)
- Fix CID 1113433 (Uninitialized scalar variable)
Insignificant issue: only prints wrong debug logs :)
- Fix CID 1113431 (Uninitialized scalar value)
Check if (!found) only to print out logs. Not a big deal
if found was invalid.
- Fix CID 1039462 (Logically dead code)
Many Edje_Edit API can fail and don't return any error information. This patch start returning
Eina_Bool for setters on dragable confine and event params to catch those error.
Reviewers: cedric
Reviewed By: cedric
CC: seoz
Differential Revision: https://phab.enlightenment.org/D274
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
At the end of the ecore_wl_init() function, send a sync request to the
server, and add a callback listener to the "done" event. When this event
is received, we are sure that all the registry bind requests done so
far were processed already, and that the registry and globals are
available and can be used.
Now, on the functions that request interfaces or registry, we call
_ecore_wl_init_wait(), which will check if the callback was received
already (that means that all requests inside the init were processed).
If it was not yet, then we wait until receiving that callback, before
returning the requested data.
When you open a theme, it is very likely that most of the data in it will be needed
at some point, that's why it is a good idea to tell it in advance to the kernel so
it could load them if it has some spare ressource.
We can't just blindly turn EINA_FILE_WILLNEED on any file or a wrong eet file would
be loaded in memory when we don't need it. So we shall keep the sequential load until
we are sure that the file is correct and then explicitely tell the kernel that the
rest of the data should be loaded in ram.
Glyphs were previously using 3 shared buffers, now reduce to 2:
- Memory pool (mempool) containing the glyph drawable data
- Index table (Shared_Index / array) containing only the
indexes of the buffers in the mempool
- Glyph_Data table (array) containing the glyphs descriptors
AS WELL as the buffer indexes.
So, we just merge the two index tables into one by using directly
objects of type Glyph_Data for the referencing of the mempool
buffers.
One socket message was sent per each glyph used ... which means
a LOT of messages when text is being redrawn.
Reduce this flow of messages by triggering send() only when
50+ items are being used.
Btw, USED is a bit useless as there is no UNUSED equivalent.
Also, slightly improve debug logs.
In the client, string_get() can cause a remapping of the
strings index & mempool. This means that all pointers to
string data are invalid past that call.
Solution: add a safe_get() function that prevents remap
during search. It might prove faster also, but will
return NULL more often.
SIGTERM and SIGQUIT don't need to be caught.
the proper signal to ask cserve2 to exit cleanly is SIGINT.
enlightenment_start (or systemd) should be responsible for
restarting in case of crash / unexpected termination.
cserve2 will not restart if killed with signal SIGINT,
as it will then exit with return code 0 (normal)
These operations have tons of side effects and it's a lot
easier to just avoid doing them. Now, repacking will always
need to happen as applications will add/delete strings and
items, but the less frequent, the better :)
Also, align most arrays & mempools to 32K instead of the
default page size (4K). This will also reduce resizes.
Try to reconnect to cserve2 if the socket connection was lost.
Resend some messages if necessary.
Images reload seems to be working.
Actually, the images don't change over time, so the clients just
keep the previous references to their images.
FONT RELOAD IS NOT WORKING:
- Crashes
- Invalid glyph data
- Infinite loop in _glyph_map_remap_check()
Root cause:
When new glyphs are requested from the server, they are added to
the mempool. So it is necessary to remap the font.
Unfortunately, in case of server reboot, we did not keep the mempool
so the old glyphs that were not requested again will not be valid.
Simply call the appropriate cache2 functions when possible
and check for usage of cache2 whenever an evas_cache_ function
is called.
This effectively adds cserve2 image (data) load support for the
GL engines. Fonts were already working out-of-the-box.
cserve2 does not support animated Gifs, as the animated icon
logic doesn't match cserve2 logic.
Also, there is probably no need to cache these into shared
buffers anyways :)
Solution: fallback to normal cache (and delete current entry in
the client)
Be more careful when selecting the original image for scaling.
Most load opts must remain the same, only smooth can be toyed with.
Also, fix alpha when scaling.
Let's reuse the logic from scalecache and call cserve2
functions when the scalecache should be used.
So, now, cserve2 server will not scale any image... This is
too computationally intensive for the server's main thread.
This is not optimal but makes a hell of a lot more sense for
the moment. (since cserve2 manages the SHM segments)
High-level problem:
cserve2 does not support load_opts properly when opening an image.
As a result, when (pre)loading a JPEG file with specific load
options (eg. w, h, region and orientation), the image buffer might
have the wrong dimensions.
So, we need to use load_opts when computing file hash key.
And, pass these load options to the loader slave,
and use them while OPENING the image. This will set
properly the geometry.
Fixes test "Preload and Prescale" in elementary_test.
Pass around "animated" flag for images that can be animated.
Fallback to local cache if the image is animated.
Implementing support for animated images in cserve2 does
not seem to make a lot of sense considering each frame must
be requested independently in real time,... and to be honest
there doesn't seem to be any valid use case anyway :)
cserve2 can't handle virtual files (mmap-only), by design.
Proper support can be added later on, but for now we might want
to just fallback to the normal cache functions.
Fixes photocam test
Images and Files can be discovered by the client scanner before they
are valid (aka. loaded or opened). We want clients to ignore all
shared objects that are not ready yet, as they are in an undefined
state (values and memory might be invalid).
Shared string indexes are not repacked, since they live in a
memory pool (where the indexes can be reused).
So, the index in the table is equal to their ID. Add initial
test to check if the item at index n has the ID n.
Use tags such as INDX, FONT, IMAG, FILE.
These can help debugging and for robustness, as they will
be visible in the memory dump.
Update generation_id after repack as well
Also, print shared arrays usage as it is sent as first message
upon connection to the server.
Add fonts to LRU and flush LRU as needed.
Seems to work okay. Could probably be finetuned a bit.
- Create one Glyph_Data array per Font_Entry
- Copy Font_Source descriptors in shared array
- Copy font entries in shared index
- Send font index path over socket
- Merge Font_Source and Font_Data in shared memory
- Send font index path on client connect
- Repack font index after free
- Pass font shm name to clients
DBG and INF messages pollute the logs and performance reports
from valgrind, let's disable them at build-time for better
benchmarking.
Fix other compilation warnings and clean code a bit
If the client exits while the server is loading fonts,
the font entry objects are accessed after being freed.
Note: This is not a proper fix. The race condition should still
be fixed, but delaying client deletion a bit might help for a while...
Read Image descriptors from the shared arrays
But, accessing the shared index can be a bit expensive, so
try to read from the socket before scanning the index,
without blocking.
- Send paths to all connected clients
- Send paths upon connection from a new client
- Client side:
- Fast find opened images
- Fast find loaded images
- Optimize load by skipping socket wait
Also, remap indexes when needed (file size changed)
When index file grows, the clients are not notified, so they
must constantly check that their mapping matches the current array
size.
- Move required struct definitions to common evas_cs2.h
- Open/close shm and map arrays to memory
Pretty stupid for now as it will close & reopen the shm files
even when unchanged.
- Check shm size and array header consistency
- Implement message send
- Send messages from server when calling repack()
Only import the C file for now.
Implement the following features:
- Shared Arrays
Store arrays of elements of fixed size in shm.
- Shared Mempool
Store random sized buffers in shm.
These buffers are indexed in a Shared Array and are
referred to using their index only.
- Shared Strings
Store strings in a shm in a way similar to Eina_Stringshare
(except strings are referred to using an int index).
- Include evas_cserve2_index.c to the compilation.
- Declare shared index functions in header file.
- Call init() and shutdown() on the shared index subsystem.
- Add find and foreach functions
- cserve2_shm_segment_request()
Creates a new shm segment (Shm_Handle) from an existing file,
without changing the current mmap.
- cserve2_shm_resize()
Grows the file and remaps in memory (new virtual address).
- cserve2_shm_id_get()
Returns the shm creation ID.
this fixes https://phab.enlightenment.org/T182 as it is an issue with a
surface alloc overwriting an already allocated surface entirely inside
the general software image infra.
Evas GL direct rendering mode didn't properly take into account
the image object's clipping information and clip the region that
it was directly rendering to. Hence there were issues with the
direct rendering region drawing over the objects that are sitting
on top of it.
Also, cleaned up the direct rendering coordinate computation code
and a nasty dependency with image object that should have been
removed a long time ago. Basically the evas-gl engine was directly
accessing the image object data structure for its data when it
really should have just passed along necessary information.