Commit Graph

121 Commits

Author SHA1 Message Date
Tom Hacohen 648ad2591c Fix code to conform to recent Eo changes. 2015-02-23 17:16:02 +00:00
Carsten Haitzler 7c5f92d702 evas - render - have lock point to allow for async obj walk + update add
this adds a lock for when walking all the objects to generate render
commands for an async render. this allows even the object tree walk
plus update area caluclation to be moved off into async if every oject
that can change canvas state actually does so correctly. this change
adds all those lock block calls to synchronise with an async object
tree walk.
2015-02-12 11:06:40 +09:00
Jean-Philippe Andre 251389fefd Evas filters: Fix COW usage.
Thanks cedric for the report.
We'll need a new function (after 1.12) to detect if the current
cow pointer is the default data or not. Maybe eina_cow_default_get()
or maybe something just returning a bool.
2014-10-29 15:12:53 +09:00
Jean-Philippe Andre 7db01ea396 Evas filters: Remove useless source_count and cow checks 2014-10-22 14:27:50 +09:00
Jean-Philippe Andre 6935880171 Evas filters: Move filter COW to evas global stuff
It will be shared between TEXT and IMAGE objects.
2014-10-22 11:14:09 +09:00
Jean-Philippe Andre 9364083b44 Evas filters: Use a cow to reduce memory usage of text objects
As pointed out by Cedric, the memory usage of basic evas objects
has increased a lot in recent versions of EFL, in part due
to this excessive use of filters data.

This is a partial fix for ticket 1725.
2014-10-22 11:01:40 +09:00
Tom Hacohen a7560dbc61 Eo: Change eo_add/del/unref behaviour.
Before this change eo_add() used to create an object with 1 ref, and if
the object had a parent, a second ref.
Now, eo_add() always returns an object with 1 ref, and eo_add_ref()
    preserves the old behaviour (for bindings).

eo_unref now un-parents if refcount is 0, and eo_del() is an alias for
eo_unref (will change to be a way to ensure an object is dead and goes
        to zombie-land even if still refed).
2014-09-25 17:38:45 +01:00
Carsten Haitzler 1c82a88d6e evas text - deal with possible null text in layout
fix CID 1039408
2014-08-22 20:14:59 +09:00
Tom Hacohen fe374084ed Efl interfaces: Add text interface and start using it. 2014-08-21 11:02:11 +01:00
Tom Hacohen ceada9523f Efl interfaces: Drop interface namespace from the used interfaces.
We don't need this namespace, it just makes the names long and complicated.
2014-08-21 11:02:11 +01:00
Tom Hacohen bf55348a92 Efl interfaces: Start using the text_properties interface. 2014-08-21 11:02:11 +01:00
Carsten Haitzler 0987f06e6b evas text - fix text object expanding when it gets some unicode in it
the text object walked all text items and took the biggest. when that
big item used some fallback font that didnt match the primary font in
ascent/descent etc. things went wrong - text expanded when not
expected to. this makes text objects just use the primary font
ascent/descent metrics and fixes e titlebar magically expanding thus
compressing window content when not expected.
2014-08-17 22:22:44 +09:00
Tom Hacohen c746d4b181 Evas text: fix text object size with empty texts.
@fix.
2014-08-11 13:33:26 +01:00
Vyacheslav Reutskiy 8ee6e168de evas: mark the evas text object as dirty, when text style is changed.
@fix
2014-07-16 14:30:51 +03:00
Daniel Kolesa 43e2349203 eolian/generator: public api func name deduplication, spank tasn if it breaks 2014-06-20 17:09:03 +01:00
Jean-Philippe Andre c99449ea09 Evas filters: Allow use of a color multiplier
We couldn't do evas_object_color_set() on a filtered text
object simply because the color was not properly taken into
account.

This should simplify some effects as it'll be much easier to
set a color or alpha value to the text regardless of the filter.

Hmm, is this a fix or feature? O_o
2014-06-12 10:59:56 +09:00
Tom Hacohen 0fc3279db9 Efl: Update code to use the new class names generated by eolian. 2014-06-03 11:28:01 +01:00
Youngbok Shin bc70a1bd84 evas/text: fix abnormal ellipsis logic when harfbuzz is enabled.
Summary:
text_props.len indicates visual length from harfbuzz logic when it is available.
But, input pram "idx" is logical length. So, ellipsis works abnormally in some case.
@fix

Test Plan: D870

Reviewers: tasn, woohyun

CC: cedric, herdsman

Differential Revision: https://phab.enlightenment.org/D871
2014-05-21 10:41:29 +01:00
ChunEon Park c399017cef evas - removed unncessary header include
it's already done in evas_common_private.h. no need it in each file.
2014-04-29 15:44:29 +09:00
Jean-Philippe Andre 59cf013db9 Evas filters: Add support for Evas_Object_Image
This adds filter support to Image objects as well.
The exact same filters can run on Text and on Images
(provided some colorspace limitations are respected).

This basically adds:
- Support for RGBA input buffer
- Eo entry points for Image filter support
- Implement basic filter support in Evas_Image
2014-04-27 17:41:40 +09:00
Tom Hacohen 35525a53e0 Adjust eo_do calls to work with the eo2 api. 2014-04-10 04:20:21 +01:00
Jean-Philippe Andre b027e58a96 Evas filters: fix potential memory leak
Unlikely use case trying to delete a source when there are no
sources yet.

@fix
2014-03-21 15:23:02 +09:00
Daniel Zaoui 6fd341a449 Eolian: Fix ctor/dtor generation 2014-03-19 07:04:28 +02:00
Youngbok Shin 7a4b65c735 evas/text: fix the issue that size of evas text object be shorten repeatly when ellipsis is shown.
Summary:
When the text was shorten by ellipsis, object size was fit to the text width.
If new text was set to the object, the text calculated with the smaller size.
It made shorten the object size when the text is set repeatly.
If the text is cutted off with ellipsis, it means there is no need to
resize the object.

Test Plan: elementary_test -> FileSelector Entry -> Click "Toggle Folder Only mode" button repeatly.

Reviewers: woohyun, tasn, raster, so.penible.animation, Hermet

Reviewed By: raster

CC: cedric, herdsman

Differential Revision: https://phab.enlightenment.org/D636
2014-03-17 19:29:17 +09:00
Daniel Zaoui 9b8f036beb Eolian: Integration of Evas Text 2014-03-09 13:18:57 +02:00
Jean-Philippe Andre 688c9c3676 Evas filters: Minor change (type is void*) 2014-03-07 10:39:55 +09:00
Jean-Philippe Andre 8ddfa35da6 Evas filters: Add return value in filter callback
This will inform the client whether an asynchronous filter properly
rendered or not.

I actually don't know any case where rendering can fail at runtime.
2014-03-04 15:17:11 +09:00
Jean-Philippe Andre 63a18f3fce Evas filters: Fix errors in Evas_Object::destructor
Remove invalid call to source_unset and call the appropriate
Eo evas_obj_text_filter_source_set in case of Evas_Text with
proxy sources.
2014-03-04 14:17:25 +09:00
Jean-Philippe Andre 993bd965ed Evas filters: Fix a typo (wrong value checked)
This was all a bad copy and paste :)
2014-03-04 11:52:53 +09:00
Jean-Philippe Andre e05885e0e3 Evas filters: Fallback to normal rendering in case of error
If the filters fail to render at runtime (that is, parsing went fine
but a command failed to run properly), fallback to normal rendering.
This should prevent text from disappearing when using proxies and
the OpenGL engine (for now).
2014-03-04 10:37:34 +09:00
Jean-Philippe ANDRE 83746e5629 Evas filters: fix black squares with the GL engine
If a text object changes regularily, there might be cases where
the object will be rendered as a simple black rectangle for just
one frame.

It seems that the previous output buffer is deleted before being
actually rendered on screen. This patch will delay the deletion
of the previous buffer until the current one has been rendered
to the target surface.

And again, thanks zmike for reporting.

@fix

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2014-03-04 10:37:19 +09:00
Jean-Philippe Andre 56d73cb897 Evas filters: Fix warnings on shadowed variables
Also, remove globals A, R, G, B from parser.c... these are
temp variables used in a macro.

My CFLAGS didn't include -Wshadow so I missed those.
Thanks Tom for spotting :)
2014-02-12 10:36:11 +09:00
Carsten Haitzler 131fc99e79 evas text filter - fix va_arg usage to not cause compiler internal errs 2014-02-08 14:26:50 +09:00
Jean-Philippe Andre 637416d62e Evas filters: Allow calling program_set and source_set in any order
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).
2014-02-07 17:59:18 +09:00
Jean-Philippe Andre 9d821a402a Evas filters: Fix proxy usage (source unset)
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.
2014-02-07 17:33:18 +09:00
Jean-Philippe Andre e112d49e0b Evas filters: Check that program code changes before updating
Save the code and compare with the new one. This way we can
safely call program_set from the edje_calc functions.
2014-02-07 17:33:18 +09:00
Jean-Philippe Andre 28d469237b Evas filters: Avoid adding multiple sources under the same name 2014-02-07 17:33:18 +09:00
Jean-Philippe Andre 8570b38dd1 Evas filters: Rename bind to source_set
Because that's what we call it for proxy images :)
2014-02-07 17:33:18 +09:00
Jean-Philippe Andre 2e401c2e91 Evas filters: Allocate buffer in the main loop (part 2)
Now the allocation is really done in the main loop.
Rendering fails, only happens in case of redraw.
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre eea049f988 Evas filters: Alloc/Dealloc buffers from the main loop only
This is a problem I didn't spot immediately... but with
tons of nasty consequences.
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre 8062df320c Evas filters: OpenGL support part 2.
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).
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre f007cd5665 Evas filters: Move font draw inside the filters functions
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.
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre 0135b45c12 Evas filters: OpenGL support part 1.
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].
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre b54eb40006 Evas filters: Optimize Text redraw with filters
Fix case when a proxy source has changed: need to fully render
the effect again.
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre 12ddad2867 Evas filters: Reuse output buffer in Text object
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.
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre 9623e1f238 Evas filters: Pass fillmode to the filters
I just need to actually implement them, now :)
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre f723d8af8f Evas filters: Fix automatic buffers with Evas_Object_Text 2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 22b8377255 Evas filters: Rename Text's special_effect into filter_chain
For consistency with Textblock.
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre a5abbf784e Evas filters: Add basic support for clip in blend
Right now, clip is used only when blending RGBA surfaces.
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 0450e027e7 Evas filters: Add Eo APIs and some comments
The entry points on evas text are there!
2014-02-07 17:33:16 +09:00