Commit Graph

101 Commits

Author SHA1 Message Date
Jean-Philippe Andre 21984b1d58 Evas masking: Add some test cases
Here are only 3 very basic test cases.

One is a dumb set/get to check that image objects can
be passed as clippers.

The other one is a pixel verification test with extremely
basic data (NEAREST scaling and just rectangles). It also
compares text clipping and masking.

The last one performs a very basic verification that masks
of masks work.
2015-01-07 15:06:03 +09:00
Jean-Philippe Andre a86f799542 tests: Remove file after Evas 3D save test
This should remove src/.eet and maybe src/.ply

make distcheck would fail on my machine because src/.eet
was not removed.
2015-01-07 15:05:04 +09:00
Cedric BAIL 21707789d7 evas: check for grayscale png and jpeg. 2014-12-28 22:14:05 +01:00
Bogdan Devichev c471665ac8 evas: make Evas 3d mesh is inherited from Efl.File (functions file_set and save) 2014-12-23 21:20:21 +01:00
Bogdan Devichev dd60525798 evas: a _mmap version of the file_set is added. 2014-12-23 21:20:21 +01:00
Bogdan Devichev 4acbae6947 evas: test cases are changed according to changes of API in step 4. Specific logic in obj_saver is removed for standardization of API. 2014-12-23 21:16:19 +01:00
Thiep Ha c30303d7e8 edje entry: improve selection performance
Summary:
The selection performance is slow if we select large chunk of text.
This is caused by many rectangles created and deleted.
This patch provides a way to improve it by combine selection rectangles
of line in middle into one rectangles (i.e, if we have N lines,
the selection rectangle for lines 2 to N-1 will be combined into one.)

@feature

Reviewers: raster, cedric, tasn

Subscribers: herdsman, woohyun, cedric

Differential Revision: https://phab.enlightenment.org/D1508
2014-11-26 11:29:09 +00:00
Thiep Ha e9a40835f2 textblock: correct text position for RTL text with margins
Summary:
If a RTL textblock has right margin, text is wrongly placed
(right margin is moved to left).
This patch fixes this issue.
Test cases are also added to test text position with margins.

@fix

Reviewers: tasn, herdsman

Subscribers: woohyun, cedric

Differential Revision: https://phab.enlightenment.org/D1691
2014-11-26 10:18:49 +02:00
Bogdan Devichev d896dfb342 evas: Evas_3D - add .ply export/import.
Summary:
.ply format is important for relation blender and EFl, because in blender exist only two mesh export API: bpy.ops.import_mesh.ply and bpy.ops.import_mesh.stl. One of them is necessary for .edc 3D generator. Which I writing now.
Sorry, it isn't like image loader. Refactoring of import/export will be soon.

Reviewers: Oleksander, artem.popov, Hermet, raster, cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2014-11-14 07:11:15 +01:00
Cedric BAIL 5c8a8a51ce evas: tests only for extension compiled in. 2014-10-22 14:15:32 +02:00
Cedric BAIL f7e07b4914 evas: tests more file format loader.
NOTE: It seems that the xpm one is broken. If somebody could give it
a better look and check if it work for him or not, before opening a bug
in phab.
2014-10-21 23:42:03 +02:00
Daniel Zaoui 31f2e6e88a Evas-3D Tests: fix Eo usage.
There are still Valgrind (invalid read) issues but at least, it doesn't
segfault more.
2014-10-21 11:09:51 +03:00
Bogdan Devichev 5d004c80f7 evas: Evas_3D - add .eet export/import
Summary: The first version of .eet format is added. All changes due to discussion in D1307 are done.

Reviewers: artem.popov, se.osadchy, reutskiy.v.v, Hermet, raster, cedric, Oleksander

@feature

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2014-10-06 16:47:25 +02:00
Cedric BAIL 308f000b39 evas: tests tgv file decoding. 2014-10-02 16:52:30 +02:00
Thiep Ha dee98ea248 evas textblock: return text direction for under cursor in cursor geometry get
Summary:
Currently, in cursor geometry get function, the text direction is not
returned if cursor is under cursor.
This patch fixs it by returning text direction for under cursor.

@fix

Reviewers: tasn

Subscribers: herdsman, cedric

Differential Revision: https://phab.enlightenment.org/D1505
2014-10-02 08:36:35 +01:00
Daniel Hirt fae337469e Evas Textblock: Fix native width of BiDi text
Summary:
This fixes an issue that causes BiDi text to get wrapped even when
resizing the textblock to its native size.
The way we find the last visual item in the native line is wrong. The
'visual_pos' describes the visual position in the formatted layout, in
which wrapping may occur. So, this is really bad to use it for native
width calculations as well.
Also, there's no need to actually reorder the line - we just need the
last visual item.
This adds and uses a function very similar to _layout_line_reorder, in
which we retrieve the last visual item in the native line. This
function does not do any actual reordering, as the native layout is
disposed of after calculation is done.

Also, added GET_ITEM_LEN macro for convenience.

Fixes T1532

@fix

Test Plan: Added to evas textblock test suite in this patch

Reviewers: tasn

Subscribers: id213sin, JackDanielZ, cedric

Maniphest Tasks: T1532

Differential Revision: https://phab.enlightenment.org/D1353
2014-10-01 16:45:58 +01:00
Daniel Hirt a4d716d1c0 Evas Textblock: Fix bad empty line add on wrapping
Summary:
In some cases of char or word wrapping, an empty line might be
accidentally added at the end of the paragraph. That line contains
no items. Of course, this line should not exist.
One outcome of this is that it causes wrong height values of the
paragraph, when the finalizing code uses the
_layout_last_line_max_descent_adjust_calc, which in turn
looks at that empty line to calculate the descent values.

@fix

Test Plan: Char-wrap and word-wrap tests to test suite included in this revision.

Reviewers: tasn

Subscribers: JackDanielZ, cedric

Projects: #efl

Differential Revision: https://phab.enlightenment.org/D1444
2014-09-26 13:20:14 +01:00
Jean-Philippe ANDRE e096a3490b Evas filters: Fix parsing of argument lists
Make check would even fail on 32bit machines because of that:
Lua tables are not arrays and lua_next doesn't ensure the order
of the elements as I wrongly assumed.

@fix
Fixes T1615
2014-09-19 10:33:24 +09:00
Youngbok Shin 15281561e5 evas textblock: fixed ellipsis character cut off issue with complex markup text.
Summary:
Evas Textblock ellipsis is handled in a item.
When the ellipsis item is added in the text, some characters are cut off
considering width of ellipsis character.
But, it is handled in only one text item.
If there are many short text item, the ellipsis item can be cut off visually.
And there was a bug in the patch when text is displayed in two lines or more.
The bug is also fixed.

Fixes Phab ticket T1213

@fix

Test Plan: This commit includes test case.

Reviewers: woohyun, seoz, sohyun, tasn, raster

Subscribers: cedric, herdsman

Differential Revision: https://phab.enlightenment.org/D1360
2014-09-02 11:47:36 +01:00
Tom Hacohen 4f3ab0db34 Evas textblock: Add a test for multiline ellipsis.
This tests that even with multiline ellipsis, the ellipsis in the second
line is not overdone (i.e it only does ellipsis as needed).

This is a test for something we found out when we applied D1311 (for T1213).
2014-08-20 16:19:44 +01:00
Tom Hacohen 841191d907 Evas textblock: Fix BiDi text cut-off at the edges.
This patch fixes an issue causing text to be cut off in some cases.
The problem was that we were calculating line width and alignment before
we did any bidi calculations, which in turn caused us to use the wrong
text items for those calculations.

Many thanks to Daniel Hirt for investigating this deeply, finding all
the nitty-gritty and generally pointing me to where the problem is.
Daniel also provided the test case.
His patch (D1291) was close, but not enough.

Fixes T1496

@Fix
2014-08-20 15:10:23 +01:00
Carsten Haitzler 9a91261a4e Revert "evas textblock: fixed ellipsis character cut off issue with complex markup text."
This reverts commit d408408283.

this breaks mult-line "long" filenames in efm. 2nd line is just ...
for almost all of them (ones that are actually in need of 3 or more
lines). break break! REVERT!
2014-08-20 12:03:14 +09:00
Youngbok Shin d408408283 evas textblock: fixed ellipsis character cut off issue with complex markup text.
Summary:
Evas Textblock ellipsis is handled in a item.
When the ellipsis item is added in the text, some characters are cut off
considering width of ellipsis character.
But, it is handled in only one text item.
If there are many short text item, the ellipsis item can be cut off visually.

Fixes Phab ticket T1213

@fix

Test Plan: This commit includes test case.

Reviewers: woohyun, seoz, sohyun, tasn

Subscribers: herdsman, cedric

Differential Revision: https://phab.enlightenment.org/D1311
2014-08-19 15:20:35 +01:00
Youngbok Shin 7a87f322f4 textblock: Update visual_pos before calling _size_native_calc_line_finalize.
Summary:
In items loop of _size_native_calc_line_finalize,
last_it should be replaced with new item according to position.
But, visual_pos is not prepared and it is always zero in the function.
So, we need to update visual_pos.
And when textblock only has LTR text,
we can replace last_it according to item list sequence.
@fix

Test Plan:
It includes test cases using the following test case.
 1. "i<b>。</b>"
 2. "。<b>i</b>"

Reviewers: seoz, woohyun, sohyun, tasn

Subscribers: raster, herdsman, cedric

Differential Revision: https://phab.enlightenment.org/D859
2014-08-06 10:40:02 +01:00
Youngbok Shin 1984961ba6 evas/textblock: fix to keep original format when a markup tag is matched to a style tag.
Summary:
We can define a style tag as opener, closer and own closer.
If there is a markup tag that is matched to style tag,
it is reprocessed to format node inside of textblock.
But, when the format node will be converted to markup text,
'/' character can be appended to text at closer and own closer style tag.
Even if original markup tag does not has '/' character,
it will be appended according to format node information.

It makes some issue when compare input text with output text.
@fix

Test Plan: This commit includes test case.

Reviewers: woohyun, raster, sohyun, tasn

Subscribers: herdsman, cedric

Differential Revision: https://phab.enlightenment.org/D1037
2014-08-05 10:26:05 +01:00
Wonguk 3a0e0df84a evas tests: remove TODO comment already done 2014-08-04 17:15:54 +02:00
Thiep Ha 104f04eda1 Evas textblock: Correct word start/end moving at new line or line begins with spaces
Summary:
Word start/end works incorrectly when it goes to new line or line begins with spaces.
Ex: In elementary_test/Entry, place cursor at the end of line, press ctrl + right arrow keys: cursor moves to begin of next line. In this case, cursor should move to end of 1st word in next line.
Ex2: In elementary_test/Entry, add some spaces to begin of 2nd line ("   uses markup"), place cursor at the first word ("uses"), press ctrl + left arrow keys twice, cursor moves to begin of 2nd line. In this case, cursor should move to begin of last word in 1st line.

This patch provides a fix by considerring next/previous text node to move cursor to correct place.

@fix

Reviewers: woohyun, raster, tasn

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1140
2014-08-04 11:01:51 +01:00
Wonguk Jeong 23815453f4 evas: jpeg loader - add tests for EXIF flip, transpose, transverse.
Summary:
Previously, there was rotation test only. (90 CW, 180 CW, 90 CCW)
Flip vertically, flip horizontally, transpose, transverse tests are added

D1126 will make added tests be passed.

Reviewers: raster, cedric, jpeg

CC: seoz, cedric

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

Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
2014-07-06 20:12:31 +02:00
Wonguk Jeong 573f477272 jpeg laoder: exif orientation test added
Summary:
currently, normal orientation tests are only added.
I'm going to add flipped orientation tests as well after I put related code in jpeg loader (currently it's not supported)

Reviewers: raster, cedric, jpeg

CC: seoz, cedric

Differential Revision: https://phab.enlightenment.org/D1098
2014-06-29 13:04:16 +02:00
Daniel Hirt 2b40860f78 Evas/Textblock: Introduce PS deletion bug test and fix
Summary:
This test should make the test suite fail. It sets "a<ps>b" and
"a<ps/>b" markups, and deletes the PS format. Essentially, these two
different markups should have the same result by this deletion. Instead,
only the <ps/> format gets deleted properly.
A follow-up commit is added with this as a fix.

Evas/Textblock: fix deletion of PS bug

Fixes an issue with deletion of "<ps>". Format deletion was only
performed for formats that are own-closers. This sets the paragraph
separator to be an own-closer format.

@fix

Reviewers: tasn

Reviewed By: tasn

CC: JackDanielZ, id213sin

Differential Revision: https://phab.enlightenment.org/D1046
2014-06-17 11:11:33 +01:00
Youngbok Shin 3e81b73aa8 evas/tests - textblock: add a test case for item format with ellipsis.
Summary:
When item format is cutoff by ellipsis, *_cursor_format_item_geometry_get API
should be failed at the item position.
But, it can be success and returns abnormal geometry.

Reviewers: woohyun, tasn

CC: cedric, herdsman

Differential Revision: https://phab.enlightenment.org/D974
2014-06-10 15:17:41 +01:00
Tom Hacohen 3b70b4f28f Evas textblock: Fix crash when cutting ligatures with formats.
"f<color=#f00>i</color>f" could cause textblock to crash. It doesn't
crash anymore. It doesn't render the colours correctly either, but at
least this is the first step.

This is the start of fixing T1308

@bugfix
2014-06-04 10:14:24 +01:00
Daniel Hirt 177135ff0d Evas/Textblock: add support for ellipsis values
Summary:
This enables textblock to support more values other than 1.0.
For 0 <= ellipsis < 1.0, it splits the text such that it fits the
textblock's width. The ellipsis is relatively position according to the
ellipsis value, and characters are removed also relatively.
For example, a value of 0.5 will position the ellipsis right in the
center of the textblock's width, while removing characters equally right
and left from the center.

Basic approach to this feature was to do some work before the layout
process. We calculate the expected total width of the items, and by how
much we exceed from the textblock's width. Afterwards is it just some
careful work to set the boundaries of the width we want to cut, and
deciding which characters we need to removed to fulfill this requirement.
The rest is splitting the text and visually-removing the part we
need to cut.
This is all handled before any logical lines are created, so the
_layout_par function remains almost intact. A designated _ellip_prev_it
field in the Paragraph struct instructs after which item we place the
ellipsis item, if at all.

Note that we keep the fast path for ellipsis 1.0, as heavier work needs
to be done for the other values.

Added tests to evas_suite for a range of ellipsis values.

Also, multiline is unsupported at the moment.
@feature

Test Plan: Anything that uses Evas Textblock (single-line, please)

Reviewers: tasn, id213sin, raster

CC: cedric, JackDanielZ, raster

Differential Revision: https://phab.enlightenment.org/D905
2014-05-29 15:52:01 +01:00
Youngbok Shin e4158510bd evas/text: add text ellipsis test case for ligatures special case.
Summary:
Some fonts has combination information for "ff".
When harfbuzz is enabled with the font, evas text ellipsis logic can be broken.

Reviewers: tasn, woohyun, cedric

Reviewed By: tasn

CC: cedric, herdsman

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

Some comment/commit message improvements by TAsn.
2014-05-21 10:41:29 +01:00
Jean-Philippe Andre 7a6943ad1e Evas test: Update filters tests (Lua) - part 2
Rendering & padding tests
2014-05-09 16:57:39 +09:00
Jean-Philippe Andre 4c4d65c388 Evas test: Update filters test (Lua) - part 1 2014-05-09 16:57:39 +09:00
Jean-Philippe Andre 1a43bb565c tests: Disable the evas filters test suite for now
Yes, it's a bad move. But I'd rather avoid breaking make check
for now until I have a proper test suite.

The script language has been changed to Lua, and so its
limitations and syntax are not the same. Remember this is a beta
API so it shouldn't even be exposed to normal apps.
2014-04-27 17:41:40 +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
Daniel Zaoui dbe02d593e Tests: fix annoying warning.
The function is not used so I commented it, in case it has to be used
later.
2014-04-27 11:05:03 +03:00
Tom Hacohen 30506b9025 Revert "tests: Add a case for ellipsis in complex markup text."
Opened a task (1151) for it and should revert this when ready to fix.

This reverts commit 9128ac82a0.
2014-04-03 11:52:00 +01:00
Youngbok Shin 9128ac82a0 tests: Add a case for ellipsis in complex markup text.
Summary: Evas textblock can't cut off text properly when it has separated items.

Reviewers: tasn, woohyun, raster

Reviewed By: raster

CC: cedric, herdsman

Differential Revision: https://phab.enlightenment.org/D667
2014-04-02 15:57:17 +09:00
Cedric BAIL 52a36461b8 evas: add infrastructure and basic tests for loading image. 2014-04-01 22:00:14 +09:00
Jean-Philippe Andre 0a6d2e6b29 tests: Add case for filters' padding_set
Test that the padding is correct and the instruction is valid.
2014-03-26 10:48:12 +09:00
Tom Hacohen aad13a286f Evas text: Make tests more lax so they'll work on Ubuntu.
It seems that a different version of freetype is causing some different
values to be calculated for some glyphs. Also, we consider the whole
font list when calculating max ascent/descent, so there will always be
differences there.

This commit just laxes the tests, requiring the values to be at least
the values we expect from our font.

Fixes T1079
2014-03-18 15:02:13 +00:00
Tom Hacohen d175b8aa69 Evas textblock: Fix clipping issues with some texts with width > advance.
This happens with many texts. The issue occurs when the width of the
last char is larger than it's advance. Before this patch, we didn't the
width into account when calculating width, thus causing clipping issues
in some cases.
2014-03-10 14:58:18 +00:00
Jean-Philippe Andre 2fe5656b63 Evas filters: Improve test coverage of the filters
LCOV reports > 80% of coverage in evas/filters.
2014-02-20 13:27:43 +09:00
Jean-Philippe Andre 18a7939f41 Evas filters: Add render test cases with pixel verification
Force render into an Ecore_Evas, and check that the pixels
are valid:
- Not all transparent (can't really happen)
- Not all black (since there's a black rect behind the text)
- All valid premultiplied values (A >= R,G,B)

Yes, it's a bit slow. But at least it really checks something :)
2014-02-20 13:27:43 +09:00
Jean-Philippe Andre e797f7f4c4 Evas filters: Add more test cases
Set filter on a text object and check the object's geometry.
Get the padding and the geometry so we're sure they match.

Also, pad_get would return 0 if the filter did not compile,
so this checks that these filters are valid.
2014-02-20 13:27:42 +09:00
Jean-Philippe Andre 78c7931575 Evas filters: Add test cases for the script parser
Basic syntax checks and instructions coverage.
2014-02-20 13:27:42 +09:00
Tom Hacohen 00b2974a2c Evas textblock tests: Improved textblock word start/end tests.
Removed a wrong test and added some more tests.
2014-02-19 14:38:06 +00:00