Commit Graph

69 Commits

Author SHA1 Message Date
Mike Blumenkrantz 7aec0565cb Revert "evas: remove unused function evas_common_load_image_from_file."
Summary:
This reverts commit 7672d1050e.
Depends on D11335

Reviewers: raster

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11336
2020-02-14 08:33:20 -05: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
Vincent Torri 01b987df59 make mman.h private
Summary:
integrate mman.h to make Evil private to the EFL, as mman.h does not exist on Windows. After a discussion with raster, i include sys/mman.h only on non Windows platform.

One issue, though, is that src/modules/emotion/generic/Emotion_Generic_Plugin.h has inlined functions using mmap()

Test Plan: compilation on Windows

Reviewers: cedric, raster, zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9542
2019-08-19 09:55:13 -04: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
Mike Blumenkrantz 79d15acca0 evas: fix big endian pixman image rendering
as indicated by the accompanying FIXME, the byte ordering is inverted
for big endian so this should be #ifdef-ed

Reviewed-by: Chris Michael <Christopher Michael <cp.michael@samsung.com>>
Differential Revision: https://phab.enlightenment.org/D7592
2019-01-16 15:58:25 -08:00
Shinwoo Kim f802c8f482 evas_image_main: make the cache->usage count eina_file size
Summary:
The image.data is set to null by evas_common_rgba_image_unload_real.
After this point the cache->usage does not count cache_entry.w and h value when
evas_gl_common_image_free calls evas_cache_image_flush.
So the cache->usage increases just around 300. If the cache->limit is 4194304,
then the cache could have around 1398 items. This would be fine.

But each items hold eina_file, and the cache does not count eina_file size.
If the file size is 326352, then a process could use 456527385 bytes.

So this patch set make the cache->usage count eina_file size.
This would be better option than https://phab.enlightenment.org/D7029

Reviewers: Hermet, jypark, cedric

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7030
2018-10-26 19:16:33 +09:00
Chris Michael 3862b304b0 evas-common: Remove cserve2 support
ref T7226

Depends on D6934
2018-08-30 13:47:27 +09:00
Carsten Haitzler f32f0d89f4 mmap memory allocation - do not used when under valgrind
we can't sensibly use things like massif to track memory if we bypass
itr with mmaping -1 fd anonymous memory... so if built with valgrind
support and running under valgrind, use malloc/calloc and free so
these tools actually do something useful for these bits of memory.
2018-01-12 03:02:43 +09:00
Cedric BAIL 7672d1050e evas: remove unused function evas_common_load_image_from_file. 2017-10-05 09:37:07 -07:00
Jiyoun Park 8ee0c30eb0 evas_image_main: fix memory leak of camera app -PLM[P161206-03545]
In gl engine, image objects try to unload image's pixel data after creating or updating the texture.
but image entry's reference is still 1, it is added to the pending_unloads list,
and it is cleaned when evas render function.

If elm image use preload feature, preload_done flag is true, so this image data cannot be removed from
pending_unloads list, it cause memory leak.

I think it is better to free image's pixel data in evas_cache_image_unload_data,
(not add to the pending_unloads list)
but it it complicated to modify.

so I'll remove the code to check preload_done flag in  evas_common_rgba_pending_unloads_cleanup function.
this flag check was added because of gl preloading, but now gl preloading feature is disabled.
this flag is related with https://phab.enlightenment.org/D2823

I tested photocam, but crash doesn't occur anymore, even though removing flag check.
2017-01-06 15:40:09 +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
Cedric BAIL 224ba8586b evas: fix use of signed and unsigned type in conditional expression warning. 2016-12-15 11:28:17 -08:00
Cedric BAIL e1843b2ced evas: fix potential use of unitialized variable. 2016-12-15 11:27:54 -08:00
Jean-Philippe Andre b2d92f2626 evas: Implement support for external buffers
This brings support for the eo api for external buffers (like
the old data_set / data_get). The new API now works with slices
and planes.

The internal code still relies on the old cs.data array for
YUV color conversion. This makes the code a little bit too
complex to my taste.

Tested with expedite for RGBA and YUV 422 601 planar, both
SW and GL engines (x11).
2016-09-06 16:55:00 +09:00
Jean-Philippe Andre 2f737e8f3b evas: Change internal function image_data_direct 2016-09-06 16:54:54 +09:00
Jean Guyomarc'h 9a82b17eff evas: don't redefine PAGE_SIZE if already defined
On OSX, we include mach.h (via the inlined locks API), which
already defines PAGE_SIZE.
2016-08-29 20:03:52 +02:00
Jean-Philippe Andre d5b0b1e683 Evas: Add SW engine map/unmap functions
Also, fix some of the code using them.
2016-03-28 16:40:01 +09:00
Jean-Philippe Andre c52a53c3dc Evas Image: Implement Gfx.Buffer get/set/copy_set APIs
Those APIs should provide a cleaner interface than the
old data_set/data_get APIs, by making sure the operations are
atomic (ie. no need to call size_set, cspace_set and then data_set).

padding/duplicated borders are not supported.

TODO: Implement legacy API on top of the new API, instead of
      this quick patch
2016-03-15 11:11:59 +09:00
Jean-Philippe Andre 7974f674aa Evas: Allow edje_decc to work with ETC images
This reuses the internal function data_get, data_put, image_save
respecting the border information and adding support for ETC
formats.

@fix
2015-11-10 16:12:21 +09:00
Jean-Philippe Andre ea001c3ec1 Evas: Add debug env var EVAS_IMAGE_NO_MMAP
Looking for image buffer memory leaks with Valgrind is impossible
when all images are mmaped. This is intended as a DEBUG environment
variable only.
2015-08-18 18:31:39 +09:00
Carsten Haitzler d31098fcec evas image unload - fix free path to remove from pending list
this should fix T2580
2015-08-04 10:47:38 +09:00
Carsten Haitzler 17823d21ea evas - image data unload - try plug another possible crash path
i am not sure if this is the odd crash i am seeing, but in theory it
could be. as these crashes are rare it's hard to find and gdb is "too
late" other than telling me the image is freed already by the time we
do an unload.
2015-07-26 03:02:06 +09:00
Carsten Haitzler 5b1e3b3a89 evas - image unload - fix unload to only unload imgs needing it
need_unload seems to have been done wrong. using preload not
need_unload. no idea why it checked/cleared preload instead of
need_unload.
2015-07-24 23:21:55 +09:00
Hosang Kim 51b097c014 evas_image : fix unloads cleanup logic
Summary:
Now Evas gl preload feature is disabled.
But if it is turned on, memory crash occurs.
Because evas_gl_common_texture_upload is not excuted immediately.

Test Plan: EVAS_GL_PRELOAD=1 ELM_ENGINE=gl elementary_test -to "photocam"

Reviewers: raster, cedric, woohyun, seoz, Hermet, singh.amitesh, jpeg

Subscribers: jpeg, cedric

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

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2015-07-16 20:15:12 +09:00
Hosang Kim eeec176166 evas: Init need_unload value after unload.
Summary: @fix

Reviewers: seoz, cedric, woohyun, raster

Reviewed By: raster

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2803
2015-07-09 12:04:40 +09:00
Chris Michael 0c0ec74ee2 evas: Remove unused variable
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-07-07 09:00:04 -04:00
Carsten Haitzler ec6ddf59e2 evas - image core - fix unloading of images to work again
i think this has been disabled for a while. image unloading is broken
- esp with gl enigne as due to async move it was effectively disabled.

this re-enables it. unloading is deferred with a managed list of things
needing unloading and then when any async sw renders are not busy any
more - do the unload then in the mainloop of all pending/flagged
images to unload

@fix
2015-07-07 21:38:21 +09:00
Carsten Haitzler cc49c1702b evas - fix yuv support to no longer ignore 709 colorspace params
if yuou use 709 instead of 601 yuv (ycbcr) evas will just be wrong and
use 601. this fixes that and implements 709. it also fixes a scaling
bug for yuv in the gl engine. no one noticed but me, so i won't call
this a bug fix, and it can go into the next efl release - no need to
backport unless it actually bothers peolpe (which it seemingly doesn't)
2015-05-27 20:19:46 +09:00
Jean-Philippe Andre bbe9425237 Evas: Remove irrelevant comment and disabled code 2014-11-19 17:10:37 +09:00
Jean-Philippe Andre 48bcf182b4 Evas gl: Add support for ETC1+Alpha textures
Compile-in the required shaders, add support for the
new EVAS_COLORSPACE_ETC1_ALPHA, and upload textures as RGB+A
pairs.

@feature
2014-07-09 09:04:55 +09:00
Jean-Philippe Andre b0df307927 Evas gl: Add support for S3TC textures
Add support for DXT1, DXT3 and DXT5 textures (4 formats in total).

@feature Add support for S3TC textures if the GPU supports them
2014-07-03 15:36:22 +09: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 f4a0c8054f Win64: Fix a bunch of warnings
Fix invalid casts.
Use printf("%z") where appropriate.
Fix unused variables warnings.

Thanks vtorri for the patch.

@fix
2014-05-29 20:02:16 +09:00
Jean-Philippe Andre 86ce491a86 Evas gl_x11: Add ETC2 support to the GL/X11 engine
This should allow texture upload with ETC2 RGB8 or RGBA8 formats.
Untested for now...

@feature
2014-04-25 16:50:29 +09:00
Jean-Philippe Andre 77d0d69c3e Evas: Add support for AGRY88 in image creation functions
- evas_common_rgba_image_from_data
- evas_common_rgba_image_colorspace_set
- evas_common_image_colorspace_normalize
2014-04-04 10:08:08 +09:00
Cedric BAIL b517ed81d5 evas: always allocate an image.data pixels buffers even YUV content.
fix T1146.
2014-04-02 16:41:41 +09:00
Cedric BAIL eb7071078a evas: handle premultiplying of AGRY88. 2014-04-01 22:00:15 +09:00
Cedric BAIL 516ee8c99e evas: don't forget that we can allocate AGRY8 now. 2014-04-01 22:00:15 +09:00
Cedric BAIL cbf81fddd1 evas: handle allocation of ETC1 color space image surface. 2014-04-01 22:00:15 +09:00
Cedric BAIL 3699ec6883 evas: remove RGBA_IMAGE_ALPHA_ONLY flags and use EVAS_COLORSPACE_GRY8 instead. 2014-04-01 22:00:15 +09:00
Alex-P. Natsios fa2b1b3d30 evas: improve portability for BSD system.
configure: fix prerequisite header issue

Summary:
in some platforms like openBSD <sys/socket.h> must be included before
net/if.h

the canonical way to ensure that with autotools is by providing that
fourth directive.

evas: use MAP_ANON instead of MAP_ANONYMOUS

Stupid unpredictable standards (or not so standard).
MAP_ANON exists and is defined almost anywhere unlike MAP_ANONYMOUS

Let's use that for portability's sake (they are practically identical
anyway)

Reviewers: raster, cedric

Reviewed By: cedric

CC: cedric

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

Signed-off-by: Cedric BAIL <cedric.bail@free.fr>
2014-03-15 19:58:08 +09:00
Carsten Haitzler 03fccbd543 evas - sw render - protect against null pointer surface access 2014-01-10 12:47:27 +09:00
Cedric BAIL a2d55c2b82 evas: fix build on windows. 2014-01-06 10:39:34 +09:00
Cedric Bail 8c094d1b2d evas: let's use HUGETLB when it makes sense. 2014-01-05 22:44:50 +09:00
Cedric BAIL 39a0ac4315 evas: disable use of mmap on windows for allocating pixels buffer.
We do have mmap provided by Evil, but there is no implementation yet of
an anonymous map support. Also it is not clear how the memory system of
windows does actually work, so not sure this optimization is relevant
to windows at all. Thus we disable it for the time being and unbreak
the windows support.

- cherry-pick me -
2014-01-03 17:53:51 +09:00
Cedric Bail 63c01cbb2a evas: reduce numbers of call to eet_init/eet_shutdown. 2013-11-21 10:50:48 +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
Carsten Haitzler c4a45c75b1 evas gl engine related - fix elm image example 01 (T182).
this fixes https://phab.enlightenment.org/T182 as it is an issue with a
surface alloc overwriting an already allocated surface entirely inside
the general software image infra.
2013-10-26 21:09:17 +09:00
Jean Guyomarc'h dd2f6b1370 evas: fix build for Mac OS X.
Reviewers: cedric, michael.bouchaud

CC: cedric

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

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-10-14 12:10:19 +09:00