Commit Graph

2121 Commits

Author SHA1 Message Date
Youngbok Shin 20ef85e307 Evas text: Fix Evas Text truncated text case.
Summary:
Evas Text only concerns about a advance of each text item.
When a width of last character is bigger than its advance, the last character can be truncated.
And the different line size calculation caused different aligning between Evas Text and Evas Textblock.
So, the width of last character will be considered in Evas Text just like Evas Textblock.
@fix

Test Plan:
The following text shows how the size calculation is different between Evas Textblock and Text.
Get native size from Evas Textblock and get width(geometry) of Evas Text.
You can see the width of Evas Text is bigger than native size of Evas Textblock.
(adv > width)
こんにちは。

The following text will be truncated without this patch.
(adv < width)
ନୂଁ

Reviewers: woohyun, tasn, herdsman

Subscribers: jpeg, cedric

Differential Revision: https://phab.enlightenment.org/D3004
2015-12-09 11:10:46 +02:00
Jean-Philippe Andre 31984449a5 Evas filters: Move 'fill' to its own file 2015-12-09 11:45:34 +09:00
Stefan Schmidt 96a9d75e0c Revert "evas: refactor model's savers and loaders."
This reverts commit 32c33ed64d.

This refactor broke the evas test cases for the model loaders and savers. I gave
it a week to get fixed but a first try did not succeed and its blocks a lot of
other automated testing. To be honest, it should have never gone it when it
breaks existing test cases. Once fixed this refactor can happily go in.

Fixes T2905
2015-12-08 22:33:05 +01:00
Daniel Hirt 7e8e392db6 Evas textblock: improve and fix line range rectangles
The line range rectangles geometries needed a bit of adjusting. I
started out with fixing T2648. In order to fill the gap between the end
of the line and the margins, the geometry of the last line's character
was used. I am not really sure why. Anyway, we have the line geometry,
so I replaced it with that.

Then, it led me to do some alignment checks, and indeed alignment cases
were not treated. For instance, an LTR paragraph could have a line
aligned with a value greater than 0.0. That means that we should fill
the gap from the left of the line, if it was the last line in a
multi-line selection. The inverse case is for RTL.

I think it now works as it should. Will see if the selection logic is
missing some more stuff once I come up with more example cases.

Fixes T2648.

@fix
2015-12-08 17:19:18 +02:00
Tom Hacohen 3896c03cff Evas render2: Fix always false comparisons.
This looks like a classic copy and paste error. It didn't make any sense
before, and it seems like no one was going to take a look at it.
This looks correct. If this breaks something (is render2 even used),
someone should remove those lines. I wasn't entirely sure if I should
just remove them, or correct them, as some of the code looked redundant
anyway.
2015-12-08 11:35:25 +00:00
Jean-Philippe Andre 15d5125d6e Evas filters: Remove unused variable 2015-12-08 14:57:51 +09:00
Jean-Philippe Andre d8b5e5da7b Evas: Remove unwanted file added by accident
From commit 82504d9d77
2015-12-08 14:54:21 +09:00
se.osadchy 82504d9d77 evas: recognize duplicated data structure with eina_quternion and ector.
Summary:
Move data structure and functionality to eina_quaternion from evas_vec4.

Reviewers: raster, Hermet, cedric

Subscribers: jpeg, Oleksander

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-07 16:36:16 -08:00
Chris Michael ef3ef643c2 evas: Fix definition of framespace in canvas eo file
The definition of 'framespace' in the canvas eo file is incorrect.
Framespace is the space occupied by the window frame within the canvas viewport

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-07 15:36:42 -05:00
Daniel Hirt 1d48dd90b2 Evas textblock: fix evas_textblock_cursor_line_set
The line_set function should set the cursor to the first logical
position in the line. We can't use the first text position of the
first item in the line, due to BiDi considerations (the line may be
reordered). I've split evas_textblock_cursor_line_char_first to avoid
code duplication, as it already handles these cases.

@fix
2015-12-07 18:21:00 +02:00
Vincent Torri 3b44645363 efl: add binary mode to f(re)open() calls
This allows better compatibility with Windows

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-05 21:04:36 +01:00
Youngbok Shin 76fa1159c5 Evas textblock: Skip layout logic for an text item which doesn't have font.
Summary:
Evas textblock could cause infinite loop if there is no fonts to use.
If there is no fonts, text_props.text_len is never set.
When text_props.text_len is 0, the for loop in _layout_par runs forever.
It is ridiculous to use Textblock without fonts. But, it shouldn't runs
infinite loop in any situation.

@fix

Test Plan:
1. Remove all of fonts in your EFL or Tizen device.
   (Or you can test it modifying some codes in Textblock by skipping load fonts.)
2. Run elementary_test -to entry3 or see any multiline textblocks.

Reviewers: tasn, herdsman, woohyun

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3402
2015-12-04 14:46:35 +00:00
Jean-Philippe Andre 8f4018b690 Evas filters: Implement mix3 func for rgba masking
This operation was faked by running a mul and a blend ops. Now
they are combined into one. A GL shader should also be able
to do this in a single pass.
2015-12-04 16:10:06 +09:00
Jean-Philippe Andre ecc7da9cba Evas filters: Use Efl.Gfx.Render_Op
Some filters are now broken. Yay for refactoring! Will be fixed
in the following commit.
2015-12-04 16:09:53 +09:00
Jean-Philippe Andre b5500a8644 Evas: Move alpha functions to static_libs/draw
This is a pretty simple code refactor, moving pixel handling
to the new draw lib.
2015-12-03 18:42:50 +09:00
Jean-Philippe Andre 615b2442b7 Ector: Move drawhelper to static_libs
Rename a few things:
 - draw helper -> efl_draw
 - Ector_Rop -> Efl.Gfx.Render_Op
 - ECTOR_ bla bla -> DRAW_ bla bla (base pixel ops)
 - ector_memfill -> draw_memset32 (and invert arg order to match memset)

The main rasterizer file is now draw.h in static_libs/draw
This is a non functional change, simple code refactor.
2015-12-03 18:42:50 +09:00
se.osadchy ce4146ec63 evas: fix bug with logic with eina_matrix in evas_3d_utils
Summary: Also need to fix logically dead code in coverity.

Reviewers: raster, Hermet, cedric

Subscribers: jpeg

Maniphest Tasks: T2832

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-02 14:15:01 -08:00
Cedric BAIL d577366acb evas: properly clean up all memory. 2015-12-02 12:31:59 -08:00
Daniel Hirt 59e9e2ddc8 Evas textblock: fix height on line wrapping
Line advance should finalize the line with its last item, and not the
item we're currently wrapping. This fixes T1583, where some line
wrapping cases would look different than their equivalent <ps>
versions.

@fix
2015-12-02 15:06:32 +02:00
Youngbok Shin 809d8fdafe Evas Textblock: Fix text disappear issue when text is made up with multiple items.
Summary:
Text is disappearing when we resize a singleline Evas Textblock with ellipsis.
It is happened by putting a Text item at logical_items list without considering about logical position.
It is only happended the text is made up with multiple items.
@fix

Test Plan:
1. Run elementary_test
2. Click Label Ellipsis
3. Resize the window dynamically and see the result.

Reviewers: woohyun, tasn, herdsman

Subscribers: jpeg, subodh6129, shilpasingh, cedric

Maniphest Tasks: T2709

Differential Revision: https://phab.enlightenment.org/D3022
2015-12-02 09:52:01 +02:00
perepelits.m 32c33ed64d evas: refactor model's savers and loaders.
Summary:
Move common part to a separated document.
Make code more readable using smaller functions. (from Task T2713)

Reviewers: cedric, raster, Hermet

Subscribers: artem.popov

Differential Revision: https://phab.enlightenment.org/D3373
2015-12-01 16:39:29 -08:00
Youngbok Shin 917fdbd597 evas: fix a NULL dereference issue in font.
Summary:
eina_list_remove returns Eina_List pointer.
It could be NULL if the last list item is removed.
And the returned Eina_List pointer could be different from the given list.
So, calling free for fdir->data after fdir's address is changed is dangerous.
@fix

Test Plan: Run expedite or test app with evas_font_path_append() API.

Reviewers: stefan_schmidt, jpeg

Reviewed By: jpeg

Subscribers: stefan, jiin.moon, cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 15:03:51 -08:00
Stefan Schmidt 3a11868201 evas_3d_utils: do not bitwise AND against 0 in condition
We need to check against the state here and if the compilers assignes 0 to the
first item in an enum we are screwed here as the bitwise AND will always
evaluate to false.

This is a re-incarnation from a486671bce
2015-11-30 17:36:24 +01:00
Stefan Schmidt 54abe37c44 evas_font_dir: do not passed free'd memory to eina_list_remove()
Free the actual memory after we removed it from the list.
2015-11-30 17:36:24 +01:00
Vincent Torri db8d1883d7 Evas: use LC_MESSAGES on Windows to fix compilation
Compilation is broken on Windows because LC_MESSAGES does not exist on this platform
Include Evil.h to provide support of LC_MESSAGES

@fix
2015-11-30 16:28:02 +00:00
Chris Michael 886c20a43b evas-3d: Fix missing field initializers
Clang spits warnings here about missing field initializers for
Evas_Vec3 (missing y and z fields), so we will explicitly initialize
them to 0 (matching the x field).

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-30 09:15:53 -05:00
Tom Hacohen 2c9a79e939 Revert "Evas: Temporarily hack OT_SUPPORT to fix textgrid"
Fixed in upstream, see T2865.

This reverts commit 8ccea8233c.
2015-11-27 12:34:15 +00:00
Stefan Schmidt 043cfaa33b evas_common3d: use void to force empty function parameters
We have to use void in a function declaration if we want no function
parameters. Using just empty parenthesis means the function takes an
unspecified number of parameters.

We had it correct for most declarations and this series fixes it for
the rest.
2015-11-26 17:25:36 +01:00
Youngbok Shin 507baf4891 evas: Add ExtraLight, ExtraBold for font weight.
Summary:
Evas supports UltraLight, UltraBold as font weight.
These terms have same weight value as ExtraLight, ExtraBold.
Some applications, for example, fontforge, use ExtraLight, ExtraBold terms for these weight values.
So, it would be better to support these terms, too.
@feature

Test Plan: None

Reviewers: tasn, woohyun, herdsman

Reviewed By: herdsman

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3126
2015-11-26 10:16:14 +02:00
Jean-Philippe Andre 8ccea8233c Evas: Temporarily hack OT_SUPPORT to fix textgrid
See T2865.
Since Harfbuzz 1.1.0, terminology displays fonts funnily aligned to
the top. This is apparently because until 1.0.6 the y_offset was
always 0 for all glyphs, but since 1.1.1 the offset is actually
set.

This is a TEMPORARY fix. There might be an underlying issue left
here.

Harfbuzz changed behaviour in this commit:

  commit 44f82750807475aa5b16099ccccd917d488df703
  Author: Behdad Esfahbod <behdad@behdad.org>
  Date:   Wed Nov 4 20:40:05 2015 -0800

      [ft] Remove font funcs that do nothing
2015-11-25 16:44:04 +09:00
Subhransu Mohanty 609f74994b efl: make path stroke related api as non virtual.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-24 15:42:29 -08:00
Daniel Hirt 40dfc4a45d Evas textblock: add support for hyphenation wrap style
We now support hyphenation in style. Use "wrap=hyphenation" to use this
wrap option. It will hyphenate based on explicit SOFT HYPHEN (&shy;)
placement in the text, and with the (optional) assistance of dictionaries
compatible with Hunspell's "hyphen" library.

This wrap mode favors breaking at hyphen positions in a word, over moving
the whole word to the next line. It will put an additional "-" at the
break position if it was hyphened.

Enabling the hyphen dictionaries is done by adding these configure
options:
  --enable-hyphen (requires Hunspell's "hyphen" library installed)
  --with-dictionaries-hyphen-dir=DIR (specifies the install location of
          the actual .dic dictionary files e.g. /usr/share/hyphen)

Note that dictionary files are expected to be in the form of "en_US.dic"
or anything that ends with it e.g. "hyph_en_US.dic" (this how they are
        named in Arch Linux).

@feature
2015-11-24 14:31:05 +02:00
Minwoo, Lee 3700be959b evas: Fix text effect which has shadow direction
Summary:
If text object has outline and shadow effect (OUTLINE_SHADOW or OUTLINE_SOFT_SHADOW), and has shadow direction except BOTTOM_RIGHT then outline is not displayed.
So fix logic of style checking.

OUTLINE_SOFT_SHADOW effect of text object is different with text block, so fix it.

Test Plan: Make text obect with OUTLINE_SHADOW or OUTLINE_SOFT_SHADOW effect with any direction except BOTTOM_RIGHT

Reviewers: cedric, woohyun, herdsman, tasn

Subscribers: id213sin

Differential Revision: https://phab.enlightenment.org/D3047
2015-11-23 20:53:29 +09:00
Oleksandr Shcherbina d871ff8d11 evas: remove useless part of code in evas_convex_hull_get function
Summary:
@fix
CID: 1339788

Reviewers: raster, cedric

Reviewed By: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-23 08:20:26 +01:00
Oleksandr Shcherbina 3a56b3f013 evas: fix uninitialize variable in convex_hull_vertex_set function
Summary:
A bit of useless claim, becouse parameter coord always have value 0 or 1 or 2.
May be for escape problem in future.
@fix
CID: 1339781

Reviewers: raster, cedric

Reviewed By: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-23 08:18:53 +01:00
Oleksandr Shcherbina 6866d256e8 evas: fix possible accsess to NULL pointer in Evas.Canvas3d.
Summary:
@fix
CID:1339784

Reviewers: raster, cedric

Reviewed By: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-23 08:16:12 +01:00
Oleksandr Shcherbina 5d4f3b22c4 evas: fix unreachable code in _generate_unic_color_key function in Evas.Canvas3D.
Summary:
Have a sence. It is hard to assume that more that 16 million color will be used.
@fix
CID: 1339790

Reviewers: raster, cedric

Reviewed By: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-23 08:12:00 +01:00
Jean-Philippe Andre 58a1b2767e Evas render: Fix another map clip render issue
This time it's only about performance. We seem to be setting the
changed flag too often, which might trigger unnecessary redraws.

- map flag is set if there is currently a map AND it's not an image
  object (because images can map themselves)
- hmap flag is set if there was a map before

So, map != hmap does not imply a transition between a mapped and
non-mapped state. Add an extra check before marking the clip
as dirty and changed.
2015-11-20 14:23:29 +09:00
Cedric BAIL 412191e5f8 ector: improve uploading of GL texture for vector graphism
This rely on a faster code path to upload dynamic texture. Once we get support
for gbm, we should see significant performance improvement in speed, but this
first step is already a 5 times improvement (Ok, we get from really bad, to not
really useful...).
2015-11-19 14:52:10 +01:00
Youngbok Shin a9b4be11e1 Evas object: Add paragraph_direciton APIs
Summary:
It adds evas_object_paragraph_direction_set, get APIs.
The APIs set or get paragraph direction to/from the given object.
It changes BiDi calculations and affect the direction and aligning of text.
It doesn't have any effect to text without Fribidi library.

The default paragraph direction is EVAS_BIDI_DIRECTION_INHERIT.
If dir is EVAS_BIDI_DIRECTION_INHERIT, paragraph direction is changed
according to smart parent object. If there is no smart parent object,
paragraph direction works as EVAS_BIDI_DIRECTION_NEUTRAL.

@feature

Test Plan:
Test cases included to the following files.
- evas_test_textblock.c
- evas_test_text.c
- evas_test_object_smart.c

Run "make check".

Reviewers: woohyun, raster, herdsman, tasn

Subscribers: c, raster, cedric

Differential Revision: https://phab.enlightenment.org/D1690
2015-11-19 11:43:39 +00:00
Tom Hacohen 1e1e50ca06 Evas text: Fix last up to pos error return value.
This commit also simplifies the code a (tiny) bit.

This fixes the bug introduced in:
392df9479f
2015-11-18 10:56:48 +00:00
Tom Hacohen 3b7ff8ece4 Evas text: Remove useless FIXME. 2015-11-18 10:53:29 +00:00
Subodh Kumar 392df9479f Evas text: Fix memory leak
Summary:
Fix memory leak

Position is getting returned without
freeing the temporary logical item list.

@fix

Test Plan: NA

Reviewers: tasn, raster

Reviewed By: raster

Subscribers: raster, cedric

Differential Revision: https://phab.enlightenment.org/D3345
2015-11-18 10:52:34 +00:00
Daniel Hirt 4c086b6e1b Evas language: add full locale language getter
evas_common_language_from_locale_get truncates the country letters in
the language. We don't always want that (one example is dictionaries).
2015-11-17 16:20:21 +02:00
Tom Hacohen 8fcf9a0fe6 Evas language: Fix language from locale function.
This function was trying to infer from the LANG env var, though it should
have just queried the locale all along, as the language we want is the
system's text language, and not necessarily the LANG variable's value.

@fix.
2015-11-17 12:07:42 +00:00
Subodh Kumar f1cffd7709 Evas text: Remove fixme marker
Summary:
Remove fixme marker

Algorithm used is good enough to sort
very few number of items, usually 2 to 6
items.

Test Plan: NA

Reviewers: herdsman, cedric, tasn

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3312
2015-11-17 11:24:39 +00:00
Subodh Kumar d14dc12d3b Evas text: Remove tabs for readability
Summary: Remove tabs

Test Plan: NA

Reviewers: tasn

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3337
2015-11-17 11:23:44 +00:00
Stefan Schmidt d94120a156 evas polygon: use Eina_Bool for one-bit bitfield
Make sure we are using a unsigned var here. Best go with a Eina_Bool directly.
2015-11-13 13:31:34 +01:00
Minwoo, Lee c196422e63 evas textblock: fixed ascent/descent calculation
Summary:
If textblock has linegap and multi language, ascent/descent calculation is
incorrect.
In _layout_format_ascent_descent_adjust(), descent is accumulated.
(for example, for a line gap of 50, the first line gap is more than 100)

Test Plan:
Textblock has "linegap=50" and multi language (ex.
        "This is a test suite for line gap -
        ഈ ലൈൻ വിടവ് ടെസ്റ്റ് ടെസ്റ്റ് ടെസ്റ്റ് ടെസ്റ്റ് ഒരു പരീക്ഷണ വെയര് ")
Added test suite in evas_test_textblock.c file.

Reviewers: tasn

Subscribers: subodh6129, cedric

Differential Revision: https://phab.enlightenment.org/D3311
2015-11-13 12:27:59 +00:00
Tom Hacohen 592b786645 Evas text: Change bitfield bool types to Eina_Bool.
This is really just a safety measure, as we always just check if the value
is true. However, with char the potential values are -1 and 0, and with
Eina_Bool they are 1 and 0, so fixing that.

Thanks to the "sparse semantic parser" for detecting that, and to Stefan
for reporting.
2015-11-12 15:49:45 +00:00