Commit Graph

39 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
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
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
Carsten Haitzler b132ce65ec evas - fix leak because cutouts_fre .. doesnt free - it just resets to 0
this works with 7166e6b859 and fixes a
leak added because ... free does not free!
evas_common_draw_context_cutouts_real_free(0 now actually frees the
rects, but evas_common_draw_context_cutouts_free() before did not.

@fix (follow on from 7166e6b859)
2016-04-01 17:54:37 +09:00
Carsten Haitzler 7166e6b859 evas sw render: fix previous thread fix to be portable
this fixes the fix 4d6a8a7fce to be
portable to platfomrs that do not support __thread - seemingly openbsd
does not (argh!) and maybe others. so on these platforms then they
dont get the optimization of keeping a cutout rect pool to avoid
re-allocation.

this also every 4096 draws "resets" the cutout cache so it doesnt
expand and stay expanded forever.

@fix
2016-04-01 11:29:50 +09:00
Carsten Haitzler 4d6a8a7fce evas sw render: cutout rects may be used in multiple threads
several draw funcs keep a static Cutout_Rect *rects = NULL; variable
to cache cutout rects to avoid re-allocating them a lot etc. this is
fast and handy but we may use these from multiple threads. thats bad
.... mmmkay. so this fixes it the dirty way - makes them thread local.
:)

this fixes T3348 - the crash mentioned by @zmike

@fix
2016-03-26 10:52:14 +09:00
Carsten Haitzler bd1d996545 evas font draw - fix up some whitespace/indenting/formatting 2015-05-18 17:13:38 +09:00
Carsten Haitzler 377e94263b evas - font - new color bitmap support - rename funcs to match file 2015-03-20 10:49:49 +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
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
Carsten Haitzler 6038318851 evas font draw - fix possible custout rect leak found by coverity
fixes CID 1039477
2014-08-25 13:18:51 +09:00
Jean-Philippe Andre 9adbbe0bd1 Evas fonts: Pass RGBA_Image instead of DATA32 buffer
Since we want to be able to draw to alpha buffers, it's
easier if we pass the whole image struct instead of just
the data pointer.
2014-02-07 15:38:43 +09:00
Carsten Haitzler 86a97efeea evas - fonts - move to using 4bit and rel 4 bit compressed font glyphs
this changes the internal encoding of font glyphs in evas to use 4bit
uncompressed if small, or 4bit rle (run length encoded) if larger.
this caves at least 50% of memory on fonts - and more if bigger. with
large fonts (40-80pixel size) we can save in the region of 80% of
memory used for glyphs. this also happesn to allow speedups in
rendering too.
2014-01-13 05:15:32 +09:00
Carsten Haitzler f41bf26d7a evas - unbreak gl font rendering with dst pointer checks 2014-01-10 12:54:54 +09:00
Carsten Haitzler 03fccbd543 evas - sw render - protect against null pointer surface access 2014-01-10 12:47:27 +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 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 bb4e7fb869 evas: fix compilation warning in evas_font_draw.
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-07-02 16:58:10 +09:00
Chris Michael 694d1600e8 We should free glyph_out also (as that gets malloc'd too) on error.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-06-28 14:13:09 +01:00
Chris Michael dd136b82e2 Fix klockwork memleak: If we allocate space for a Font Glyph (through
evas_common_font_int_cache_glyph_get), then we should free that
allocation when we have an error.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-06-28 14:02:00 +01:00
Sebastian Dransfeld 336f6ec328 efl: formatting 2013-06-20 13:28:18 +02:00
Sebastian Dransfeld 51023d2d4f evas: Keep sane name for public header
Evas_Common.h should be used for the public header, and rather rename
evas_common.h internal header to another name.

Sa:
Evas_Common_Header.h -> Evas_Common.h
evas_common.h -> evas_common_private.h

Shouldn't have both Evas_Common.h and evas_common.h because of case
insensitive filesystems.
2013-06-20 12:53:29 +02:00
Carsten Haitzler ae2f824413 evas: fix possible seg with font glyphs from font instance in glyph array with no refcounting. 2013-06-14 19:57:18 +09:00
Cedric BAIL 58291fb022 efl: let's use text_prop cache properly.
Now evas_object_textgrid_render account for 1% of the benchmark.


SVN revision: 82928
2013-01-17 10:28:18 +00:00
Cedric BAIL ffafb3602e efl: let's do less memcpy.
SVN revision: 82855
2013-01-16 06:31:32 +00:00
Paulo Alcantara b557bd9e0d efl/engines: Introduce multi_font_draw() function
This new engine function will only be used in software generic for
now - since it's the only engine used with the async render.

This function has been introduced in order to avoid growing thread
command queue too much to draw a text_props at a time on render calls
from textgrid objects.

Patch by: Paulo Alcantara <pcacjr@profusion.mobi>



SVN revision: 82832
2013-01-15 17:35:11 +00:00
Ulisses Furquim 48c15aaa74 evas/async_render: only get a ref if a thread cmd was issued
This patch should make us get a reference on images, maps and glyphs
which are sent in a command to the render thread. Before we were doing
some useless ref and unref operations.



SVN revision: 82666
2013-01-11 19:57:09 +00:00
Ulisses Furquim f0f9f7b7a6 evas/text: remove misleading comments on glyphs array refs
SVN revision: 82665
2013-01-11 19:56:49 +00:00
Ulisses Furquim b9f05341c3 evas/async_render: skip early if text_props with no glyphs
This is intended to preserve old behavior now that we have
evas_common_font_draw_cb() to handle both sync and async callbacks.
However, we need to check where why we end up with no glyphs in a
text_props even after calling evas_common_font_draw_prepare().



SVN revision: 82664
2013-01-11 19:56:32 +00:00
Leandro Pereira a868276f11 evas: Try to reuse glyph array if possible
This sould bring back a little bit of text rendering performance, while at
the same time decreasing memory usage and fragmentation.

Patch by: Leandro Pereira <leandro@profusion.mobi>



SVN revision: 82660
2013-01-11 19:49:15 +00:00
Leandro Pereira 468b44c444 evas: Do not use an Eina_Lock for glyph array
Patch by: Leandro Pereira <leandro@profusion.mobi>



SVN revision: 82659
2013-01-11 19:48:28 +00:00
Paulo Alcantara 5eaba08284 efl/font: Avoid passing NULL glyphs arrays on unref
evas_common_font_glyphs_unref() *should* be called with valid glyphs
arrays.

Patch by: Paulo Alcantara <pcacjr@profusion.mobi>



SVN revision: 82658
2013-01-11 19:48:00 +00:00
Cedric BAIL 451abe47f5 efl: only compute font clip when relevant.
SVN revision: 82611
2013-01-11 05:21:54 +00:00
Cedric BAIL 4c64334b9d evas: remove duplicated piece of code.
SVN revision: 82601
2013-01-11 01:52:46 +00:00
Carsten Haitzler ff3a370b9b font draw - dont alloc font props for 32 chrs.. if we are only ever
going to have less than 32.. eg textgrid. 1 per prop.



SVN revision: 81654
2012-12-23 11:02:50 +00:00
Leandro Pereira 274c9159c9 evas: Use refcounted glyph arrays
This is in preparation for threaded render landing: the render thread will
hold a reference to a text object's glyphs while it hasn't been rendered
yet (and will drop that reference after drawing). This changes the internal
API a little bit (evas_common_font_rgba_draw() now takes an Evas_Glyph_Array
instead of an Evas_Text_Props).


SVN revision: 81183
2012-12-17 21:27:07 +00:00
Paulo Alcantara a9bdfcca37 evas/font: Refactor common code for font drawing
This patch refactors common code for font draws - so that it can be used
by other engines and *threaded* X11.

Signed-off-by: Paulo Alcantara <pcacjr@profusion.mobi>

Patch by: Paulo Alcantara <pcacjr@profusion.mobi>



SVN revision: 79853
2012-11-29 20:47:12 +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