Work done by Jaeun Choi, rebased & squashed by jpeg.
This commit introduces changes to the low-level draw functions
of the SW engine considering the existence of an alpha mask image.
Features:
- Font masking (TEXT, TEXTBLOCK),
- Rectangle masking,
- Image masking (all image scaling functions should be handled).
The mask image itself is not yet set in the draw context (see
following commits).
@feature
Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
Summary:
Without EGL_PLATFORM environment variable, eglInitialize() can be
failed because egl tried to load DRM platform instead of X11 platform and it
tried to handle XDisplay pointer as a gbm_device pointer as well.
The failure seems to be occured especially if the egl was built
with DRM platform as native platform.
This revision can prevent the failure by indicating proper egl platform using
EGL_PLATFORM environment variable.
@fix
Reviewers: gwanglim, jaehwan, seoz
Reviewed By: seoz
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1828
If MSAA was requested, it is very likely that no config was
found (depending on the driver), so we'll try again without
MSAA. Yeah, this might not look very smooth but it should be
better that failing at eglMakeCurrent.
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.
Summary: This fixes Coverity CID1257606 and CID1257607: Dereferencing
null return value. _evgl_tls_resource_get Can return NULL so we should
be checking that returned value before trying to use it
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
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.
Summary: This fixes a leak in the xcb engine where the Outbuf_Region
was not being freed.
@fix
Signed-off-by: kabeer khan <kabeer.khan@samsung.com>
Reviewers: devilhorns
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1750
If an app calls glDisable(SCISSORS) and uses direct rendering,
then the DR scissors were dropped and so glClear would erase
the contents of the entire canvas, instead of being restricted
to the image object.
Example scenario:
- Create a direct rendered Evas GL 'sfc' 'ctx'
- Create a PBuffer dummy surface, make it current
- Do some stuff
- Make current (NULL, NULL) to go back to no target
- Make current (sfc, ctx)
--> glClear() will not render anything on screen
Reason:
The current FBO binding is still set to the implicit FBO
bound to the PBuffer surface (it could be any surface, really).
If the node is not visible, it is not rendered, which improves performance.
@feature.
Reviewers: raster, Hermet, cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1722
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
A little fix of copy-paste, there were problems while changing texture coordinates of indices.
@fix
Reviewers: raster, Hermet, cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1725
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Since this struct is likely to grow in size over time, client apps
built against future versions of EFL might start indexing fields
that are not present in the current form.
Also, don't reset the struct memory as this would break
multithreaded GL applications.
While this is not exactly a fix, I'll backport this.
@fix
Summary: Evas compilation was broken for --with-opengl=es due to the
use of GL_R16 (which is not defined for EGL).
NB: This may Not be the Proper fix, but at least it compiles now.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Reviewers: raster, Hermet, cedric
Reviewed By: cedric
Subscribers: cedric
The texture used to store the depth map should be a single-channel texture.
@fix
Differential Revision: https://phab.enlightenment.org/D1713
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
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.
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
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.
Carefully select the requested EGL config and match it with
the available visual from X, including the following options:
- Stencil
- Depth
- MSAA
TODO: The same thing for GLX. And fix direct rendering as well.
This is a new attempt at avoiding reload of an image
that failed to load during async preload.
See 42d2f8a12b (reverted).
I still can't figure out why setting load_error does not
work as expected (E pager becomes blank).
- 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.
Apps would crash if they call make current without creating
a surface in the same thread. I don't see a good reason why
we should have this a limitation.
It will be triggered when EVAS_GL_API_DEBUG is set.
Yeah, that's abusing the variable a bit, as it was intended for
GL calls only, but this is pretty harmless.
Also add string "GL_DEPTH_STENCIL".
NOTE: The draw_buffers extension might need to be checked more and
wrapped, if it can have adverse effects on how Evas works (could
it replace the default render target?).
This adds support for the following extensions:
- disjoint_timer_query
- occlusion_query_boolean
- alpha_test
- draw_buffers
- read_buffer
- read_buffer_front
- framebuffer_blit
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
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.
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.
All shaders will be in a single .x (C) file.
There shall be no more useless .h files.
This also removes the need for awk (replaced by sed and bash stuff)
this cleans oyt a few bits o9f old glx context handling code that are
no longer used as well as avoids causing server-side to crash on
tryng to set a "none" glxwindow as current. this is what cases the
nvidia server-side crashes.
Summary: This commit fixes compiler warning:
modules/evas/engines/gl_common/evas_gl_3d.c:1322:48: warning: 'ld' may
be used uninitialized in this function [-Wmaybe-uninitialized]. We
declare 'ld' as NULL now, and check it is valid before using it.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary: glsym_evas_gl_common_error_set used here leads to an implicit
declaration in compiler warnings. Remove the call to that function and
just print out an error message. This is a cleanup function anyway.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary: In fixing a Coverity issue, I copy/pasted a call to
evas_gl_common_error_set without compiling :( Bad me !! This commit
fixes the issue (data was undefined). Since evas_gl_common_error_set can
take NULL as the data parameter, lets use that.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
evas gl window was freed before new one was created getting shared ctx
to 0 refcount thus freeing everything there - BAD. fix. new issue in
git, not from release
so this is a re-try at the evas gl destination alpha fix. this is what
cedric tried, but done RIGHT. it required adding an ecore_x call to
create a window with correct visual/colormap. it requires doing
visuals totally correctly all the way from ecore_evas to the evas
gl_x11 core. nvidia drivers are very picky about visuals. i also had
to vid the egl/gles code too to do the same thing. nvidia gles/egl
drivers are also picky, mesa is not. this all requires a lot of code
changes. it's far from trivial
this isn't backported for a few reasons:
1. verify this fix doesn't break for anyone.
i tested:
nvidia glx + egl/gles
intel glx + egl/gles
radeon glx
it needs wider testing. nouveau, fglrx for starters and maybe
some other gles/egl drivers.
2. have some review time
3. time to settle before blasting to stable branches
@fix
Summary: The function prototype for eng_context_create has recently
changed in gl_common, however nobody thought it wise to update all
engines using it, so this commit fixes the function for the gl_drm
engine.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Not sure if this is very relevant, since GLX does not support
GL-ES as such, anyways... We should be using the extension
GLX_EXT_create_context_es_profile to create proper contexts.
Note: GLX + OpenGL-ES 1.1 crashes at any function call on my
machine (binary bloc driver), while EGL + GLES1.1 is fine.
Summary: Apparently, somewhere down the line, the function prototype
for eng_context_create was changed in the EVGL_Interface, but nobody
decided to fix All engines. This commit fixes the function prototype
for evgl_eng_context_create
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Forgot to set the TLS value after creating a new context.
No problem would show up in most cases, even in my test app.
But elementary_test GLView would just not work at all, spitting
incomplete FBO errors at me. Damn this one line was hard to find.
But introduced in df66916cd22ec6c4.
This introduces XPixmap usage for indirect rendering.
Of course this works only for the gl_x11 engine... and for
now only when using EGL... and only on some drivers...
damn limitations.
Direct rendering should work on more platforms (eg. some desktop
nvidia cards with the EGL drivers).
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).
Welp, glGetString() crashes if called before eglInit... And this
piece of code is now useless because "safe native" mode is not
used anymore (safe_native is never read).
Remove all safe native-related code.
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
This should add support for the following EGL extensions:
- EGL_KHR_fence_sync
- EGL_KHR_reusable_sync (eglSignalSyncKHR)
- EGL_KHR_wait_sync (eglWaitSyncKHR)
@feature
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
This is a new feature allowing direct rendering even when
the view is rotated. In that case, the application is responsible
for rotating its view and rendering it properly given the object
geometry.
This implements support for the flag
EVAS_GL_OPTIONS_CLIENT_SIDE_ROTATION
@feature
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
When using direct rendering, glClear() should not do anything
if the ClearColor was (0,0,0,0). The application would indeed
expect a transparent output (so, see the widgets below the view),
but glClear would erase the pixels instead. So add a quick check
to skip glClear entirely in that specific case.
Summary:
When compiling for EGL, GL_LINE_SMOOTH ends up not being defined so
compile breaks. This fix just checks if GL_LINE_SMOOTH is missing and
if so it defines it.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This was affecting use of GL backend when having a transparent window. It
is actually a fix for a bug reported by Thanatermesis. It has been inspired
by D1229.
To reproduce the issue just do ELM_ACCEL=gl elementary_test -to "Icon transparent".
Summary:
evas_gl_symbols() (introduced in commit 9a9d78d) was not dlsym()ed
which led to unloaded symbols, so NULL function pointers which were happily
dereferenced, leading to an early segfault, and therefore to a broken engine.
@fix
Reviewers: cedric, raoulh
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1440
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
These are obsolete codes because evas engines no longer
has a use case for handling the drm file descriptor. And also it
is the same change as what Stefan Schmidt did to evas_drm.
Test Plan: N/A
Reviewers: devilhorns, stefan_schmidt, cedric, raster
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1452
Summary: Variable palpriv is going out of scope and leaks the storage it points to,
if we do not free it before exiting.
Test Plan: NA
Reviewers: seoz, raster, cedric
Subscribers: cedric, seoz
Differential Revision: https://phab.enlightenment.org/D1429
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This fixes an issue where we had to hard-code the resolution in the
wl_drm module. Instead, we now properly get the current screen
resolution/mode from the drm library and use that.
NB: This is needed to fix wl_drm module in Enlightenment to setup the
proper resolution.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary:
Now, evas gl-drm engine is using ecore_drm instead of its own code to handle tty.
This patch has removed obsolete tty handling codes from engine. It is almost the same as what
Stefan Schmidt did to evas drm engine.
Test Plan: N/A
Reviewers: devilhorns, cedric, raster, stefan_schmidt
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1409
With the move to ecore_drm for tty handling these all became unused.
Ecore_drm already takes care of setting up the SIGUSR1/2 handler and
the rest of the tty setup.
Now that this is gone evas_drm_init/shutdown have no functionality
anymore either.
When getting called from expedite we don't have ecore_evas in between which
normally sets things up for tty. Handle this special case here so the evas
drm engine keeps working for expedite.