Commit Graph

23509 Commits

Author SHA1 Message Date
Carsten Haitzler b3debcc3e1 compliance/licensing - clarify, fix formatting and point to tldrlegal.com 2013-10-30 19:27:26 +09:00
Carsten Haitzler 309e287b7c evas - gif loader rewrite (clean up code, document it a lot AND fix bugs)
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.
2013-10-30 18:18:08 +09:00
Carsten Haitzler 6c28aff7a0 evas - animated images. fix leak in not freeing the list of frames itself 2013-10-30 18:18:08 +09:00
Sung W. Park 9bb4c48691 EvasGL: cleaning up unnecessary code.
Cleaning up unnecessary code.
2013-10-30 10:47:52 +09:00
m.biliavskyi 1b802b0e3a Return Eina_Bool value for method which deleting style from edje_edit object.
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
2013-10-30 08:40:11 +09:00
Albin Tonnerre 6b130d8b18 ecore_x/xlib/ecore_x_vsync.c uses dlopen and dlsym, but configure.ac
only checks for this for the XCB variant. This results in linker errors
when using strict linker flags (-Wl,-z,defs)
2013-10-29 23:37:03 +01:00
Rafael Antognolli 047e3bf113 ecore/wayland: Using underscore on private functions. 2013-10-29 19:32:00 -02:00
Rafael Antognolli cb0f6171a8 ecore/wayland: Oops, initialize member of malloc'ed struct. 2013-10-29 19:14:59 -02:00
Rafael Antognolli 06d6bf0dba ecore/wayland: Add some getters.
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.
2013-10-29 19:14:22 -02:00
Chris Michael 40a2dfc870 On a focus_in event, if the ecore_evas already has focus, don't resend
a focus in. Similar change for focus_out also.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-10-29 08:41:48 +00:00
Chris Michael 49dfea5566 If mouse is already inside the ecore_evas, then we don't need to call
the mouse_in function of the ecore_evas.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-10-29 08:05:32 +00:00
Chris Michael d1d0090706 Don't send mouse_up or mouse_down events unless we have a focused
surface

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-10-29 08:05:32 +00: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 44f89bb8ad evas/cserve2: Fix CID 1039286 (Resource leak)
Close socket in case of connection failure.
2013-10-29 15:08:19 +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
m.biliavskyi 73c2ae44e0 edje: return Eina_Bool values in setters for dragable confine and event params in Edje_Edit API.
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>
2013-10-29 10:24:31 +09:00
Rafael Antognolli ccdeae7ce4 ecore/wayland: Use sync callback to report end of ecore_wl_init().
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.
2013-10-28 14:47:33 -02:00
Rafael Antognolli 3aca95bb22 ecore/wayland: Add info about other bound interfaces.
Add output, seat, data_device_manager and subcompositor as possible
bound interfaces, on the ECORE_WL_EVENT_INTERFACES_BOUND event info.
2013-10-28 14:47:32 -02:00
Rafael Antognolli ad731e8b21 Revert "change init done bindings."
This reverts commit b87afd1b94.

Wrong branch, wrong commit.
2013-10-28 14:46:40 -02:00
Rafael Antognolli b87afd1b94 change init done bindings. 2013-10-28 14:07:25 -02:00
Cedric Bail e35c7b19fb eina: long forgotten function in Eina_File for Windows. 2013-10-28 19:47:40 +09:00
Cedric Bail 6bc393e740 evas: fix leak of ellipsis object in Evas_Object_Text. 2013-10-28 19:45:46 +09:00
Cedric Bail 8b01f7b06d evas: fix possible memory leak in the ellipsis code. 2013-10-28 18:44:26 +09:00
Cedric Bail 1a3c9d68d0 eet: help the kernel to actually load the eet file in memory more efficiently.
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.
2013-10-28 18:32:40 +09:00
Cedric Bail 570ce667f3 eina: fix API as we don't and never will touch memory for write in that function. 2013-10-28 18:32:40 +09:00
Cedric Bail 60a34c1cd0 eina: avoid possible race condition when unreffing an Eina_File. 2013-10-28 18:32:40 +09:00
Jean-Philippe Andre 7338164468 Evas/cserve2: Merge branch 'devs/jpeg/cserve2'
Improve stability, performance and overall support of
evas cserve2.

In particular:
- Implement shared indexes and memory pools to share cserve's
  internal state with all clients. Apps can then scan these
  indexes and avoid waiting for socket responses when loading
  resources.
- Implement crash resiliency in evas. If cserve2 crashes, apps
  can safely reconnect and continue working as if nothing
  happened.
- Implement support for the GL engine (very basic support so
  far, "just works").
- Improve performance by reusing the scalecache logic.
2013-10-28 15:51:10 +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 4c44b5a553 evas/cserve2: Use Eina_Refcount instead of int
Use the refcount macros instead of manually handling
integers. Not sure if it really helps since the refcounting
in cs2 client is a bit special :)
2013-10-28 15:47:16 +09:00
Jean-Philippe Andre ffa27c7082 evas/cserve2: prevent unwanted remap of strings table
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.
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 6b6e33e262 evas/cserve2: Fix refcount for glyphs & glyph buffers
Maybe a little overkill on the iterations (ref/unref),
but at least we can really track down which glyphs are
currently being used.
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 3889feca24 evas/cserve2: Implement support for GL engine
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.
2013-10-28 15:47:15 +09:00
Jean-Philippe Andre 2cd0b316f1 evas/cserve2: Fix CList usage
In some error cases, the list could become a cycle.
Foreach would then loop forever!
2013-10-28 15:47:15 +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 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 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 fc73405c40 evas/cserve2: Add cache hit count on image data 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