Commit Graph

87 Commits

Author SHA1 Message Date
Hermet Park 3bd57c2c66 evas x: code refactoring.
keep simple code as possible.
2019-04-24 16:45:05 +09:00
Hermet Park 3856e1a002 evas gl: move to floating point coordinate system.
Summary:
GL engine has used integer coordinates system since it's born though
OpenGL basically uses floating point vertex coordinates system.

There were many dissatisfaction, complaints about this
since object's transition is jiggled, not perfectly smooth.

It's obvious because Positioning must be stepping with integer units
without any subpixel rendering.

Our gl engine currently supports msaa options and evas map allows to
have double precivion coordinates system, our engine must do handle this over as well,
to work together.

If you don't like change,

We could switch behaviors optionally (turn on, only when msaa is enabled)
But I think it's pointless using integer coordinates system in GL thesedays.
It just make code complex to maintain.

There will be an additional patch coming for SW backend map behavior soon.

Left: before patch
Right: after patch

{F3694624}

Reviewers: #committers, raster

Reviewed By: #committers, raster

Subscribers: raster, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8552
2019-04-18 20:08:16 +09:00
Carsten Haitzler 3439134ea1 Revert "evas gl engines - avoid getting context if possible"
This reverts commit e7771438a2.

This should fix T7764

zmike - you're right. thanks for narrowing down the commit... revert
time.
2019-03-29 00:18:13 +00:00
Carsten Haitzler e7771438a2 evas gl engines - avoid getting context if possible
so getting context at least on some dviers is expensive. it may really
impact cpu usage a lot (in this cate getpid() was being called by the
nouveau drivers and that can be expensive. it is on ARM as it's a full
syscall and 1-2% of cpu time was just getting pid all the time thanks
to this...

@opt
2018-11-09 11:43:58 +00:00
Carsten Haitzler 01109a8c7b glx extns - check client and server extns
in case... client should be a superset...
2018-10-11 16:25:06 +01:00
Carsten Haitzler 76725b2d3b evas gl x11 - add working measure funcs for debugging performance 2018-10-11 16:25:06 +01:00
Carsten Haitzler cb9dc80fdf evas gl-x11 engine - nvidia driver - fix performance drop
this has been going on for a while. on nvidia drivers in gles mode on
x11 there is a massive perf drop to like a few fps with enough windows
if we build for egl/gles instead of opengl. it was the re-creating of
eglimages every frame. put a vendor specific workaround for this and
avoid it. it's not needed there anyway. framerate back to 60fps
smoothness afterwards.

@fix
2018-07-10 16:08:19 +09:00
Ross Vandegrift 71e5c74eb6 efl: drop deprecated Encoding key from desktop files
Summary:
The Encoding key is no longer required, all desktop files are assumed to
be UTF-8 encoded.  See details at:
https://standards.freedesktop.org/desktop-entry-spec/1.1/apc.html

Fix various typos and misspellings

lintian, Debian's package checker, uses strings to check for common typos
in compiled binaries.  This change fixes the ones it identified in 1.20.6.

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-12-13 10:27:48 -08:00
Chris Michael c8e5614830 evas-gl-x11: Remove need for useless free_region function
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-06 09:25:19 -05:00
Cedric BAIL 39d4e343b0 evas: make all window GLES3 or none. 2017-08-25 10:51:59 -07:00
Cedric BAIL 3e88aa37bc evas: Render_Engine_Swap_Mode is actually about output swap. 2017-08-25 10:49:15 -07:00
Jean-Philippe Andre 1d4affadd1 evas: Try to fix compilation with EGLAttrib 2016-12-21 13:56:14 +09:00
Derek Foreman c11b66434f evas engines: Stop using arrays of 1 member for egl context and surface
There's actually an array of 2 in gl_x11, but it appears we only use the
first 1, except in an #if 0 block.

I gather this is legacy for some reason - it sure doesn't seem to make
any sense now, so I'm chopping off all the extra array indexes.

Note: I've not changed gl_sdl - it looks like it doesn't use the context
or surface at all and they could just be removed, but I don't build that
one here and don't want to touch it.
2016-12-16 09:48:15 -06:00
Cedric BAIL 73b308fb66 evas: refactor setup stage and reduce complexity for engine. 2016-12-07 15:47:56 -08:00
Jean-Philippe Andre 182418dc1c gl drm/x11: Fix compilation for EGL < 1.5
This is an attempt at fixing compilation for systems with old
EGL headers (version < 1.5).

Thanks Roy for the report!
2016-12-02 14:26:47 +09:00
Jean-Philippe Andre a3276714ee evas/x11: Fix EGL engine for recent nvidia binary
Thank you NVIDIA for breaking your drivers regularly!
eglGetDisplay(x11_display) should work but was consistently
returning 0 instead.

Apparently EGL 1.5 introduced "eglGetPlatformDisplay" that
is more advanced to open a display. So, prefer that over
eglGetDisplay if it's available.

@fix
2016-12-01 15:32:17 +09:00
Carsten Haitzler 35cbdbb08f evas gl engines - buffer age - remove 'if age changes go to full' code
this technically isn't needed. it does help in some cases hide driver
or other buffer swap bugs, but in and of itself is not needed, so
remove. at least the drm egl bugs still happen on my pi3 so its
something else...
2016-11-17 18:41:31 +09:00
Carsten Haitzler b1e5539005 swap mode - add evlog logging for querying surface age
more debugging to hunt down possible blocks in getting buffer age if
it happens
2016-11-07 11:47:46 +09:00
Carsten Haitzler ad9cc1676e egl engines (wl, x11, drm) - add buffer age events for debugging
this adds evlog events that give buffer age details for event log
debugging to help hunt down issues.
2016-11-07 11:45:08 +09:00
Derek Foreman 1809b3b959 gl_x11: Do KHR Partial Damage properly
KHR partial damage must be set once at the beginning of rendering with
buffer damage for the entire scene to be rendered.  Doing otherwise can
result in graphical anomalies on some GL implementations.
2016-10-20 14:30:00 -05:00
Derek Foreman 7a978fe58c evas_engines: Send both surface and buffer damage to outbuf_flush callback
Some engines should using sending surface damage, until now we'd only ever
provided them with buffer damage.

The difference is that surface damage is the damage to the surface the
compositor is displaying, and the buffer damage is the damage to the
buffer the client has rendered.  These are different when the client
is using multiple buffers of different ages to render into.

Anything that calls eglSwapBuffersWithDamage, wl_surface_damage() or
wl_surface_damage_buffer() should be using surface damage, and not
buffer damage.

This patch is intended to make no functional change - any flush cb that
used buffer damage before still should.  Actual fixes to follow.

Apologies if I broke any engines - it's a bit of a copy and wasteland
out here.
2016-10-19 16:29:05 -05:00
Jean-Philippe Andre d5da8d31ce gl: Fix usage of GLX/EGL/GL extensions
This is reverts:
e4c641ed1e
  build fix
19eb7b727fbf35620a13fb65b50d3056a484360e:
  glx: Fix black windows in E on nvidia

For all extension functions, we need to match with the extension itself
since GetProcAddress() can return a non-NULL value even when the function
does not exist. Drivers can do a runtime mapping depending on the
context. So, we only trust the return value of GetProcAddress() when
we know for sure that the extension exists.

Thus, if a symbol exists we will always prefer it rather than relying
on GetProcAddress().

Also, glGetString(GL_EXTENSIONS) is now deprecated so we're lucky
it still works most of the time. glGetStringi() should be used
instead. This patch changes some of the use cases, but not all.

Fixes T3030 (again)
Fixes T4288

@fix
2016-08-16 16:14:21 +09:00
Carsten Haitzler 40250fda22 evas gl x11 engine - fix buffer age symbol find and use
it serems some changes broke our buffer age querying - we were using
the wrong symbol... the EXT or ARGB onenot the core one which does
work. use that first. then we get buffer age.

@fix
2016-08-16 15:19:21 +09:00
Chris Michael e4c641ed1e evas: Fix compiling evas x engine with no gles
This fixes an issue from 19eb7b727f where the code
would no longer compile due to not finding noext_glXCreatePixmap in
the structure. This was due to the fact that this field was not
compiled into the structure if gl_gles was defined.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-08-03 09:00:50 -04:00
Jean-Philippe Andre 19eb7b727f glx: Fix black windows in E on nvidia
This fixes calls to glXCreatePixmap that would consistently
fail on nvidia >= 360.

It seems glXCreatePixmapEXT was used instead of glXCreatePixmap,
and that function always returned 0.

One could assume always using the non-EXT version of the
function should be preferred. Unfortunately, doing so for all
the other functions brings back the black windows.

I'm taking a very careful approach by doing this only for drivers
>= 360.

Fixes T3030

@fix
2016-08-03 17:32:14 +09:00
Carsten Haitzler 2ca5075193 efreet - fix mime file path messing with short paths like /
this fixes T4015

@fix
2016-07-05 16:28:52 +09:00
Benjamin Jacobs 08585ba0c4 gl_x11: Working GLES2 fallback.
Summary:
Disables GLES3 support when it cannot be determined that it is
available. Prevents to repeatly request a (missing) gles3 support and
fail.
Fixes T3795.

Reviewers: jpeg

Subscribers: cedric, jpeg

Maniphest Tasks: T3795

Differential Revision: https://phab.enlightenment.org/D4014
2016-06-07 13:58:14 +09:00
Carsten Haitzler af4c3c0fe1 evas gl - fix leak with font glyph textures
some font glyphs are still allocated after tyhe last gl window is
freed which means we can't make current anymore to free textures after
that. this fixes that by flushing gl texture info from the font cache
when the last gl windows are gone.

@fix
2016-04-12 12:47:30 +09:00
sunghyun kim c418910948 Evas GL: XFreeColormap when window free
When gl window is created, XCreateColormap is called in eng_best_visual_get
but when gl window is freed, Colormap is not freed.

See original patch: D3342.
2015-11-18 11:40:39 +09:00
Jean-Philippe Andre f7aa6b33b0 Evas GL: Fix BadMatch with pbuffer make current
This is the kind of horrible things you'll encounter when working
with GL. The surface and context need to have matching configuration
otherwise make current will fail, and the only way to get a matching
config is to reuse the config selected to create the context. Gah.

This is the same fix as for EGL. More a hack than a fix, to be honest.

@fix
2015-11-17 18:04:43 +09:00
Jean-Philippe Andre c55c7c0a0d Evas GL: Optimize out calls to eglGetCurrent from the main loop
This is an optimization for EGL only and for the main loop only.

eglGetCurrent{Display,Context,Surface} are expensive calls (they
shouldn't be, but they are). eglMakeCurrent is also very expensive,
so we want as much as possible to avoid calling those functions.
Store the pointers for the main loop as static variables.

Valgrind stats for a quick scrolling session in elm_test:

Before this patch:
 - eglGetCurrentContext ~ 0.4%
 - eglGetCurrentDisplay ~ 0.4%

After this patch:
 - evas_eglGetCurrentContext ~ 0.02%
 - evas_eglGetCurrentDisplay ~ 0.02%
2015-11-10 16:12:21 +09:00
Jean-Philippe Andre b80d7fa302 Evas GL: Fix linking to 'context_restore_set'
There was a terribly complex mechanism to call this function
from the gl_x11 engine to gl_common (evas gl core)... and it
simply didn't work because the function pointer would be NULL.
2015-11-10 16:12:20 +09:00
Jean-Philippe Andre a2b64d9772 Evas: minor whitespace and debug changes 2015-11-04 15:15:05 +09:00
Carsten Haitzler f05686c051 evas engines - fix partial swap to not skip swaps if full mode used
@fix
2015-10-06 14:37:10 +09:00
Cedric BAIL 72b13c3ebb evas: move all GL safe define to a common header and use it. 2015-09-30 15:12:48 -07: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
mythri.venugopal d9ee48b013 evas gl: add support for new partial update extension.
Summary:
If EGL_KHR_partial_update extension is implemented by the driver,
set the damage region. This is done before the draw calls.

@feature

Reviewers: wonsik, spacegrapher, jpeg

Reviewed By: spacegrapher

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-08-04 17:34:30 +02:00
Jean-Philippe Andre 6e587b5479 Evas GL_X11: Fix memory leak 2015-04-20 16:36:49 +09:00
Chris Michael 2a7640cb4e evas-gl-x11: Fix dereference before null check
Summary: This fixes Coverity CID1293519 where einfo was being used
Before it was being null checked (which Could have caused a crash if
in fact einfo Was NULL).

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-12 21:13:18 -04:00
Jean-Philippe Andre 5bdcea59db Evas gl_x11: Fix runtime switching of GL window configurations
Test case:
- Elementary Test
-- GLView
--- Direct rendering

Direct rendering would never happen in reality, because Evas GL
had to fallback. The reason being that DR requires the window
to have a depth buffer, but this depth buffer was no present
in the default config.

From elm, the solution is to set a special accel_preference,
for instance "gl:depth". But setting this value right before
calling elm_win_add() for the GLView test was already too late.
Indeed, evas_x would keep the default configurations and reuse
them no matter what was requested (ie. only RGB and RGBA would
work).

Solution:
Implement a slightly more complex cache based on a hash map instead
of just two static variables. Always request a new config if it's
not found in the current hash. Store that config, and reuse it for
the same config requests.

Tons of line changes because of the name changes and the whitespace
adjustments. Also some variables disappeared into the magic hash table.
2015-04-07 14:10:33 +09:00
Dongyeon Kim 69fa047048 evas/gl_x11: Separate gl symbols check
Summary:
There is a restriction for some gpu drivers that
eglGetProcAddress must be called after eglMakeCurrent.
So separate egl/glx extensions check from gl_symbols
to be called inside eng_window_new.

Test Plan: egl and glx backend tests

Reviewers: cedric, jpeg

Subscribers: cedric, mer.kim, wonsik

Differential Revision: https://phab.enlightenment.org/D2193
2015-03-23 17:17:37 -07:00
Jean-Philippe ANDRE 5bc4b89115 Revert "evas/gl_x11: Optimize out calls to make current"
This reverts commit 0585540bb3.

This broke Evas 3d examples. I also suspected some weird things and
wasn't 100% confident with this patch.

Closes T2215.
Thanks for the report.
2015-03-24 06:27:20 +09:00
Jean-Philippe Andre 4315944259 Evas: Really use GLES3 by default (fix logic)
I enabled gles3 by default in a previous commit but apparently my
logic was all wrong and it fell back to gles2.
2015-03-18 10:06:17 +09:00
Jean-Philippe Andre 358bd3eb25 Evas GL: Fallback to safe GL configs with GLX as well 2015-03-17 18:42:19 +09:00
Jean-Philippe Andre 9e0095a53c Evas GL: Fallback to safe values of depth, stencil & msaa if not supported
Depth32, Stencil16 and MSAA are known to be unsupported on many platforms.
While applications should try not to request them, we can try to fallback
nicely and still render using depth24+stencil8 (which is often supported),
or reducing the number of MSAA samples (until 0 if not supported at all).
2015-03-17 18:16:40 +09:00
Minkyoung Kim 0585540bb3 evas/gl_x11: Optimize out calls to make current
Summary: Reducing the number of calling eglMakeCurrent.

Reviewers: jpeg

Subscribers: wonsik, cedric, spacegrapher

Differential Revision: https://phab.enlightenment.org/D2094
2015-03-17 11:47:35 +09:00
Wonsik Jung 25502e37f8 evas_gl: Add feature to set depth/stencil/msaa bit to window surface.
Summary:
When Evas GL runs with direct rendering, it can not set depth, stencil and msaa to Window surface.
This patch is possible to use "option" input paramater of ecore_evas_gl_x11_options_new.
So, new API is not needed.

The other patch is in elementary. The elementary patch will be used this patch.

Test Plan: Test elm gl veiw in elementary_test and JP's test app.

Reviewers: spacegrapher, cedric, raster, jpeg

Reviewed By: jpeg

Subscribers: cedric, mer.kim

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

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
Note: jpeg changed the original patch a bit (fix style and depth value)
2015-03-16 14:50:56 +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
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 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