Commit Graph

142 Commits

Author SHA1 Message Date
Dmytro Dadyka 31651a8842 evas: Evas_3D - add alpha testing.
Reviewers: Hermet, cedric

Reviewed By: cedric

Subscribers: Ievgen, cedric

Differential Revision: https://phab.enlightenment.org/D2046
2015-03-18 15:22:20 +01:00
Jean-Philippe Andre 29be7a36c7 Evas masking: Fix rendering of masks into invalid surfaces (GL)
In some rare cases, a mask would be rendered (from mask_subrender)
into a surface that is NOT an FBO. This would happen because the
previous surface was a "scaled GL image" and its size would
match the required geometry.

That took a while to figure out...
http://thecodinglove.com/post/111546429281/when-i-finally-solve-a-nasty-bug
2015-03-12 11:32:15 +09:00
Jean-Philippe Andre bea9567d0e Evas GL: Kill runtime warnings caused by auto fallback
The previous commit modifies the concept of direct rendering
vs. indirect rendering, so some runtime checks (in debug mode
only) will fail.

This commit introduces two new engine functions:
 - gl_get_pixels_pre
 - gl_get_pixels_post

The latter will be used in a later patch for optimization.
2015-03-03 20:08:16 +09:00
Jean-Philippe Andre a14492ef73 Evas GL: Automatic fallback to indirect rendering when the scene has
not changed.

Automatically fallback to indirect rendering on FBO or X11 Pixmap
if the Evas Object Image is not marked as dirty. This should
improve the performance and/or power consumption in those
rare cases where this area of the canvas needs to be redrawn
but the GL content has not changed.

@feature
2015-03-03 18:11:32 +09:00
Jean-Philippe Andre fab0d7f9d3 Evas masking: Simplify previous commit
Call object's function to get the private engine_data (here, the
image object). Thanks Dongyeon for your patch which inspired me to
do that instead of forcing pre_render.
2015-02-27 13:06:09 +09:00
Jean-Philippe Andre fddaf62fcc Evas masking: Add fast path for image-only masks in GL.
This will currently optimize most of the masks when using the
GL engine[1].

This is a very special case that adds a highly optimized path
for masking in GL. It works by creating a virtual image, containing
a pointer to the original image and a new geometry[2].

Instead of creating a new FBO-based surface (image_map_surface),
we refer to the original image and adjust the mask geometry on
the fly.

KNOWN BUGS:
- masking a map with such a scaled image is now broken.

[1] Right now all masks are simple Evas Object Image, so that means
    all cases of masking, except masks of masks, or masks of maps,
    will be optimized with this new method.

[2] This virtual image mechanism is still quite hackish and may
    be improved (for memory usage, refcounting, etc...)
2015-02-27 13:06:09 +09:00
Jean-Philippe Andre 93d167ac87 Evas GL: Add hidden config values for direct rendering options
Those 2 new values are here to avoid using environment variables
that have side effects on the whole application.

I'm actually wondering if we shouldn't just kill off the env
vars altogether. Also, direct override is a terrible option that
should never be used.
Memory optimization can make sense (needs more testing tho).
2015-02-24 22:12:00 +09:00
Oleksandr Shcherbina d28b82be45 evas: Evas_3D - callbacks for Evas 3D.
Summary:
Add class and type Evas_3D_Callback like wrapper under smart object
Incapsulate Evas_3D_Callback in Evas_3D_Object
Add virtual function register and unregister in Evas_3D_Object
Add function evas_3d_callback_call
Add callbacks clicked and collision for Evas_3D_Node

@feature

Reviewers: raster, Hermet, cedric

Reviewed By: cedric

Subscribers: artem.popov, cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-18 22:42:07 +01:00
Dmytro Dadyka 1c74a1afe2 evas: Evas_3D - refactor node shapes update mechanism.
Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-17 15:39:48 +01: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
Oleksandr Shcherbina dc0b144cf0 evas: Evas_3D - mechanism for finding node by color pick.
Summary:
See first part https://phab.enlightenment.org/D1811 (backend, gl)

Add get/set for color pick mode at evas_3d_mesh and evas_3d_scene
Add evas_3d_node_color_node_mesh_collect function to collect data at force rendering
Add state flag for scene to avoid useless force rendering in case scene wasn't changed
Add functionality for color pick in evas_3d_scene_pick method

Reviewers: Hermet, raster, cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-11 17:44:50 +01:00
kabeer khan 46b9b23144 evas: add image orient set/get API in software backend for now.
Summary:
Added API's to rotate(0, 90, 180, 270), flip(horizontal, vertical, transpose, transverse)
evas image object. Also added example to demonstrate this.

Signed-off-by: kabeer khan <kabeer.khan@samsung.com>

Reviewers: raster, stephenmhouston, cedric

Subscribers: stephenmhouston, cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-11 17:30:54 +01:00
Jean-Philippe Andre 7a50f5827f Evas render: Improve debug output with REND_DBG
Better formatting and less code clutter.

This is a purely non-functional change as all the
changed lines are ifdef'ed out by default.
2015-02-10 12:00:37 +09:00
Oleksandr Shcherbina 00c2451656 evas: Evas_3D - ColorPick mechanism finding node and mesh in scene.
Summary:
Added additional texture and framebuffer for rendering meshes to it.
Added function that return OpenGL id additional texture
Added function that return color from target texture by mouse pick coordinates
Added function that render need meshes to target texture
Added engine wrappers for possibility force render to texture

@feature

Reviewers: Hermet, raster, cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-09 22:03:26 +01:00
Jean-Philippe Andre a688ba45c8 Evas masking: Fix some remaining issues with animations
Yeah, mixing maps and masks of masks in a genlist leads
to tons of amazing bugs :)

This commit removes x,y from the "mask" field in an object,
as they are duplicates of cur->geometry.{x,y} but were not
properly kept in sync.

This patch fixes a situation of:
- A genlist in a map
- Each item has an icon masked
- Scrolling the genlist
--> The masked items would not render properly before this
    patch.

Remaining known problem:
- Mask a genlist (big mask)
- Each item has an icon masked (small mask)
- Apply a map to the genlist
- Scrolling the genlist
--> The big mask still works but totally screws up the
    small icons with masks.

Note: These changes look scary just before the release
      but I would have to backport them to 1.13.x as they
      definitely are bug fixes. Also, they only concern
      code paths used exclusively by masking.
2015-02-04 15:03:37 +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
Jean-Philippe Andre 0793dee86a Evas masking: Try to reduce memory footprint a little
Move some mask object pointers around to spare a few
bytes of memory.

Fixes T2025.
2015-01-21 17:38:22 +09:00
Cedric BAIL c25ba993f6 evas: reduce potential memory hole in Evas_Object_Protected_State.
The main difference between 1.12 and 1.13 memory foot print is actually
related to this two pointer to mask. I am wondering if there is not an
issue here also has we do have a duplicated pointer. We have prev_mask
and mask in both cur and prev state of an Evas_Object, but only mask
and prev_mask from the cur state seems to be accessed.

If we can remove two pointers from those state, we should have a decent
win in expedite benchmark. Hopefully 300KB to win there (Close to half
the additional cost in memory).
2015-01-20 18:46:08 +01:00
Jean-Philippe Andre 2a0201d571 Evas masking: Allow setting an image object as clipper
The render function is not yet implemented, but this
prepares the infra used to set an object other than
Rectangle as a clipper.

@feature
2015-01-07 15:06:02 +09:00
Jean-Philippe Andre a9630a77b6 Evas masking: Add clip_image_[un]set functions to draw context
This allows passing a mask image to the render functions.

@feature
2015-01-07 15:06:02 +09:00
Bogdan Devichev dd60525798 evas: a _mmap version of the file_set is added. 2014-12-23 21:20:21 +01:00
Bogdan Devichev 61aab62be0 evas: entry points to modules is Eina_File. Model_Common_Loader is deleted. 2014-12-23 21:20:20 +01:00
Bogdan Devichev 17baa3fa6f evas: entry points to modules is new struct with Eina_file, not const char *file. 2014-12-23 21:20:20 +01:00
Bogdan Devichev aaddf1a963 evas: Evas_3D_Mesh_File_Type sank into oblivion. Changing entry point to model_save_load. Changing API in examples. 2014-12-23 21:16:07 +01:00
Bogdan Devichev 02c85b9fe8 evas: add lib/evas/common/evas_model_<action>.c. Functions are renamed similar to functions in image_save_load process. 2014-12-23 21:14:52 +01:00
Jean-Philippe Andre 4cf2d75715 Evas GL: Fix direct rendering with client-side rotation
There was a problem when checking whether the current surface
is compatible with direct rendering. In case of client-side
rotation (it's a flag set on the surface by the app), a surface
can be directly rendered even if the rotation is not 0.

But, before this patch, it was assumed that the surface was
current. Which doesn't make sense because make_current is
called by the pixel callback, from the application, and this
happens *after* we check for direct rendering.

As a consequence, it was not possible to mix directly rendered
surfaces with FBO-based ones, and use client-side rotation.

This patch should solve that issue.
2014-12-10 10:52:22 +09:00
Dmytro Dadyka 6762af0beb evas: Evas_3D - add mesh blending mode.
Reviewers: Hermet, raster, cedric

Subscribers: Oleksander, cedric

@feature

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2014-12-01 08:09:29 +01:00
Oleksandr Shcherbina 54c1667d4e evas: Evas_3D - add bounding sphere, revision frustum culling
Summary:
Move check visibility of node from evas_3d_node to evas_3d_camera
Move functionality (normalize, check distance, calculate frustum)
in evas_3d_utils.h (we are planing use evas_is_sphere_in_frustum in evas_gl_3d.c -
don't render mesh if it non visible)
Add possibility check frustum by box, aabb, central point
Refactor example frustum culling

@feature

Reviewers: Hermet, raster, cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2014-12-01 06:26:32 +01: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
Jason Gerecke 26c943bac0 Expose device (e.g. pen) axis information to applications
Summary:
This patch set adds the necessary code to expose device axis state to applications. This was primarily written with graphics tablets in mind, which -- in addition to acting like a mouse -- also provide information about pen pressure, tilt, etc. Other devices could potentially benefit from this API as well: touchscreens, joysticks, knob controllers, "spaceballs", etc.

Whenever an update to the device state is recieved, an "Axis update" event is synthesized. This event contains the updated information, typically scaled and normalized to a particular logical range (e.g. zero to one for pressure, -pi to pi radians for angles, etc.). Information about the tool which generated the event is also stored so that applications can disambiguate events from multiple devices (or in the case of multitouch screens, individual fingers).

This API is only wired up for use with X11 at the moment. Support for other backends (e.g. Wayland) should be easy to add for those familiar them.

**Note**: The following is a list of changes from the "v2" patches originally sent to the mailinglist

//Define and implement new Ecore_Event_Axis_Update events//
 * Harcode axis labels instead of including xserver-properties.h
 * Use C89-style comments
 * Use doxygen comments
 * Update comment text to note axes with unbounded/undefined ranges/units
 * Create "Ecore_Axis" and "Ecore_Axis_Label" typedefs
 * Reference typedef'd instead of raw types
 * Adjust how we count through valuators to support tilt/az
 * Add support for tilt and azimuth
 * Tweak memory management in case number of valuators differ
 * Expand TWIST axis normalization to declared range
 * Only normalize TWIST axis if resolution == 1 (wacom bug)
 * Cache label atoms on first use to minimize round-trips

//Implement EVAS_CALLBACK_AXIS_UPDATE event and friends//
 * Update to doxygen comments
 * Update comment text to note axes with unbounded/undefined ranges/units
 * Typedef 'Evas_Axis_Label', 'Evas_Axis'
 * Move typedef for 'Evas_Event_Axis_Update'
 * Reference typedef'd instead of raw types

//Wire the Ecore and Evas implementations of axis update events together//
 * Expose ecore_event_evas_axis_update in Ecore_Input_Evas.h
 * Move ecore_event_evas_axis_update to more logical position

//DEBUG: Add axis update logging to evas-multi-touch.c//
 * Removed from patch set

//Make evas-multi-touch demo use new axis functionality//
 * Have pressure adjust rectangle brightness instead of size
 * Use more available axis data when rendering rectangle (azimuth, tilt, twist)

Test Plan: The evas-multi-touch demo was updated to support axis update events. A graphics tablet was then used to verify that the pressure, azimuth, tilt, and twist data was coming through correctly.

Reviewers: cedric, raster

Subscribers: cedric

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

Conflicts:
	src/lib/ecore_input/Ecore_Input.h

Carsten Haitzler -

** fixed forward enum typedefs (make things unhappy)
** fixed conflict above
** fixed wrong param type for _evas_canvas_event_feed_axis_update()
** fixed @sinces to be 1.13
** fixed formatting/indeting
** fixed order of operation reliance in if's with ()'s to be clear
** fixed functions to be static that should have been
2014-11-25 12:43:15 +09: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
Jean-Philippe Andre a56cc8a8c1 Evas: Avoid creating an extra context for proxy rendering 2014-11-12 19:18:09 +09:00
Jean-Philippe Andre fe677a0518 Evas: Use common function for proxy_subrender
Merges functions from:
- filters
- image object
2014-11-12 17:11:49 +09:00
Jean-Philippe Andre 4fb138a65f Evas: Remove ugly REND_DBG
Here's a macro that's used for debugging in some of the ugliest
ways possible: avoid passing an extra argument to a function when the
cost of always passing it is negligible (it's an int).

Fixes T1749.
2014-11-12 15:26:59 +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 5a9d8d6f03 Evas GL: string_query returns a const char *
Why cast to/from void* in the first place?
2014-10-27 16:12:38 +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 4315537820 Evas GL: Add support for OpenGL-ES 1.1 (part 2)
Add version param to context_create.
Add support for 1.1 contexts in the GL_X11 engine, and checks
for version in all other engines (return NULL).
Add API wrappers for all OpenGL-ES 1.1 APIs (normal and debug
modes).
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre a0712e25e1 Evas GL: Add support for pbuffer surfaces
Supports only EGL for now :(

These pbuffer surfaces can be used to create dummy surfaces for
make_current and render threads.

@feature
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre 29e7f54ea0 Evas GL: Add evas_gl_surface_query
When using EGL, this function should return the properties of
a surface. Limited to a subset of known attributes.

Right now, this function will only work fine with EGL.
GLX support or any other engine is not implemented.

@feature
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre de7a8a3dab Evas GL: Add API evas_gl_rotation_get
This will be used to increase the chances of having direct
rendering (no fallback to FBO) even if the window is rotated.

The client is then responsible for handling the view rotation.

@feature
2014-10-20 12:16:07 +09:00
Jean-Philippe Andre cb5e88d20f Evas GL: Add APIs to get current surface/context
- evas_gl_current_surface_get
- evas_gl_current_context_get

@feature
2014-10-20 12:16:07 +09:00
Jean-Philippe Andre 8d6f873354 Evas GL: Add API evas_gl_error_get()
Similar in meaning to eglGetError()

@feature
2014-10-20 12:16:06 +09:00
Bogdan Devichev 1f9ace657b evas: fix warnings introduced by Evas_3D eet import/export feature.
Summary:
This is a fix of those warnings. Sorry for existence of them.
   CC       lib/evas/common/lib_evas_libevas_la-evas_alpha_main.lo
../../src/lib/evas/canvas/evas_3d_mesh_loader_eet.c:113:13: warning:
assignment from incompatible pointer type
     eet_file = _evas_3d_eet_file_new();
              ^
   CC       lib/evas/common/lib_evas_libevas_la-evas_blend_main.lo
   CC       lib/evas/common/lib_evas_libevas_la-evas_blit_main.lo
   CC       lib/evas/common/lib_evas_libevas_la-evas_convert_color.lo
../../src/lib/evas/canvas/evas_3d_mesh_saver_eet.c: In function
'evas_3d_mesh_save_eet':
../../src/lib/evas/canvas/evas_3d_mesh_saver_eet.c:159:13: warning:
assignment from incompatible pointer type
     eet_file = _evas_3d_eet_file_new();
              ^
   CC       lib/evas/common/lib_evas_libevas_la-evas_convert_colorspace.lo
   CC       lib/evas/common/lib_evas_libevas_la-evas_convert_gry_1.lo
../../src/lib/evas/canvas/evas_3d_eet.c: In function
'_evas_3d_eet_file_new':
../../src/lib/evas/canvas/evas_3d_eet.c:28:4: warning: return discards
'const' qualifier from pointer target type
     return creating_file;

Reviewers: cedric, artem.popov

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2014-10-08 18:48:42 +02:00
Jean-Philippe Andre fe2dcfb895 Evas: Remove unused array calculate_objects 2014-10-08 15:52:39 +09:00
Stefan Schmidt 5f2863cf87 evas/3d: Add declaration for new mesh functions.
They are used in other files but have never been declared.
2014-10-07 09:33:51 +02: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
Dmytro Dadyka 0d2f4dbc11 [Evas/evas-3d] Add shadow maps. Added two scene-API functions for enable and disable shadows on the scene. Added 6 light-API function for set and get the light projection.
Reviewers: raster, cedric, Hermet

Subscribers: raster, cedric

Differential Revision: https://phab.enlightenment.org/D1330
2014-09-03 21:19:16 +09:00
Jaehyun Cho b3d900e748 evas: Fix not to clean and re-render if position of object enabled map is changed
Summary: Fix not to clean and re-render if the position of an object enabled map is changed.

Reviewers: raster, cedric, Hermet

Reviewed By: Hermet

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1220
2014-08-07 15:32:40 +09:00