Commit Graph

1580 Commits

Author SHA1 Message Date
Jean-Philippe Andre e531ab9bc0 Evas GL: Use Eina_Strbuf for the extensions list
The usage of strcat/strncat was not safe, and even Coverity reported
about it.

Fixes CID 1256197:
CID 1256197 (#1 of 2): Buffer not null terminated (BUFFER_SIZE_WARNING)
1. buffer_size_warning: Calling strncpy with a maximum size argument
of 10240 bytes on destination array _gl_ext_string of size 10240 bytes
might leave the destination string unterminated.
2015-03-02 19:51:30 +09:00
Dongyeon Kim 753b2b6e78 Evas GL: remove evgl_init in gl_get_pixels_set
Summary:
gl_get_pixels_set is called in evas_object_image_render
even when evas gl is not used.
As gl_get_pixels_set does not actually call evas gl functions,
we can safely remove evgl_init macro here.

Reviewers: raster, cedric, jpeg, Hermet

Subscribers: cedric, mer.kim, wonsik

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

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2015-03-02 16:29:22 +09:00
Dongyeon Kim 80b21a7d3f evas/gl_x11: fix duplicated egl error check
Summary:
When egl window surface creation fails, eglGetError() is called twice,
thus removing error state.

Reviewers: cedric, Hermet, jpeg

Reviewed By: jpeg

Subscribers: mer.kim, wonsik, cedric

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

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2015-03-02 16:22:12 +09:00
Minkyoung Kim de797bbd3b Evas GL: Fix abnormal extension name.
Summary: Fix abnormal extension name.

Test Plan: local test.

Reviewers: jpeg

Reviewed By: jpeg

Subscribers: wonsik, cedric, spacegrapher

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

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2015-03-02 16:20:07 +09:00
Dongyeon Kim a32edfaf19 evas/gl: implement dynamic hint set using tbm surface
Summary:
Currently dynamic hint set is implemented using eglMapImageSEC extension,
which is no longer supported by any drivers (should be deprecated)
This patch implements dynamic hint set using Khronos extension EGL_TIZEN_image_native_surface.
Since tbm surface library is required for this, libtbm.so is queried at context new.

Test Plan: Local tests

Reviewers: raster, Hermet, cedric, jpeg

Subscribers: mer.kim, wonsik, cedric

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

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>

jpeg: I also fixed a few minor style issues and two warnings (bad function
names, glsym instead of secsym).
2015-03-02 15:55:47 +09:00
Jean-Philippe Andre 433d24cfa0 Evas GL common: Remove uniform-related stuff
Remove last traces of the uniforms stuff for shaders, that was
removed in the following commits: 6b48c106d3 and cfd337a758.

Don't use uniforms in the evas GL pipeline, at least not like that.
2015-03-02 11:30:34 +09:00
Chris Michael d7a8626f5b evas-gl-drm: Fix T2158: compile fails when --with-opengl=full is passed
Summary: This fixes compile for the gl_drm engine if
--with-opengl=full is passed on the cmd line. These changes are
based on the diff provided by spotrh in the above ticket.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-03-01 10:49:10 -05:00
Chris Michael f14a893ce5 evas-gl-drm: Cleanup compiler warnings for dbg/err messages
Summary: This commit compiles out the debug messages that were
generating compiler warnings during build. You can reenable these
messages if you uncomment GL_DRM_DBG in evas_engine.h

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-03-01 10:45:39 -05:00
Chris Michael 3bb11b938c evas-software-x11: Provide TBM Native Surface support for xcb engine
Summary: This adds support for native surfaces in xcb. Previously when
the TBM Native Surface support was added, it broke the xcb build.
These commits fix that issue.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-27 10:36:58 -05:00
Chris Michael 24c92d8caf evas-software-x11: Remove improper EINA_UNUSED for function parameter
Summary: In the _native_bind_cb function, the data parameter is
actually used inside here, so having EINA_UNUSED on the function
parameter is incorrect.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-27 10:29:06 -05:00
Jean-Philippe Andre 2e3ee0e658 Evas masking: Fix double free() with scaled images
The function image_scaled_update() frees() the old scaled image
passed as input if it doesn't match the old dimensions. This commit
will avoid double frees.
2015-02-27 17:56:49 +09:00
Jean-Philippe Andre ab89dc401c Evas masking: Check fill properties to consider image as filled
Edje may not set the filled flag on an image even if its fill
properties make it fill the whole object. For masking, it can
then be considered as a filled image.
2015-02-27 15:57:36 +09:00
Jean-Philippe Andre 87aed21c05 Evas masking: Remove commented-out code
I shouldn't have pushed this :)
2015-02-27 14:11:59 +09:00
Jean-Philippe Andre 0da6278af8 Evas masking: Fix masking of maps in GL
This completes the transition to auto-scaled mask images when
using the GL engine. Now the shaders do the work on-the-fly of
resizing the mask.
2015-02-27 13:06:09 +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
Bogdan Devichev 5eba6ae468 evas-3d: fix incorrect reading of .obj file which had an empty line before data in unix encoding.
Summary:
For example of a bug, part of .obj file:
vn 0.5536 -0.7200 -0.4185\n
vn -0.5536 -0.7200 -0.4185\n
\# 239 vertex normals\n
\n
vt 0.4998 0.2618 0.0000\n(lines like this were ignored)
vt 0.5205 0.2550 0.0000\n
vt 0.5249 0.2618 0.0000\n

@fix

Test Plan: Run colorpick example. Before and after this update. ("M15.obj" has fixed places.)

Reviewers: cedric, Hermet, raster

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-26 21:06:38 +01:00
Jean-Philippe Andre b815f57078 Evas masking: Simplify map masking shaders.
Use vertex shader for all coordinates computations.
This reduces the number of varyings used.
2015-02-26 17:49:21 +09:00
Jean-Philippe Andre 964d6e559f Evas GL: Fix leak of surfaces with GLES 1.1
When destroying a GLES 1.1 surface, it is necessary to also
destroy and remove the main surface from the list.

This issue probably never really showed up because people
don't:
- use GLES 1.1
- constantly create & destroy new Evas GL surfaces
- but mostly no one cares about 1.1 anymore :)

@fix
2015-02-25 15:01:45 +09:00
Jean-Philippe Andre 29da1113ee Evas GL: Restore viewport and scissor test for GLESv1
This is necessary when switching back to direct rendering.
But I suspect there are other corner cases that we didn't spot.
2015-02-24 22:18:53 +09:00
Jean-Philippe Andre ae2061dbe2 Evas GL: Fix support for GLES 1.1 indirect rendering
This requires a special context that matches the configuration
required for GLES 1.1. Otherwise eglMakeCurrent() would fail
miserably with EGL_BAD_MATCH in case of indirect rendering
(at least on some drivers).
2015-02-24 22:12:00 +09:00
Minkyoung Kim 9a0f591314 Evas GL: Wrap glGetString() for gles1.x.
Summary:
- Implement glGetString() wrapper func in the same way as gles2.x.
- Small bug fix glGetString() for gles2.x.

Reviewers: cedric, raster, jpeg

Subscribers: cedric, mythri, wonsik, spacegrapher

Differential Revision: https://phab.enlightenment.org/D2033
2015-02-24 22:12:00 +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
Minkyoung Kim 65775c2e04 Evas GL:Add evasgl extension macro '_EVASGL_EXT_DRVNAME_PRIVATE'.
Summary:
To distinguish supported extension name from not supported.
This patch can be solution to the problem, glGetString() returns non-supported extention name.

Test Plan: Local tests

Reviewers: raster, jpeg, Hermet, cedric

Subscribers: cedric, spacegrapher, wonsik

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

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2015-02-24 13:57:17 +09:00
kabeer khan 4f7718539d evas: fix evas software_generic backend while doing rotation in stress test.
Summary:
Resolved T2133 by using eng_image_data_get instead of evas_cache_image_pixels to
get image pixels. Also made other minor changes for error handling.

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

Reviewers: cedric

Subscribers: cedric

Maniphest Tasks: T2133

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-23 15:46:54 +01:00
Dmytro Dadyka 1b142d09d9 evas: Evas_3D - add parallax occlusion shading.
Reviewers: Hermet, cedric

Reviewed By: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2018
2015-02-23 15:46:25 +01:00
Dmytro Dadyka 49f350d046 evas: Evas_3D - add texture units count checking.
Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-23 15:41:37 +01:00
mythri.venugopal 88fc0e0568 Evas GL: Fix issues in gles extensions initialisation
Summary:
Fix 1- If extension is not listed in GL_EXTENSIONS, do not try
to get the function address of the extension functions.
Fix 2- For GL_EXT_robustness, for GLESv1 version, do not try to
export glGetnUniformXXX functions.

Reviewers: jpeg

Subscribers: cedric

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

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2015-02-23 21:21:28 +09:00
Cedric BAIL 93333ede15 evas: refactor shutdown. 2015-02-23 11:35:29 +01:00
Cedric BAIL 552a38cde5 evas: refactor software engine initialisation. 2015-02-20 15:04:52 +01:00
Cedric BAIL b115fe108d evas: apparently some configuration can't generate this file correctly, so putting it in. 2015-02-19 23:48:52 +01:00
Cedric BAIL d6f2dd4dd0 evas: remove compilation warning. 2015-02-18 22:42:17 +01:00
Dmytro Dadyka b9b5ced501 evas: Evas_3D - refactor shader system.
Reviewers: Hermet, raster, jpeg, cedric

Subscribers: artem.popov, cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-18 22:42:07 +01:00
Minkyoung Kim 4aeb8a4e7d evas: fix error checking of eglBindAPI.
Summary: If eglGetError sequencially called, second eglGetError() doesn't give the information of real Error.

@fix

Reviewers: raster, jpeg, cedric, Hermet

Subscribers: cedric, spacegrapher, wonsik

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-17 16:34:41 +01:00
Minkyoung Kim c972994e01 evas: Evas GL - add glGetError() after surface capability test.
Summary:
After using gl funcs, must call glGetError().
To prevent wrong error catch for subsequent glGetError().

Test Plan: Local tests

Reviewers: raster, jpeg, Hermet, cedric

Reviewed By: cedric

Subscribers: spacegrapher, wonsik, cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-16 11:54:27 +01:00
Jean-Philippe Andre 968751f835 Evas: Free variable in error path
Fixes CID 1270032
  Resource leaks  (RESOURCE_LEAK)
  Variable "exim" going out of scope leaks the storage it points to.
2015-02-13 11:07:39 +09:00
Mike Blumenkrantz 38f1f9c5f2 ee-win32 probably might compile now
<vtorri> bad Mike !
<vtorri> the name of the function is not good, so compilation fails on Windows
<vtorri> remove 'object' in the name of the definition of the function :)

@fix
2015-02-12 16:21:52 -05:00
Jean-Philippe Andre 6b48c106d3 Revert "Evas GL: Add support for uniforms in the shaders"
This reverts commit 21d08f86e6.
2015-02-12 15:18:19 +09:00
Jean-Philippe Andre cfd337a758 Revert "Evas GL common: Use uniform instead of attribute for sample"
This reverts commit 986b60eaf0.
Added PUSH_SAMPLE for simplicity.

It was dumb of me to use uniforms, so I added a comment to prevent
other dumb people from making the same mistake later.
2015-02-12 15:01:39 +09:00
Jean-Philippe Andre 651f0ae241 Evas GL common: Improve code readability (simplify macro)
The exact same ugly macro would appear hundreds of times in the GL
code:
  GLERR(__FUNCTION__, __FILE__, __LINE__, "");

Instead, override the common GL functions iif GL_ERRORS is defined.
This greatly simplifies code and removes tons of useless lines.
Also, this will give better debugging output as the exact code line
is printed, and the function name is also printed.

Also, fix linking to the glerr function.

This is a code cleanup. Hopefully I didn't break anything with this
big operation of find & replace.
2015-02-12 11:23:03 +09:00
Jean-Philippe Andre 9eaadb2eb7 Evas GL common: Simplify GL pipe code with macros
A lot of the code was just brutal copy & paste.
Reduced by using simpler macros, which I believe are even
more readable.
2015-02-12 11:23:03 +09:00
Jean-Philippe Andre 7e26c30522 Evas GL common: Call glGetUniformLocation as early as possible
This should speed up setting uniforms in the shaders, by storing
their locations in the Evas_GL_Program description.

I kept the previous solution with name as fallback, but it won't
actually be used with the current shaders.
2015-02-12 11:23:03 +09:00
Jean-Philippe Andre 986b60eaf0 Evas GL common: Use uniform instead of attribute for sample
Image and texture programs "12", "21" and "22" used tex_sample
as a texture attribute passed to the vertex shader. Instead of
this seemingly hackish solution, use a vec2 uniform.
2015-02-12 11:23:03 +09:00
Bogdan Devichev 1506130866 evas: Evas_3D - iport/export of Obj format can be read even if obj-file does not have normals or tex-coords.
Summary:
This commit fixed several bugs, and show what was be fixed.

Bugs:
- When designer save obj file in Blender, he/she can set flags (fig 1). Normals and UV coords flags was necessary  for obj loader. Loader crushed when they are not set as true. It fixed by this commit.
- Another loaders set default values to data which aren't in loading file, so mesh need more memory for unused data. It fixed by this commit for obj and will be fixed for another formats in future.
- Saver saved incorrect data if normals or tex_coords was not set in mesh in evas. Now it fixed.
- Saver failed if it save mesh without material. It fixed and in this case material file is not created now.
- Also fixed some leaks and undefined behavior which valgrind shows.

Example:
- Example shows cases described above. Example use files saved with different flags for it.

Resources:
- man_mesh is replaced by several smaller file, to use them for showing new features and fixes. For example, similar to that models can be added when implement work with material for obj, work with different flags for obj loader/saver etc. (big count of man_meshes is to much memory).
- texture for home is flipped, because of bug with texture in efl to see if tex_coords is incorrect.

Test:
- test should be rewritten in future, because another formats still use default values for normals and tex_coords. And test can not pass for all types of obj file because of standardization for any format in him.

Test Plan: Test suit will be rewritten after correcting of other formats (they will set NULL to file when save an empty data (like mesh without normals))

Reviewers: Hermet, raster, cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-11 18:31:53 +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 b643dabc36 Evas masking: Force BLEND mode in case of image masking (GL)
This fixes some cases where the image has no alpha and COPY mode
is used, but a mask is also applied. In that case, masking
takes precedence and BLEND mode is used.

@fix
2015-02-10 18:18:05 +09:00
Jean-Philippe Andre 2450a249e7 evas/software_x11: Restore legacy compatibility with old SLP DRM
I really REAAALLLY doubt that was necessary, but I'm still adding
these few changes for legacy compatibility.

This lib seriously should have had a stable API.
2015-02-10 17:42:01 +09:00
Dongyeon Kim 21bc9bee48 evas/software_x11: replace drm_slp with tbm
Summary:
libdrm_slp has been replaced with libtbm, so modify xlib swapper
to use tbm apis instead of drm_slp apis

Test Plan: Local tests

Reviewers: raster, Hermet, cedric, jpeg

Reviewed By: jpeg

Subscribers: cedric, wonsik

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

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2015-02-10 17:05:06 +09:00
Jean-Philippe Andre 4702670146 Evas sw_x11: Fix previous patches
Restore support for Evas GL with the software engine (OSMesa).
2015-02-10 15:10:23 +09:00
Dongyeon Kim c0d990c724 evas/software_x11: implement tbm native surface type
Summary:
This native surface type is based on the tbm surface used for the tizen platform.
For the software_x11 backend, image data is retrieved from tbm surface
and color format converted appropriately.
This will only work when libtbm.so is present in the system.
@feature

Test Plan: Local tests

Reviewers: raster, cedric, jpeg, Hermet

Subscribers: wonsik, cedric

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2015-02-10 14:48:53 +09:00