Commit Graph

65 Commits

Author SHA1 Message Date
Cedric BAIL eaeaf8831c evas: expose evas_map_coords_get. 2017-06-30 13:46:07 -07:00
Jean-Philippe Andre 092866c058 map: Fix efl.gfx.map render
Internally the call to map_reset was setting the count to 0
rendering the map data invalid and useless.
2017-06-09 13:46:33 +09:00
Thiep Ha b1d287bbf2 map: add more checking on input and memory allocation
More checking on input parameter and memory allocation
when set number of map points.
Thanks jp.
2017-06-09 10:18:50 +09:00
Thiep Ha 4f77bb2f5a evas_map: support map with number of points as multiples of 4
Currently, in evas map, we only support map with 4 points.
This patch adds support for map with number of points as
multiples of 4.

@feature
2017-06-08 16:53:45 +09:00
jiin.moon e250a27922 evas: Fix don't redraw map_sufarce issue
Summary:
map_surface does not redraw in below case.

1) parent and child are smart object and has map.
3) drawing objects.
4) apply new map to child object.

Test Plan: sample code

Reviewers: jpeg, cedric, jypark

Differential Revision: https://phab.enlightenment.org/D4889
2017-05-30 19:25:37 +09:00
Jean-Philippe Andre ba8db108cb evas map: Fix uninitialized fields
This fixes a "jump on uninitialized value" as reported by valgrind.
See evas_map.c:85:
  if (obj->map->cur.map->normal_geometry.x != x1) ch = 1;
2017-05-17 15:32:04 +09:00
Jean-Philippe Andre 290f1893cd evas map: Reach feature parity with legacy API
I've done this by translating "Flip Page" to this new set of
EO APIs. In particular, absolute coordinates need to be used
in some calls, and the map needs to be calculated between
get and set operations.

This required an adjustment of the raw_coord API as the flip_page
code does some math after reading and then writing to the map.
Same for color. Those two properties now act like commands (ie.
like the other gfx map functions).

This also introduces a duplicate set of APIs to handle absolute
coordinates. Other solutions included:

 - Use an enum to specify the type of coordinates (but then the
   unit of cx,cy varies between non-unit relative position and
   pixel position. Also this adds an extra argument to all those
   function calls.

 - Pass a special value (an empty eo object) as the argument for
   pivot. Same remark about the unit as above. This way was
   deemed too confusing because of the weird object.

Those two options have been discarded after asking the opinion
of a few developers I could reach.

@feature
2017-05-11 18:02:31 +09:00
Jean-Philippe Andre 0a224da86f evas map: Introduce new API for maps (Efl.Gfx.Map)
This implements an entirely new API model for Evas Map by relying
on high-level transformations on the object rather than an external
Evas_Map structure that needs to be constantly updated manually.

The implementation relies on Evas_Map.

To rotate an object all you need to do now is
  efl_gfx_map_rotate(obj, 45.0, NULL, 0.5, 0.5);

Or with a C++ syntax:
  obj.rotate(45.0, NULL, 0.5, 0.5);

Or even simply (with default arguments):
  obj.rotate(45.0);

The map transformation functions are:
 - rotate
 - rotate_3d
 - rotate_quat
 - zoom
 - translate (new!)
 - perspective_3d
 - lightning_3d

@feature
2017-05-11 17:54:00 +09:00
Jean-Philippe Andre d111c6e1dd evas map: Replace EO APIs for populate with reset
Manual points population will eventually be useless as the
map API will become more like a transformation API, where
the current object geometry doesn't matter as much as which
transformation is applied to it.
2017-05-11 17:53:57 +09:00
Jean-Philippe Andre 81dd06a6ed evas map: Move Efl.Gfx.Map mixin to its own C file 2017-05-11 17:53:51 +09:00
Cedric BAIL 55e1b3f205 evas: remove engine.data.output.
This is the first step toward handling multi output. This patch
remove engine.data.output from Evas structure and use an Eina_List
for it instead. It also start moving code around to fetch an output
or an engine context (which are the same at the moment, but will be
split in a later patch).
2017-04-24 15:10:48 -07:00
Jean-Philippe Andre fd69113f6a evas map: Fix test case "Flip Page"
Since 9b7ac51943 evas map tries to avoid recalculating
stuff when the map parameters have not changed. Unfortunately the
code in elementary_test -to "Flip Page" was badly written. It was
modifying a constant's internal value (after ugly cast). So the
memcmp() and all other checks would return successfully, as the
exact same pointer was being compared to itself.

So, I've fixed the comparison by adding some forgotten parameters
(perspective) but most importantly I fixed the map API usage in the
test case.
2017-04-10 19:38:56 +09:00
Cedric BAIL 8f1c071d6a eina: rename EINA_{FLT,DBL}_CMP to EINA_{FLT,DBL}_EQ. 2017-01-06 15:58:46 -08:00
Chris Michael 0e93d8121b evas: remove float comparison warnings for evas_map
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-20 10:25:50 -05:00
Guilherme Iscaro 484dae76e6 Evas: Add support for per mouse pointer mode/properties.
This patch introduces the possibility to set the pointer mode and
query other properties like current position per pointer device.
The old API will still works, however it will only act on the default seat.
2016-12-02 09:57:50 -02:00
Subhransu Mohanty 9b7ac51943 evas/map: do nothing when same map is set again
Reviewers: cedric, Hermet, jpeg

Reviewed By: jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4344
2016-10-17 10:49:10 +09:00
Jean-Philippe Andre 290413543d evas events: Switch wheel event to the new type
For now this covers only the wheel event.

Note: This patch also modifies evas map to use double in an
internal function, rather than ints.
2016-08-26 10:18:00 +09:00
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
Jean-Philippe Andre 86dc7e0c87 evas: Fix warning about unused function
I kept it here for the record. It was useful, could be useful
again.
2016-07-08 12:27:29 +09:00
Carsten Haitzler e57084d5c5 evas event handling4- fix more corner cases where bounding is bad
so smart object bounding box wasnt updated properly in several other
cases. fix those other cases too by dirtying bounding box region.

this continues on from:

f6b3c31561
25d77bc1d2
9f0fd66ab8

this fixes T4017

@fix
2016-07-08 10:17:56 +09:00
Jean-Philippe Andre b13ae2fb82 evas: Implement evas map support in eo as a mixin
It relies a bit on evas legacy APIs and will only work on
evas objects (Efl.Canvas.Object) for now.

The main difference with Evas_Map is that there is no
separate map object, as the functions apply directly to
any canvas object.

For convenience, most functions will automatically populate
the map if there was no previous map info. While this may
be convenient, the object's size changes still need to
be tracked to update the map info.
2016-06-29 09:57:58 +09:00
Jean-Philippe Andre 6b8228ffbd evas: Move map to a separate mixin
Evas map is not translated to proper eo apis yet.
Efl.Canvas.Map will be a mixin implementing the evas map
API in a bindable API.
2016-06-29 09:12:26 +09:00
Jean-Philippe Andre 7bf8da2baa evas: Rename Evas.Object to Efl.Canvas.Object
One step closer to make the EO inheritance tree look like
it's all Efl.
2016-06-21 14:35:19 +09:00
Cedric BAIL ddf92ba61b evas: let's reuse what we know when possible to avoid more useless eo_data_scope_get. 2016-05-06 17:01:10 -07:00
Jean-Philippe Andre b5c9350805 Evas: Replace image_map_surface_free by common image_free
Those two functions were doing exactly the same thing[1], which
is free an image, so this commit only attempts to simplify the code
a little bit.

[1] Actually image_map_surface_free() might even not have worked
properly with cserve2 sw (calling unload instead of close).
2015-07-02 12:05:50 +09:00
Cedric BAIL 0acf23857f eina: beginning of a generic quaternion API. 2015-05-29 17:20:29 +02: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
ChunEon Park d85d9672b5 evas/map: make an internal function to static.
no need this function set external.
2015-01-23 22:52:25 +09:00
ChunEon Park 405d30617a evas/map: remove old comments.
It's been so long. even SLP is not a valid name anymore.
No idea whether the problem still exist or not.
If it is then it should be reported and fixed.
2014-11-28 20:36:38 +09:00
Jaehyun Cho 3e4a191e3e evas_map: Remove unnecessary check for current map
Summary:
Remove unnecessary check for current map
         @fix

Reviewers: Hermet

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1708
2014-11-28 13:24:24 +09:00
Jaehyun Cho 30623aea9e evas_object_main: Keep map effect after evas object move
Summary:
Keep map effect after evas object move
@feature

Reviewers: raster, cedric, Hermet

Subscribers: raster, cedric

Differential Revision: https://phab.enlightenment.org/D1678
2014-11-28 13:18:16 +09:00
artem.popov e6722b6ab3 evas: evas_map - fix cast from double to int with using lround()
Summary:
All points in map are double, when try to get point coordinates, there
are issues with rounding.

@fix

Reviewers: Hermet, raster, seoz, cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2014-10-20 17:30:57 +02:00
Jean-Philippe ANDRE d589e760d3 Evas map: Add missing EINA_MAGIC check 2014-06-22 18:12:01 +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
Cedric BAIL 4dcf49c6e9 evas: let's not access a potential NULL object when looping on a corrupted object list.
This fix CID 1191920.
2014-03-13 10:40:14 +09:00
Daniel Zaoui f22bd9e6ee Eolian: Integration of Evas Object.
const have been added in object parameter of two legacy APIs to fit
Eolian generated files.
Since these functions retrieve information from object, it is logic that
the object would be const.
2014-03-12 10:57:28 +02:00
ChunEon Park eea4fbff6a evas/map - added comment to do. 2014-02-05 20:55:38 +09:00
ChunEon Park a76e751eb4 evas - fixed side effect caused by f4d24e962d
since the map_changed is reset right after the map is updated,
it could not decide to redraw the map surface properly.

now map_update() returns the value to redraw the map surface properly.
2014-01-06 13:54:58 +09:00
ChunEon Park f4d24e962d evas/map - ensure map updation.
for more gurantee to update map properly,
we should reset the map changed flag after the map updation is performed.
this will fix a mapbuf bug that map is not updated.

when the map is changed without rendering but it's in the active object list,
the map updation couldn't be happened later that map is rendered. (if the map is not updated at this frame)
2013-12-19 15:34:15 +09:00
ChunEon Park cb384fe88b Revert "evas/map - commeted out insane compare."
This reverts commit b259cfafe5.

my fault. the compare is reasonable.
2013-12-19 14:33:02 +09:00
ChunEon Park b259cfafe5 evas/map - commeted out insane compare.
cedric, is it just typo?
2013-12-19 14:12:23 +09:00
Chris Michael a0fb1f4728 Fix formatting
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-09-17 07:41:07 +01:00
Chris Michael 24847d77dc Remove extra blank space
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-09-17 07:41:07 +01:00
Sebastian Dransfeld 336f6ec328 efl: formatting 2013-06-20 13:28:18 +02:00
Sebastian Dransfeld 51023d2d4f evas: Keep sane name for public header
Evas_Common.h should be used for the public header, and rather rename
evas_common.h internal header to another name.

Sa:
Evas_Common_Header.h -> Evas_Common.h
evas_common.h -> evas_common_private.h

Shouldn't have both Evas_Common.h and evas_common.h because of case
insensitive filesystems.
2013-06-20 12:53:29 +02:00
Rafael Antognolli d44a69f911 evas/map: Add FIXME comment to remember that it's just a workaround. 2013-06-13 19:16:23 -03:00
Rafael Antognolli 383bb37e61 evas/wayland_egl: Workaround for map perspective issues.
Account for the framespace offset on perspective fx and fy of each map
point.

This is just a workaround because I could not understand exactly why it
is needed. When no perspective is used, the viewport is set to the size
of the surface, and each map point seems to be used as is, with no
adjustment being needed.

However, when the map is not flat (perspective is used), a more complex
math is used to find the glViewport size. It ends up being bigger, but
there are some offsets used to compensate that, gc->shared->ax/y, which
are added to each vertex before pushing them. Thus, it seems to me that
the framespace offset should not be added to them, but things are weird
if this is not done.

Anyway, I just added those offsets, and it should not impact on gl_x11
since it's not using framespace, and software engines don't seem to
implement perspective anyway, so it all should be fine.

If anyone understands better what's going on here, please make a proper
fix or at least contact me to explain the problem, and maybe I can fix
it by myself.
2013-06-04 14:52:26 -03:00
Carsten Haitzler f8c9a8d167 revert the revert... damn you git!
Revert "Revert "Efl: replace eo_data_get for objects data referencing.""

This reverts commit b64a2994b3.
2013-05-02 16:47:16 +09:00
Carsten Haitzler b64a2994b3 Revert "Efl: replace eo_data_get for objects data referencing."
This reverts commit 654a3f5f94.
2013-05-02 14:17:19 +09:00
Daniel Zaoui 654a3f5f94 Efl: replace eo_data_get for objects data referencing. 2013-05-01 10:37:08 +03:00