So, the (font) effects will be described by a string. It's
basically a new language (yeah yeah sorry), VERY simple, based
on function calls a la Python, with sequential and named arguments.
This string is intended to be passed directly to an evas text object
and embedded into the evas textblock's markup tags.
This file implements both the basic parsing functions, the
compilation of instructions into a queue of commands, and the glue
code for the rest of the filter infrastructure.
These bump maps implement two light effects at once:
- 3D Shadows
- Specular lights
The specular light is activated by a flag.
Another flag enables compensation for darkening/whitening of
horizontal surfaces.
NOTE: This implementation is VERY SLOW.
It uses double values and divisions all over the place.
It might be possible to optimize by computing two LUTs before
running the algorithm.
Displacement maps are a simple but powerful tool to move pixels
around in a buffer, based on a displacement map (image).
Currently, various modes are implemented:
- X, Y or XY displacement
- Alpha map or RGBA map where R and G only are used
An intensity parameter is given as well.
Some of these might not be useful, we can just strip them off when
the final API is decided.
Color curves are a very simple tool to alter the colors of an image,
on a per-pixel basis. This implementation will simply map each pixel
to a 256 bytes buffer, provided by the application.
NOTE: There are no convenience functions yet for easy curve
generation, but this is the plan (give point A, B, B and interpolate
between them to generate the 256 values array).
Currently supported:
- Box blur for Alpha and RGBA
- Gaussian blur for Alpha and RGBA
Motion blur is not implemented.
These effects are SLOW. Gaussian blur is based on a true gaussian
curve for small radii, or a sine-based approximation.
The true gaussian might need to be removed for consistency, since
it gives slightly different results from the sine one (less blur).
It is not possible to mix Alpha and RGBA surfaces in this filter.
These functions differ from normal blending as they will use
a mask on top of input and output buffers.
So, basically they blend input+mask into a third buffer output.
If output is RGBA then mask or input MUST be RGBA.
evas_filter.c contains the entry points for the evas filters subsystem,
in particular, the filter API, the (yet very basic) buffer management
system, the command queue and main context handling functions.
Right now, the Evas engine is left untouched, so these implementations
will work ONLY in the software engine.
NOTE: This will not compile on its own (thus, not added to Makefile.am),
as it will require the filter implementations to be linked.
Evas is an RGBA only engine, BUT we also use some alpha masks,
especially in the font rendering pipeline.
This commit adds basic support for alpha buffer operations
(blend and copy).
RGBA_Image can then point to either alpha-only data, if
its colorspace is grey.
Summary:
When input string has non-finished markup tags or escaped tags,
eina_strbuf_append_length is called with Null string.
There is a Null checking in eina_strbuf_* API, but it will print error message when input string is Null.
Strictly speaking, *_markup_to_utf8 API could be used with any kind of input string.
So, we need to add Null checking for removing the useless error message.
Test Plan:
Call the API like the following code.
evas_textblock_text_markup_to_utf8(NULL, "test_text&&&&");
ERR message will be printed.
Reviewers: woohyun, tasn, seoz, Hermet, hbr4570
CC: cedric
Differential Revision: https://phab.enlightenment.org/D493
This is a long awaited feature that has been requested years ago.
Fontconfig finally added the support needed to make it happen, so here
it is.
I added a fontconfig query to look for similar fonts in case we loaded a
font from eet/edje/file(no fontconfig). This now works quite well.
Still missing: if you load a bold/italic/whatever font directly (set the file)
without putting ":weight=bold" you will not get run-time emboldenment if
only non-bold fonts are found.
This unfortunately depends on very recent fontconfig version (#ifed out
when unavailable), so only people with fontconfig >= 2.11 will enjoy
this feature.
warning: argument 'above' of command @param is not found in the argument list of edje_edit_part_restack_part_above(Evas_Object *obj, const char *part, const char *below)
This doesn't work nicely, as for some reason fontconfig doesn't work
nicely with ':spacing=mono' without a font name.
Doesn't work with fc-match either. It does work with fc-list, but that's
not what we'd like to use. It could be just an issue with my local
fontconfig configuration.
This fixes T865 although the problem is now with freetype.
This is a regression introduced in
548e548632.
This is really bad, and essentially broke selection geometry for bidi
text. Very serious.
The problematic code assumed that the range comparison for the items
assumed the item marked with 1 is always logically before the item marked
with 2, which is just not true.
So I have a weird crash in terminology.
Reproduction path:
eet -x /path/to/elm/theme/default.edj edje/images/537
Scroll back in the terminal buffer, to show the entire file: CRASH.
Reviewers: cedric, tasn
CC: cedric, raster
Differential Revision: https://phab.enlightenment.org/D468
Signed-off-by: Cedric BAIL <cedric.bail@samsung.com>
Summary:
delete_cb is called at thread exit for each Eina_TLS keys used by the thread
Details:
posix:
pthread_key_create(key, delete_cb); does it
win32/wince:
eina_tls_free/new un/registers key&&cb into a static eina_list.
eina_tls_set add the key to an eina_list in Eina_Thread_Win3.
this list is cleared and callbacks are called in _eina_thread_join()
Test Plan: win32/wince has to be tested, I have no setup to do it.
Reviewers: cedric
CC: cedric
Differential Revision: https://phab.enlightenment.org/D489
An invalid optimization was implemented in proxy rendering.
We can't assume a proxy is a smart object.
Refer to 5cefa00d0a.
Fixes T832.
Proxy rendering is still broken when using cserve2... :(
apparently I read the commit order wrong and this fix went in for 1.4.0, not 1.3.2, which means anyone who has 1.3.2 has been having lots of fun crashes for the past 24 hours
This function does the following operation:
COPY pixel x mask --> dst
But it wasn't iterating over the source. So it was repeating
the value of the first pixel over and over again.
Is this even used anywhere? RGBA + alpha mask function!?
this was a fixme which was likely written sometime before July 2010 when the bug was fixed, just prior to the 1.3.1 release. I think it's probably okay to require that release since it's been 3+ years.
This reverts commit f8b0322704.
this breaks efreets icon cache. i have been noticing this since
yesterday across all my machines once i update just efl. i tracked it
down to this commit.
Summary:
When processing random data result of this function differs from C variant in more than 50% cases.
This difference is due to alpha calculation, in C code :
a = 256 - (c >> 24)
in NEON:
"vmvn.u8 q7,q6 \n\t"
// ie (8 bit)~(c>>24) === 255 - (c>>24)
We cant just add "1" as overflow will occur in case (c>>24) == 0 (we use only 8 bit per channel in vector registers)
So here is the solution:
copy *d right before multiplication and add it to the result of it later.
This makes the function slower by 20-30% but it is still at least 2 times faster then C code.
Reviewers: raster
Differential Revision: https://phab.enlightenment.org/D455
The code was giving enough memory to store doubles and longs, but they
could be unaligned as "unsigned char" allows 1-byte alignment, while
double may require 8 bytes.
By specifying the array as "long long" we force certain alignment in a
platform independent way. As this array is small enough and
short-lived, the number of items were not changed, this results in
more bytes on the stack but it shouldn't matter.
Summary:
When user paste text to elm_entry, _edje_entry_user_insert is called.
We need to reset a prediction buffer just like _edje_entry_text_markup_insert.
Reviewers: seoz, Hermet, woohyun, tasn, jihoon, raster
Reviewed By: raster
CC: cedric
Differential Revision: https://phab.enlightenment.org/D461
I do think that it was a left over from previous file format. Removing
this memcpy should make Enlightenment startup faster and should reduce
by 500KB the memory it use.
It is sometime useful to start from a defined buffer, but to not touch it
until needed. This make life of caller more easier as they don't need to
duplicate the buffer themself as Eina will now take care of that.
Summary:
"_edje_entry_imf_event_delete_surrounding_cb" changes text of entry.
When the callback function is called and the entry is changed,
we need to notice to applications that the entry is changed.
Reviewers: seoz, Hermet, tasn, woohyun, jihoon, raster
Reviewed By: raster
CC: cedric
Differential Revision: https://phab.enlightenment.org/D460
Summary:
If ONE single item in the whole textblock has a padding of k,
then ALL the lines of the textblock will be padded by k pixels.
Here's a solution to add the padding only to the first line.
Test Plan:
Write any multiline text, without styles, in an entry.
Add some glow to one element. All lines should be spaced by
an extra 2 pixels.
Reviewers: tasn
CC: cedric
Differential Revision: https://phab.enlightenment.org/D442
Track padding per paragraph, since this is how it is computed.
Problem before this patch:
- If markup text is changed, padding may grow, and the layout is updated (good)
- If the UI itself needs a relayout, the old padding value is NOT reused,
so style paddings will reset the padding to 0.
Test protocol:
- Set some text with style=glow. The whole object should have padding 2,2,2,2
- Relayout the UI, the whole object will have padding 0,0,0,0 (should be 2,2,2,2)
Summary:
If the property was successfully fetched the number of items stored in
val is returned, otherwise -1 is returned.
Note: Return value 0 means that the property exists but has no elements.
Reviewers: seoz
Reviewed By: seoz
CC: cedric
Differential Revision: https://phab.enlightenment.org/D457
Fix race condition when touching/changing a (theme) file often.
An Eio_Monitor was marked as "delete_me" but the rename callback
was still called, leading to memory access to already freed
objects.
Test protocol was:
ELM_THEME=~/default.edj elementary_test &
watch touch ~/default.edj
If a file had changed, a new OPEN message was sent, and the
client image ID was then changed, but the LOAD message was
sent with the previous image ID. So cserve2 would not be
able to honor that request.
When an image file is changed, it is discarded from cserve2,
so the references become invalid. In case we were loading a
scaled version of that image, no proper error checking was
done, leading to obvious crashes.
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.