Commit Graph

94 Commits

Author SHA1 Message Date
Carsten Haitzler 699fadd514 evas cache - up padding just in case i was off by one
coverity was complaining but it's a false positive - it seems to not
realze the loadopts_append does nul terminate at the end.
2020-04-17 11:06:32 +01:00
Mike Blumenkrantz 576229bf6a evas: set mmap data to image data after preload with skip_head enabled
this is a bit ugly, but in the case where skip_head is used it's important
to propagate the resulting Eina_File back up to the image object's data
for use in other api functions

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11422
2020-03-06 13:30:46 +01:00
Mike Blumenkrantz c37e545a03 Revert "evas: Compile out unused functions"
Summary:
This reverts commit 7d36ef88bc.
Depends on D11338

Reviewers: raster

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11339
2020-02-14 08:33:38 -05:00
Mike Blumenkrantz 08b291e540 Revert "evas: remove unused function evas_cache_engine_image_request."
Summary:
This reverts commit 90e1ca7154.
Depends on D11334

Reviewers: raster

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11335
2020-02-14 08:33:13 -05:00
Mike Blumenkrantz c1dd72fc91 Revert "evas: remove unused function evas_cache_image_request."
Summary: This reverts commit ee3f4e0529.

Reviewers: raster

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11334
2020-02-14 08:33:07 -05:00
Shinwoo Kim 8da73f9a68 evas_cache_image: drop image after replacement
Summary:
When a newly created Image_Entry works for instead of an old one,
we need to drop it. And we did dorp it.

The line calling ref and drop was added by following commit.

   d550190 evas image cache - add lots more locking to try stamp out
           any thread bug

But it is missed by following commit.

   9f99ab1 evas cache: clear up caching locking and reference count.

Reviewers: Hermet, raster, jsuya, cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10333
2019-10-14 11:07:27 +09:00
Carsten Haitzler e15d9c86df eina file refs in edje/evas - audit them and plug holes where refs stay
in 1 situation at least we delete the eina file (close it) but keep
the ptr around (during destruction) which could cause issues with
callbaks and events on del and so on.... which may lead to multiple
closes where only one should happen ... which would explain my invalid
eina file ref problems i'm seeing. i carefully matched eina file
handle stores/opens/dups to closes in edje/evas and they seemed to all
match up so this audit with comments and fixes seems to have plugged
that now.

@fix
2019-08-21 20:02:24 +01:00
Carsten Haitzler 21efff6d3e evas image - eina file - be paranoud about double closes
tracking some seemingly not so good asan hits on the eina file where
we're accessing an eina file already closed... so be extra paranoid
about it and set things to null after free/close...
2019-08-05 18:59:33 +01:00
Vincent Torri 24e4881efb Evas: remove Evil.h when not needed and use evil_private when needed
Test Plan: compilation

Reviewers: zmike, raster, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8921
2019-05-20 08:46:02 -04:00
Shinwoo Kim 3a89ea15b9 evas cache image: compare with cached image file
As cache2 knows cached image could be not matched even though
hash key is not different.

Please refer to the following comment of evas_cache2_image_open.

   /* image we found doesn't match what's on disk (stat info wise)
    * so dirty the active cache entry so we never find it again. this
    * also implicitly guarantees that we only have 1 active copy
    * of an image at a given key. we wither find it and keep re-reffing
    * it or we dirty it and get it out */

The hash key is created base on the image file address.
If the image file address to find does not equal cached image file address
then it means that the cached image is no longer valid.

This case could happen with the following step.

(1) Call evas_object_image_memfile_set with content data A
(2) Call evas_object_image_memfile_set with content data B
(3) Add timer with short time (ex: 0.01 sec)
(4) Delete A image, and add A image in timer callback
(5) Delete B image, and add B image in timer callback

Sometimes you could see image of A from the B image, because newly created
image at step 5 has same address of setp 1.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D6870
2018-11-29 16:01:48 -08:00
Carsten Haitzler 0c1eab0cf9 evas cache - avoid a segv...
but this needs mroe digging as to how this state was gotten to to
begin with.
2018-10-11 16:25:06 +01:00
Hermet Park 9f99ab1eae evas cache: clear up caching locking and reference count.
Summary:
On reviewing, found out some logical problems in evas cache.

ref-drop pair doesn't make sense, proper locking for cache image neither.

Reviewers: raster, #reviewers

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7129
2018-10-11 13:54:40 +09:00
Marcel Hollerbach 46d464e5bf here comes meson
a new shiny buildtool that currently completes in the total of ~ 4 min..
1 min. conf time
2:30 min. build time
Where autotools takes:
1:50 min. conf time
3:40 min. build time.

meson was taken because it went quite good for enlightenment, and is a traction gaining system that is also used by other mayor projects. Additionally, the DSL that is defined my meson makes the configuration of the builds a lot easier to read.

Further informations can be gathered from the README.meson

Right now, bindings & windows support are missing.

It is highly recommented to use meson 0.48 due to optimizations in meson
that reduced the time the meson call would need.

Co-authored-by: Mike Blumenkrantz <zmike@samsung.com>

Differential Revision: https://phab.enlightenment.org/D7012
Depends on D7011
2018-10-02 17:22:50 +02:00
Youngbok Shin ed621d7003 evas cache: add more null check for cache
Summary:
The 'cache' pointer is checked against null but then
dereferenced anyway. It needs to add null checking conditions.

Test Plan: N/A

Reviewers: raster, cedric, Hermet, zmike

Reviewed By: Hermet

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7084
2018-09-21 16:45:15 +09:00
Hermet Park 423d8a2296 evas image: fix a bug in image preloading.
Summary:
Current preloading is too buggy since it's on thread-based.
This is a fundamental improvement to fix a bug.

The critical issue here is,
When preloading img object suddenly cancel its preloading,
the object possibly cannot render image next then because
renderer doesn't have any idea when async cancelling is
finished. Renderer just tries to render regardless of
image loading status, and this could occur no-texture(in gl case)
image object.

So, here improvement is, adding a notification for async cancelled
so that putting img objects to redraw images properly after their preloading is
cancelled.

The best scenario to reproduce this bug is this one.

Evas_Object *img2 = evas_object_image_filled_add(evas);
evas_object_image_file_set(img2, "test.jpg", NULL);
evas_object_image_preload(img2, EINA_FALSE);
evas_object_resize(img2, 200, 200);
evas_object_show(img2);

Evas_Object *img = evas_object_image_filled_add(evas);
evas_object_image_file_set(img, "test.jpg", NULL);
evas_object_image_preload(img, EINA_FALSE);
evas_object_move(img, 200, 200);
evas_object_resize(img, 200, 200);
evas_object_show(img);

evas_object_image_preload(img2, EINA_TRUE);
If you run this on gl backend, occasionally happens rendering fail.

Yet there other bugs on preloading feature....

@fix

Reviewers: #committers, raster

Subscribers: cedric, #reviewers, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6919
2018-09-03 17:12:55 +09:00
Hermet Park 54f2a554da evas cache: refactor internal logic.
Summary:
Adding cache targets in other modules are inproper.
This can't be managed by cache module inside.

One representive scenario is,
when preload cancel is triggered, preload canceling sequence
can't be performed properly because cache targets implicitly were
increased by backend modules.

And then, Cache itself couldn't get notified it.
see this condition.

if ((!ie->targets) && (ie->preload) && (!ie->flags.pending))
in _evas_cache_image_entry_preload_remove()

Consequently, I move preloaded callbacks to sync with adding cache targets,
not to add by backed engines themselves.

This will bring Cache to manage cache targets properly.

Reviewers: #committers, raster

Subscribers: cedric, #reviewers, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6912
2018-08-30 13:26:06 +09:00
Hermet Park 4e1553905c evas cache: remove unused custom task in preload.
Summary:
That redundant code just made code complex.

This is one of intermediate patches for preload

Reviewers: raster, #committers

Subscribers: cedric, #reviewers, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6907
2018-08-30 13:17:44 +09:00
Hermet Park 43fcca4acd evas cache: code refactoring.
rename to proper internal variables.
Differential Revision: https://phab.enlightenment.org/D6911
2018-08-27 21:25:29 +02:00
Mike Blumenkrantz aa9cc3a068 evas: remove ecore init/shutdown calls from everywhere besides evas_main
Summary:
these separate inits and shutdowns make it impossible to effectively control
ecore's lifetime which makes evas_shutdown unreliable as objects may be
destroyed at any point

ref T7052
Depends on D6475

Reviewers: ManMower, devilhorns

Reviewed By: ManMower, devilhorns

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T7052

Differential Revision: https://phab.enlightenment.org/D6476
2018-06-28 15:03:15 -05:00
Carsten Haitzler 6d9d978faf evas cache - fix return val to fix warning
fix return val if cache is null (something bad happening)
2018-03-05 23:29:37 +09:00
Carsten Haitzler 91086fca39 evas cache image - protect against null cache ptrs
ok. i can't find the root cause because all i have is a backtrace from
ApBBB and he says he can't reproduce it and i know im->cache is
null... if i could reproduce ... i'd be hunting the root cause. but
the best i can do is check for null im->cvache ptrs and be safe.
crashes are bad. especially for end users.
2018-03-05 19:04:42 +09:00
Chris Michael 7d36ef88bc evas: Compile out unused functions
These timestamp functions are not currently being called, perhaps they
were intended for something later?, but for now just #if 0 them out as
they are not used

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-10-11 09:17:35 -04:00
Cedric BAIL ee3f4e0529 evas: remove unused function evas_cache_image_request. 2017-10-05 09:42:36 -07:00
Cedric BAIL 90e1ca7154 evas: remove unused function evas_cache_engine_image_request. 2017-10-05 09:41:41 -07:00
Vincent Torri 0cdd501246 EFL For WIN32: Replace HAVE_EVIL define with _WIN32 2017-09-22 05:06:10 -05:00
Mike Blumenkrantz e436947ff0 evas image cache: notify preload for image objects without explicit callbacks
non-gl images do not have an explicit callback and so the preload inform callback
must be triggered manually for all cases

fix T5200
2017-08-25 14:48:12 -04:00
Mike Blumenkrantz e4ba40c5bc evas image cache: break out preload complete notification code into function
no functional changes
2017-08-25 14:48:12 -04:00
Carsten Haitzler 6aa72e3cf6 evas - async preload cancel fix - don't double delete/free
just match the ref with the drop anddon't also manually free the image
as this leads to accessing of freed memory which is not a good thing.

this should fix T5374

@fix
2017-04-10 10:40:52 +09:00
Carsten Haitzler d550190d6b evas image cache - add lots more locking to try stamp out any thread bug
this definitely fixes T5223 because it adds an engine lock around the
code segemtnt that does compare time stamps... and hopefulyl a few
more things too.

@fix
2017-03-09 11:21:19 +09:00
Jean-Philippe Andre 9dcf2d3965 evas: Set thread name for preload
This can be useful during debugging.
2017-03-08 11:25:40 +09:00
Carsten Haitzler b61e69a956 evas cache image - remove double unlock of image task locks.
this is indeed a bug and fixes coverity CID 1367492
2017-02-08 21:19:39 +09:00
Cedric BAIL 62d6b4072c evas: simplify waiting logic for image decoding as we do not need lock and cond with Ecore_Thread infra. 2017-02-02 10:30:39 -08:00
Cedric BAIL ddf1907217 evas: make sure we always wait in the correct thread. 2017-02-02 10:30:39 -08:00
Carsten Haitzler e2fe31fc09 evas async preload - fix valgrind issue in accessing image after free
cache flish and async end ended up dropping some cacneled images that
were then accessed further in the cancel func for the thread. this
fixes that

@fix
2017-01-31 23:01:50 +09:00
Cedric BAIL 8f1c071d6a eina: rename EINA_{FLT,DBL}_CMP to EINA_{FLT,DBL}_EQ. 2017-01-06 15:58:46 -08:00
Carsten Haitzler 0690d47880 evas image preload - fix race condition that stops preloads
so if you queue a preload while a cancel is still pending the new
preload never happens. this fixes that. now it does but checking for
leftover tasks in the cancel cb and rescheduling a preload thread.

@fix
2017-01-06 17:46:13 +09:00
Carsten Haitzler 3842e87d3a evas image skip header - more fixes for when images fail to load
this fixes some more issues i have found in using skip header like if
the file doesn't exist etc. recent feature add so not a fix.
2017-01-06 09:38:44 +09:00
Carsten Haitzler 9e01cf2698 evas image async preload - add option to also make header load async
to date if you use async preload we still load the header
synchronously and this can be horrible especially with generic
loaders. there is no way to farm this off to the preload thread. now
there is. youhave to set it as a skip head load option before doing a
file_set AND you need to issue a preload ... but now it's possible.

@feature
2017-01-02 18:53:56 +09:00
Carsten Haitzler ef49935f72 evas - clean up whitespace and 80 column wrapping and commented out code
this doenst change functionality but just cleans up the file
whitespacing and formatting and removed commented out junk, 80 column
wrapping/overflow etc.
2016-12-28 13:31:48 +09:00
Carsten Haitzler 8424c2b4a3 evas - use freeq for common and cache images
this makes software rgba images and cache images use freeq to try and
minimize possible bugs and crashes if we hit use of freed data for
images.
2016-12-28 12:40:14 +09:00
Chris Michael 33ad245b80 evas: remove float comparison warnings for evas_cache_image
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-20 10:25:50 -05:00
Carsten Haitzler b9e0772533 evas - async preload - stop hang when missing wakeup of preload data
this isn't pretty and i think some stuff needs a redesign... but...
this should fix T5025

@fix
2016-12-20 22:38:21 +09:00
Cedric BAIL 8205051ff6 evas: wait on one specific task to be done.
This prevent dead lock.
2016-12-07 11:17:20 -08:00
Cedric BAIL 3aa63faa10 evas: add possibility for image loader to know if what they are working is still useful. 2016-12-06 16:26:08 -08:00
Cedric BAIL 3fab272906 evas: add capability to know if a thread has been cancelled. 2016-12-06 16:26:08 -08:00
Cedric BAIL 34758ad4f5 evas: switch to use Ecore_Thread instead of half done Evas thread infrastructure. 2016-12-06 16:26:08 -08:00
Jean-Philippe Andre ef759b6395 evas: Prevent crashes in case of error
SEGV would happen if the cache was NULL, as the error pointer
was also NULL in some cases (root cause for cache == NULL not
quite known, happens in elm_suite with CK_FORK=no).

Note: simply adding evas_common_init() to evas_init() leads to
a whole new set of issues with CK_FORK=no elm_suite - not good.
2016-09-23 11:28:14 +09:00
Jean-Philippe Andre caf237abdf evas: Fix unlikely crash with image cache
This happened to me when running elm_suite manually, during
elm_shutdown. At this point, cache shouldn't be null, but better
be safe anyway.
2016-09-01 11:57:43 +09:00
Carsten Haitzler 485074df3a evas engine cache - drop useless iff that assert already checked
CID 1267465 pointed this out - assert(eim) already checked this so no
need to do it again - looks confusing
2016-07-11 22:09:12 +09:00
Carsten Haitzler 5fa3815e01 evas update buf - dont ref and unref outbug as an evas image - it's not
we need calls to ref/unref them from engines, but atm it's ok because
they dont get deleted until the flush is done and not used after that...

@fix
2016-07-03 15:45:46 +09:00