Commit Graph

462 Commits

Author SHA1 Message Date
Carsten Haitzler 86a97efeea evas - fonts - move to using 4bit and rel 4 bit compressed font glyphs
this changes the internal encoding of font glyphs in evas to use 4bit
uncompressed if small, or 4bit rle (run length encoded) if larger.
this caves at least 50% of memory on fonts - and more if bigger. with
large fonts (40-80pixel size) we can save in the region of 80% of
memory used for glyphs. this also happesn to allow speedups in
rendering too.
2014-01-13 05:15:32 +09:00
Carsten Haitzler 10d9adfc46 evas cserv2 - remove logical dead code
fixes CID 1113441
2014-01-10 20:16:09 +09:00
Carsten Haitzler 6017b803a9 edje_cc - remove dead code
fixes CID 1132639
2014-01-10 18:45:01 +09:00
Carsten Haitzler 796b84e6ec cserve2 - debug bin - fix theoretical leak of socket fd
fixes CID 1039286
2014-01-10 18:40:52 +09:00
Jean-Philippe Andre 3b06d11fdf Evas cserve2: Fix crash in cserve2 when slaves die
If a slave dies (eg. killed) when it's idle, then cserve2 will crash
miserably at the next request. Indeed, the dead slave's corpse was
removed from the working slaves' list but not from the lazy idle
slaves list.

Also, set read buffer to NULL after free. Just in case. We never know :)
2014-01-09 16:12:54 +09:00
Carsten Haitzler 43725e960a ethumbd - stop using an idler that spins at 100% cpu while generating queues 2013-12-28 11:15:26 +09:00
Carsten Haitzler b4411c90bf ethumbd - if thumb gen takes too long don't just quit ethumbd, but skip thumb 2013-12-28 11:07:30 +09:00
Carsten Haitzler 332a54d1c6 ethumbd - drop priority to 19 like efreetd so it lurks in bg as much as it can 2013-12-28 10:28:57 +09:00
Carsten Haitzler 0aa4de9f1d efreet - minor formatting and move set prirority to very start 2013-12-28 10:22:23 +09:00
Daniel Juyung Seo 76d8532b54 efl: Unified eina critical manro to CRI.
Being annoyed by different types of eina critical macros - CRI, CRIT,
 CRITICAL -, I concluded to unify them to one. Discussed on IRC and
 finally, CRI was chosen to meet the consistency with other macros -
 ERR, WRN, INF, DBG - in terms of the number of characters.
If there is any missing bits, please let me know.
2013-12-26 12:27:13 +09:00
Andrii Kroitor 574c5c1ba7 edje: edje_decc - added -output flag (save to specified dir)
Reviewers: cedric, seoz

Reviewed By: cedric

CC: reutskiy.v.v, cedric

Differential Revision: https://phab.enlightenment.org/D402

Signed-off-by: Cedric BAIL <cedric.bail@samsung.com>
2013-12-23 10:48:13 +09:00
Andrii Kroitor 7a3cd879d2 edje: edje_edit - fix .edc file generation
Reviewers: cedric, seoz

Reviewed By: cedric

CC: reutskiy.v.v, cedric

Differential Revision: https://phab.enlightenment.org/D401

Signed-off-by: Cedric BAIL <cedric.bail@samsung.com>
2013-12-23 09:49:53 +09:00
Andrii Kroitor b556df55af edje: edje_cc - note for future image_id changes added
Reviewers: cedric

Reviewed By: cedric

CC: reutskiy.v.v, cedric

Differential Revision: https://phab.enlightenment.org/D396

Signed-off-by: Cedric BAIL <cedric.bail@samsung.com>
2013-12-20 14:43:24 +09:00
Vyacheslav Reutskiy f358520483 edje: edc ref - update the information about fill type values
Reviewers: cedric, raster, seoz

Reviewed By: cedric

CC: cedric

Differential Revision: https://phab.enlightenment.org/D395
2013-12-20 14:43:24 +09:00
discomfitor d45eb7a9cf bugfix: eldbus code generator struct members named "proxy" should not be passed to eina_value_free.
come on.
2013-12-15 00:08:50 -05:00
Carsten Haitzler 5dfe3789f2 evas - fb engine - fix mem leak if ioctl fails on fb mode
this fixes CID 1137852
2013-12-15 11:25:56 +09:00
discomfitor 1fa7d3070b bugfix: make eldbus generated code not crash on every single generated event
this is pretty depressing to find after it's been in git for over a year
2013-12-14 19:54:35 -05:00
Vorobiov Vitalii 0640b7f341 edje: adding Alias API into edje_edit module
Summary:
This commit will add some API for working with aliases.
There are four functions will be added:
1. edje_edit_group_aliases_get - this function will return the list of aliases of certain group.
2. edje_edit_group_is_alias - this function will check if the given group name is actually an alias.
3. edje_edit_group_aliased_get - return the main real group that is being aliased.
4. edje_edit_group_alias_add - add new alias name.

Also the function "edje_edit_group_del" was modified because of wrong behaviour.
Now if the given group is alias, it will successfully delete it,
but if the given group is main group, it will also delete all it's aliases.

This commit also modify EDJ file by adding new field for detecting if the group is alias or not.

Reviewers: cedric, seoz, raster

Reviewed By: raster

CC: reutskiy.v.v, cedric

Differential Revision: https://phab.enlightenment.org/D376
2013-12-14 18:40:26 +09:00
Carsten Haitzler 83615efe6a ethumbd - fix possible out of bounds access to work table
this should fix CID 1039314 in case an unsused table slot cannot be
found. this should actualyl never happen because table expands/allocs
zero out new entires so they are "unused".
2013-12-13 21:26:05 +09:00
Carsten Haitzler abb780bf5f edje - epp - fix possible array access by negative
this should fix CID 1039357
2013-12-13 21:26:05 +09:00
Carsten Haitzler f745ac2591 eeze - fix uninitialised sigation struct content
should fix CID 1039552
2013-12-13 21:26:05 +09:00
Carsten Haitzler e8c8f0b876 edje_decc - fix possible use of uninitialized string
this should fix CID 1039553
2013-12-13 21:26:05 +09:00
Carsten Haitzler 6991785df9 embryo - embryo_cc - argv parsing MIGHT leave str buf not nul terminated
should fix CID 1039726
2013-12-11 22:50:34 +09:00
Carsten Haitzler b0e7df47b5 edje - edje_pick - fix coverty access-after-unref issue
fixes CID 1039916
2013-12-11 19:24:42 +09:00
Carsten Haitzler 0b641196c6 edje - edje_cc - fix coverty issue of not exiting loop for box items name
this shoul fix CID 1039918
2013-12-11 19:13:16 +09:00
Carsten Haitzler a42407c7b3 evas - cserve2 - fix uninitialized member "image_id".
fixes CID 1042303.
2013-12-11 18:47:39 +09:00
Carsten Haitzler f779c49c89 edje - edje_cc - try and make coverty ignore the leak (invalid)
hope that this does not reappear in future if changes happen in src.
CID 1132627
2013-12-11 18:20:13 +09:00
Sebastian Dransfeld 494e75eb0e eldbus: print error when fwrite fails
Return value of fwrite should be checked.

Fixes 1039715
2013-12-07 21:11:33 +01:00
Sebastian Dransfeld 63f824c659 eldbus: create object when needed
We allocate the strbuf at the beginning of the function, but do several
return checks after this which does not free the strbuf before return,
and we don't use the strbuf.

So create the strbuf object after checks, just before we need it.

Fixes CID 1039287
2013-12-07 21:11:32 +01:00
Sebastian Dransfeld 4413b3a311 efreet: propagate scan error to caller
Current code ignored return from recursive calls, so if cache_add failed
during recursion, the parent call would still succeed.
2013-12-05 12:15:07 +01:00
Carsten Haitzler 931d02378b efreet - fix recusrion checks need to pop as well as push.
stable release - cherry-pick me!

this fixes a lack of popping the efret recursion stack handler. this
wasn't done in 1.8 and is a bug.
2013-12-05 20:04:25 +09:00
Carsten Haitzler f6f28bf75a efreet - protect efreetd from recursing too far to save overhead and mem
an errant path made its way into my efreet cache. this had a
side-effect of causing efreetd to scan my entire $HOME recursively
to monitor everything. while the original cause was $HOME getting in,
we shouldn't have efreetd sit and consume scan all of $HOME when this
is far from a normal situation. the recursive scanning is there ot
handle some minimal levels of subdirs in app directories, but not an
entire filesystem, so this mitigates the effects of errant cache data
by limiting the amount of recursion allows for icon dirs and desktop
dirs to 8 and 3 levels respectively.
2013-12-04 20:25:57 +09:00
Sebastian Dransfeld 70474a4bc5 efreet: Create stack at start of recursion
No need to check for NULL stack, we know where we start our recursive
scan, so create the stack there.

Also fixes CID1132751 and CID1132752
2013-12-04 09:12:31 +01:00
Sebastian Dransfeld 8bc17db6fa efreet: Create stack at start of recursion
No need to check for NULL stack, we know where we start our recursive
scan, so create the stack there.
2013-12-04 09:12:31 +01:00
Otavio Pontes afd8a238d1 Adding the cubic-bezier curve to edje transitions
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
2013-12-02 15:02:40 +09:00
Cedric Bail 18632bc8c7 edje: make sure there is an initial value to avoid garbage out.
Detected by clang static analyzer.
2013-11-28 16:55:24 +09:00
Carsten Haitzler c69cf48746 recursive monitoring and scanning fix for icons and desktop files
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.
2013-11-27 19:50:24 +09:00
Jean-Philippe Andre 7aa577c774 evas/cserve2: Update image loaders list
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.
2013-11-27 13:22:25 +09:00
Sebastian Dransfeld c483214170 efreet: Check for missing icon cache file
Fixes T196
2013-11-21 12:25:26 +01:00
Chris Michael 7575883a56 ftell can return -1 to indicate error, so trap for that
Fixes Coverity CID1039358

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-11-18 12:37:38 +00:00
Chris Michael 41a700b2d5 ftell can return -1 to indicate error, so trap for that.
Fixes Coverity CID1039356

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-11-18 11:58:39 +00:00
Gustavo Sverzut Barbieri 8e362c7ad4 allow ecore to not load system modules.
this won't go to changelog/news as it's mainly internal, I can't see
people wanting to use it except rare cases as edje tools.
2013-11-14 13:27:19 -02:00
Cedric BAIL a157813602 evas: use portable infrastructure to detect page size. 2013-11-10 09:26:30 +01:00
Cedric Bail 44f539e1a3 eina: fix eina_hash_int64 on Windows system. 2013-11-09 20:07:27 +09:00
Cedric Bail 926f4c5e84 efl: detect 64 bits correctly. 2013-11-09 19:48:31 +09:00
Carsten Haitzler f82c77843e embryo - embryo_cc: fix buffer overrun warning
gcc warning was right. it's a pretty smart cookie too.
2013-11-09 10:15:35 +09:00
Thiep Ha 44639b2098 Remove selection handlers (and move to elm)
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
2013-11-08 17:30:45 +09:00
Vyacheslav Reutskiy 8efe24c87d edje: add string "program_%p" (%p - edje_program pointer) to a default description of the program being build.
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>
2013-11-07 18:03:03 +09:00
Cedric Bail 11bad33813 epp: avoid to rely on undefined behavior for fopen.
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.
2013-11-05 16:28:56 +09:00
Vyacheslav Reutskiy d9a72ccf8b edje: add string "default" to a default description of the part being build.
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>
2013-11-04 15:41:54 +09:00
Vyacheslav Reutskiy cff3ec04b4 edje: delete unused images from eet(edj) file.
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>
2013-11-04 15:29:09 +09:00
Andrii Kroitor 3973ecf2e8 edje: make functions return Eina_Bool and fix documentation.
Make the following functions return Eina_Bool so the caller can detect errors:
edje_edit_part_drag_x_set
edje_edit_part_drag_y_set
edje_edit_part_drag_step_x_set
edje_edit_part_drag_step_y_set
edje_edit_part_drag_count_x_set
edje_edit_part_drag_count_y_set

Added functions for threshold:
edje_edit_part_drag_threshold_set
edje_edit_part_drag_threshold_get

Fixed description of 'count' parameter of dragable.x/y

Reviewers: cedric, seoz

Reviewed By: cedric

CC: reutskiy.v.v

Differential Revision: https://phab.enlightenment.org/D304

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-11-01 11:03:34 +09:00
Jean-Philippe Andre 2b8e74e623 evas/cserve2: Fix crash in server when an image file changes
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.
2013-10-30 19:48:17 +09:00
Jean-Philippe Andre 10f80df018 evas/cserve2: Fix new Coverity issues
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)
2013-10-29 15:08:14 +09:00
Jean-Philippe Andre 1513007815 evas/cserve2: Merge Glyph_Data and mempool index
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.
2013-10-28 15:47:16 +09:00
Jean-Philippe Andre 7b62d77cf5 evas/cserve2: Add debug and reduce number of GLYPHS_USED messages
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.
2013-10-28 15:47:16 +09:00
Jean-Philippe Andre 745b4d4acc evas/cserve2: catch only SIGINT from cserve2
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)
2013-10-28 15:47:16 +09:00
Jean-Philippe Andre cd702b3785 evas/cserve2: Reduce repacking and resizing of SHM
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.
2013-10-28 15:47:16 +09:00
Jean-Philippe Andre c8e6f9e5f9 evas/cserve2: Fix font reloading after cserve2 restart.
Well it LOOKS like it's working properly.
Clients can safely keep running after cserve2 crashed and
restarted.
2013-10-28 15:47:16 +09:00
Jean-Philippe Andre 660ad6e4a4 evas/cserve2: Add PID to shm filenames
This will help identify new memory pools in case cserve2
restarts and reloads the same glyphs for instance.
2013-10-28 15:47:16 +09:00
Jean-Philippe Andre e74cac57e4 evas/cserve2: Reconnect to cserve2 in case of server crash
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.
2013-10-28 15:47:16 +09:00
Jean-Philippe Andre 6f485d2a12 evas/cserve2: Fix reload of image without load_opts
Problem: Images opened without load_opts are reopened
multiple times.
Solution: Use empty load opts when looking for the key.
2013-10-28 15:47:15 +09:00
Jean-Philippe Andre 74080fba22 evas/cserve2: Fix scaling error (server side)
This causes crashes in the client also...
2013-10-28 15:47:15 +09:00
Jean-Philippe Andre f18b71d515 evas/cserve2: Fix invalid file referencing in client
Fixes elementary_test "Bg Image":
 - Various load_opts (jpeg geometry) where not handled properly
   by the client.
2013-10-28 15:47:15 +09:00
Jean-Philippe Andre c5ecf6e5d1 evas/cserve2: Fix scaling options
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.
2013-10-28 15:47:15 +09:00
Jean-Philippe Andre 25d71f8236 evas/cserve2: Add alpha flag to Image_data 2013-10-28 15:47:15 +09:00
Jean-Philippe Andre 1e82480c9a evas/cserve2: Use scalecache with cserve2
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)
2013-10-28 15:47:15 +09:00
Jean-Philippe Andre 0d506a7b73 evas/cserve2: Fix images indexing (File_Entry stuff)
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.
2013-10-28 15:47:15 +09:00
Jean-Philippe Andre 85cd382725 evas/cserve2: Drop pre-emptive load of large images
When the image is too large, let's not preload it unless
specifically requested by the application.

Value 320x320 is completely arbitrary.
2013-10-28 15:47:15 +09:00
Jean-Philippe Andre 97d9fab704 evas/cserve2: Fallback to normal cache for animated gifs
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 :)
2013-10-28 15:47:15 +09:00
Jean-Philippe Andre 808c20f989 evas/cserve2: Fix font hinting
cserve2 was not handling font hints properly in the server side
Add some consistency checks and separate glyphs per hinting value
2013-10-28 15:47:15 +09:00
Jean-Philippe Andre 94f0e1b3e1 evas/cserve2: Fix segfault in cserve2 slave
Slaves always crash when loading SVG images.
The svg module was simply not a dynamic module.
2013-10-28 15:47:14 +09:00
Jean-Philippe Andre 50be9145a1 evas/cserve2: Small performance fixes 2013-10-28 15:47:14 +09:00
Jean-Philippe Andre 877532e000 evas/cserve2: Repack strings index when too fragmented 2013-10-28 15:47:14 +09:00
Jean-Philippe Andre 74d399ab81 evas/cserve2: Fix NULL vs. empty string
Server side: Some strings were NULL, some other were empty.
Client side was looking for NULL, but the shared index contained
empty key.
2013-10-28 15:47:14 +09:00
Jean-Philippe Andre 3f30fae818 evas/cserve2: Remap indexes when count is wrong
When advertised count is wrong, try to remap the index.
This will avoid errors with string_get().
2013-10-28 15:47:14 +09:00
Jean-Philippe Andre 8b39c443fe evas/cserve2: Fix lag with invalid font glyphs 2013-10-28 15:47:14 +09:00
Jean-Philippe Andre 9d2400af8b evas/cserve2: Add valid flag on Image_Data and File_Data
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).
2013-10-28 15:47:14 +09:00
Jean-Philippe Andre 743e204763 evas/cserve2: Optimize shared strings
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.
2013-10-28 15:47:14 +09:00
Jean-Philippe Andre 71fdd0d342 evas/cserve2: Add SHM debug tool (CLI)
Prints out the content or the shared index.
Does not need any socket connection to the server, read-only.
2013-10-28 15:47:14 +09:00
Jean-Philippe Andre bc7b337fc0 evas/cserve2: Add glyph shm names to Font_Data 2013-10-28 15:47:14 +09:00
Jean-Philippe Andre b5ca88027d evas/cserve2: Remove dead code. 2013-10-28 15:47:14 +09:00
Jean-Philippe Andre 4f5c48236f evas/cserve2: Add proper tags to shm arrays
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
2013-10-28 15:47:14 +09:00
Jean-Philippe Andre 1e4ee656a0 evas/cserve2: Fix cserve2_usage tool
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.
2013-10-28 15:47:14 +09:00
Jean-Philippe Andre 467b1b1739 evas/cserve2: Store Glyph_Data in shared mempools
- 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
2013-10-28 15:47:14 +09:00
Jean-Philippe Andre c7515f3300 evas/cserve2: Add mempool_buffer_offset_get() api 2013-10-28 15:47:14 +09:00
Jean-Philippe Andre 7ebda2d123 evas/cserve2: Store glyphs in shared arrays
Also, change the internal structure of glyph listing:
 - Use lists instead of inlists

Switch to use Glyph_Data instead of Glyph_Entry
2013-10-28 15:47:14 +09:00
Jean-Philippe Andre 28a5c6f587 evas/cserve2: Add compile-time log level flag for cserve2
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
2013-10-28 15:47:13 +09:00
Jean-Philippe Andre 9d731364c1 evas/cserve2: Optimize cserve2_shared_string_del()
eina_hash_del_by_data is very expensive, so let's delete by key
since we can get the original data.
2013-10-28 15:47:13 +09:00
Jean-Philippe Andre e95bd7755e evas/cserve2: Add binary search in server side 2013-10-28 15:47:13 +09:00
Jean-Philippe Andre f5fee255de evas/cserve2: Fix race condition on font load / socket fail
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...
2013-10-28 15:47:13 +09:00
Jean-Philippe Andre 88ef4131a0 evas/cserve2: Share paths of index tables with clients
- 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.
2013-10-28 15:47:13 +09:00
Jean-Philippe Andre 47be3a2b81 evas/cserve2: Prepare shared indexes in clients
- 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()
2013-10-28 15:47:13 +09:00
Jean-Philippe Andre c0bb73c775 evas/cserve2: Fix image load premultiplication
There was a color problem in elementary_test since elm
sets premul to 0 while expedite sets it to 1 during image load.
2013-10-28 15:47:13 +09:00
Jean-Philippe Andre db66f69104 evas/cserve2: _cserve2_cache_fast_scaling_check()
Adapt function to new Data/Entry model.
2013-10-28 15:47:13 +09:00
Jean-Philippe Andre ee74562bf0 evas/cserve2: Simplify error logs 2013-10-28 15:47:13 +09:00
Jean-Philippe Andre 64e7d48296 evas/cserve2: Store Image_Data in shared array
Split image entries into Image_Data and Image_Entry.
Store, find and use Image_Data descriptors from shared array.
Fix some wrong hash table usages.
2013-10-28 15:47:13 +09:00
Jean-Philippe Andre 315c2fd161 evas/cserve2: binary search in Shared_Array 2013-10-28 15:47:13 +09:00
Jean-Philippe Andre d0e647fee3 evas/cserve2: Repack File_Data shared array 2013-10-28 15:47:13 +09:00
Jean-Philippe Andre acae35b4d1 evas/cserve2: Use Shared_Array storage for File_Data
File_Entry and File_Data are now two different types,
one being stored in the shared array, the other one
is only a reference counting entry.
2013-10-28 15:47:13 +09:00
Jean-Philippe Andre c57a319df3 evas/cserve2: Rename File_Data pointers to fd
The name fe is also used by Font_Entry, slightly confusing
2013-10-28 15:47:13 +09:00
Jean-Philippe Andre 12deed8073 evas/cserve2: Use unique id counter
Merge file id and image id into a single entry id.
2013-10-28 15:47:12 +09:00
Jean-Philippe Andre 07fb7172d5 evas/cserve2: Implement shared index and buffers
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
2013-10-28 15:47:12 +09:00
Jean-Philippe Andre deb8776de5 evas/cserve2: Add functions to resize shm files
- 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.
2013-10-28 15:47:12 +09:00
Jean-Philippe Andre 781c2e26e5 evas/cserve2: Prepare usage of shared strings
+ Add macros to fake usage of future cserve2 strings functions
+ Rename all File_Entry to fe
+ Other costmetic changes
2013-10-28 15:47:12 +09:00
Jean-Philippe Andre afde0c892b evas/cserve2: Add CRIT() macro
For easy debugging
2013-10-28 15:47:12 +09:00
Chris Michael 28fed3fdb7 Fix formatting
Signed-off-by: Chris Michael <devilhorns@comcast.net>
2013-10-27 15:44:31 +00:00
Chris Michael 2be84a6073 Fix compiler warning(s) about eina_hash_int64 being passed pointer
from integer

Signed-off-by: Chris Michael <devilhorns@comcast.net>
2013-10-27 15:43:18 +00:00
Sebastian Dransfeld 7eebd55ebe efreet: Fix file opening
- Store result from mkstemp so we don't leak file descriptor
- No need to chmod, as we set correct umask before createing file
- Use fdopen to open file from file descriptor, not from path
2013-10-22 12:54:22 +02:00
Carsten Haitzler ed0e8b8df1 Revert "efreet: Use eina_file_mkstemp"
This reverts commit bd5a5e7fce.

sorry about this... all fine eina mkstemp use and all... but this
*BREAKS EFREET*! ibar icons stop working (vanish). efreet no longer
issues a desktop file update event to e etc. etc. etc. ... so let's
keep code that works for now even if it uses mkstemp and not eina...
:) working is better. :)
2013-10-16 22:56:38 +09:00
Sebastian Dransfeld bd5a5e7fce efreet: Use eina_file_mkstemp 2013-10-16 04:48:20 +02:00
Cedric Bail 4be4076cd4 edje: handle reallocation of pointed data properly for limits. 2013-10-15 18:15:51 +09:00
Cedric BAIL 443012dbcb edje: typo fix. 2013-10-14 14:00:59 +02:00
Cedric BAIL 48bc51b0c7 edje: fix CID 1054522 - Logically dead code
The buffer is a static buffer in that scenario, so never going to be NULL indeed.
2013-10-14 13:53:06 +02:00
Cedric BAIL 12072b2217 edje: fix CID 1062226 - Dereference after null check.
It seems to be possible in some badly crafted edj to trigger that path.
2013-10-14 13:45:26 +02:00
Sebastian Dransfeld e2dabc5d23 efreet: Set umask before creating temporary file
CID 1039615
2013-10-14 13:20:44 +02:00
Sebastian Dransfeld 67a8feeb08 efreet: Set umask before creating temp file
CID 1039616
2013-10-14 13:19:59 +02:00
Sebastian Dransfeld cc89eb2af9 efreet: Check size of buffer and '\0' terminate
CID 1039595
2013-10-14 13:14:59 +02:00
Carsten Haitzler 6732ab15af 1 char editing messup - revert it. 2013-10-13 11:38:59 +09:00
Carsten Haitzler f3e3739e7c edje_cc - CEEEEEEEEEEEEDRIIIIIIIIC! realloc+lookup bug workaround!
need i say more. this is a q1uick workaround a bug that is a result of
realloc moving memory around and thus lookups becoming broken.
2013-10-13 02:07:28 +09:00
Carsten Haitzler 69e27abdc3 eina - and e3fl in general - stop using eina_error_get/set - useless really 2013-10-11 16:50:40 +09:00
Cedric Bail b125a9afa6 gitignore: do not track generated files. 2013-09-26 15:51:25 +09:00
José Roberto de Souza 5a8d3125b5 eldbus codegen: Initialize signal events with 0 2013-09-19 15:47:22 -03:00
Cedric Bail 797ad7528f edje: add border linked to Image sets.
It is quite common that in an image sets each image has different border size.
This patch permit to define the border value on a per image basis in the set.
2013-09-06 16:47:36 +09:00
Boris Faure 84c383dc1a export EFL_VERSION_MAJOR/MINOR 2013-08-29 15:28:32 +02:00
Boris Faure 18ee1e1789 edje: export EINA_VERSION_MAJOR/MINOR when compiling edc files 2013-08-29 15:17:19 +02:00
Daniel Willmann 3e5bd813d3 embryo: Fix a potential buffer overflow (klocwork id 321)
Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
2013-08-12 18:32:40 +01:00
Gustavo Lima Chaves d84e77d93f Enough with this bad align Edje property documentation. 2013-08-12 13:29:43 -03:00
Stefan Schmidt 84a7cefcc2 edje: Do not access after freeing
Better free it after we access it.

CID 1039917
2013-08-09 11:43:25 +01:00
Sebastian Dransfeld f854efd041 efreet: Use mkstemp for tempfile
CID: #1039615
2013-08-07 13:02:53 +02:00
Sebastian Dransfeld 6a7f417cec efreet: Check return value of chmod
CID: #1039716
2013-08-07 13:02:53 +02:00
Cedric Bail 93b0fbfe65 edje: add warning when not finding the exact match.
This will close T223.
2013-08-07 16:01:57 +09:00
Chris Michael ff9b4775e8 Fix memleak in data_thread_script of edje_cc_out
NB: If we are going to exit data_thread_script function due to malloc
failure or fread failure, then we should close the previously fdopen'd
file so that we do not leak 'f'.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-08-05 15:32:12 +01:00
Chris Michael b344ef2440 Remove Eet_Connection from hash Before we call eet_connection_close
(as that frees the connection).

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-08-05 13:13:19 +01:00
Chris Michael 397e8afc1a Avoid potential divide by zero in INF call.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-08-05 12:42:31 +01:00
Chris Michael 42496ac4ea fopen can fail. check file is open before trying to write to it.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-08-05 10:41:16 +01:00
Daniel Juyung Seo a3165bff15 edje: added BLOCK_HANDLE description and vim syntax. 2013-08-02 13:27:54 +09:00
Cedric Bail ee72c809f0 efl: fix headers order. 2013-07-23 11:27:29 +09:00
Cedric Bail cf9b0180d6 edje: add threshold to draggable part. 2013-07-19 15:40:11 +09:00
ChunEon Park 8cec34d1d4 edje/map - changed data structure from list to array to improve color data memory access 2013-07-18 20:09:54 +09:00
Carsten Haitzler 08105a0136 fix clang sizeof complaint 2013-07-16 20:45:24 +09:00
Carsten Haitzler a484403db8 fix a bunch of reallocs self-assigning the same var 2013-07-16 20:45:24 +09:00
Carsten Haitzler b84e81fbea fix clang sizeof complaint 2013-07-16 20:45:24 +09:00
Carsten Haitzler a091a1d730 fix clang sizeof complaint 2013-07-16 20:45:24 +09:00
Carsten Haitzler 9a3256ba44 fix clang sizeof complaint 2013-07-16 20:45:24 +09:00
Carsten Haitzler 36cd49a182 fix realloc assign to "self". 2013-07-16 20:45:24 +09:00
Carsten Haitzler 4c970812f2 fix clang nonnull complaint 2013-07-16 17:16:20 +09:00
Carsten Haitzler 2ca7f23dbc fix clang nonnull complaint 2013-07-16 17:12:08 +09:00
Carsten Haitzler 8db1013956 fix clang nonnull complaint 2013-07-16 17:10:59 +09:00
Cedric Bail 2859d76402 efreet: set process priority on Windows too. 2013-07-12 08:42:08 +09:00
Cedric Bail 83de2e25ca efreet: it should be a #ifdef now... 2013-07-11 18:22:38 +09:00
Cedric Bail b887558afa efreet: use the correct guard. 2013-07-11 18:16:32 +09:00
Igor Murzov 079c1c6d9b eet: Fix copy&paste issue 2013-07-11 00:52:36 +04:00
Carsten Haitzler 6ceabbdb6c ethumb - fix ethumbd timeout to always work at start and mid-run too. 2013-07-09 20:13:24 +09:00
Carsten Haitzler bb4539c826 ethumbd timeout to 30s to not timeout in middle of long generate 2013-07-09 19:56:18 +09:00
Carsten Haitzler 95c836eaa3 up ethumbd timeout to 10sec by default 2013-07-09 19:37:55 +09:00
Stefan Schmidt 531be113be efreet: Guard priority settign and getting functions for WIN32
These functions are not available on a mingw build. Not really needed
either so just ifdef them.
2013-07-09 09:06:21 +01:00
José Roberto de Souza 9b9002e7e3 eldbus-codegen: If substr dont exist in string return string.
CID: 1039339
2013-07-08 13:52:12 -03:00
Chris Michael 7fc497ee6e Fix memleak reported by Coverity:
If we have file And fname, then we can call the source_fetch_file
function, HOWEVER we may only have One or the Other in which case we
still need to potentially free the other.

NB: Fixes Coverity CID1039296

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-08 13:13:15 +01:00
Chris Michael 61e17aa5c2 Fix memleak reported by Coverity: Don't leak a strdup.
NB: Fixes Coverity CID1039295

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-08 13:11:10 +01:00
Chris Michael 93fc18daf2 Fix leak of fd handle reported by Coverity
NB: Fixes Coverity CID1039288

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-08 13:07:18 +01:00
Jean-Philippe Andre ee037d3586 evas/cserve2: Add infix to shm filenames
Minor change
So, we can distinguish between image, font and index shm files.
2013-07-08 17:16:04 +09:00
Jean-Philippe Andre c6db8ba782 evas/cserve2: Implement fast(er) scaling of images
In its current model, cserve2 will reopen, reload and scale an
image whenever a new scaled version is requested by the client.

Instead, we can load the original image when too many scaled
versions are requested, and place the original in the LRU.
2013-07-08 16:06:08 +09:00
Jean-Philippe Andre cf61319ae1 evas/cserve2: Minor fixes from Coverity check
- CID 1042303
- CID 1039912
- CID 1039285
2013-07-08 16:06:08 +09:00
Chris Michael 9d60d6ccff Check return value of lseek call for errors.
NB: Fixes Coverity CID 1040029

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-08 07:31:50 +01:00
Ryuan Choi 8d41667412 edje_cc: Fixed possible leak when description.map.color defines same idx more than one time
Spotted by coverity. CID 1039298.
2013-07-06 01:30:54 +09:00
Jean-Philippe Andre 09a5c28e5b evas/cserve2: no cache for large images or non-smooth
The concept is taken from scalecache. I am not sure of the
performance impact.
2013-07-04 13:02:48 +09:00
Jean-Philippe Andre 7c7c231015 evas/cserve2: simplify more
Remove Image_Load_Opts and use Evas_Image_Load_Opts for cs2 master to
slave communication.
2 things to note:
- The struct size is bigger (but at the same time we removed a memcpy)
- The scale_load field is not passed to the slave
2013-07-04 13:02:48 +09:00
Jean-Philippe Andre 46b7baa379 evas/cserve2: merge SETOPTS into OPEN
When opening an image, OPEN and SETOPTS were always sent
consecutively. Merging these two messages may improve the
performance a bit (not measured), but also simplify the
whole thing.

Note: cserve2 debug tools have not been fixed yet.
2013-07-04 13:02:48 +09:00
Jean-Philippe Andre ca5d174568 evas/cserve2: use Evas_Image_Load_Opts directly
Image_Data contained a similar struct to the standard Evas struct,
let's not duplicate it uselessly.
2013-07-04 13:02:48 +09:00
Carsten Haitzler 64f8ea918c ethumbd - set default timeout for ethumbd to 2 seconds 2013-07-04 08:40:35 +09:00
Chris Michael 03448524ab Don't try to print out how many bytes we write to an eet file Unless
we actually write something.

NB: Fixes klockwork issue.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-02 09:54:30 +01:00
Chris Michael 292d23321c Check for valid out_file before trying to write eet data to it.
NB: Fixes klockwork issue.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-02 09:53:08 +01:00
Chris Michael e2b2918858 Check for valid output_filename before trying to use it.
NB: Fixes klockwork issue.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-02 09:43:23 +01:00
Jean-Philippe Andre 67cccea61b evas/cserve2: fix usage of Evas_Image_Load_Opts
Since the load options are not copied but the pointer is simply
stored by the module, we need to move the struct higher in the
stack.

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-07-02 16:58:10 +09:00
Jean-Philippe Andre 687c4aa475 evas/cserve2: use Eina_Stringshare.
We must close the image after loading the data.
Also, Evas loaders expect stringshares.

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-07-02 16:58:10 +09:00
Jean-Philippe Andre 8db3d4d2bf evas/cserve2: remove dead code (old loaders API).
Remove: cserve-specific loaders and deprecated code.
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-07-02 16:58:10 +09:00
Jean-Philippe Andre 48d97f7a90 evas/cserve2: use Evas loaders from slave
Use common loaders with evas, and ignore specific modules.

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-07-02 16:58:10 +09:00
Jean-Philippe Andre db6cba1429 evas/cserve2: avoid useless SETOPT messages.
Most of the time, the SETOPT message is sent only
to carry 0 data. Let's add a flag to the OPEN message to
avoid useless socket calls.
Server-side: implement with message faking.
Also, fix image ID logic on client side:
 - alloc data entry asap,
 - assign image_id during call to OPEN

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-07-02 16:58:10 +09:00
Jean-Philippe Andre f9a7820e02 evas/cserve2: Simplify debug logs (server side).
Remove newlines.

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-07-02 16:58:10 +09:00
Jean-Philippe Andre 29bf164c75 evas/cserve2: pass loader data during open.
Note: this path seems never to be used.
Loader options are set by the file loader or after open.

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-07-02 16:58:10 +09:00
Jean-Philippe Andre 6a2a0187ff evas/cserve2: write() can return other errors.
In case of error, return from the function and don't decrement
the send variable.

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-07-02 16:58:10 +09:00
Jean-Philippe Andre f7c6545170 evas/cserve2: minor fixes (error paths).
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-07-02 16:58:10 +09:00
Jean-Philippe Andre d712a13a7a evas/cserve2: use null-terminated strings everywhere.
Some hashtable lookups failed because the keys were added
either with eina_stringshare_add() or e_s_add_lenth() but
looked for with e_s_add_length() only.

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-07-02 16:58:09 +09:00
Chris Michael 7e222b949c Fix klockwork memleak: If we allocate a colormap above, then we need
to free it on error.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-06-28 13:57:56 +01:00
Chris Michael 204212131b Fix klockwork error: Null pointer may be dereferenced
Check for valid out_file before trying to use it.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-06-28 13:48:21 +01:00
Daniel Willmann cd980c4bea edje_cc: Fix memory leak in data_thread_script() in error case
Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
2013-06-26 11:10:57 +01:00
Sebastian Dransfeld 70d491fd68 efreetd: log to file
Since it is started as a service
2013-06-21 10:32:18 +02:00
Sebastian Dransfeld ebcd97cc93 efreet: Create cache dir in efreet_cache_init
efreetd used efreet functions before efreet init which fails.
2013-06-21 10:00:20 +02:00
Sebastian Dransfeld 58fc3a8f32 efreet: Low priority for cache rebuild 2013-06-20 13:53:54 +02:00
Sebastian Dransfeld 336f6ec328 efl: formatting 2013-06-20 13:28:18 +02:00
Sebastian Dransfeld 068f1ddc62 efl: formatting 2013-06-20 13:08:36 +02:00
Sebastian Dransfeld 51023d2d4f evas: Keep sane name for public header
Evas_Common.h should be used for the public header, and rather rename
evas_common.h internal header to another name.

Sa:
Evas_Common_Header.h -> Evas_Common.h
evas_common.h -> evas_common_private.h

Shouldn't have both Evas_Common.h and evas_common.h because of case
insensitive filesystems.
2013-06-20 12:53:29 +02:00
Jean-Philippe Andre 9929ee9aec cserve2: add more error debug for font loading 2013-06-20 17:42:07 +09:00
Mike Blumenkrantz b3984339db inform users when eldbus-codegen is cowardly refusing to generate code 2013-06-19 11:18:47 +01:00
Mike Blumenkrantz e2ba21e266 use sizeof for eldbus-codegen internal define lengths 2013-06-19 11:18:47 +01:00
Mike Blumenkrantz b8ea27d53c s/LENGHT/LENGTH 2013-06-19 11:18:46 +01:00
Stefan Schmidt 90aee3addd edje-codegen: Now really fix the mem leak without running into a double free.
The missing free was only for one of the paths to the end label. The other one
freed it before already. Take this into account to avoid the double free.
2013-06-14 10:54:19 +01:00
Jean-Philippe Andre 16c8ab3b18 evas/cserve2: remove garbage shm files during server init
If server crashes or is forcefully killed, it will not
properly cleanup its shm files. So, some memory will be leaked pretty
badly.
2013-06-14 17:09:03 +09:00
Jean-Philippe Andre 42309042c6 evas/cserve2: fix crash when shutting down cserve2
If a slave is still alive during shutdown, then it will be killed
and the dead callback should be called. This would then trigger
a request failed callback on invalid data.
But there's no point in calling the dead_cb since we're shutting
down already.
2013-06-14 16:38:18 +09:00