Commit Graph

230 Commits

Author SHA1 Message Date
Jean-Philippe Andre 581505791a evas: Remove context from some engine function
This is for canvas_alpha_get. context is never used.
2016-12-16 10:40:55 +09:00
Cedric Bail 7316bda150 evas: refactor swap mode info get. 2016-12-08 15:06:25 -08:00
Cedric BAIL 73b308fb66 evas: refactor setup stage and reduce complexity for engine. 2016-12-07 15:47:56 -08:00
Cedric BAIL 6427c77707 evas: refactor initialisation and shutdown of evas_common. 2016-12-05 11:22:52 -08:00
Carsten Haitzler dbebf2835f evas surface/buffer wl support - define missing egl ifdefs if missing
this will define EGL_WAYLAND_PLANE_WL and EGL_WAYLAND_BUFFER_WL if
missing as SOME older egl public headers dont expose them and yet we
still wans to compile and support the feature should the egl BINARY
etc. actually support this (or be upgraded to support it after efl
compilation).

@fix
2016-11-17 18:41:31 +09:00
Carsten Haitzler e146371ed9 evas modules - only unregister log domain if its registered
some modules did check, some didnt... but this makes them consistent
and silences and eina err log. :)
2016-11-17 18:41:31 +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
Jean-Philippe Andre b88093c847 evas: Last fix... now it builds 2016-10-19 14:05:31 +09:00
Jean-Philippe Andre e67d9c4e1c evas: More compilation fixup with EGLImage
This is what happens when you can't test a patch yourself ^^
2016-10-19 13:40:08 +09:00
Jean-Philippe Andre 5fd4875ad4 evas: Fix compilation with older EGL (maybe <1.5)
EGLImage was not introduced until very recently. EGLImageKHR was
the proper type. Thanks Roy for the report.
2016-10-19 13:35:12 +09:00
Derek Foreman 3d6aae4633 evas gl x11 engine - Wrap eglCreateImage
eglCreateImage and eglCreateImageKHR have different parameters - the
attribute list is EGLint for one and EGLAttrib for the other.  Since
EGLAttrib is long, on a 64-bit system it's a different size than EGLint.

This was causing a crash in Enlightenment's wl_x11 on 64-bit machines when
trying to use a gl client.

Add a thin wrapper to use whichever is available and pass the appropriate
sized data.
2016-10-14 16:07:08 -05:00
Derek Foreman 5eec34812e evas_engines: Add a redraws_clear callback
This gives us a callback from the main thread after outbuf_flush occurs -
this is useful to get timing right on the drm and wayland engines.
2016-09-08 13:55:24 -05:00
Derek Foreman 0c21a926a3 engines: Add a damage_region_set callback
To properly implement EGL_KHR_partial_update we need to know the buffer
damage before any drawing operations take place.  Add a new callback to
software_generic that takes place after combining of surface damage and
swap mode when we actually have this available.

Note: This means the three copy pasta implementations of
EGL_KHR_partial_update scattered around the tree are all wrong.  bummer.
2016-08-19 16:26:20 -05:00
Minkyoung Kim 042e94f10d evas/gl_x11 : Add multiple_buffer member in native surface x11 type union.
Summary:
If native surface is multiple buffer pixmap such as named pixmap, Evas should recreate eglImage everyframe.
Because DDK get the buffer ID once at eglImageCreate time.
So if internal buffer ID is changed, should recreate eglImage.

Test Plan: Wearable Tizen.

Reviewers: wonsik, raster, cedric, jpeg

Reviewed By: jpeg

Subscribers: spacegrapher, dkdk, cedric

Differential Revision: https://phab.enlightenment.org/D4211
2016-08-17 17:56:17 +09: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
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
Jean-Philippe Andre f06506c970 evas: Mark native_surface as const
The void* argument should be considered read-only.
This doesn't change anything, really.
2016-08-08 15:16:53 +09: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
Jean-Philippe Andre 444ab8fb17 gl_x11: Minor code refactor around eglCreateImage
Trying to debug T3030... hitting a brick wall at the moment.
Add better error handling (for EGL).
2016-08-03 17:32:14 +09:00
Carsten Haitzler febfa6de9d ecas gl: ensure make current/window/outpbut enabled before flushing
this should cover up possible texture leaks from gl engine with a null
context on font freeing.

@fix
2016-04-12 17:30:48 +09:00
Minkyoung Kim f10672dd74 evas : remove native.func.data variable and data argument of native calblacks.
Summary:
Evas Image should be independent of render engine.
So remove native.func.data member of RGBA_Image, Evas_GL_Image struct.
And remove data argument,too.

Test Plan: Local test, Tizen3.0 mobile, Desktop englitenment

Reviewers: jpeg, spacegrapher, wonsik

Subscribers: cedric, dkdk

Differential Revision: https://phab.enlightenment.org/D3850
2016-04-01 12:09:06 +09:00
Minkyoung Kim bc2b32cba7 evas/gl_x11 : Move engine data to native.
Summary:
If 2 evases refer to same pixmap, use same EvasGL_Image.
But EvasGL_Image can have only one engine data.
When evas related to native is destroyed and another evas use that native, crash occur.
So native callbacks need to be independent to engine data.

Test Plan: mobile, local test

Reviewers: cedric, spacegrapher, wonsik, jpeg

Reviewed By: jpeg

Differential Revision: https://phab.enlightenment.org/D3800
2016-03-18 13:28:45 +09:00
Jean-Philippe Andre 20b4d9dd6a Evas engines: Add internal functions for native images
- image_native_init
- image_native_shutdown

init() will be used to test whether the engine supports a
certain type of native image.

Note: Native image support is very much dependent on the engine,
and some stuff like opengl should work everywhere (even in sw
with osmesa) but that's not the case.
2016-03-15 11:11:59 +09:00
Jihoon Kim f6e019565f evas/gl_x11: fix build warning related to the uninitialized value 2016-02-17 17:49:40 +09:00
Jean-Philippe Andre 8884ce59b3 Evas: Fix compilation for GLX
Sorry, I forgot to check that :)
2016-01-05 18:46:21 +09:00
Wonsik Jung 7db9613e8c Evas_Engine: add TBM surface and clean up Native Struct
Summary:
Add TBM surface in wayland and clean up Native struct on Evas Engine.
Previous TBM surface for evas_object_image's native_surface_set is only in Evas X11 backend.
This patch has the code for wayland backend.
In addition, evas_native_tbm.c is moved to software_generic. Becuase this file is common.
And, Native in Evas_Engine is clean-up.

@feature

Test Plan:
TBM surface is tested with spacegrapher's test app(tbm.c) in Tizen Device.
Pixmap surface is tested in ubuntu with same test app.
EvasGL is tested with elementary_test.

Reviewers: jpeg, spacegrapher, raster, cedric

Subscribers: dkdk, scholb.kim, JoogabYun

Differential Revision: https://phab.enlightenment.org/D3501
2016-01-05 17:01:45 +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
Dongyeon Kim 7db0e20661 evas/gl: Bind texture with external target for tbm surface
egl images created using tbm surface for native surface set use
GL_TEXTURE_EXTERNAL_OES as texture target, so we should bind to
this target when rendering.
Dynamic hint set using tbm surface also creates egl images, but
as we only use RGB* colorspace for this we can use GL_TEXTURE_2D.
So, keep track of texture target in shader array, and bind to the
appropriate one.
This also fixes the bug that image_data_get only worked when BOTH
sec_image_map and sec_tbm_surface extensions are supported.
2015-11-12 13:56:17 +09:00
Dongyeon Kim 16eb3942bb evas/gl: Do not check for egl errors with glEGLImageTargetTexture2DOES
Summary:
glEGLImageTargetTexture2DOES is a GL extension API, so we need to use
glGetError instead of eglGetError!
2015-11-12 10:03:10 +09:00
Dongyeon Kim 74e556febc evas/gl_common: Enable dynamic hint set using tbm surface only when egl extension is supported
Summary:
Dynamic hint set using tbm surface can only be used when EGL_TIZEN_image_native_surface
extension is supported by the driver. So check for both tbm surface and egl extension.
2015-11-12 08:56:29 +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 c70ba9e13b Evas GL: Save all binary shaders during idle_flush 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 c22c25c9ef Evas GL: Release shader compiler during evas_render_idle_flush
It is safe to release the compiler at any time since the next
call to glCompileShader will restore it. This may even be a no-op
for all we know (this is driver-dependent).
2015-11-10 16:12:20 +09:00
Mike Blumenkrantz 6b1af3c55a evas gl-x11: add missing EVAS_NATIVE_SURFACE_WL support
copy/pasted from other engines, only functional with gles+wayland,
A Thoroughly Tested Calculated Risk™

ref 1dbecbb676
2015-11-04 14:14:16 -05:00
Jean-Philippe Andre a2b64d9772 Evas: minor whitespace and debug changes 2015-11-04 15:15:05 +09:00
Srivardhan Hebbar b9d8426eb7 evas: removing redundant check in gl_x11 backend.
Summary:
Checking for NULL is redundant here, because if cfgs was NULL, then at
line 760 it would fail.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-31 02:12:06 +01:00
Jean-Philippe Andre 079436d4f1 Evas GL: Don't call eglMakeCurrent if already null
If the current context & surface are already null, avoid
calling eglMakeCurrent again, since it can return an error
(EGL_FALSE but with no error code, thanks Nvidia).
2015-10-15 16:20:53 +09:00
Marcel Hollerbach a1be855fe4 gl_x11: val can be everything expected 0 to mean true
For me on a intel driver val is -1 and it needs to be inverted.
So we need to checkout that val is not 0 and not equals to 1.

Thx to raster for helping debugging this thing :).
2015-10-14 11:14:02 +02:00
Carsten Haitzler ef59dc702c evas gl engine - typo remove from previous commit
some typo crept in that... compiled. a stya / on a line. how it
compiled, i don't know.
2015-10-14 15:17:06 +09:00
Carsten Haitzler 620dc45af9 evas - obj destructrion - handle when obj layer is partly destroyed
this should fix T2715 and anything similar as during destruction
object internals are a bit weird.
2015-10-14 14:50:54 +09:00
Amitesh Singh 16819d37d2 evas: fix compilation error
This is introduced in 5c02935a86
2015-10-13 09:01:47 +05:30
Cedric BAIL 5c02935a86 evas: correctly get GLX_Y_INVERTED_EXT. 2015-10-12 17:47:40 -07:00
Dongyeon Kim b6f8244b0b evas/gl_x11: Fix indentation and invalid error check in native set/bind/unbind 2015-10-06 14:55:20 +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
Carsten Haitzler 11c29579d0 evas gl - optimize updates
@feature

this makes the gl engine by default not do bounding box, but instead
try and smartly merge nearby update regions. this means multiple
render passes IF your drivers support buffer age, but it seems to
actually help. in my test case on nvidia drivers which support buffer
age, i saw compositor cpu overhead drop by about 30%
2015-09-25 14:38:21 +09:00
Carsten Haitzler 601273522e evas gl engines - remove TIMDBG code that is unused entirely 2015-09-23 14:03:33 +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
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