valign handling was really broken. this fixes it to pretty much work
again. ie 0.0 == top, 0.5 == centered, 1.0 == bottom align and -1.0
== baseline. only baseline worked before.
Well, proxy sources are rendered to a... GL texture! But we
actually want the image pixels. So we'll need to call glReadPixels
to get them.
Yes, it will be horribly slow. But there isn't really a way around.
This will require a new internal API. For now, just disable the
feature. Hopefully I can make it work soon enough for the release?
If source_set was called after program_set, then parsing would fail.
It used to work because the program was re-parsed at source_set.
Now, save the code, mark the filter as changed, and reparse again
if the source changed (keep track of invalid programs to avoid
excessive parsing).
In async mode, the filter runs in the render thread, so can't
allocate buffers on the fly.
This case should not happen, unless maybe a source has a null
size (eg. it's invisible and not properly rendered).
Proxy sources & objects were not properly unset.
This results either in crashes (especially in the Edje tests)
or dangling objects with tons of references.
Remove the refcount increase/decrease, as it is redundant.
Store pairs proxy+source instead of just the source in all hashes,
so we can unset the is_proxy flag on the proxy when there are no
sources anymore.
Remove compilation warnings: we don't really need cubic
interpolation at this point, we can still add it back
later if wanted.
Also, make it clear that buffer #2 is the output buffer.
Remove meaningless FIXME.
Use the mapped rendering to implement repeat and stretch
with rgba to alpha buffers blending.
If stretch is required, it will add one more (expensive)
scaling step.
This patch implements the final draw from RGBA_Image to the
OpenGL surface. We can even steal the output buffer and
redraw it quickly, without having to re-render everything
(same as in SW).
Since the filters will have to decide on which engine (SW, GL) to
choose from to render the font and the effects, move the font
draw call inside the filters module.
Quick and dirty solution to support the OpenGL engine:
[1] Allocate CPU buffers
[2] Render text and process all effects to these buffers
[3] Push final image as an OpenGL texture.
This patch implements [1].
Well, raster did some great job at optimizing font draw... but only
to RGBA32 targets. In this font effects case, we also want to render
text on ALPHA buffers.
For now, reuse the existing alpha blending & glyph decompress
functions. It's MUCH easier, and works. Definitely slower than
decompressing on-the-fly and optimizing everything. But for now,
this will not even be the performance bottleneck in an effect
(blur will be a lot slower).
It is not possible to logically handle padding and offset at the same
time for a proper mirror effect, unless this is handled directly at the
transformation level.
Also, add support for blend() operation padding computation.
This is the simplest solution I can come up with for "mirror" effects.
Displacement maps are HARD to generate and use properly, since the buffer
size is unknown until runtime.
Even if we align the map to the text itself (using the padding information),
it's still hard to describe properly how to apply the displacement map, and
to generate it... So let's just add a simple flip operation.
The displacement effect is way too complicated. Let's keep it
simple and have only one displacement map format (RG + Alpha).
Here's what's missing now:
- Alpha support, to blend in the input with a variable intensity
- Extra padding (see below)
Also, the intensity VS. map values are not perfectly defined yet.
Problems: How to create a complete mirror effect (map needs to go
over boundaries... add extra padding to the buffers).
This is the first possible optimization: save the rendered
text (since we already have the output buffer anyways), and
reuse it if the text + filter didn't change.
Add parameters l, r, t, b to clip the fill area.
While l=x and t=y, the width and height of the clip are determined
at filter run-time, since we don't know the buffer size before.
Brutal method for now: allocate YET ANOTHER buffer,
render scaled image to it (smooth scaling, oh yeah),
use this as a new mask.
For now, supports:
Alpha Input, RGBA mask, RGBA output, X,Y,XY stretching
Syntax was: buffer(name=bla,alpha=bool);
Changed to: buffer:bla(alpha);
There's a semicolon between buffer and its name because ALL whitespaces
are discarded. This might prove useful sometime in the future, so let's
keep it this way for now :)
Padding was brutally calculated by suming ALL the filters'
individual paddings. Now we try to be a bit smarter and propagate
the padding between buffers in the filter chain.
If the buffer is smaller than the blur kernel, then artifacts appear
and CRASHES happen because we read/write out of the buffer bounds.
Output buffer must be larger than the kernel diameter.
Input buffer's size is used to reduce the blurring effect on the edges.
malloc() and mmap() don't return empty buffers, so blending on top
will present tons of artifacts.
Visible mostly on very small buffers as they are malloc()'ed from
previously used memory segments.
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.
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.