Commit Graph

34 Commits

Author SHA1 Message Date
Jaehyun Cho 7812e9afa6 evas: fix typo in evas_cache comment.
Summary: Fix typo in comment

Reviewers: Hermet

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2014-10-29 22:38:31 +01:00
Jean-Philippe Andre a2de0a0bc9 Evas: Support duplicated borders in surface alloc
Now, the evas loader is supposed to advertise the actual border
size in case of compressed texture formats.

The only case where the border was non zero was ETC formats,
from the TGV loader, so I think we don't need to keep the
previous behaviour (auto-calculate borders for ETC).
2014-07-03 11:37:48 +09:00
Jean-Philippe Andre 54fb9b2346 Evas: Use Evas_Colorspace to declare cspace
Why use int when we have a proper type?
All these APIs are internal.
2014-04-15 18:50:37 +09:00
Jean-Philippe Andre d8d5189003 Evas/cserve2: Remove dead code
Fixes CID 1039925.
2014-01-15 11:00:47 +09:00
Jean-Philippe Andre a0dc5c16ac Evas/cserve2: Add another load error check
This one is very unlikely as it would mean the image is
invalid while being in the hash.
2014-01-14 14:23:04 +09:00
Jean-Philippe Andre 35fd233d0c Evas/cserve2: Fix crash on image file change
When an image file is changed, it is discarded from cserve2,
so the references become invalid. In case we were loading a
scaled version of that image, no proper error checking was
done, leading to obvious crashes.
2014-01-14 14:23:04 +09:00
Jean-Philippe Andre b3b5999847 evas/cserve2: Prevent another infinite loop (flush)
And add some error messages
2013-10-30 19:48:17 +09:00
Jean-Philippe Andre 498418bb67 evas/cserve2: Prevent potential infinite loop (shutdown)
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.
2013-10-30 19:48:17 +09:00
Jean-Philippe Andre 82e8028b5d evas/cserve2: Fix image preload with gl-x11 engine
Cserves supports only the SW (xlib) and GL (gl-x11) engines.
Also, improve cs2 support for some lesser used functions in the
gl_x11 engine.
2013-10-30 19:48:17 +09:00
Jean-Philippe Andre aa6d4a3756 evas/cserve2: Fix error path in evas_cache2_image_writable()
Return NULL and check for nullity in the only calling function.

Fixes CID 1039461 (Logically dead code)
2013-10-29 15:12:58 +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 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 9bb52372bd evas/cserve2: Fix animated Gifs support with cs2
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)
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 fc73405c40 evas/cserve2: Add cache hit count on image data 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 d76e869a59 evas/cserve2: Fallback to normal cache for mmap
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
2013-10-28 15:47:15 +09:00
Jean-Philippe Andre 7bf4394198 evas/cserve2: Rename _evas_cache_ to _evas_cache2_ 2013-10-28 15:47:14 +09:00
Jean-Philippe Andre f5d0f0aec3 evas/cserve2: Scan shared indexes in client side
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.
2013-10-28 15:47:13 +09:00
Jean-Philippe Andre 8b257d0238 evas/cserve2: fix error parameter usage
The error pointer could be NULL but still dereferenced in case of
failure. Also, it wasn't reset in case of success.
2013-07-08 16:06:08 +09:00
Chris Michael 10897713ea Remove dead code. In the error goto, im2 cannot exist here else we
would not have gotten to this error handler if it did (so no point in
checking for it and calling functions using it).

NB: Fixes Coverity CID1039926

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-08 07:39:44 +01: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 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 096a8ece9f evas/cserve2: Set default LRU size to 4Mb or env-based
The LRU should not be limited to 0 byte otherwise all scaled
images will be dropped and reloaded constantly, killing the
performance.
The size is inspired from the scalecache's size of 4Mb.

Variable: EVAS_CSERVE2_SIZE (number in Mb)
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-07-02 16:58:10 +09: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 a5329fc680 evas/cserve2: add lots of error checks in the client side.
It seems some images are fully loaded even when we request
only preload. The load handler will take care of both cases anyway.

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-06-04 20:20:55 +09:00
Cedric Bail c3f9d3b8b8 evas: Make Evas_Loader API public. 2013-05-08 18:16:59 +09:00
Cedric Bail c5b0d28d73 evas: move flags and attribute around. 2013-05-06 19:02:04 +09:00
Paulo Alcantara d7ae50462c efl/cserve2: Increase refcount of scaled image entries properly
Patch by: Paulo Alcantara <pcacjr@profusion.mobi>


SVN revision: 82484
2013-01-09 21:40:25 +00:00
Paulo Alcantara c6f907a9f4 efl/cache: Set loaded flag properly with loaded pixels
Patch by: Paulo Alcantara <pcacjr@profusion.mobi>


SVN revision: 82481
2013-01-09 21:36:03 +00:00
Paulo Alcantara 0809c7de3f efl/cserve2: Fix ref/unef of image entries for threads
Signed-off-by: Paulo Alcantara <pcacjr@profusion.mobi>


SVN revision: 81584
2012-12-21 21:13:06 +00:00
Leandro Pereira f96a5aac5c evas: Get rid of RGBA_Image ref member
(It's not by anything in the code.)



SVN revision: 81182
2012-12-17 21:26:15 +00:00
Paulo Alcantara f8f79f8599 evas/cserve2: Add scalecache support
Signed-off-by: Paulo Alcantara <pcacjr@profusion.mobi>

Patch by: Paulo Alcantara <pcacjr@profusion.mobi>



SVN revision: 79754
2012-11-27 18:23:25 +00:00
Vincent Torri c15e9c6575 merge: and now Evas
I've tested make -j 3 install and it works nicely

I've tested expedite with software and opengl xlib,
and it works. Not tested other engines, so please
report any problems (engines or other) on the ML.

TODO: examples and tests, I'll add them later

ISSUE: Eina_Unicode size check. It indirectly depends on
       eina_config.h, which is created at the end of the
       configure script. So its size is always 0. I don't
       know how that size is used, so I can't do a lot,
       for now.


SVN revision: 78895
2012-11-04 11:51:42 +00:00