Commit Graph

50 Commits

Author SHA1 Message Date
Cedric BAIL 84c6d3332e evas: remove unused engine data from error set/get code. 2017-08-25 10:52:26 -07:00
Uma Devika d4ab6ff90a Evas and Eolian : Freed string buffer
Summary:
Summary : String buffer returned by eina_strbuf_new() is not freed in some cases

@Fix

Signed-off-by: Uma Devika <u.bodapati@samsung.com>

Reviewers: cedric, tasn, jpeg, raster, singh.amitesh

Subscribers: tanwar.umesh07, yashu21985, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5000
2017-07-07 13:22:53 +09:00
DaeKwang Ryu 8b5d5a5a8d EvasGL: Add support for Evas GL 3.1
Summary:
2 wrapper functions are added.
(glFramebufferParameteri, glGetFramebufferParameteriv)

update gl2ext.h(generated 20160209) in evas_gl.h

Test Plan: OpenGL ES Conformance Test

Reviewers: jpeg

Subscribers: spacegrapher, wonsik, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3782
2016-07-04 20:47:57 +09:00
Vincent Torri 47ed848a87 Evil: integrate the dlfcn code into Evil
This will remove some incompatibilities with other packages,
especially for win-builds
2015-12-29 22:13:58 +09:00
Dongyeon Kim 65b2a43639 Evas GL: Minimize internal resource creation
Summary:
Evas GL maintains internal resource (XWindow, EGL Window Surface, EGL Context)
per thread to be used for make current when indirect rendering is used.
Currently this internal resource is created regardless of current rendering mode,
and always created when a new Evas GL thread is created by the application.
Internal resource created in a new thread is not freed until evas shuts down
in the main thread, so this causes memory/fd leak.
This can be fixed by creating internal resource only in necessary cases (ie. indirect rendering),
and adding tls resource destructor to be called when thread exits.
2015-11-11 15:59:52 +09:00
Wonsik Jung 64890d260f EvasGL: Add error handling for GL_OES_EGL_image/EGL_Image_KHR
Summary:
Add code for exception case for GL_OES_EGL_image/EGL_Image_KHR
These EvasGL's extension functions does not have the code for exception case.
e.g. EvasGLImage is NULL.

Test Plan: Native Pixmap surface's example is created and changed EvasGLImage's value(e.g. valid data or NULL)

Reviewers: raster, spacegrapher, jpeg

Subscribers: scholb.kim, JoogabYun, dkdk, cedric

Differential Revision: https://phab.enlightenment.org/D3284
2015-11-11 14:35:56 +09:00
DaeKwang Ryu 5ccd783069 Evas GL: implement GLES2/GLES3 wrapper functions
Summary:
I found some bugs in EvasGL with OpenGL ES conformance test.

6 wrapper functions are added for GLES2,
(glDeleteFramebuffers, glFramebufferRenderbuffer
glFramebufferTexture2D, glGetError
glGetFloatv, glGetFramebufferAttachmentParameteriv)

3 wrapper fucntions are added for GLES3.
(glDrawbuffers, glGetStringi, glReadBuffer)

Test Plan:
GLES3 sample app,
EvasGL(OpenGL ES CTS) for 2.0 is passed.
For 3.0, 10 TCs are failed (Total : 2994TCs).

Reviewers: wonsik, spacegrapher, jpeg

Subscribers: cedric, JoogabYun, scholb.kim

Maniphest Tasks: T2621

Differential Revision: https://phab.enlightenment.org/D3301
2015-11-11 14:35:50 +09:00
Jean-Philippe Andre e09a4094be Evas GL: Add EGL_KHR_surfaceless_context since it is supported
See 3e39bf3638.
Surfaceless contexts are supported even if the driver does not
support them.
2015-10-15 16:20:53 +09:00
Dongyeon Kim bea42e6a00 Evas GL: Restore current context to evas gl context when the backend has taken over
Summary:
When Evas GL apis are called outside of on pixels callback,
evas gl backend context may have been made current, and Evas GL will
render into a wrong context.
So here we provide context restore mechanism of keeping track of
currently bound context and calling make current when needed.
@feature

Test Plan: Run Evas GL test cases

Reviewers: jpeg, cedric

Subscribers: mythri, mer.kim, wonsik, cedric

Differential Revision: https://phab.enlightenment.org/D2956
2015-08-18 18:31:40 +09:00
Jean-Philippe Andre 8942c0c29b Evas GL: Fix sync, wlbuffer and image egl ext functions
Before this patch, those EGL/EvasGL functions can not work
without a current context. But EGL does not require any
current context for those to work, or at least, this should
be left to the driver to decide.

Evas GL was only able to get a pointer to the display
if a context was current.

The display pointer should be infered from Evas_GL unless
we can find a current display. EGL does not require a
context to be current in most of these function calls.

This should bring evasgl a little bit closer to EGL in terms
of behaviour (those are EGL-only extensions, btw).

Thanks @spacegrapher for the quick review

@fix
2015-07-17 14:47:42 +09:00
Jean-Philippe Andre 576f2ccab7 Evas GL: Fix evasglImageDestroy() from non-evasgl threads
If the TLS variable was not initialized, Evas GL can't get a pointer
to a valid EGLDisplay which is required by eglImageDestroy.

So, we keep track of the dpy used at creation time and use that
if we're in another thread.
2015-07-16 19:50:38 +09:00
Jean-Philippe Andre 8d72372fa7 Evas GL: Fix error message (ERR --> INF) 2015-06-15 17:51:36 +09:00
Dongyeon Kim ae91db021b Evas GL: Pass correct attachment enum for glDiscardFramebufferEXT
Summary:
When default framebuffer(0) is bound, attachment should contain
COLOR, DEPTH or STENCIL for glDiscardFramebufferEXT.
When a framebuffer object is bound, attachment should contain
COLOR_ATTACHMENT0, DEPTH_ATTACHMENT or STENCIL_ATTACHMENT.
This should be correctly taken into account for indirect rendering,
where internal FBO is used.
@fix
2015-06-03 11:30:22 +09:00
Dongyeon Kim 660bfcf3c2 Evas GL: Separate EGL and GL extension lists
Summary:
Separate EGL extensions from GL/GLES extension list, since
we have extension list for each GL version, and we do not want to
check EGL extensions differently when different GL versions are used.
This also simplifies extension string get function as we just need to
concatenate EGL and GL extensions rathan than keeping track of
GL extensions only.
2015-06-03 11:30:22 +09:00
Dongyeon Kim e789b24ff4 Evas GL: 1.x support for GLX
Summary:
Now we can support EVAS_GL_GLES_1_X version for GLX backend
with both direct and indirect rendering.
Refactored api get functions to have similar code path for each version.
@feature

Test Plan: Evas GL test case

Reviewers: cedric, jpeg

Subscribers: cedric, mer.kim, mythri, wonsik

Differential Revision: https://phab.enlightenment.org/D2342
2015-06-03 11:30:21 +09:00
Mike Blumenkrantz 35c0dfde1d evas-gl common: clarify cryptic error message 2015-05-04 17:11:43 -04:00
Jean-Philippe Andre 13c3d3d7d6 Evas GL: Fix GL_X11 engine when using GLX
eglGetProcAddress is obviously not supported in that case.
2015-03-16 17:44:20 +09:00
Dongyeon Kim eae786917c Evas GL: change function naming and small bug fixes
Summary:
Remove gles1 prefixes for functions that are also used by gles3.
Refactor evgl_make_current a little bit.
Destroy indirect context properly.
Some log message changes and typo fixes.

Test Plan: Local tests on desktop PC

Reviewers: jpeg

Subscribers: mythri, mer.kim, wonsik, cedric

Differential Revision: https://phab.enlightenment.org/D2104
2015-03-16 15:56:48 +09:00
Jean-Philippe Andre 8f57cbcdd6 Evas GL: Fix build errors and warnings from previous commit 2015-03-16 15:56:48 +09:00
mythri.venugopal 4d1a45627f Evas GL: Add support for Evas GL 3.0
Summary:
This should enable applications to use GLES 3.0 through evas gl.
Todo: Fix indirect rendering issue occuring because texture objects
cannot be shared between different version of GLES contexts.
Todo: extension pointers need to be updated for GLES 3.0

Reviewers: wonsik, spacegrapher, jpeg

Subscribers: cedric

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

@feature
2015-03-16 15:56:43 +09:00
Jean-Philippe Andre 611741e65d Evas GL: Fix list of extensions with GLESv1
EGL/EvasGL extensions are also valid with GLESv1.
This means evasglCreateImage could be used.

@fix
2015-03-05 20:59:50 +09:00
Jean-Philippe Andre be3b011822 Evas GL: Fix build error on some systems w/o Wayland
Thanks Mythri for the report.
wl_display and wl_resource is declared in eglmesaext.h but older
systems may not have that.
2015-03-03 20:57:59 +09:00
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
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
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
mythri.venugopal 48d8cdb4dd Evas GL: Fix GLES1.1 extension initialisation bug
Summary:
Extension function pointer initialisation requires glGetString(GL_EXTENSIONS).
To get GLESv1 extension string, GLESv1 context has to be bound.
Change involves updating extensions after GLESv1 context has been bound.

Reviewers: jpeg

Subscribers: cedric

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

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2015-02-09 14:28:16 +09:00
Jean-Philippe Andre 8f6b34d4cc Evas GL: Fix list of GLES 1.1 extensions
We should use GLESv1 functions in a GLESv1 context to scan for
GLESv1 extensions. Makes sense yeah?

This should expose the proper list... especially enabling FBO
extension when it's supported by the driver.
2014-12-19 18:14:25 +09:00
Gwanglim Lee 9eefb3ea89 Evas GL: Add support for bind_wayland_display extension
This provides EGL_WL_bind_wayland_display EGL extension to bind
and unbind the wl_display of a wayland server to an EGLDisplay.

@feature
2014-12-02 22:45:36 +09:00
Jean-Philippe Andre 151eeacec8 Evas GL: Use strncat and strncpy for safety
Fixes Coverity reports:
- CID 1256183

Coverity was a bit stupid there. It knows the size of both
strings and complained about unsafe strcpy. It should have
complained about unsafe strcat instead.
2014-11-28 16:26:49 +09:00
Jean-Philippe Andre 02d123be77 Evas GL: Fix up some more desktop GL extensions
OpenGL 1.2 already supports some of the features that
GLESv2 has as extensions:
- GL_EXT_read_format_bgra
- GL_EXT_texture_format_BGRA8888
- GL_EXT_texture_type_2_10_10_10_REV

Also, we need to check the proper ARB name of some extensions when
running on desktop, instead of their OES/IMG/EXT equivalent:
- GL_ARB_texture_float
- GL_ARB_texture_half_float
- GL_ARB_texture_non_power_of_two
- GL_ARB_half_float_vertex
- GL_EXT_packed_depth_stencil
2014-11-27 21:07:24 +09:00
Jean-Philippe Andre 45374e2536 Evas GL: Also add read bgra for desktop GL 2014-11-27 20:50:47 +09:00
Jean-Philippe Andre 9be96f4b96 Evas GL: Advertise support for npot on desktop
The extension name is GL_ARB_texture_non_power_of_two
for desktop GL, but GL_OES_texture_npot for GLES.

We will consider the extensions compatible, I believe
the GLES version is a subset of the desktop one. Not sure
if that's 100% true.
2014-11-27 20:50:47 +09:00
Jean-Philippe Andre eaefb7c047 Evas GL: Always support BGRA8888 on desktop GL 2014-11-27 20:50:47 +09:00
Jean-Philippe Andre 1a403849dc Evas GL: Wrap glGetString for VERSION
- glGetString(GL_VERSION) should not return "OpenGL ES 3.0" because
  GLESv3 is not supported yet.

- GL_EXTENSIONS should return only the list of supported extensions
  --> disabled for now as the whitelist of safe extensions is way
      too small.
2014-11-19 16:22:37 +09:00
Jean-Philippe Andre 198a508f9d Evas GL: Scan extensions for OpenGL-ES 1.1 2014-11-14 10:43:00 +09:00
Jean-Philippe Andre d2aee4e5ca Evas GL: Add support for some required extensions
- debug
- debug_label
- debug_marker
2014-11-14 10:43:00 +09:00
Jean-Philippe Andre 56a64756eb Evas GL: Introduce concept of safe extensions
This will mark some extension functions as "safe", which means
we don't need to wrap them in order to expose them.

All the known extensions from Evas_GL_API have been marked as safe
for now.

In the future, we may encounter extensions that are not safe
out of the box, but can be wrapped. At that time, we will have
to mark them as safe but return the pointer to the wrapper instead.
Until then, only whitelisted extensions will be supported.

@feature
2014-11-14 10:43:00 +09:00
Jean-Philippe Andre aff423e3bd Evas GL: Introduce macro _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
It will be used to link to extension functions that need no
wrapping.
2014-11-14 10:43:00 +09:00
Jean-Philippe Andre ce3146b262 Evas GL: Add original extension names to the EVAS_GL_EXTENSIONS string
The idea is that normal opengl applications might very well want to
check for an extension using the usual string and not have to do
something special just because they're using evas_gl and not egl.
2014-11-14 10:42:59 +09:00
Jean-Philippe Andre f3226f5e81 Evas GL: Fix potential crash
Welp, it looks like this crash actually happened once even though
it should not. glGetString() seems to have returned NULL somehow.
2014-10-29 15:12:53 +09:00
Jean-Philippe Andre f30f55f9f4 Evas GL: Fix compilation for EGL/GLES
Configure with --with-opengl=es --enable-egl
Fixes runtime link dependencies
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre 81bf993c6c Evas GL: Add support for fence_sync and similar extensions
This should add support for the following EGL extensions:
- EGL_KHR_fence_sync
- EGL_KHR_reusable_sync (eglSignalSyncKHR)
- EGL_KHR_wait_sync (eglWaitSyncKHR)

@feature
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre 6848cf40b6 Evas GL: Add evasglCreateImageForContext + import defs
evas gl CreateImage function was assuming the current context
should be used to create an image, while the equivalent EGL function
specifically requires the context to be specified.

This also imports some definitions for CreateImage.

And fixes typo in glEGLImageTargetRenderbufferStorageOES.

This adds new functions in Evas_GL_API struct. The version
number will be bumped to 2 in a later commit.

@feature
2014-10-20 12:16:08 +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
Sung W. Park 90bbc21d02 evas_gl : Fixed macro substitution bug in evas_gl
In evas_gl_api_ext_def.h there're calls such as:

    _EVASGL_EXT_DRVNAME(EGL_KHR_image_base)

    The macro is defined in evas_gl_api_ext.c as:

    (strstr(glexts, #name) != NULL || strstr(glueexts, #name) != NULL)

    if (_EVASGL_EXT_CHECK_SUPPORT(name)) *ext_support = 1;

    But EGL_KHR_image_base is itself a macro, which is defined
    in EGL/eglext.h like this:

    Thus, the _EVASGL_EXT_CHECK_SUPPORT macro will unwrap into:

    (strstr(glexts, "1") != NULL || strstr(glueexts, "1") != NULL)

    instead of intended:

    (strstr(glexts, "EGL_KHR_image_base") != NULL ||
     strstr(glueexts, "EGL_KHR_image_base") != NULL)

    This patch fixes this by applying stringification earlier in
    _EVASGL_EXT_DRVNAME

Bugfix reported by jinhyung.jo@samsung.com
2013-11-13 15:39:12 +09:00
Chris Michael 50f446199a Fix 'return' with no value, in function returning non-void
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-05-14 10:49:14 +01:00
Sung W. Park 289a666333 evas: Fixed evas_gl multi-window support design issue.
Evas engine is created per window but evas_gl engine was not properly
updating the engine info for new windows that are created. So, addressed
the design issue by passing engine_data to evas_gl engine apis..
2013-05-08 18:39:12 +09:00
Carsten Haitzler 4eed45ae88 Small adjustment to gl engines to use procaddress if found and NOT
fall back to dlsym if such a "getprocaddress" is around.
2013-03-08 19:35:36 +09:00
Sung Park 57f2e02b9e Fixed a bug where if an image object rendered using Evas GL
direct rendering and then another image object using Native
Surface rendering, there was a potential for it to fall into
the same direct rendering path.

Also, fixed some minor Evas GL extension bugs that came from refactoring.



SVN revision: 79532
2012-11-22 07:58:06 +00:00
Vincent Torri c15e9c6575 merge: and now Evas
I've tested make -j 3 install and it works nicely

I've tested expedite with software and opengl xlib,
and it works. Not tested other engines, so please
report any problems (engines or other) on the ML.

TODO: examples and tests, I'll add them later

ISSUE: Eina_Unicode size check. It indirectly depends on
       eina_config.h, which is created at the end of the
       configure script. So its size is always 0. I don't
       know how that size is used, so I can't do a lot,
       for now.


SVN revision: 78895
2012-11-04 11:51:42 +00:00