Commit Graph

48 Commits

Author SHA1 Message Date
Jean-Philippe Andre 31a5bfb464 evas/cserve2: Reuse file entries when possible
For some reason, a new File_Entry was created whenever
a new image is loaded, even if that file was already
opened by the client.
2013-10-28 15:47:15 +09:00
Jean-Philippe Andre 8aa4a58d5b evas/cserve2: Reduce debug logs (s/INF/DBG) 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 a7b3f7efd3 evas/cserve2: Reset pointers to NULL after close 2013-10-28 15:47:14 +09:00
Jean-Philippe Andre e061114934 evas/cserve2: Add TIMEOUT macro for cs2 client
This will help debugging as we can disable the timeout on demand.
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 45456f8cf0 evas/cserve2: Fix crashes in E17/cserve2
When remapping the glyph data buffer, we need to reposition
the glyph pointers as well.
2013-10-28 15:47:14 +09:00
Jean-Philippe Andre ca44473f18 evas/cserve2: Scan glyphs and add to fash
This will save (just) a few socket waits.
2013-10-28 15:47:14 +09:00
Jean-Philippe Andre d5ac5a8df3 evas/cserve2: Remap glyph mempool if resized 2013-10-28 15:47:14 +09:00
Jean-Philippe Andre 22009a3f64 evas/cserve2: Use only one Glyph_Map per font
In the new cs2 model, only one shared buffer is allocated
for a font, and it resizes on demand.
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 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 a14e69e573 evas/cserve2: Remap string entries when size changed
Lots of files can't be found by the client when the strings table
changed, because it was not remapped properly.
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 df31807329 evas/cserve2: Client-side scanning of Font Entries 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 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 a230e41409 evas/cserve2: Fix Eina_File leak at shutdown
cserve2_shutdown was not called
2013-10-28 15:47:13 +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 08648ab2a5 evas/cserve2: Add _shared_index_remap_check()
Check consistency of index header and remap if necessary.
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
Chris Michael 016e365424 Don't call fcntl functions if we do not HAVE_FCNTL support built in.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-08-05 10:14:46 +01:00
Carsten Haitzler a588851b8f fix clang nonnull complaint 2013-07-16 17:18:59 +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
Jean-Philippe Andre 22e79af097 evas/cserve2: return in case of select timeout.
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-07-02 16:58:10 +09:00
Jean-Philippe Andre 79b102f6fd evas/cserve2: add some more error debug (client side).
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 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 d2c3b67a72 cserve2: fix minor memleaks with fonts
Leaks happen when fonts fail to load
2013-06-20 17:42:07 +09:00
Jean-Philippe Andre 4b473c90c0 cserve2: Handle interrupts when failing to read from server
If we don't do that, the client will end up in an infinite loop
from where it just can't exit, if the server is dead/stuck.
2013-06-20 17:42:07 +09:00
Jean-Philippe Andre 1821c91d10 cserve2: prevent infinite loop during connection
In case of EACCESS, there is no point trying forever
In case of EINTR (interrupt), we can consider for now
that any signal will prevent the use of cserve2.
If we don't do that, Ctrl+C simply won't work :)
2013-06-20 17:42:07 +09: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
Tom Hacohen 026559f752 Evas cserve2: Remove useless var when calculating size of sun_path. 2013-03-21 13:22:35 +00:00
Cedric Bail 8d5e33077e efl: use HAVE_FCNTL around call to fcntl. 2013-03-10 23:10:27 +09:00
Henrique Dante de Almeida f5d4ae70bd evas: Fix buffer overflows on environment variables 2013-02-26 10:17:28 -03:00
Carsten Haitzler 0bdfe655a0 patch over an aawesome source of segv's in cserve2... data2 is null.
but why?



SVN revision: 83877
2013-02-14 03:26:21 +00:00
Carsten Haitzler 179fd31b77 add api and lets test it - i'll document it later, but need to test
first.



SVN revision: 83867
2013-02-13 11:35:46 +00:00
Gustavo Sverzut Barbieri df701d8ca2 some clang warning cleanups i forgot to commit
SVN revision: 83024
2013-01-21 00:22:35 +00:00
Paulo Alcantara cf46337e17 efl/font: Dispatch font load request once sent to server
Patch by: Paulo Alcantara <pcacjr@profusion.mobi>


SVN revision: 82482
2013-01-09 21:37:34 +00:00
Paulo Alcantara fb97c82882 efl/cserve2: Fix some bugs regarding fonts
Signed-off-by: Paulo Alcantara <pcacjr@profusion.mobi>


SVN revision: 81582
2012-12-21 21:11:23 +00:00
Cedric BAIL 88ba56d9d5 efl: don't leak fd on exec.
SVN revision: 80434
2012-12-07 11:01:41 +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
Carsten Haitzler b8ad8ae5fe lets not have system("format c:") even tho its amusing as it just
creates warnings. :)



SVN revision: 79310
2012-11-15 04:29:34 +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