Commit Graph

91 Commits

Author SHA1 Message Date
Jean-Philippe Andre 748e6ad1b9 Evas GL common: Add very basic GL calls tracing method
Rewrap the GL calls to print them out. The arguments are not
interpreted. See the GL_ERRORS #define.
2015-05-13 10:24:24 +09:00
Cedric BAIL 71b7fc982a evas: remove the need to order the header correctly for Windows. 2015-05-07 09:53:10 +02:00
Oleksandr Shcherbina 0f6d101ad5 evas: add to Evas_GL_Image flag disable generate atlas.
Summary:
It is need in case Evas_3D_Mesh created with not normileze texture coordinate
and flag repeat mode for Evas_3D_Texture
Additional info see here https://phab.enlightenment.org/conpherence/54/
Use Evas_GL_Image for generation texture unit for Evas_3D_Texture
see here https://phab.enlightenment.org/D2371

Reviewers: jpeg, cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-07 09:53:09 +02:00
kabeer khan ce45d443c1 evas: fix rotation and flipping of image in gl engine
Summary:
fix rotation(90, 180, 270) and flipping(vertical, horizontal, transpose,
transverse) of evas image in gl engine backend.

@fix

T2338

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

Reviewers: cedric, jpeg

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-04-22 15:10:19 +02:00
Jean-Philippe Andre 0c7857024b Evas GL common: Enable vertex arrays only when requested
This should fix Dave's crash with the GL engine.

Indeed the pointer to the color array is passed directly
to the driver, without memcpy. Then, during glDrawArrays, the
driver will try to address it... but it could as well be NULL or
invalid. So, crashes would occur.

Also mark use_vertex as always true. We keep this field only for the
alloc() function.
2015-04-13 17:43:42 +09:00
Jean-Philippe Andre f8f1a3e9ed Evas GL common: Factorize GL shader selection code
Improve the shader selection function to handle all possible
cases. Only images really need special handling as they
support so many parameters.
2015-04-03 11:26:14 +09:00
Jean-Philippe Andre a3de2ee3fd Evas GL common: Factorize shader generation code
Remove all individual shaders, factorize everything into
one vertex and one fragment shader. All previous functionality
has been kept as is[*]. Some new features have been added
(new shader types).

This is a first step in simplifying and improving the shaders system.
Next: simplify shader selection

[*] Yeah, that's quite a bold statement here. Maybe I broke everything.
2015-04-03 11:26:13 +09:00
Jean-Philippe Andre ed157ee67b Evas masking: Implement line masking in GL
This commit also introduces a few whitespace changes...
2015-04-01 10:39:36 +09:00
Jean-Philippe Andre 740995e089 Evas GL generic: Simplify "scaled" images (used for masking)
Invert the meaning of scaled (w,h), so that im->(w,h) corresponds
to the final scaled size, and the original size is stored directly
in the texture itself.

This simplifies code a little bit.

Also, lift the limitation on the maximum texture size, as those
virtual textures are not limited by GPU texture size.
2015-04-01 09:59:49 +09:00
Jean-Philippe Andre 32009a0e8c Evas masking: Refactor GL code
Use the same method as for map masking:
- Pass absolute geometry of the mask to the push functions,
- Compute absolute position in the shader (like gl_Position)
  and apply scaling factor + offset to sample the mask.

Masking now uses a single vec4 attribute instead of hi-jacking
other vertices.

This way, all masking shaders share the same code and are way
simpler. On the other hand, the vertex shaders have a little bit
more work to do.
2015-04-01 09:53:55 +09:00
Youngbok Shin e197f8804f evas: Support bitmap embedded color font.
Summary:
Add the code for getting bitmap buffers from embedded color font,
And draw the bitmap buffers as images.
For drawing the bitmap buffers as images,
evas_common_draw_context_font_ext_set internal API is changed to
pass additional gl engine functions.
T2139
@feature

Test Plan:
1. Set a bitmap embedded color font to textblock.
2. Set a unicode emoticon text.
3. See the result.

Please check the sample unicode in the following link.
http://www.fileformat.info/info/unicode/char/1f3af/index.htm
http://www.fileformat.info/info/unicode/char/1f555/index.htm
http://www.fileformat.info/info/unicode/char/2600/index.htm
http://www.fileformat.info/info/unicode/char/263a/index.htm

Reviewers: tasn, woohyun, jpeg, raster

Reviewed By: raster

Subscribers: herdsman, cedric

Differential Revision: https://phab.enlightenment.org/D2084
2015-03-19 19:02:03 +09:00
Dongyeon Kim 0ff8936de8 Evas GL: Adjust function naming and remove macros
Summary:
Change function and variable names to more suitable ones.
Remove FBO_FUNC macros.
Little tidying up from previous commit.

Test Plan: Local Evas GL tests for 1.1, 2.0, and 3.0

Reviewers: jpeg

Subscribers: cedric, mer.kim, mythri, wonsik

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

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2015-03-16 15:56:49 +09:00
Dongyeon Kim 1a2c6ba1e1 Evas GL: Fix build errors for glx backend
Summary:
Fix build errors for glx backend made from previous commit
Revert parameter naming

Test Plan: Local Evas GL tests for 1.1, 2.0, and 3.0

Reviewers: jpeg

Subscribers: mythri, wonsik, cedric, mer.kim

Differential Revision: https://phab.enlightenment.org/D2117
2015-03-16 15:56:49 +09:00
Dongyeon Kim d8fc60e0e6 Evas GL: Use EGL image to share between Evas GL and GL backend
Summary:
When the context version between Evas GL and GL backend differs,
we cannot share texture between them.
So, when the driver has support for KHR_gl_texture_2D_image extension,
use EGL image to share between Evas GL and GL backend

Test Plan: Local Evas GL tests for 1.1, 2.0 and 3.0

Reviewers: jpeg

Subscribers: mythri, mer.kim, wonsik, cedric

Differential Revision: https://phab.enlightenment.org/D2115
2015-03-16 15:56:49 +09:00
Jean-Philippe Andre 8f57cbcdd6 Evas GL: Fix build errors and warnings from previous commit 2015-03-16 15:56:48 +09:00
Jean-Philippe Andre 03ab2e27c8 Evas GL common: Create OpenGL ES 3.x contexts by default
Automatically fallback to OpenGL ES 2.0 if OpenGL ES 3 is not supported.
This is a first step in trying to support GLES 3 for Evas GL.

This commit is also a wild test to see whether using GLES 3 contexts
by default will break anything. The theory says that GLES 3 is
backwards compatible with GLESv2.

So, if anything GL breaks for you... scream loudly!
But before reporting any bugs, please set the env variable:
- export EVAS_GL_DISABLE_GLES3=1

This does not add any requirement for GLESv3 support.
2015-03-05 20:59:53 +09:00
Jean-Philippe Andre f020171bf2 Evas GL common: Disable evas gl preload by default
Unfortunately, this "feature" has many problems and does not really
fix those it was supposed to address:

- Elm Photocam becomes horrible to use (the transition from
  low-res to high-res tiles triggers this miniature path).

- Evas async preload callback is called before the full image
  is ready (ie. the texture is not uploaded yet), when really
  the preload callback should be triggered only once the image
  is 100% ready. (TODO)

- Sometimes the miniature image keeps being used even though the
  main image has been uploaded (eg. with E background). Maybe the
  object image is not redrawn when it should.

- This uses a separate thread for the upload, which is both a good
  and bad idea because we need to do a make current. Also, this does
  not upload the full-res image tile by tile, but only in one pass,
  thus blocking the render loop until finished.

This patch changes the env var from "EVAS_GL_NOPRELOAD" to
"EVAS_GL_PRELOAD" (and only "1" will enable).

Sorry Cedric, we can talk later about how to improve this.
2015-03-04 17:31:31 +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 21051d3252 Evas masking: Use mask_smooth to differentiate "shaders"
If mask_smooth changes, it should trigger a flush of
the pipeline (and call glDrawArrays).

This may or may not fix some potential bugs with masking.
2015-03-02 20:47:17 +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
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 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 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 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
Dongyeon Kim 72f3e684d9 evas/gl_x11: introduce tbm native surface type
Summary:
This native surface type is based on the tbm surface used for the tizen platform.
EGL_TIZEN_image_native_surface EGL extension is used to map
tbm surface to an egl image
@feature

Reviewers: raster, cedric, jpeg

Subscribers: cedric, wonsik

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2015-02-10 14:48:22 +09:00
Jean-Philippe Andre 21d08f86e6 Evas GL: Add support for uniforms in the shaders
This will simplify greatly the code for map masking.
2015-02-10 12:00:37 +09:00
Jean-Philippe Andre 323db06279 Evas GL common: Remove unused filter_prog 2015-01-14 16:37:11 +09:00
Jean-Philippe Andre 80fe4b1673 Evas GL common: Add shader ID as debug info in the pipe
Simplifies code readability a bit and helps for debugging (with GDB).
2015-01-14 16:37:06 +09:00
Jean-Philippe Andre 1874ea9890 Evas masking: Fix evas map masking in GL
While this may look like a feature, it's definitely a fix.
2015-01-14 16:35:20 +09:00
Jean-Philippe Andre bb923d5586 Evas masking: Minor fixes in GL masking 2015-01-07 15:06:03 +09:00
Jean-Philippe Andre 44387b60a3 Evas masking: Add rectangle masking for GL 2015-01-07 15:06:03 +09:00
Jean-Philippe Andre 2bd5cf6e6f Evas masking: Use new texm sampler instead of texa
texa should be used only for RGB+A whereas texm should
be used for masking. This should fix RGB+A masking, too.
2015-01-07 15:06:03 +09:00
Jean-Philippe Andre a2604956f9 Evas masking: Add support for BGRA/ARGB masking
Also, refactor font & image GL masking.
2015-01-07 15:06:03 +09:00
Jean-Philippe Andre 1fac1dcf57 Evas masking: Font masking for GL 2015-01-07 15:06:03 +09:00
Jean-Philippe Andre 124ab102b7 Evas masking: Implement image masking for GL engines 2015-01-07 15:06:02 +09:00
Mun, Gwan-gyeong d1b8d52e0e evas/gl_drm: add native surface for wayland_egl_client.
Reviewers: zmike, devilhorns, cedric, gwanglim

Reviewed By: cedric, gwanglim

Subscribers: jpeg, torori, cedric

Differential Revision: https://phab.enlightenment.org/D1507
2014-12-04 17:59:30 +09:00
Jean-Philippe Andre e18886a2a3 Evas GL: Fix list of shaders to distribute
Some shader files (shd) were not included in EXTRA_DIST. This didn't break
the build because the .x file was correctly generated.
I guess the missing files in previous releases also had no impact because
the .h files would be generated and shipped.

Also generate the enum automagically. New shaders need to be added
to Makefile_Evas.am.
2014-11-14 10:01:30 +09:00
Jean-Philippe Andre 28a76266c6 Evas GL: Fix runtime linking issues
There is some mess with gl common functions that need to be
called from the engine itself, eg. error set/get.
2014-10-20 12:16:07 +09:00
ChunEon Park 026e767b86 evas: support anti-alias for gl line drawing. 2014-10-08 15:47:58 +09:00
Cedric Bail dde9a1e977 evas: allocate enougth atlas for all supported format. 2014-08-16 15:15:07 +02:00
Cedric BAIL 9a9d78dfcb evas: provide GetProcAddress by the engine. 2014-07-25 20:24:28 +02:00
Cedric BAIL 0d00b476cb evas: export symbol from gl_common so that loading gl_generic can expose them. 2014-07-11 15:32:51 +02:00
Jean-Philippe Andre 24f38eaf6d Evas gl: Replace all remaining references to mask stuff by alpha
Masking is not used (there even was a recent commit by Hermet to
remove most of the occurences of mask shaders in GL), and I've
introduced a new ETC1+Alpha feature. Replace the old texm and
associated variables by texa for alpha texures.
2014-07-11 12:20:07 +09:00
Jean-Philippe Andre ec9ffd0ae8 Evas gl: Fix invalid number of atlasses
Left-over from a local experiment where ETC1+Alpha had its own
texture pool. Not required.
2014-07-09 12:39:18 +09:00
Jean-Philippe Andre 48bcf182b4 Evas gl: Add support for ETC1+Alpha textures
Compile-in the required shaders, add support for the
new EVAS_COLORSPACE_ETC1_ALPHA, and upload textures as RGB+A
pairs.

@feature
2014-07-09 09:04:55 +09:00
ChunEon Park b3d11fae4c evas/gl - removed MASK ramains. 2014-07-07 17:08:22 +09:00