DMABuf buffers destroy their glimage in the unbind callback, so it's
usually already gone for the free callback.
Now we test if we actually need to destroy anything.
Also, switch to GLERRV macro for error reporting - it saves us the heavy
eglGetError() unless we've built it in intentionally.
i've been gettign persistent evas test suite suite failures ffor a
while. annoying as i can't get 100% pass anymore. it's due to segv's
in evas test suite thanks to chunks of uninitialized memory in the
mesh loaders/saver code.
this fixes that
@fix
Previously events used to use class name as a prefix and ignored eo_prefix
when specified. This is no longer the case. Events follow eo_prefix by default
now. In order to get around this for classes where this is undesirable, a new
field event_prefix was added which takes priority over eo_prefix. If neither
is specified, class name is used like previously.
@feature
We used to have eo_del() as the mirrored action to eo_add(). No longer,
now you just always eo_unref() to delete an object. This change makes it
so the reference of the parent is shared with the reference the
programmer has. So eo_parent_set(obj, NULL) can free an object, and so
does eo_unref() (even if there is a parent).
This means Eo no longer complains if you have a parent during deletion.
On shutdown we need to set wl_surface to NULL to let the engine know
there's nothing to write to - however we've been setting up an entirely
new outbuf instead of just changing the old one.
The outbuf code should free the surface structure, not the dmabuf
abstraction or a use after free occurs on fallback.
Re-organize some code to make sure we don't rely on anything that may
have already been freed.
Add a wl_surface_commit() to keep the animation timer alive through
the fallback process.
This adds a separate backend to the "shm" engine that allows allocation
of buffers via libdrm that can be turned into dmabuf handles and used
with the wayland dmabuf extension.
Currently only the intel buffer manager is supported.
The benefit of dmabuf buffers is that they don't require a texture upload
like shm buffers do, and when we have plane support they can be dropped
directly into a plane without a memcpy.
Split this into two parts, one that makes the base surface, one that
calls the potential back ends.
Once the dmabuf backend is added this will allow a fallback path to
re-initialize the surface as wl_shm if dmabuf fails.
This doesn't really care what the buffers were allocated with, so
let's make this chunk of code useful to both the shm method and the
upcoming dmabuf one
Refactor evas_outbuf_setup a bit so there's only one call to
_evas_shm_surface_create.
Also makes the NULL return on unhandled rotation a lot more obvious.
Summary:
enum Evas.Canvas3D.Shade_Mode are using for choose relevant shader source code.
So renaming have a sence.
Rename evas_canvas3d_shade_mode_set/get property to evas_canvas3d_shader_mode_set/get
Rename internal fields and functions
Reviewers: cedric, Hermet, raster
Subscribers: jpeg
Differential Revision: https://phab.enlightenment.org/D3882
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
Summary:
Add post processing render function as rendering full screen quard after
rendering to texture.
Add possibility use size of current frame in shader.
Add FXAA shader source files
Reviewers: raster, cedric, Hermet
Subscribers: jpeg
Differential Revision: https://phab.enlightenment.org/D3847
As portions of this code have been derived from existing code in
Weston, we should also be including their copyright/license text to
give credit.
Fixes T3421
@fix
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
AFILL should be used only for certain images, which are
actually native external or dynamic content images.
All normal image don't need the AFILL flag, since they should
have proper argb and alpha flag.
We're supposed to allocate a large pool at startup and use it for
resizing to save pool allocations. However, this was broken and
we ended up allocating both a large pool and a proper sized pool
every resize.
This restores correct behaviour.
eng_window_use() uses outbuf->redirect, so the clever code in
eng_outbuf_reconfigure that avoided setting it to NULL to check
if we needed to recreate the redirect was not very clever at all.
Previous redirect to texture approach broke multiple window applications
by having only a single redirect per context. This approach allows
multiple redirections.
This follows commit f10672dd74
which apparently forgot some changes in xlib and eglfs.
I hope there are no remains of the old native bind/unbind
functions. Also... I can't build everything, so I'm just hoping
this works. Note: GL and SW native images are not using the
same internal api prototypes.
Programs crashed on a segmentation fault when the last window was
closed. The eng_output_idle_flush() function was removed... but
since gl_cocoa does not properly use *_generic modules, the
output_idle_flush() function called by the render engine was
garbage (hence the segfault).
Now nothing is done... but at least we don't crash anymore.
if gif has example 4 colors in colormap, pixels provided still can
hold values higher than 3 (4, 8, 255 etc.) ass a pixel is still a
byte. it should not, but it could. technically it'd be nice for gitlib
to pad its palette out to 256 entires to ensure this cant be a
problem, but it doesn't have to , so make a local copy of the cmap
when decoding pixels and pad out to 256 entires (using color 0 as any
value > pallette ize is invalid anyway so any color will do).
this fixes a possible security attack vector in reading memory out of
bounds of an allocated array. not very far out of bounds - but enough
to cause a crash - ie a dos attack, (not to inject code though).
@fix
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.
ref f10672dd74
@fix
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
Use the new post-processing API and www extension to implement
CSS effects for wayland-egl applications.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
New API allows a context to be redirected to texture. When rendering is
complete the texture can be unbound from the frame buffer and used for
post-processing effects.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
this accumulates all data relevant to client-side www into
the Evas_Engine_Info_Wayland_Egl struct so the client can react to it.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
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
Summary:
native_xx_cbs must be independent to evas render engine.
This was applied to only gl_x11 backend.
Propagate to others.
Test Plan: Tizen3.0 Mobile
Reviewers: wonsik, spacegrapher, jpeg
Reviewed By: jpeg
Subscribers: cedric, dkdk
Differential Revision: https://phab.enlightenment.org/D3840
Summary: ob is already declared. need not to call again.
Test Plan: Tizen3.0 Mobile
Reviewers: jpeg, wonsik
Subscribers: dkdk, cedric
Differential Revision: https://phab.enlightenment.org/D3837
1. unsigned char* as a return type was not even compatible
with the default colorspace (ARGB: 32 bits).
2. Change all unsigned to int for... uh... simplicity
unsigned is more correct than int for things like width,
size or stride, but in fact having both ints (x,y) and unsigned
ints makes the code more complex.
This is a matter of personal taste.
Prior to this fix, window rotation was not operating correctly and the
surface contents would get rendered at the wrong size and position.
This patch fixes the engine so that rotation operates properly now.
NB: Tested with the Window States(2) test in elementary
Thanks to shiin for reporting :)
@fix
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
EGL Fullscreen is a module intended to support many proprietary GL driver that come
with custom API to create framebuffer/window. This one is starting by covering Android
with libhybris/hwcomposer. Later on, it should be able to support easily the Raspberry Pi
driver.
At this moment this does not work properly. Activate it at your own risk ! Do not report
bug if you don't know what you are doing :-) A backend for Ecore_Evas will come later on
along with a patch for Ecore_FB to use libinput. Finally a few patch should hopefully
enable this backend to work and compile more easily (relying on proper header detection
and dlopen/dlsym for access to proprietary function).
You can read more about the goal of this patch by reading our wiki at :
https://phab.enlightenment.org/w/boot2efl/
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
A previous commit added these functions so we can test if native image
is supported, however that commit did not actually override this
functions (evas api override). This small patch simply does that.
ref 20b4d9dd6a
@fix
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
If we are going to define native_init & native_shutdown functions,
then we should probably be using them ;) Also, as this is a wayland
egl engine, we can return from native_init based on
eglQueryWaylandBufferWL
ref 20b4d9dd6a
@fix
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
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
This replaces standard Evas_Object_Image when it is used "normally",
ie. it's an image from a file or from a pixel buffer. All other APIs
(proxy, snapshot, 3d, gl, ...) are disabled on this object.
Also, reduce number of failing calls when the object is not a legacy
object, but a legacy function is called. This is because a lot of
image APIs are called internally using the legacy APIs, often in
order to reset the state of the image object (eg. set file to NULL,
etc...)
Summary:
Main flow: add several meshes(with different number of polygons) in one node,
enable LOD for node, set boundary distances to choose need mesh depend on distance
to the camera node, render only need mesh. Add API's enable lod in
evas_canvas3d_node module and set boundary distance to module
evas_canvas3d_mesh module Refactored function evas_canvas3d_node_mesh_collect
to calculate distance. Refactored _scene_render to have possibility pass to the
render only need LOD mesh.
Reviewers: cedric, Hermet, raster
Subscribers: jpeg
Differential Revision: https://phab.enlightenment.org/D3731
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
- 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.
texture_free() accesses struct members which can be freed if image cache entry
reaches zero references
@fix
==30989== Invalid read of size 1
==30989== at 0x23BA2934: evas_gl_common_texture_free (evas_gl_texture.c:1506)
==30989== by 0x23BA9117: evas_gl_common_image_free (evas_gl_image.c:724)
==30989== by 0x23B80DA1: eng_image_data_put (evas_engine.c:988)
==30989== by 0x872681A: _evas_image_data_set (evas_object_image.c:1264)
==30989== by 0x87360B5: evas_obj_image_data_set (evas_image.eo.c:236)
==30989== by 0x8736B43: evas_object_image_data_set (evas_image.eo.c:741)
==30989== by 0x4820A4: e_comp_object_render (e_comp_object.c:3746)
==30989== by 0x477B92: _e_comp_object_pixels_get (e_comp_object.c:909)
==30989== by 0x872CF52: evas_process_dirty_pixels (evas_object_image.c:3154)
==30989== by 0x872DD16: _evas_image_render (evas_object_image.c:3389)
==30989== by 0x872DB01: evas_object_image_render (evas_object_image.c:3351)
==30989== by 0x879C524: evas_render_mapped (evas_render.c:1802)
==30989== by 0x879E82A: evas_render_updates_internal_loop (evas_render.c:2380)
==30989== by 0x87A005D: evas_render_updates_internal (evas_render.c:2770)
==30989== by 0x87A140D: evas_render_updates_internal_wait (evas_render.c:3122)
==30989== by 0x87A1502: _evas_canvas_render_updates (evas_render.c:3144)
==30989== by 0x871ED0D: evas_canvas_render_updates (evas_canvas.eo.c:354)
==30989== by 0x8720C5F: evas_render_updates (evas_canvas.eo.c:1089)
==30989== by 0x22F65C35: _ecore_evas_drm_render (ecore_evas_drm.c:1072)
==30989== by 0x7416F7B: _ecore_evas_idle_enter (ecore_evas.c:172)
==30989== by 0xDDE3577: _ecore_call_task_cb (ecore_private.h:282)
==30989== by 0xDDE3A5E: _ecore_idle_enterer_call (ecore_idle_enterer.c:174)
==30989== by 0xDDE836B: _ecore_main_loop_iterate_internal (ecore_main.c:2261)
==30989== by 0xDDE67B8: ecore_main_loop_begin (ecore_main.c:1284)
==30989== by 0x4407B6: main (e_main.c:1087)
==30989== Address 0x23a9e1d2 is 338 bytes inside a block of size 552 free'd
==30989== at 0x4C29E00: free (vg_replace_malloc.c:530)
==30989== by 0x882B2E2: _evas_common_rgba_image_delete (evas_image_main.c:343)
==30989== by 0x87B1E17: _evas_cache_image_entry_delete (evas_cache_image.c:205)
==30989== by 0x87B3C52: evas_cache_image_drop (evas_cache_image.c:950)
==30989== by 0x23BA90F5: evas_gl_common_image_free (evas_gl_image.c:722)
==30989== by 0x23B80DA1: eng_image_data_put (evas_engine.c:988)
==30989== by 0x872681A: _evas_image_data_set (evas_object_image.c:1264)
==30989== by 0x87360B5: evas_obj_image_data_set (evas_image.eo.c:236)
==30989== by 0x8736B43: evas_object_image_data_set (evas_image.eo.c:741)
==30989== by 0x4820A4: e_comp_object_render (e_comp_object.c:3746)
==30989== by 0x477B92: _e_comp_object_pixels_get (e_comp_object.c:909)
==30989== by 0x872CF52: evas_process_dirty_pixels (evas_object_image.c:3154)
==30989== by 0x872DD16: _evas_image_render (evas_object_image.c:3389)
==30989== by 0x872DB01: evas_object_image_render (evas_object_image.c:3351)
==30989== by 0x879C524: evas_render_mapped (evas_render.c:1802)
==30989== by 0x879E82A: evas_render_updates_internal_loop (evas_render.c:2380)
==30989== by 0x87A005D: evas_render_updates_internal (evas_render.c:2770)
==30989== by 0x87A140D: evas_render_updates_internal_wait (evas_render.c:3122)
==30989== by 0x87A1502: _evas_canvas_render_updates (evas_render.c:3144)
==30989== by 0x871ED0D: evas_canvas_render_updates (evas_canvas.eo.c:354)
==30989== by 0x8720C5F: evas_render_updates (evas_canvas.eo.c:1089)
==30989== by 0x22F65C35: _ecore_evas_drm_render (ecore_evas_drm.c:1072)
==30989== by 0x7416F7B: _ecore_evas_idle_enter (ecore_evas.c:172)
==30989== by 0xDDE3577: _ecore_call_task_cb (ecore_private.h:282)
==30989== by 0xDDE3A5E: _ecore_idle_enterer_call (ecore_idle_enterer.c:174)
==30989== by 0xDDE836B: _ecore_main_loop_iterate_internal (ecore_main.c:2261)
==30989== by 0xDDE67B8: ecore_main_loop_begin (ecore_main.c:1284)
==30989== by 0x4407B6: main (e_main.c:1087)
==30989== Block was alloc'd at
==30989== at 0x4C2AA98: calloc (vg_replace_malloc.c:711)
==30989== by 0x882B0A0: _evas_common_rgba_image_new (evas_image_main.c:295)
==30989== by 0x87B1F1B: _evas_cache_image_entry_new (evas_cache_image.c:253)
==30989== by 0x87B4170: evas_cache_image_data (evas_cache_image.c:1079)
==30989== by 0x23BA7EDE: evas_gl_common_image_new_from_data (evas_gl_image.c:333)
==30989== by 0x23B7F972: eng_image_new_from_data (evas_engine.c:531)
==30989== by 0x23B80D81: eng_image_data_put (evas_engine.c:984)
==30989== by 0x872681A: _evas_image_data_set (evas_object_image.c:1264)
==30989== by 0x87360B5: evas_obj_image_data_set (evas_image.eo.c:236)
==30989== by 0x8736B43: evas_object_image_data_set (evas_image.eo.c:741)
==30989== by 0x4820A4: e_comp_object_render (e_comp_object.c:3746)
==30989== by 0x477B92: _e_comp_object_pixels_get (e_comp_object.c:909)
==30989== by 0x872CF52: evas_process_dirty_pixels (evas_object_image.c:3154)
==30989== by 0x872DD16: _evas_image_render (evas_object_image.c:3389)
==30989== by 0x872DB01: evas_object_image_render (evas_object_image.c:3351)
==30989== by 0x879C524: evas_render_mapped (evas_render.c:1802)
==30989== by 0x879E82A: evas_render_updates_internal_loop (evas_render.c:2380)
==30989== by 0x87A005D: evas_render_updates_internal (evas_render.c:2770)
==30989== by 0x87A140D: evas_render_updates_internal_wait (evas_render.c:3122)
==30989== by 0x87A1502: _evas_canvas_render_updates (evas_render.c:3144)
==30989== by 0x871ED0D: evas_canvas_render_updates (evas_canvas.eo.c:354)
==30989== by 0x8720C5F: evas_render_updates (evas_canvas.eo.c:1089)
==30989== by 0x22F65C35: _ecore_evas_drm_render (ecore_evas_drm.c:1072)
==30989== by 0x7416F7B: _ecore_evas_idle_enter (ecore_evas.c:172)
==30989== by 0xDDE3577: _ecore_call_task_cb (ecore_private.h:282)
==30989== by 0xDDE3A5E: _ecore_idle_enterer_call (ecore_idle_enterer.c:174)
==30989== by 0xDDE836B: _ecore_main_loop_iterate_internal (ecore_main.c:2261)
==30989== by 0xDDE67B8: ecore_main_loop_begin (ecore_main.c:1284)
==30989== by 0x4407B6: main (e_main.c:1087)
==30989==
==30989== Invalid write of size 1
==30989== at 0x23BA293E: evas_gl_common_texture_free (evas_gl_texture.c:1506)
==30989== by 0x23BA9117: evas_gl_common_image_free (evas_gl_image.c:724)
==30989== by 0x23B80DA1: eng_image_data_put (evas_engine.c:988)
==30989== by 0x872681A: _evas_image_data_set (evas_object_image.c:1264)
==30989== by 0x87360B5: evas_obj_image_data_set (evas_image.eo.c:236)
==30989== by 0x8736B43: evas_object_image_data_set (evas_image.eo.c:741)
==30989== by 0x4820A4: e_comp_object_render (e_comp_object.c:3746)
==30989== by 0x477B92: _e_comp_object_pixels_get (e_comp_object.c:909)
==30989== by 0x872CF52: evas_process_dirty_pixels (evas_object_image.c:3154)
==30989== by 0x872DD16: _evas_image_render (evas_object_image.c:3389)
==30989== by 0x872DB01: evas_object_image_render (evas_object_image.c:3351)
==30989== by 0x879C524: evas_render_mapped (evas_render.c:1802)
==30989== by 0x879E82A: evas_render_updates_internal_loop (evas_render.c:2380)
==30989== by 0x87A005D: evas_render_updates_internal (evas_render.c:2770)
==30989== by 0x87A140D: evas_render_updates_internal_wait (evas_render.c:3122)
==30989== by 0x87A1502: _evas_canvas_render_updates (evas_render.c:3144)
==30989== by 0x871ED0D: evas_canvas_render_updates (evas_canvas.eo.c:354)
==30989== by 0x8720C5F: evas_render_updates (evas_canvas.eo.c:1089)
==30989== by 0x22F65C35: _ecore_evas_drm_render (ecore_evas_drm.c:1072)
==30989== by 0x7416F7B: _ecore_evas_idle_enter (ecore_evas.c:172)
==30989== by 0xDDE3577: _ecore_call_task_cb (ecore_private.h:282)
==30989== by 0xDDE3A5E: _ecore_idle_enterer_call (ecore_idle_enterer.c:174)
==30989== by 0xDDE836B: _ecore_main_loop_iterate_internal (ecore_main.c:2261)
==30989== by 0xDDE67B8: ecore_main_loop_begin (ecore_main.c:1284)
==30989== by 0x4407B6: main (e_main.c:1087)
==30989== Address 0x23a9e1d2 is 338 bytes inside a block of size 552 free'd
==30989== at 0x4C29E00: free (vg_replace_malloc.c:530)
==30989== by 0x882B2E2: _evas_common_rgba_image_delete (evas_image_main.c:343)
==30989== by 0x87B1E17: _evas_cache_image_entry_delete (evas_cache_image.c:205)
==30989== by 0x87B3C52: evas_cache_image_drop (evas_cache_image.c:950)
==30989== by 0x23BA90F5: evas_gl_common_image_free (evas_gl_image.c:722)
==30989== by 0x23B80DA1: eng_image_data_put (evas_engine.c:988)
==30989== by 0x872681A: _evas_image_data_set (evas_object_image.c:1264)
==30989== by 0x87360B5: evas_obj_image_data_set (evas_image.eo.c:236)
==30989== by 0x8736B43: evas_object_image_data_set (evas_image.eo.c:741)
==30989== by 0x4820A4: e_comp_object_render (e_comp_object.c:3746)
==30989== by 0x477B92: _e_comp_object_pixels_get (e_comp_object.c:909)
==30989== by 0x872CF52: evas_process_dirty_pixels (evas_object_image.c:3154)
==30989== by 0x872DD16: _evas_image_render (evas_object_image.c:3389)
==30989== by 0x872DB01: evas_object_image_render (evas_object_image.c:3351)
==30989== by 0x879C524: evas_render_mapped (evas_render.c:1802)
==30989== by 0x879E82A: evas_render_updates_internal_loop (evas_render.c:2380)
==30989== by 0x87A005D: evas_render_updates_internal (evas_render.c:2770)
==30989== by 0x87A140D: evas_render_updates_internal_wait (evas_render.c:3122)
==30989== by 0x87A1502: _evas_canvas_render_updates (evas_render.c:3144)
==30989== by 0x871ED0D: evas_canvas_render_updates (evas_canvas.eo.c:354)
==30989== by 0x8720C5F: evas_render_updates (evas_canvas.eo.c:1089)
==30989== by 0x22F65C35: _ecore_evas_drm_render (ecore_evas_drm.c:1072)
==30989== by 0x7416F7B: _ecore_evas_idle_enter (ecore_evas.c:172)
==30989== by 0xDDE3577: _ecore_call_task_cb (ecore_private.h:282)
==30989== by 0xDDE3A5E: _ecore_idle_enterer_call (ecore_idle_enterer.c:174)
==30989== by 0xDDE836B: _ecore_main_loop_iterate_internal (ecore_main.c:2261)
==30989== by 0xDDE67B8: ecore_main_loop_begin (ecore_main.c:1284)
==30989== by 0x4407B6: main (e_main.c:1087)
==30989== Block was alloc'd at
==30989== at 0x4C2AA98: calloc (vg_replace_malloc.c:711)
==30989== by 0x882B0A0: _evas_common_rgba_image_new (evas_image_main.c:295)
==30989== by 0x87B1F1B: _evas_cache_image_entry_new (evas_cache_image.c:253)
==30989== by 0x87B4170: evas_cache_image_data (evas_cache_image.c:1079)
==30989== by 0x23BA7EDE: evas_gl_common_image_new_from_data (evas_gl_image.c:333)
==30989== by 0x23B7F972: eng_image_new_from_data (evas_engine.c:531)
==30989== by 0x23B80D81: eng_image_data_put (evas_engine.c:984)
==30989== by 0x872681A: _evas_image_data_set (evas_object_image.c:1264)
==30989== by 0x87360B5: evas_obj_image_data_set (evas_image.eo.c:236)
==30989== by 0x8736B43: evas_object_image_data_set (evas_image.eo.c:741)
==30989== by 0x4820A4: e_comp_object_render (e_comp_object.c:3746)
==30989== by 0x477B92: _e_comp_object_pixels_get (e_comp_object.c:909)
==30989== by 0x872CF52: evas_process_dirty_pixels (evas_object_image.c:3154)
==30989== by 0x872DD16: _evas_image_render (evas_object_image.c:3389)
==30989== by 0x872DB01: evas_object_image_render (evas_object_image.c:3351)
==30989== by 0x879C524: evas_render_mapped (evas_render.c:1802)
==30989== by 0x879E82A: evas_render_updates_internal_loop (evas_render.c:2380)
==30989== by 0x87A005D: evas_render_updates_internal (evas_render.c:2770)
==30989== by 0x87A140D: evas_render_updates_internal_wait (evas_render.c:3122)
==30989== by 0x87A1502: _evas_canvas_render_updates (evas_render.c:3144)
==30989== by 0x871ED0D: evas_canvas_render_updates (evas_canvas.eo.c:354)
==30989== by 0x8720C5F: evas_render_updates (evas_canvas.eo.c:1089)
==30989== by 0x22F65C35: _ecore_evas_drm_render (ecore_evas_drm.c:1072)
==30989== by 0x7416F7B: _ecore_evas_idle_enter (ecore_evas.c:172)
==30989== by 0xDDE3577: _ecore_call_task_cb (ecore_private.h:282)
==30989== by 0xDDE3A5E: _ecore_idle_enterer_call (ecore_idle_enterer.c:174)
==30989== by 0xDDE836B: _ecore_main_loop_iterate_internal (ecore_main.c:2261)
==30989== by 0xDDE67B8: ecore_main_loop_begin (ecore_main.c:1284)
==30989== by 0x4407B6: main (e_main.c:1087)
Coverity reports that 'ctx' may be NULL here and we should check it
before usage (as is done above).
Coverity CID1339785
@fix
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
Mostly unused vars following the removal of eo_do_ret().
However, there are some cases where the migration script got some things
wrong, and I had to manually fix them.
I just ran my script (email to follow) to migrate all of the EFL
automatically. This commit is *only* the automatic conversion, so it can
be easily reverted and re-run.
We can't really drive this buffer unlocking from the page flip handler for
a lot of ugly reasons. This will be better in the future when evas
supports multiple target buffers. For now let's cut this down and keep
2 buffers locked at all times.
This gets drm-gl to work without massive tearing artifacts.
@fix
If we don't have the right extension for age we probably don't have
partial updates either. The code to get the age calculations right is
actually much nastier than this anyway since gbm can hand back buffers
in arbitrary order, and as many as it feels like.
Summary:
Previously if we ever tried to queue up two page flips in less than a
retrace interval (which can easily happen since the evas clock isn't
based on vblank) we'd give up on ever using page flips again, and tear
on every screen update.
This fixes that by using a vblank callback for custom ticks and using
page flips whenever possible.
If a page flip fails it means a page flip raced with the vblank ticker,
so we need to queue up that frame when the current page flip completes.
This ensures that while we might drop interim frames, we will never
lose the most recent.
Now it should only be possible to tear if two ticks fire during the
wait for a page flip to complete. This would result in rendering
taking place in the front buffer. I don't think this can happen,
but an error is logged if it does.
Reviewers: zmike, devilhorns
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D3594
This patch fixes some compiler warnings about assignment from
incompatible pointer type when getting image data from evas_cache. The
simple fix is to cast the return value to RGBA_Image.
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
Summary:
Evas Text, Textblock, Textgrid keeps own language information.
This language information could be vary from the result of setlocale().
Especially, Evas Textblock supports <lang> tag. The language could be
changed in the middle of text. All of these language has to be used
for harfbuzz shaping.
@fix
Test Plan: N/A
Reviewers: herdsman, raster, woohyun, tasn
Reviewed By: tasn
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D3628
This would be cleaner than adding it as a suffix to the filename.
Use simple write and read_direct for simplicity.
This is an improvement on 3dcd903a53 and should make sure
everyone is actually using the latest version of the shaders even
if they track master or the alpha/beta releases.
Since we now have only two shader strings, this is trivial to do:
hash the strings and add them to the cache filename.
This will allow people using 1.17.0-alpha, etc... to discard their
old shaders cache automagically and use the latest version of the
shaders (because alpha is not in the filename).
If we end up adding more runtime generated shaders, we might need
a better strategy, but this should be good enough for now.
This mostly reverts 448720fed4
After my previous patch, semi-transparent windows would render incorrectly
in E. The AFILL flag should make sure the source texture is "opaque" (ie.
if it's not marked as having an alpha channel), and masking or color
multiply should then be applied later on.
Sorry for the mess...
Summary:
dlfcn.h is not available anymore on Windows, Evil provides all the
necessary declarations.
Reviewers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D3577
@fix
Summary:
printf %m stringifies and prints errno. I've tried to remove its use
anywhere that the immediately preceding function might not set errno
or is a complicated function for which knowing errno doesn't really
give any useful information.
I've left a few of the drmMode calls because they're just wrappers
around ioctl, which legitimately sets errno.
@fix
Reviewers: zmike, devilhorns
Reviewed By: zmike, devilhorns
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D3572
When evas gl surface is destroyed, not only the current surface for the current context
should be set to NULL, but current surface for all contexts should be reset.
Commit fd4e133cc1 changed the internal
API, but it was not reflected in evas_gl_cocoa.
This commit fix a compiling warning and possible undetermined behaviour.
@fix
This is a follow up on the previous commits.
The original patch on Phab was split in 3 parts (factorization,
fix & this one).
Adds support to both SHM and EGL.
See D3501.
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
This implements a generic way of scaling buffers, using fake
RGBA_Image wrapping ector buffer maps. The underlying algo is
still the good old linear sw scaler.
Now the filters *should* be back to their previous level of
usability. Performance will probably be even worse than it was
before, for GL, as more glReadPixels may be involved. Optimization
now consists in actually implementing the filters with GL shaders.
Now the filters should work with the GL engine, again, but with
a potentially crazy performance. Indeed, the input buffer is now
backed by an FBO, that needs to be glReadPixel'ed everytime it is
accessed by the filters (mapped).
Evas filters is now more and more unaware of evas images (RGBA_Image)
and the engine + ector take care of everything.
Still left to do:
- map / unmap an FBO buffer into RO or RW memory
Dumb implementation of a "smart" buffer capable of wrapping an
RGBA_Image but that can still be rendered on screen (ie, an
Evas_GL_Image is attached to it).
This fixes crashes, adds safety, and notes a couple of things that
are not yet implemented:
- Make an Evas_GL_Image from an RGBA_Image so we can draw it on the
canvas. This means Evas.Ector.GL.RGBA_Image.Buffer
- Readable Evas_GL_Image objects with gl_read_pixels
--> Implement proper map() & unmap() for GL buffers
This is a major refactoring of the evas filters submodule.
Use Ector.Buffer and the map/unmap methods instead of directly
accessing image buffers with RGBA_Image. RGBA_Image is still
used under the hood, for two reasons:
- Required for the final output (blend onto Evas itself)
- Required for the scaling routines
FIXME:
- Breaks proxy support (ie. all kind of texturing).
- This breaks filters support for the GL engine.
Since Evas still relies entirely on Image_Entry and Evas_GL_Image,
we will need an engine-specific wrapper object creating a Buffer
around an existing cached image.
Currently only SW support is implemented. GL will be more fun to
do (with glReadPixels and whatnot).
Shutdown eet only if it was actually initialized.
This fixes make check (for me) after applying the previous patch.
It seems on my machine, the gl cache files are not saved properly
from within the make check environment.
Summary:
Move common part to a separated document.
Make code more readable using smaller functions. (from Task T2713)
Everything is OK with make check.
Reviewers: cedric, raster, Hermet, stefan_schmidt
Reviewed By: stefan_schmidt
Subscribers: jpeg, artem.popov
Differential Revision: https://phab.enlightenment.org/D3430
Summary:
wl_surface.damage_buffer() takes surface damage in buffer co-ordinates.
Right now since we don't use wayland's scaling, transforms, or viewports
it's exactly the same as wl_surface.damage(). In the future if we start
using those features it's much easier to do so with damage_buffer().
Reviewers: zmike, devilhorns
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D3457
Summary:
Fix siquence in multiply of matrices. Need multiply position on scale,
otherwise we have wrong texture.
Reviewers: cedric, Hermet, raster
Subscribers: jpeg
Differential Revision: https://phab.enlightenment.org/D3477
Summary:
'cached' flag is not enough to check whethere data is loaded and texture is uploaded.
so check more options for prevent re-preload image data on gl-backend.
Test Plan: Local Test (elementary_test : elm images)
Reviewers: jpeg, eunue
Reviewed By: jpeg
Subscribers: cedric, jiin.moon, wonsik, spacegrapher
Differential Revision: https://phab.enlightenment.org/D3446
An ERR message would be printed out mentionning that direct rendering
won't work on this window, even if DR was not requested.
Also, set the DR-specific flags only if DR is enabled.
See T2936.
This reverts commit 01a32f64c0.
This broke make check with the following error:
evas_test_mesh.c:123:F:Meshes:evas_object_mesh_loader_saver:0: Failure 'res == 1' occurred
Reopen https://phab.enlightenment.org/D3420
Summary:
set current target with default value of GL_TEXTURE_2D.
target should be valid value.
Reviewers: jpeg
Reviewed By: jpeg
Subscribers: wonsik, cedric, spacegrapher
Differential Revision: https://phab.enlightenment.org/D3423
Summary:
Move common part to a separated document.
Make code more readable using smaller functions. (from Task T2713)
I did it again because somehow test is passing now. It seems like this test suite is unstable.
Please, let me know if there are any errors after running distcheck.
Reviewers: cedric, raster, Hermet, stefan_schmidt
Subscribers: jpeg, artem.popov
Differential Revision: https://phab.enlightenment.org/D3420
Summary:
The Function _evas_canvas3d_eet_file_free(void) is referenced in evas_model_load_file_eet()(file:evas_model_load_eet.c at line 122).
This call is under condition
if ((eet_file->mesh == NULL) || (eet_file->header == NULL)).
when either eet_file->mesh or eet_file->header are NULL, dereference of the corresponding pointer in function "_evas_canvas3d_eet_file_free()"
will generate Segmentation Fault.
@fix
Reviewers: raster, Hermet, tasn, wonsik, spacegrapher, cedric, jpeg
Subscribers: singh.amitesh, sachin.dev, alok25, yashu21985, mvsovani, cedric
Differential Revision: https://phab.enlightenment.org/D3369
Summary:
When preload is cancelled before finishing loading,
should reload the image data and update the texture during rendering object.
So, force texture to be updated on first drawing time.
(It should be guaranteed that preload image object is hidden before preload done.)
Test Plan: Local tests
Reviewers: jpeg
Reviewed By: jpeg
Subscribers: eunue, jiin.moon, wonsik, cedric, spacegrapher
Differential Revision: https://phab.enlightenment.org/D3416
This reverts commit 32c33ed64d.
This refactor broke the evas test cases for the model loaders and savers. I gave
it a week to get fixed but a first try did not succeed and its blocks a lot of
other automated testing. To be honest, it should have never gone it when it
breaks existing test cases. Once fixed this refactor can happily go in.
Fixes T2905
Summary:
As we do not set the ob->info->info.win variable anymore inside
Ecore_Evas (old code that was removed), we can omment out the line.
This line was causing unnecessary renewal of the engine window (thus
causing flickering when rotation was applied).
@fix
Test Plan: Rotate or Resize the window on wayland-egl.
Reviewers: gwanglim, devilhorns
Reviewed By: devilhorns
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D3407
As @zmike mentionned in T2396 there is an extension string
declaring full support for GLES 3 when using OpenGL.
Note: I can't really test myself since I have recent drivers.
Hopefully this is correct.
Fixes T2396
This fixes the build for Windows. Thanks @vtorri for the report.
I'm not using "unsigned int" as uint was mostly used like DATA32,
ie. color data (one pixel color or a pixel buffer).
The original plan was to have two different surfaces for GL and SW,
but this is probably not going to happen anytime soon. So, move
the implementation back to lib/ector. This avoid a file duplication.
Rename a few things:
- draw helper -> efl_draw
- Ector_Rop -> Efl.Gfx.Render_Op
- ECTOR_ bla bla -> DRAW_ bla bla (base pixel ops)
- ector_memfill -> draw_memset32 (and invert arg order to match memset)
The main rasterizer file is now draw.h in static_libs/draw
This is a non functional change, simple code refactor.
Ector Surface now inherits from Ector Buffer, and the current
two renderers (SW and Cairo SW) use Ector.Software.Buffer
implementations for pixel surfaces.
Basic pixel handling is merged and will allow easy extension
(color conversion, etc...).
Buffer classes are Mixins to be fully implemented by the final
class, such as: Ector.Software.Buffer, Ector.Software.Surface
or Ector.Cairo.Surface.
This is a large ugly commit. Sorry.
The code is quite a mess right now.
all we need to do for image transformation such as rotation or flipping in gl
is to map the vertices of source image to destination in a changed order.
this commit not only enhances readability but also fixes bugs in rotation.
@fix
Summary:
Add uniform varialble uColorTexture. Generate sampler count for textcolorpick
and pass to renderer for bind additional texture unit to gl.
It can be used for different 3D effects - blur, wave distortion, heat haze, etc.
T2761
Reviewers: Hermet, raster, cedric
Reviewed By: cedric
Differential Revision: https://phab.enlightenment.org/D3372
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
Move common part to a separated document.
Make code more readable using smaller functions. (from Task T2713)
Reviewers: cedric, raster, Hermet
Subscribers: artem.popov
Differential Revision: https://phab.enlightenment.org/D3373
We have to use void in a function declaration if we want no function
parameters. Using just empty parenthesis means the function takes an
unspecified number of parameters.
We had it correct for most declarations and this series fixes it for
the rest.
We have to use void in a function declaration if we want no function
parameters. Using just empty parenthesis means the function takes an
unspecified number of parameters.
We had it correct for most declarations and this series fixes it for
the rest.
Summary:
The OpenGL functions assigns a value to the local variable. However,
in case of error it would take the uninitialized garbage value. So, the
correct solution would be to initialize it to 0.
Signed-off-by: Deepjyoti Dutta <deepjyoti.d@samsung.com>
Reviewers: Hermet, singh.amitesh, raster, jpeg
Reviewed By: jpeg
Subscribers: yashu21985, mvsovani, alok25, sachin.dev, cedric
Differential Revision: https://phab.enlightenment.org/D3375
Summary:
I thought its better to fail and return null if realloc fails than to
continue. So returning by closing all openend file.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric, illogict
Differential Revision: https://phab.enlightenment.org/D3232
Summary:
Use less memory by indexation vertices and not keeping more than one copy of it (from task T2713).
[Fix]
Reviewers: cedric, raster, Hermet
Subscribers: artem.popov
Differential Revision: https://phab.enlightenment.org/D3355
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This rely on a faster code path to upload dynamic texture. Once we get support
for gbm, we should see significant performance improvement in speed, but this
first step is already a 5 times improvement (Ok, we get from really bad, to not
really useful...).
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.
If we end up leaving evas_xlib_image_dri_native_set due to a failure
to allocate memory, we should free the previously allocated
Evas_DRI_Image so that we don't leak
NB: Fixes Coverity CID1339782
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
evas_xlib_image_dri_native_set should be returning a pointer to an
RGBA_Image on success, or NULL on failure. Returning EINA_FALSE here
leads to an expression which evaluates to zero being treated as a null
pointer constant
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
clang warns of equality comparison with extraneous parentheses in
these cases. Remove the extra parens as they are not needed anyway
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
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
The version field was not properly set for GLES 1 and 3 (but not tested),
double free() could happen on the API structs, and empty API structs
could be returned.
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.
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.
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.
Summary:
if device support sec_tbm_surface, but doesn't support the EGL_NATIVE_SURFACE_TIZEN
then below api called cause crash!
evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
evas_object_image_alpha_set(o, 0);
1. evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
[evas_gl_image.c]
if (im->im)
{
if (evas_cache2_image_cached(&im->im->cache_entry))
evas_cache2_image_close(&im->im->cache_entry);
else
evas_cache_image_drop(&im->im->cache_entry);
im->im = NULL; // im->im now NULL!!!
}
im->tex = evas_gl_common_texture_dynamic_new(im->gc, im); // im->tex also NULL!!
im->text also NULL!! because If driver does not support the EGL_NATIVE_SURFACE_TIZEN
then below code return NULL at _pool_tex_dynamic_new();
pt->dyn.img = secsym_eglCreateImage(egldisplay,
EGL_NO_CONTEXT,
EGL_NATIVE_SURFACE_TIZEN,
pt->dyn.buffer, attr);
2. evas_object_image_alpha_set(o, 0);
[gl_generic/evas_engine.c]
static void * eng_image_alpha_set()
{
now im->im and im->tex are null so crash happend at eng_image_alpha_set()
}
bug fixed in case of the tbm surface create fails so device cannot support the dynamic hit set,
Test Plan: experdite
Reviewers: jpeg, cedric, spacegrapher
Subscribers: dkdk, scholb.kim, wonsik
Differential Revision: https://phab.enlightenment.org/D3318
Summary: add DRI2-x11 feature at image_native_set() on Software-x11
This is based on TBM, which means Tizen platform.
Reviewers: spacegrapher, wonsik, raster, jpeg
Subscribers: scholb.kim, dkdk, cedric
Differential Revision: https://phab.enlightenment.org/D3291
Summary:
In Evas-SW-Generic/X11, native_unbind_cb is not called sometimes, although
native_bind_cb was called.
Some native surface's cases, both native_bind_cb and native_unbind_cb should
be called for mapping and unmapping, eg. with tbm_surface.
@fix
Test Plan:
Evas Native Surface with pixmap sample.
Evas Native Surface with tbm(this sample can work in Tize Device)
elementary_test
Reviewers: raster, jpeg, cedric, spacegrapher
Subscribers: JoogabYun, scholb.kim, dkdk
Differential Revision: https://phab.enlightenment.org/D3317
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
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
Summary:
Refactoring code of functions e3d_drawable_scene_render,
e3d_drawable_scene_render_to_texture,_shadowmap_render to have possibility
render in scene to additional texture
See T2761
Reviewers: Hermet, cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D3142
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
if eglGetError sequencially called, second eglGetError() doesn't give
the information of real Error.
Reviewers: jpeg, spacegrapher, cedric
Reviewed By: cedric
Subscribers: wonsik, scholb.kim, cedric, dkdk
Differential Revision: https://phab.enlightenment.org/D3305
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
- image_file_colorspace_get
This will be used to determine the best loading format, especially
targeted at edje_cc / edje_decc so we can avoid ETC re-encoding.
- image_data_has
Checks whether the image is currently loaded in (CPU) memory,
and also returns the current colorspace.
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%
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.
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).
Instead of generating the shaders at compile-time, do this at
runtime. Also load only the required shaders in memory.
This saves 25000 LOC, lots of strings inside the .so files
and save a non negligible amount of memory since those shader
binaries can weigh a few megabytes in total.
The current shader selection mechanism is a bit complex and
uses eina_hash_int32 but this can be optimized later if it's
deemed too slow.
Summary:
Returning from default would result in memory leak of f. Now the memory
is not leaked.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric
Differential Revision: https://phab.enlightenment.org/D3272
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
Use same way using color pick under GLES and not:
Use GL_RGBA texture insted of GL_RED
Generate and pass to engine 3 components color of mesh
See T2761
Reviewers: cedric, Hermet
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D3135
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary: In efforts to reduce tearing in the gl_drm engine, implement
support for eglSetDamageRegionKHR to mark parts of a surface as being
damaged.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
In efforts to reduce tearing in the gl_drm engine, find and link to
the eglSetDamageRegionKHR function so we can mark damaged regions of a
surface
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
The engine setup code already checks if we are disabling vsync
(defaults to on), so we should be setting the Outbuf vsync according
to what the engine info has
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary: Support for using EVAS_NATIVE_SURFACE_WL was missing/incomplete in the
wayland_egl engine. This commit addresses that issue so that now the
wayland_egl engine can support both EVAS_NATIVE_SURFACE_OPENGL and
EVAS_NATIVE_SURFACE_WL.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary: With linux kernels >= 4.2.x, the gl_drm engine was not
functional. This is due to the egl config returning an improper config
which did not match the expected pixel format. This commit fixes that
issue and gl_drm evas engine works again. Should fix ticket T2807
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary:
According to my understanding of this function, this check of im_old is
redundant, as im_old will never be NULL. For im_old to be NULL, image should be
NULL. But that is checked at line 637. im is assigned image and im is checked for NULL. At line 654 im_old is assigned image and it is not modified till line 673. So this check would always return true and enter if case and would never
enter else case. So removing the redundant code.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric
Reviewed By: cedric
Differential Revision: https://phab.enlightenment.org/D3233
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
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>
Summary: When we are told to resize the canvas, we should also be
resizing the gbm_surface. This should fix the issue of wl_drm module
in E not working when the canvas gets resized (WFM now)
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Typos, lack of NULL check, excessive sizeof(type) not matching
the object type, no border set, etc... This all lead to a crash
and then no render (with an error message and then without...).
This also simplifies the implicit loading of ETC1 as ETC2 when
supported by the driver.
@fix
so the evas thread renderer didnt START rendering until evas FINISHEd
walking all objects generating a render queue. this means all the cpu
time spend generating commands couldn't allow a parallel thread
actually go and DO the rendering.
this flushes the render thread every render command thus waking up the
render thread to work in parallel to the mainloop generating commands.
this actually means int he traces i see the render thread finished byt
he time evas_render completes thus brinign forward the frame display
by quite a bit.
thanks to evlog for pointing this out.
@fix
we use a bit more memory than we need by having unused fields for
shaders. the old binary data ptrs and size fields we just have not
used for years now as we dont compile in shader binaries anymore as no
living drivers need this anymore. so this removes that with no actual
side-effects.
no shortcuts. we used the same img sharder for pixles as for native
surf. so need new shaders to do the swiszzling. add them all,
generation scripts metadata and enums etc.
@fix (along with previous 3 commits)
this fixes rendering on ppc (bigendian) where we have thnigs swizzled
oddly. not bgra -> argb but rgba -> grab ...
so generate a bigendian shader file and use if on bigendian.
this should fix T2721
it fixes it in the visual screenshots i can get remotely.
While OSMesa may support surfaceless contexts, we don't support
them yet in the SW engine. Instead of switching to NULL, NULL,
let's error out and do nothing instead.
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).
Since @raster changed the behaviour of the dirty flag on images,
damages must be added to redraw the GL surface. Evas_Image checks
if it is an Evas GL surface by looking at its native surface.
But in case of SW engine, there was no native surface information
for Evas GL surfaces. Also, the OPENGL surface type was awfully
abused for OSMesa support. Luckily EVASGL surface type lets us
pass arbitrary pointers :)
This is only one step into making the software engine actually
work the same as a proper GL engine from Evas GL APIs point of view.
This is necessary for the test suite (coming next).
Show an error message and call make_current(NULL, NULL) only if
the object (context, surface) being destroyed is current.
Otherwise, avoid changing the current context & surface.
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 :).
As spotted by @FurryMyad I inverted the logic for source_clip.
This should restore the proper behaviour while keeping my previous
fixes working. See D2940.
This reverts commit f51168f4ec.
if this is right or not... this RESULTS in enlightenment becoming
totally unusable. put this back WHEN other issues are fixed you think
that exist. last i knew we query yinvert start with glx per native
surface and use that info - so as best i know it is and has been right
for a long time.
:)
Following this patch, the correct enum type is now passed to this
function. It's also passing the same value (0), but now from the correct
enum. This doesn't change behaviour, and looks like what was intended.
This fixes the clang warning.
Double parenthesis comparison is reserved for evaluation for assignment, not just comparison.
So for example you should do ((x = 2)) and (x == 2), but not ((x == 2)) or (x = 2).
Summary: As we loop the regions of the output buffer and accumulate
changes to post, we should be freeing the rectangles when we are done
with them.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary: Seems we were never setting any merge_mode for the
wayland-shm engine. This fix implements setting merge_mode
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
valgrind pointed this one out. we access freed memory when we dup a
context because the context CONTAINS ptrs to things like rects for
cutouts. we didnt dup these. use the proper context dup call (and
properly ref pixman color image too). this was a random bug/crash
waiting to happen and valgrind caught it. suprising it hasnt turned up
before :/
@fix
Summary: We really don't need to be allocating a shm pool this large
during resize, so reduce the size of the pool.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary: This just adds support for 'smart' merge mode in the evas
gl_drm engine to keep in line with gl_x11 engine.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary: This just adds support for 'smart' merge mode in the wayland
egl engine to keep in line with the gl x11 engine
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary:
Change type of texdepth from GL_R(doesn't support with GLES) to GL_RGBA.
Don't use useless additional framebuffers for shadows.
Use same shader code for generation shadow map texture.
Turn always using software alpha-test.
It reduce and simplify code in general.
Reviewers: cedric, Hermet
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D3115
Evas_GL_Image created for font glyphs in evas_common_font_rgba_draw
is sometimes freed after Evas_Engine_GL_Context is freed.
Since gc is already freed, pt_unref returns and leaves pt behind.
@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%
Summary:
Bug reproduce if delete evas_gl_3d_shaders.x and try re-build.
Source file include.shd for generation shader code consist m4 macro definitions.
After this revision https://phab.enlightenment.org/D3056 order of the quatation
marks in function pcf was broken.
@fix
Reviewers: cedric, Hermet
Reviewed By: Hermet
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D3085
this optimizes draw ctxt cutouts by skipping small ones and
remembering the last cutout added so it isn't double-added as well as
extending the minimum cutout array to 512 and going up in blocks of
512 instead of 128. also optimize the clipping code a bit more.
This is a huge patch, but keep in mind that 4326 line changes
were automatically generated from the template GLSL files.
This also adds some minor refactors here and there to accomodate
for the new shaders, but nothing crazy.
"GL fast-path" downsampled masks should now look pretty good.
Summary:
cur_tex* are unsigned int, so minus value should not be set.
Also, add cur_texa, cur_texm here.
Test Plan: Local tests
Reviewers: jpeg
Subscribers: mer.kim, wonsik, cedric
Differential Revision: https://phab.enlightenment.org/D3036
After clip_image_get, the old mask may be replaced by a new one,
and unref'ed, but it is later on set back as the context mask image.
Maybe it's possible that there was 0 reference and the image
got freed in between.
No idea how to test this.
@fix
Okay, I'm being paranoid and this can't possibly happen (calloc
fail? yeaaaah) but this makes sure we don't return NULL after
freeing the original image.
evas gl common was simply resetting to the wrong texture id in the gl
context struct - it was using pipe[0] not state.current. why i don't
know. i know i wrote the pipe[0] code many years ago - really don';t
know. it may have been a transitional piece of code that just happened
t6o work 99% of the time that never got fixe when i added pipes.
@fix
this pulls yuv in line with yuy2 textures and dobule buffers them.
this is a workaround some driver bugs where either the driver doesnt
block and wait for the gpu to finish with a texture when updating OR
it does wait, and when it does it blocks and spins using cpu.
so... if you load a non-jp2k file using openjpeg, you can get an abort
deep inside the openjpeg library that we can't do anything about. we
set all error handlers but literally the openjpeg code has ab assert
there that causes this bug. it shouldn't and newer opengjpeg libs have
it removed, but 1.5.2 has it and this causes an untrappable crash.
this is simply bad behavior in openjpeg not allowing it to be used
safely to loade image files. the relevant backtrace:
w=w@entry=0x7fffffffb548, h=h@entry=0x7fffffffb54c,
alpha=alpha@entry=0x7fffffffb556 "", map=map@entry=0x7fff29ac2000,
length=<optimized out>, error=error@entry=0x7fffffffb5bc,
opts=<optimized out>)
at modules/evas/image_loaders/jp2k/evas_image_load_jp2k.c:111
the relevant code in openjpeg:
int cio_numbytesleft(opj_cio_t *cio) {
assert((cio->end - cio->bp) >= 0);
return cio->end - cio->bp;
}
so that assert is triggered. and nothing can be done about it which is
pretty poor.
so an upgrade of openjpeg should fix this as in newer versions have
dropped the assert line in that function, but until poeople have that from
their distro, this adds magic number checks for file headers that avoids
using openjpeg if it's not "apparently" a jp2k file. this does not
stop a corrupt file or a maliciously designed file still causing this
problem, but it does just result in an abort() and isnn't seemingly an
overflow isse that can be exploted, so if you still suffer, find a way to
upgrade openjpeg to 2.x. until then... this reduces inadvertent damage.
@fix
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
Summary: if EGL_KHR_partial_update extension is implemented in the
driver, set damage region. This is done before the draw calls.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Some files were still including SDL-1 headers even though we only link
against SDL2 libs.
URL: https://bugs.gentoo.org/551882
Reported-by: Barnaby <badbit@me.com>
Reported-by: Romain Naour <romain.naour@openwide.fr>
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>
Summary: This fixes T2625 where launching filemanager would cause a
deadlock. The issue here is that wl_display_dispatch actually uses
poll() which will block and wait, while using
wl_display_dispatch_pending does not case any blocking.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary:
This fixes a rendering issue with wayland apps. We consume all buffers then
drop any attempted renders that take place while we have no buffers.
This fix now waits for the server to give us some buffers back.
This is the cause of T2612
@fix
#Kansas
Reviewers: zmike, devilhorns
Reviewed By: devilhorns
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2897
Summary: As we need access to the wl_display in order to dispatch
events on the queue while we wait for free buffers, pass it in to the
surface creation function and set it in the Shm_Surface structure
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary: These functions need to have an additional wl_display
parameter so that we can set the field inside the Surface structure
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary: In order to fix an existing rendering issue, we need access
to the wl_display so that we can dispatch events on the que while we
wait for a free buffer
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary: This just adds a field so we have some place to store the
wl_display for use in the evas wayland engine
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary: This fixes a crash which Could occur if no outbuf depth was
given during a call to reconfigure.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary:
We now track each shm buffer's time since last draw so evas can tell
what it needs to re-render.
Reviewers: zmike, devilhorns
Reviewed By: devilhorns
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2893
Summary:
This is when we're about to start a new render, so it's the best
time to set up the next buffer to draw to.
Reviewers: zmike, devilhorns
Reviewed By: devilhorns
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2892
Summary:
We already have *current, but we're not using it properly. Let's throw
out curr_buff and just use *current.
This temporarily makes swapmode_get do full renders, this will be
fixed in a future commit that adds proper buffer ages.
Reviewers: zmike, devilhorns
Reviewed By: devilhorns
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2890
Summary:
Split out the buffer picking stuff because we're going to want to call
it from somewhere else.
Reviewers: zmike, devilhorns
Reviewed By: devilhorns
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2889
Summary:
It doesn't redraw anything, it posts a buffer full of data to the
compositor.
Reviewers: zmike, devilhorns
Reviewed By: devilhorns
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2887