Commit Graph

65 Commits

Author SHA1 Message Date
Youngbok Shin 1750410650 evas: Add scale feature for embedded bitmap fonts.
Summary:
When evas selects a strike of embedded bitmap font,
calculate ratio and use it for scaling embedded bitmap.
@feature

Reviewers: jpeg, tasn, woohyun, raster, herdsman

Reviewed By: raster

Subscribers: charlesmilette, Francesco149, cedric

Differential Revision: https://phab.enlightenment.org/D2713
2017-09-26 11:31:31 +09:00
Vincent Torri 0cdd501246 EFL For WIN32: Replace HAVE_EVIL define with _WIN32 2017-09-22 05:06:10 -05:00
Vincent Torri 15108ecad0 evas: move EAPI undef to the correct place
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-08-14 10:16:44 -07:00
Carsten Haitzler b2ca7a96dc thread fence code - move elsewhere in file to avoid conflicts 2017-04-28 18:41:39 +09:00
Derek Foreman 83adbadc89 evas: Add a function to block for render thread completion
This is needed by dmabuf engine fallback when it realizes it locally
allocated a buffer, has been rendering to it, but the compositor can't use
it.

So the engine copies its buffer contents into a new wl_shm buffer and
continues from there - however we need to make sure the async renderer
has finished first, so we don't copy a partial buffer.

This allows us to block for all previously submit actions in the render
queue to complete.
2017-04-26 13:47:46 -05:00
Jean-Philippe Andre 3d2f1a3d9b evas filters: Implement mask filter in pure GL
This reuses the existing mask infrastructure, but adds a color
flag to use the whole RGBA range, rather than just the Alpha
channel.

Filters are still very slow (glReadPixels and non-optimized use of
GL buffers...), but this is progress :)
2017-04-14 11:26:43 +09:00
Cedric BAIL 9883831b76 evas: move Efl_Canvas_Output to be an internal only API. 2017-04-13 15:25:29 -07:00
Youngbok Shin f83ce20e1c evas: clean up GL images for emojis when GL context is free'd
If GL context is free'd before processing font shutdown,
textures for emoji glyph's GL images will be free'd without clean
up its GL images. It causes eina mempool infinite loop issue when
emoji's GL images are free'd in shutdown process.

So, the patch will make a list for emoji's GL images in context and
clean up them when the context is free'd. Just like font textures in
context.

@fix

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

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2017-03-08 19:35:03 +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 a909ca1f68 evas draw context - reduce size and allocations and frees
so a little perf fun shows malloc/free/realloc/etc. are, combined a
reasonable overhead. this reduced malloc overhead for draw contexts so
whne we duplicate them or create new ones, we re-use a small cache of
8 of them to avoid re-allocation. just take the first one from the
list as it really is that simple. mempool would not have helped more
here and cost more overhead.

@optimize
2017-01-31 23:01:50 +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 b0530aba4f evas cutouts - quickly avoid huge per issues with large nos of cutouts
i found evas_common_draw_context_apply_cutouts() was procsessing 300+
cutouts and as it's O(n^2)/2 to try and merge adjacent rects for
cutouts this really performs like complete junk. we apply cutout rects
a LOT. this is not the best solution, but it's quick and much faster
than doing the clipouts which drop framerate to like 1-2fps or so in the
nasty case i say (tyls -m of photos in a dir with a 2160 high
terminal).

this figures out the target area to limit the count of rects
significantly so O(n^2) is far far better when n is now < 10 most of
the time. and for the few operations where it's a high value this now
uses qsort to speed up merges etc. etc.

@optimize
2017-01-02 18:53:56 +09:00
Wonki Kim 88e1fc9613 evas: Add shutdown logic on thread creation failure
Summary:
In case of thread creation failure, shutdown logic will be stuck.
To prevent stuck, set exit variables to make thread_shutdown working
even if init fails.

Also modify init logics to return init result to a caller.

Reviewers: jypark, woohyun, cedric, jpeg

Subscribers: cedric

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

Note (@jpeg):
I have modified the patch just a little bit.

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2016-11-22 14:50:38 +09:00
Cedric BAIL 53dd596f43 evas: reduce usage of __thread directive.
Moved rects caching into draw context to avoid the use of __thread
slot. Draw context are defined per thread anyway and should be just
fine. This doesn't really change the picture regarding glibc problem
when to many __thread are needed, but slightly improve the global
picture. Also this patch doesn't affect our performance in expedite
benchmark as far as I can tell.
2016-11-16 16:05:56 -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 1773ba5d82 evas: Internally switch to Eina_Slice for buffers
This will be used for the gfx buffer map/unmap eo apis.
2016-09-06 16:54:53 +09:00
Jean-Philippe Andre 7bf8da2baa evas: Rename Evas.Object to Efl.Canvas.Object
One step closer to make the EO inheritance tree look like
it's all Efl.
2016-06-21 14:35:19 +09:00
Jean-Philippe Andre d4b96d33d6 Evas: Mark type as legacy and protected
Only set() is allowed for EO, and it's a constructor,
protected function. Unfortunately, this means a lot
of #define EVAS_OBJECT_PROTECTED
2016-06-17 11:37:39 +09:00
Minkyoung Kim f10672dd74 evas : remove native.func.data variable and data argument of native calblacks.
Summary:
Evas Image should be independent of render engine.
So remove native.func.data member of RGBA_Image, Evas_GL_Image struct.
And remove data argument,too.

Test Plan: Local test, Tizen3.0 mobile, Desktop englitenment

Reviewers: jpeg, spacegrapher, wonsik

Subscribers: cedric, dkdk

Differential Revision: https://phab.enlightenment.org/D3850
2016-04-01 12:09:06 +09:00
Jean-Philippe Andre 488854af2b Efl.Gfx.Buffer: Switch to void* data and signed ints
1. unsigned char* as a return type was not even compatible
   with the default colorspace (ARGB: 32 bits).

2. Change all unsigned to int for... uh... simplicity
   unsigned is more correct than int for things like width,
   size or stride, but in fact having both ints (x,y) and unsigned
   ints makes the code more complex.
   This is a matter of personal taste.
2016-03-28 16:40:01 +09: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 28a03d6e19 Evas: Remove unimplemented image comment (internal)
This is a minor cleanup of RGBA_Image.
2016-03-28 16:40:01 +09:00
jiin.moon cdb7286485 evas: some changes for preload thread dead lock issue
Summary:
Add spin lock to access to new flag can check to
status of the preload

Reviewers: jpeg, cedric, jypark

Subscribers: raster

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2016-03-15 11:57:25 -07:00
jiin.moon 41b8a320a0 evas: fix preload thread deadlock issue
Summary: Wrong condition makes deadlock issue.

Reviewers: jpeg, jypark

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-03-04 16:09:51 -08:00
Minkyoung Kim 25ebd91555 evas/gl : Do not re-preload image data if texture is successfully uploaded with image data.
Summary:
'cached' flag is not enough to check whethere data is loaded and texture is uploaded.
so check more options for prevent re-preload image data on gl-backend.

Test Plan: Local Test (elementary_test : elm images)

Reviewers: jpeg, eunue

Reviewed By: jpeg

Subscribers: cedric, jiin.moon, wonsik, spacegrapher

Differential Revision: https://phab.enlightenment.org/D3446
2015-12-18 16:49:17 +09:00
Pankaj Mittal 1363cd757a evas_eet: Add Type Safety check
Summary:
The Function _evas_canvas3d_eet_file_free(void) is referenced in  evas_model_load_file_eet()(file:evas_model_load_eet.c at line 122).
This call is  under condition
        if ((eet_file->mesh == NULL) || (eet_file->header == NULL)).
when  either eet_file->mesh or eet_file->header are NULL, dereference of the corresponding pointer in function "_evas_canvas3d_eet_file_free()"
will generate Segmentation Fault.

@fix

Reviewers: raster, Hermet, tasn, wonsik, spacegrapher, cedric, jpeg

Subscribers: singh.amitesh, sachin.dev, alok25, yashu21985, mvsovani, cedric

Differential Revision: https://phab.enlightenment.org/D3369
2015-12-10 16:26:56 +09:00
Jean-Philippe Andre b5500a8644 Evas: Move alpha functions to static_libs/draw
This is a pretty simple code refactor, moving pixel handling
to the new draw lib.
2015-12-03 18:42:50 +09:00
Jean-Philippe Andre 615b2442b7 Ector: Move drawhelper to static_libs
Rename a few things:
 - draw helper -> efl_draw
 - Ector_Rop -> Efl.Gfx.Render_Op
 - ECTOR_ bla bla -> DRAW_ bla bla (base pixel ops)
 - ector_memfill -> draw_memset32 (and invert arg order to match memset)

The main rasterizer file is now draw.h in static_libs/draw
This is a non functional change, simple code refactor.
2015-12-03 18:42:50 +09:00
Carsten Haitzler 5801013ad4 evas - region updates - go back to tiler as its faster
the overhead didnt show up in y tests. do show up with certain
expedite tests. hmmm. last time i messed with region code it was
actually same speed as tiler. bonus was it was fully accurate.
2015-10-05 18:41:00 +09:00
Carsten Haitzler 217faeebe8 evas cutouts - optimize to use less cpu
this optimizes draw ctxt cutouts by skipping small ones and
remembering the last cutout added so it isn't double-added as well as
extending the minimum cutout array to 512 and going up in blocks of
512 instead of 128. also optimize the clipping code a bit more.
2015-09-24 14:09:20 +09:00
Carsten Haitzler 49adf8aa47 evas tiler update handler - move to region code to be accurate and fast
this move evas tiler that does update handling to use fully correct
regions using region.[xh]. this also removed old unused regionbuf code
and a bunch of commented out code no longer needed. much simpler now
and easier to maintain.
2015-09-24 14:09:09 +09:00
Jean-Philippe Andre f654a3b300 evas_render: simplify masking and clipping in general
Use context_dup to inherit from previous contexts in a clean
manner. This removes the need for restoring the previous
clip information.

Plus, this commit removes lines of code so it must be good, right?
2015-09-04 11:11:39 +09:00
Jean-Philippe Andre c45ae022c8 Evas masking: Fix crash in async rendering
There was a FIXME comment... >_<

Improper management of image resources in async render led to
a rare crash. This should fix that.

@fix
2015-07-27 14:15:09 +09: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
Cedric BAIL 71b7fc982a evas: remove the need to order the header correctly for Windows. 2015-05-07 09:53:10 +02:00
Cedric BAIL b18b1e89ff evas: fix Windows build. 2015-04-03 16:34:22 +02:00
Youngbok Shin 262dd3a139 evas: fix build failure with old version freetype.
Summary:
Fix build failure with old version freetype.
It is caused for supporting colored font.

Reviewers: raster, jpeg, woohyun, Hermet

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2200
2015-03-20 13:24:31 +09:00
Youngbok Shin e197f8804f evas: Support bitmap embedded color font.
Summary:
Add the code for getting bitmap buffers from embedded color font,
And draw the bitmap buffers as images.
For drawing the bitmap buffers as images,
evas_common_draw_context_font_ext_set internal API is changed to
pass additional gl engine functions.
T2139
@feature

Test Plan:
1. Set a bitmap embedded color font to textblock.
2. Set a unicode emoticon text.
3. See the result.

Please check the sample unicode in the following link.
http://www.fileformat.info/info/unicode/char/1f3af/index.htm
http://www.fileformat.info/info/unicode/char/1f555/index.htm
http://www.fileformat.info/info/unicode/char/2600/index.htm
http://www.fileformat.info/info/unicode/char/263a/index.htm

Reviewers: tasn, woohyun, jpeg, raster

Reviewed By: raster

Subscribers: herdsman, cedric

Differential Revision: https://phab.enlightenment.org/D2084
2015-03-19 19:02:03 +09:00
Cedric BAIL 552a38cde5 evas: refactor software engine initialisation. 2015-02-20 15:04:52 +01:00
kabeer khan 46b9b23144 evas: add image orient set/get API in software backend for now.
Summary:
Added API's to rotate(0, 90, 180, 270), flip(horizontal, vertical, transpose, transverse)
evas image object. Also added example to demonstrate this.

Signed-off-by: kabeer khan <kabeer.khan@samsung.com>

Reviewers: raster, stephenmhouston, cedric

Subscribers: stephenmhouston, cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-11 17:30:54 +01:00
Dongyeon Kim c0d990c724 evas/software_x11: implement tbm native surface type
Summary:
This native surface type is based on the tbm surface used for the tizen platform.
For the software_x11 backend, image data is retrieved from tbm surface
and color format converted appropriately.
This will only work when libtbm.so is present in the system.
@feature

Test Plan: Local tests

Reviewers: raster, cedric, jpeg, Hermet

Subscribers: wonsik, cedric

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2015-02-10 14:48:53 +09:00
Dongyeon Kim defcc1f2ac evas/software_x11: implement native surface set for x11 type
Summary:
implement native surface set for EVAS_NATIVE_SURFACE_X11 type
on software_x11 backend.
@feature

Test Plan: local tests on PC

Reviewers: jpeg, cedric, raster, Hermet

Subscribers: wonsik, cedric

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2015-02-10 14:48:22 +09:00
Jaeun Choi 9af60b1b04 Evas masking: Use alpha mask in SW engine draw functions
Work done by Jaeun Choi, rebased & squashed by jpeg.

This commit introduces changes to the low-level draw functions
of the SW engine considering the existence of an alpha mask image.

Features:
- Font masking (TEXT, TEXTBLOCK),
- Rectangle masking,
- Image masking (all image scaling functions should be handled).

The mask image itself is not yet set in the draw context (see
following commits).

@feature

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2015-01-07 15:06:02 +09:00
Jean-Philippe Andre 05aee3e370 Evas: Don't pass whole RGBA_Image to low-level render functions
Idea originated from Cedric the b0rker.

This is a big fat search-and-replace commit.
This commit also introduces space changes... Sorry for the mix.

NOTE: This commit may have one side effect as there was some very
      dubious code chaning the dst image's alpha flag in the
      Gfx get functions. Logically this didn't make sense (at
      draw time the dst alpha should already be well defined),
      so it should be safe.
2014-11-13 12:20:57 +09:00
Wonguk Jeong 1cc23d4ff2 evas: jpeg loader - support flip, transpose, transverse
Summary:
Previously, jpeg image loader support rotation (90°, 180°, 270°) only.
this patch is about supporting flip(vertical, horizontal), transpose, transverse

@feature

Test Plan: I'm going to make tests in src/tests

Reviewers: cedric, raster, jpeg

CC: seoz, cedric

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

Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
2014-07-06 20:12:31 +02:00
Jean-Philippe Andre 2b191b3c51 Evas loader: Introduce border param 2014-07-03 11:37:47 +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
Cedric BAIL 05239d8dd2 evas: let loader specify there prefered color space. 2014-04-01 22:00:14 +09:00
Jean-Philippe Andre ac8140ccd1 Evas filters: Rename RGBA_Image::mask.data into image.data8
The structure should not be changed, despite the union modification.

I am renaming for consistency with older branches that had a mask
field in RGBA_Image. Also, the mask.data or data8 is really just
a way to avoid casting between DATA8 and DATA32 (and it shows
clearly what kind of data you are dealing with).
2014-03-04 12:10:29 +09:00