Commit Graph

2740 Commits

Author SHA1 Message Date
Jean Guyomarc'h 60215a5c53 evas-gl_cocoa: migrate to gl_generic infrastructure
It has been a long journey, but here we are at last...
The infamous gl_cocoa engine has been migrated to the
gl_generic infrastructure. This should provide great
improvements and hopefully reduce side-channels b0rkage.

Fonts seems better, scrolling is smoother, expedite
does not segfault anymore... I haven't found a
regression with elementary_test, elementary_config,
terminology, expedite.
2016-08-25 23:29:27 +02:00
Jean Guyomarc'h d8e488b1c8 evas-gl_cocoa: start refactoring for gl_generic 2016-08-25 21:41:17 +02:00
Jean Guyomarc'h c2856b040a evas-gl_cocoa: remove unused code 2016-08-25 21:41:17 +02:00
Jean Guyomarc'h 54b417fa30 evas-gl_cocoa: cleanup eng_setup 2016-08-25 21:41:17 +02:00
Jean Guyomarc'h f4f94a9f79 evas-gl_cocoa: cleanup eng_info 2016-08-25 21:41:17 +02:00
Jean Guyomarc'h 62c342c4e3 evas-gl_cocoa: init/shutdown cleanup 2016-08-25 21:41:17 +02:00
Derek Foreman ae83b96030 wayland_egl: Destroy gl context if engine info updated with NULL wl_surface
We set the wayland surface to NULL in engine info, then destroy the wayland
surface later.  The GL stack tries to render to the destroyed surface and
dies.

If we destroy the GL surface when we set the engine info (before we destroy
the wayland surface)it stops the GL stack from doing bad wayland calls.

This fixes a crash on exit, or when any window closes when using mali GL
drivers.  Surprisingly, Mesa was tolerant of this.
2016-08-23 15:27:06 -05:00
Jean Guyomarc'h 84679d3173 evas-gl_cocoa: fix crashes at engine startup
Recently, the gl_cocoa engine started to crash at
startup. glGetIntegerv() in gl_common was called
without any gl context, and therefore segfaulted.

We now make sure it is called after a gl context
has been created and used.

Thanks jpeg for troubleshooting.

Fixes T4402
2016-08-22 19:56:08 +02:00
Derek Foreman a71b688b10 evas_engines: Update remaining enges for damage_region_set callback
I missed several engines when I changed this.

Make sure they all build.
2016-08-22 08:39:44 -05:00
Jean Guyomarc'h 52295607e5 evas-engines: fix compiling of the fb engine
Build was broken after commit 0c21a926a3
which changed an internal API.
2016-08-20 14:06:27 +02:00
Derek Foreman 0774088c90 wayland_egl: Fix EGL_KHR_Partial_Update usage
Use the new damage region set callback to do partial updates that actually
work.  Fixes gl rendering on mali.

@fix
2016-08-19 16:26:32 -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
Derek Foreman 20f9acdf19 wayland_shm: Fix dmabuf orientation
So apparently when dmabuf support went into weston it went in with a
Y axis inversion that has since been corrected.

This updates our code to match.
2016-08-19 14:51:55 -05:00
Derek Foreman 7828d0e072 wayland_egl: Fix rendering on systems without buffer age
If buffer age isn't present we really want to return MODE_FULL, but we were
previously returning MODE_AUTO.

On recent mali drivers this resulted in accidental partial updates leading
to incorrect rendering.
2016-08-17 16:24:05 -05:00
Derek Foreman 6ce113791e wayland_egl: Remove swap_mode from engine info
This was never set anywhere and always defaulted to 0, or AUTO
2016-08-17 16:21:29 -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 be5381960b evas: Fix BMP load with region set and scale down
This fixes usage of photocam on large BMP images.
Follows previous commits by @jiin.moon.
2016-08-17 17:28:53 +09:00
Jean-Philippe Andre 0193e40d8c evas: Fix region test in jpeg load with region + zoom
The previous commit exposed an issue with the region test
does not take into account the scale down factor.

Not a @fix in itself, as it depends on the previous patch.
2016-08-17 17:28:53 +09:00
jiin.moon 922a1bcd9e evas: Add support for region load with PNG files
Summary:
PNG loader support  region_set when decoding
@feature

Reviewers: cedric, jpeg, jypark, raster

Subscribers: raster

Differential Revision: https://phab.enlightenment.org/D4165
2016-08-17 17:28:53 +09:00
jiin.moon a76fd7b37e evas: Support region_set for BMP image
Summary:
1) BMP loader support region decoding.
     @feature

2) Fix an issue what BMP loader can't decode an 16bit image with bit field
    @fix

Test Plan: attached sample codes

Reviewers: cedric, jpeg, jypark

Differential Revision: https://phab.enlightenment.org/D4228
2016-08-17 17:28:53 +09:00
Stefan Schmidt 31f289ff4c evas: engine: remove set but unused variable 2016-08-16 16:22:06 +02: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
Jean-Philippe Andre 8fb2dca520 evas: Implement GL map/unmap for the simple case
Most of the code relies on the software generic engine
implementation, using inheritance between engines.

This fixes expedite image map RGBA test.
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 Guyomarc'h be67c1553a elementary: fix memory leaks when using elm_prefs
"regex" is heap-allocated and is not handled by regfree().
We must explicitely call free() after a regfree() to remove
the regex_t from memory.
2016-08-12 16:36:12 +02:00
Jean Guyomarc'h b6b8289636 elementary: fix segmentation faults when using elm_prefs
There are several cases of failure:
- if regex is NULL, regfree(regex) may lead to segmentation fault
  (undefined behaviour, as specified in POSIX.1)
- if regex is not NULL, there are cases of use-after-free.

@fix
2016-08-12 16:28:32 +02:00
Jean-Philippe Andre ad4c92ceeb evas: Fix shader for text masking
Fixes T4338

@fix
2016-08-12 11:10:36 +09:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Chris Michael 7cf75b269e evas-gl-drm: Don't release gbm buffer twice
Not sure how this got in there, but it looks like
gbm_surface_release_buffer was being called twice on the same buffer.
This should sort out the double-free mentioned in ref T4335

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-08-11 07:53:51 -04:00
Jean-Philippe Andre b29847e0da wayland_egl: Fix double free in case of failure
When trying to create a window, the WL EGL engine creates
an ecore_evas and connects to the wayland display. But if
EGL is not supported (in weston with nvidia for instance),
the egl initialization fails and the window must be detroyed
in order to fallback to wayland_shm.

This led to a double disconnect from the wayland display
as both the ecore_evas del and the error handling code
were trying to disconnect.

Also, use ref == 0 in two places rather than ref <= 0, as
it can prevent double frees in bad situations (ref < 0).
And reset a global variable to NULL on shutdown.
2016-08-11 11:37:41 +09:00
Jean-Philippe Andre eba63b7441 wayland_shm: Fix basic support for Evas GL
Simply add support for EVASGL native surfaces.
I removed all code related to OPENGL surfaces (deprecated stuff
from old Evas GL).

Fixes T2936

Note that here are still some missing features in Evas GL
support on Wayland (at least pbuffers support is not implemented).
2016-08-11 11:13:01 +09:00
Carsten Haitzler 60fec61c8b ecore gl module - dont check value that is already valid
make coverity happy with CID 1347410 - it's technically right that the
code assumes the im ptr is valid until then as it dereferences it
until then and then stores it under pd->image but then checks for
NULL.. it would have crashed already if it were, so rmemove the
pointless check.
2016-08-08 17:47:14 +09: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
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
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 67246cddcb ecore imf - ibus - fix destroy/disconnect handling that crashes
restart e or have ibus input get destroyed and come back... the ibus
module will do bad things to its pants... because the wrong things
were passed to the signal callbacks... this fixers that along with
ensuring a freed string ptr is NULL.

@fix
2016-07-30 01:42:15 +09:00
Stefan Schmidt 620d0031de evas: xcb: fix build break of xcb engine
This was broken since commit ed2e78286b
The variable is named differently in the xlib vs. xcb code
2016-07-29 14:17:39 +02:00
Derek Foreman 8b87cd9e46 wayland_shm: Use correct filename in unlink
We switched from mkstemp to eina_file_mkstemp() but ended up unlinking
the template filename, which didn't exist on the filesystem.
2016-07-26 12:38:24 -05:00
Carsten Haitzler ed2e78286b evas software x11 - be agressive with shm cache and keep it low
shm cache size is now 1.5x the total number of pixels in sw x11
outbutf's and that's it. 32 segment max limit too. this should keep
things down

@opt
2016-07-26 13:59:54 +09:00
Carsten Haitzler 93a683daad evas and ecore_x shm segment management - fix over allocation and perms
so our sysv shm segments were both over-permissive (nothing bad
really, just other users could read and write to/from our pixel data
destined for the screen... they could do this to x11 directly anyway
so no real issue), but be more restrictive and use 0600 as xserver
runs as root so can read/write anyway and we only want our own uid
access. but even more - fix our shm segment flushing to not keep lots
of segments floating about like a bad smell when we don't need them.
we had a cache but it wasnt flushed when it should be since async
rendering turned up. this fixes that and we're back to agressively
flushing them out when idle.

@fix
2016-07-26 13:21:50 +09:00
Derek Foreman da6b03540f wayland_shm: Fix fd leak in dmabuf
Need to close the fd from PrimeHandleToFD.
2016-07-25 12:19:43 -05:00
Carsten Haitzler 89a3be8735 ector module - remove sueless chekc for null done already CID 1347411
fixes a pointeless check coverity found
2016-07-24 18:44:15 +09:00
Carsten Haitzler b94a7b5cb4 ecore-imf - remove usueless checks for context - CID 1351451
useless checks for ic in code. fix
2016-07-24 18:44:15 +09:00
Davide Andreoli 3a726037fa Gstreamer1: implement subtitles mute/unmute ability
This seems the only way to disable subtitles embedded in the video file.

WIthout this patch calling em_spu_mute_set/get do not work, thus I consider this a @fix
2016-07-24 11:07:23 +02:00
Derek Foreman 6108aa942c wayland_shm: Speed up dmabuf on intel
using map_bo/unmap_bo instead of gem_map_bo_gtt/gem_unmap_bo_gtt
results in a cacheable mapping and a large performance boost.

(dmabuf will still remain turned off by default for the release)
2016-07-22 14:32:37 -05:00
Jean-Philippe Andre f09df82283 evas: Fix call to NULL object 2016-07-19 19:36:43 +09:00
Jean-Philippe Andre f18747e6dd Evas GL: Use [u]int64_t directly in all APIs
This removes the need for khronos_[u]int64_t as well as the special
typdef EvasGL[u]int64.

Hopefully this should work on all platforms (note: [u]int64_t is
used in Eina APIs, so it is already required for EFL apps).

Fixes T3200
2016-07-18 15:09:19 +09:00
Derek Foreman f48f565306 ecore_drm2: Fix page flipping
Properly handle the ticker racing ahead of the refresh rate by once again
triple buffering.

Fixes T3819
2016-07-14 15:29:54 -05:00
Derek Foreman 8507b512a0 ecore_drm2: Don't disable custom ticker if flip fails
When using a mix of vblank and pageflip events like we're stuck with now
a failed flip is going to happen sooner or later.  We fix this by triple
buffering.  We shouldn't turn off the custom ticker.
2016-07-14 15:29:49 -05:00
Chris Michael 91437a3424 evas-wayland-shm: Create buffers with ARGB by default
We need to be creating buffers with ARGB by default so that things
like Alpha/Transparency work when toggled. If we always create with
XRGB then toggling Alpha/Transparency state fails.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-07-13 14:45:51 -04:00
Minkyoung Kim 1733b09e1b ecore_evas_extn: Check whether server_data sender is client's server.
Summary:
Sometimes, In ipc_server_data, extn->ipc.server's data is different with e->server's data.

The case is as follows.

Process'A' has a server.
Process'B' has 'A's client(ee address : 0xB0).
Process'B's client die, and 'B's server created. and server's ee address is same with destroyed client's ee(0xB0).
At the same time, 'A's server send the message to 'B's client.
but 'B's client is died! so _ipc_server_data would manipulate 'B's server data.

Test Plan: Tizen Mobile Text.

Reviewers: raster, spacegrapher, jpeg, wonsik, dkdk

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D4158
2016-07-13 21:00:07 +09:00
Minkyoung Kim fd1917e90d evas/gl_generic: Recreate texture when native surface image size is changed.
Summary:
Now, if image is native, do not recreate texture when image size is changed.
Recreate next native surface set time. So during the time between image_size_set and native_surface_set, native image is fragile. Fix it.

Test Plan: Local Test

Reviewers: spacegrapher, jpeg, wonsik, dkdk, raster

Reviewed By: raster

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D4153
2016-07-12 14:11:37 +09:00
se.osadchy f796f04aae evas: fix work of engine on macOS.
Summary: Update eng_image_free function and check of references.

Reviewers: thiepha, NikaWhite, FurryMyad, raster, cedric

Subscribers: raster, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-07-11 10:54:50 -07:00
Carsten Haitzler ea99e6288d evas software x11 - dri swapping - fix possible coverity bug
fix CID 1039620 - coverity is right, in theory.
2016-07-11 21:29:32 +09:00
Carsten Haitzler 72438ab2a1 Revert the wobbly window code in wayland_egl engine - fun is over guys
So ok. haha. Amusing. But this is inappropriate.

1. It's not an INTENDED effect in theme so unless the theme ius doing
it - it shouldn't happen.
2. There are places to do this and it's NOT inside an engine. There
are high level filter and other mechanisms.
3. Actually this shouldn't be even done client-side. It should be done
compositor-side when moving a window around. Knowing velocity vector
etc. is useful to a client so the protocol can stay but doing the
animation client-side is "wrong". Some windows wobble and others do
not based on toolkit? really? sure we have to live with the CSD
difference but this? The compositor can do this JUYST fine. leave it
to compositor... OR do this properly with filters client-side. e.g. a
2d displacement map with evas filters would do the job as long as it
interpolates. If you want a way of forcing ALL objects in the canvas
to redirect to an intermediate buffer then do it up there at the
canvas level. It then works in GL and software, as opposed to only GL.

Also.... this is now causing issues for users:

<memeka> hi, from
https://git.enlightenment.org/core/efl.git/commit/?id=fb76fe55a52ac212b6870f1d74470a79ea5c5246
i run EFL_WAYLAND_DISABLE_WWW=1 terminology -> but it crashes in
wayland_egl/www.c in the setup_shaders function .... HELP?

so the fun was fune until we do a release (now) and until this causes
problems for users. Back to tried and tested code.

If you want to do this... do it right at the portable layers above.

...

Revert "wayland-egl: Fix use after free"
Revert "wayland_egl: Fix redirect to texture"
Revert "evas-wayland-egl: Add www protocol handling to wayland-egl engine"
Revert "gl_common: Add API for redirecting render to texture"

This reverts commit 2760afbb0e.
This reverts commit c937248eac.
This reverts commit c67f50b40a.
This reverts commit 0f7f4b6de0.
2016-07-11 14:54:35 +09:00
Carsten Haitzler cdbd437c5f evas sw generic - handle alloc failures correctly for map struct
map struct allocation was not handled right - we assumed successthen
later checked for failure with an if() after using the ptr. this
should fix CID 1353722
2016-07-09 12:28:05 +09:00
Carsten Haitzler a9025a3e4f evas gl generic - fix ector end to place return in right var
fixes new CID 1357394
2016-07-09 11:44:35 +09:00
Chris Michael b2a8ef3d13 evas-wayland-shm: Fix Insecure temporary file
Fix using mkstemp directly without securely setting umask first by
making use of eina_file_mkstemp function which does set umask.

Fixes Coverity CID1357164

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-07-08 08:51:54 -04:00
Carsten Haitzler eb1650d5f2 emotion xine module - silence coverity
silence CID 1357140 as its harmless to not check fcntl here, but dont
confuse coverity.
2016-07-08 19:15:10 +09:00
Carsten Haitzler a510349d00 emotion vlc module - fix potential divide by 0
fix CID 1357146
2016-07-08 19:12:41 +09:00
Carsten Haitzler 4354712ccb emotion xine module - silence coverity complaint
getting the fd from a valid fd handler wont return < 0 but in theory
it can, so just be silent coverity

silence CID 1357155
2016-07-08 19:06:57 +09:00
Carsten Haitzler fe9fb7bcf2 emotion xine module - fix minor complaints but not bugs
silence CID 1357156 , 1357172
2016-07-08 19:02:50 +09:00
Carsten Haitzler 3c793f98a9 gl generic ector leak - fix not using return value of eng_image_data_put
this fixes CID 1339963

@fix
2016-07-08 17:13:17 +09:00
Carsten Haitzler 38735806c6 emotion libvlc module - fix possible argv init issue with tokens
fixes CID 1357170
2016-07-08 11:45:07 +09:00
Cedric BAIL 005375176d evas: fix initialisation and shutdown of eet and eina by mesh loader and saver. 2016-07-06 13:26:15 -07: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
Jean-Philippe Andre f955a20c02 Evas GL: Fix warning about invalid type (GLES 3.1) 2016-07-05 15:04:51 +09:00
Carsten Haitzler aeeda1f77d efl - threads and signals - make efl work on "insane" os's with signals
so. on linux signals are delivered to the main process thread/loop.
thats' where signal handlers are set up and always run. this is sane.
it's predicatble. but of course this is not the same in bsd land.
there "just send the signal to any old thread and call the signal
handler there" seems to tbe the order of the day. this explains why
wer are losing sigchld signals in edje_cc - it's heavily threaded and
bsd is just randombly picking a thread to call it on.

this fixes that. in theory. i hope. i can't test, but putting it in to
share

@fix
2016-07-04 23:47:25 +09:00
Carsten Haitzler 9527240d74 efl - fix lots of little init/shutdown pairs that are wrong
i've fixed almost all the eina init/shutdown pairs to do the right
thing now... except one (ecore_shutdown) with comment inline where
eo_shutdown is not called. if this is called we are in crash land.
this needs further inspection.
2016-07-04 21:30:34 +09:00
DaeKwang Ryu 8b5d5a5a8d EvasGL: Add support for Evas GL 3.1
Summary:
2 wrapper functions are added.
(glFramebufferParameteri, glGetFramebufferParameteriv)

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

Test Plan: OpenGL ES Conformance Test

Reviewers: jpeg

Subscribers: spacegrapher, wonsik, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3782
2016-07-04 20:47:57 +09:00
Derek Foreman 10f2e9c15f wayland_shm: free dmabuf resources on fallback
Add destructors for the buffer managers, and clean up properly when
falling back.

Fixes Coverity CID1357163 and CID1357162
2016-06-30 13:44:51 -05:00
Chris Michael 0da58a8d78 ecore-evas-wayland: Fix issue of passing wrong values to resize
Coverity detected that the same code was being passed to resize
regardless of canvas orientation. This patch fixes the issue by
passing the proper values to window_resize.

Fixes Coverity CID1357150

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-30 11:03:07 -04:00
Chris Michael 59a09e04aa evas-wayland-shm: Remove logically dead code
Coverity reports that this bpp check is actuall dead code due to the
fact that bpp can never be < 0.

Fixes Coverity CID1357144

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-30 10:56:01 -04:00
Chris Michael 1fb3c33286 ecore-evas: Fix error handling issues in wayland_shm engine
This patch fixes 2 Coverity issues where engine_info_set was being
called, but the return was never being checked.

Fixes Coverity CID1357141 and CID1357142

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-30 10:51:29 -04:00
Jean-Philippe Andre 4adbd32a52 Revert "evas: Fix compilation when using different build directory"
This reverts commit 3c13ef14e3.

This introduced new build breaks, especially with in-tree builds.
In particular, DIR was not defined. See T3975.

I'll make the shaders regen an opt-in rather than on by default.
2016-06-27 16:19:43 +09:00
Felipe Magno de Almeida 3c13ef14e3 evas: Fix compilation when using different build directory 2016-06-24 22:47:49 -03:00
Jean-Philippe Andre e1d5d5e4a1 evas: (Try to) fix shaders gen without breaking everything
So... adding the .x files to BUILT_SOURCES means they would
get deleted during clean. This was bad, but turned to be awful
when this made the check for writability fail.

See:
8a27315878
2b8912462e

This commit reverts:
0b69356f1b

Notes:
Please revert if this breaks the build for anyone.
I'm pretty sure the use of top_srcdir is not recommended the
way I've done it.

I hate autofoo.
2016-06-24 16:46:57 +09:00
Carsten Haitzler 0b69356f1b Revert "evas: Fix distcheck by disabling shaders generation"
this breaks the simplest configure + make ... so obviously it's broken
2016-06-24 10:05:41 +09:00
Derek Foreman d2a3502481 wayland_shm: Make dmabuf opt-in
Some weird bugs and performance issues around these days, and I
keep chasing them in dmabuf first.  Removing it from the equation for
now.
2016-06-23 13:55:03 -05:00
Jean-Philippe Andre 2b8912462e evas: Fix distcheck by disabling shaders generation
make distcheck is verified by checking the env var "top_distdir"
This is not a great solution but should work.
2016-06-23 17:51:10 +09:00
Jean-Philippe Andre 41e17f7e73 evas 3d: Fix shaders compilation (parallax and normal)
My nvidia EGL driver coultn't compile some shaders because of
the error:
  error C1059: non constant expression in initialization

The proposed patch at D4068 is not acceptable since it just
brings the original problem back. Instead, make sure all vec3
variables are initialized in main() or another function, not in
the global scope.

I tested all examples in evas
2016-06-22 14:30:37 +09:00
Jean-Philippe Andre 8a27315878 evas 3d: Fix shaders generation script 2016-06-22 13:43:07 +09:00
Chris Michael 3186f3a5fd evas-drm: Reset current buffer state when pageflip completes
When an fbo pageflip finishes, we should be marking the current fbo
(one just sent) as no longer busy since it's already been pixel
blasted to the screen. Also, if we fail to flip to a given fbo during
buffer swap, then don't leave that fbo marked as busy since it is
technically not in use

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-21 12:59:30 -04:00
Chris Michael c39e8e7555 evas-drm: Remove improper EINA_UNUSED for function parameter
'fd' is actually used in the call to WaitVBlank, so do not mark it as
EINA_UNUSED

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-21 12:07:54 -04:00
Tom Hacohen 6202cc7485 Adjust the code according to the eo event stop changes.
This was changed in the previous commit.
2016-06-20 18:02:00 +01:00
Stefan Schmidt 19ebcc02b4 evas: native-tbm: remove unused variable
The variable was set but never used in this function.
2016-06-20 16:07:20 +02:00
Jean-Philippe Andre 4ca91c4881 evas gl: Fix invalid argument
GCC didn't warn where it should have :(
Luckily the previous code worked just as well as the value
of EINA_TRUE and EVAS_GL_GLES_1_X are the same (1).
2016-06-20 21:08:58 +09:00
Jean-Philippe Andre c0dcb30c61 evas 3d: Fix shader compilation with EGL
This fixes the following error:
 error C1059: non constant expression in initialization

It happened with the hedgehog example: evas_canvas3d_aabb
2016-06-20 15:35:01 +09:00
Jean-Philippe Andre 5964c33567 evas: Improve debug logs (print shader code) 2016-06-20 14:19:30 +09:00
Jean-Philippe Andre 52f9220b3f Evas: Rename smart object into Efl.Canvas.Group 2016-06-17 19:32:43 +09:00
Jean-Philippe Andre 42b63f5507 Evas: Add smart_ prefix to all smart functions (eo)
This is a first step at separating legacy smart
object features away from standard efl interfaces.
2016-06-17 19:25:48 +09:00
Ji-Youn Park 830faf2502 evas_image_load_bmp: fix bug that image is not decoded, if image is not perfact. 2016-06-17 18:42:28 +08:30
Derek Foreman 47e9d11f74 wayland_shm: Fix another dmabuf corner case
When kernel support for locally mmapping buffers is unavailable and
software rendering is used, dmabuf may need to fallback to shm for the
very first frame rendered.

We need to copy that frame to a shm buffer during the fallback to make
sure it's actually displayed.
2016-06-15 12:40:36 -05:00
Carsten Haitzler fa19b37458 shader gen - make this use plain sh not bash for portability
this should fix T3793
2016-06-15 14:33:56 +09:00
Jean-Philippe Andre c9d94a44cf wl_shm: Fix compilation warning (cast) 2016-06-14 16:27:42 +09:00
Chris Michael c163e51dd3 ecore-evas-wayland: Minor formatting fixes
NB: no functional changes

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-13 16:19:46 -04:00
Chris Michael fb569d7eb0 ecore-evas-drm: Re-enable direct input callback
As it seems the jpeg breakage is over wrt direct input callbacks, we
can re-enable these for the drm engines

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-13 16:19:46 -04:00
Minkyoung Kim 93b4df1f5a evas-native-tbm: fix stride mismatch and allocate image data for converting from yuv to rgb.
Summary:
1. For converting tbm buffer from yuv to rgb, image.data should be allocated.
2. Stride should be set by info of tbm surface.
3. The number of row is height*2. but if height is odd, last row is invalid in process of _evas_video_i420.

Test Plan: Local Test, Tizen2.4 Mobile

Reviewers: spacegrapher, wonsik, jpeg

Subscribers: cedric, dkdk

Differential Revision: https://phab.enlightenment.org/D3870
2016-06-13 15:27:56 +09:00
Jean-Philippe Andre e691de04be Evas: Rename Clickable_Interface to Efl.Ui.Clickable
Event prefix is efl_ui:
 EFL_UI_EVENT_CLICKED
 EFL_UI_EVENT_CLICKED_DOUBLE
 ...

The event prefix could be reduced to efl but I personally
prefer with UI.
2016-06-10 17:33:53 +09:00
Benjamin Jacobs 16f4c5c35a evas-wayland-egl: Make sure surface pointer is valid before using it
Summary:
Prevents the uninitialized surface pointer to be used when
glsym_evgl_native_surface_buffer_get is NULL.

Reviewers: devilhorns

Subscribers: cedric, jpeg

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

@fix
2016-06-09 09:33:16 -04:00
Oleksandr Shcherbina 32d1f4b2e5 evas: fix possible memory leaks in e3d_drawable_texture_rendered_pixels_get
Summary:
@fix
CID: 1356243, 1356242, 1356242, 1356242

Reviewers: cedric, Hermet, raster

Subscribers: jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-06-08 13:58:30 -07:00
Jean-Philippe Andre 0e17dc79b3 wl_shm: Fix uninitialized warning
warning: variable 'surf' is used uninitialized whenever 'if' condition
is true [-Wsometimes-uninitialized]
2016-06-07 15:11:27 +09:00
Jean-Philippe Andre ecc1d5dfaf gl_drm: Fix shadow warning 2016-06-07 15:10:28 +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
Oleksandr Shcherbina e3eb246e2c evas: fix typo in description of the engine functions.
Reviewers: Hermet, raster, cedric

Reviewed By: cedric

Subscribers: jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-06-06 16:40:25 -07:00
Oleksandr Shcherbina 6c580faad9 evas: fix order binding attributes to gl.
Summary:
In same cases(devices) can lead to mix up attributes in shaders.
@fix

Reviewers: cedric, Hermet, raster

Subscribers: jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-06-06 16:39:41 -07:00
Jean Guyomarc'h 1f69a7cfa7 ecore_evas_cocoa: better handling of resize callback 2016-06-05 12:12:02 +02:00
Jean Guyomarc'h b2775d90b1 evas-gl_cocoa: resize the gl context before resizing the window
This order seems more right. It does not have a visible
impact though...
2016-06-05 12:12:02 +02:00
Derek Foreman 3de4e31003 wayland_shm: Fix more dmabuf failure corner cases
With the exynos allocator a failure can happen during a resize, and the
resize path wasn't properly falling back to wl_shm buffering.
2016-06-03 16:28:24 -05:00
Derek Foreman 34ce296cac psd_loader: Fix bad assumption about signedness of chars
Whether "char" is signed or unsigned is architecture dependent, so if we
know we need a -1 in a char type we must declared it to be signed.
2016-06-03 16:28:24 -05:00
Derek Foreman 821aada3c4 wayland_shm: Add exynos allocator for dmabuf
Allows clients on exynos hardware to allocate GEM buffer objects
to back DMAbuf buffers.
2016-06-03 11:05:28 -05:00
Derek Foreman 0f07f67b12 wayland_shm: Abstract out dmabuf management
Split out the intel specific stuff into an abstraction in preparation for
adding exynos support.
2016-06-03 11:05:16 -05:00
Oleksandr Shcherbina 7e0601c980 evas: Get pixels from rendered 3D scene
Summary:
Implemented interface Efl.Gfx.Buffer functions bufer_map/unmap for Efl.Canvas3D.Scene.
Added function e3d_drawable_texture_rendered_pixels_get to module evas_gl_3d
to getting pixels from FBO. Added wrappers for functions
e3d_drawable_texture_rendered_pixels_get and e3d_drawable_texture_id_get
to have possibility call it through engine functions.

Reviewers: cedric, Hermet, raster, jpeg

Reviewed By: jpeg

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D3978
2016-06-03 14:22:33 +03:00
Cedric BAIL c77856456e evas: attempt to fix massive memory leak in the fb engine.
T3763
2016-06-02 10:53:42 -07:00
Jean-Philippe Andre 014295fbc9 ecore_evas: Fix mouse in/out events
Apparently I broke some inputs in E (efm) like mouse wheel.
Somehow the list of objects where the pointer is in was NULL.
This was because the mouse_in/out events were not matched to
the proper window ID.

Fixes T3760
2016-06-02 14:19:18 +09:00
Tom Hacohen a6a2338962 Revert "Eo: Remove eo_del() and make eo_unref() the replacement."
This reverts commit 546ff7bbba.

It seems that eo_del() is useful and removing it was creating bugs.
The issue is that the way we defined parents in eo, both the parent and
the programmer share a reference to the object. When we eo_unref() that
reference as the programmer, eo has no way to know it's this specific
reference we are freeing, and not a general one, so in some
circumstances, for example:
eo_ref(child);
eo_unref(child); // trying to delete here
eo_unref(container); // container is deleted here
eo_unref(child); // child already has 0 refs before this point.

We would have an issue with references and objects being freed too soon
and in general, issue with the references.

Having eo_del() solves that, because this one explicitly unparents if
there is a parent, meaning the reference ownership is explicitly taken
by the programmer.

eo_del() is essentially a convenience function around "check if has
parent, and if so unparent, otherwise, unref". Which should be used when
you want to delete an object although it has a parent, and is equivalent
to eo_unref() when it doesn't have one.
2016-06-01 13:33:21 +01:00
Chris Michael e01ac62e5f ecore-evas-drm: Disable direct input callback
For ecore_evas drm engine(s), disable setting of
ecore_event_window_direct_callback as this Completely Breaks all input
when running Enlightenment Wayland.

NB: This can likely be re-enabled at some point, when the jpeg
breakage is over ;)

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-31 09:49:43 -04:00
Chris Michael 1ca1f8b06d ecore-evas-drm: Register direct input callback for gl_drm also
@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-31 09:23:20 -04:00
Jean-Philippe Andre 8e31929aab Efl.Pointer.Event: Add dup() method to copy an event 2016-05-31 19:03:04 +09:00
Jean-Philippe Andre 05dfab8442 ecore_x: Pass in/out through ecore_input_evas
This whole input system is a massive mess. It looks like spaghetti.
Long live the giant flying monster.

This commit changes how some events are propagated in X.

Before:
 ecore_x -> evas_event -> evas

After:
 ecore_x -> ecore_input_evas -> ecore_evas -> evas_event -> evas

There are still inconsistencies between events and between X and WL,
but ecore_evas should be used for all events since it rotates the
inputs.
2016-05-31 19:03:04 +09:00
Jean-Philippe Andre 5aa00004a5 ecore_evas: Register direct input cb from modules
If the ecore_evas modules were using
ecore_event_window_register() then they can also redirect
everything though the direct callback instead.
2016-05-31 19:03:04 +09:00
Chris Michael 593961c2e2 ecore-evas-drm: Fix issue of mouse pointer not centering on startup
This patch fixes an issue where starting Enlightenment would not
center the mouse pointer. Basically the issue is that we cannot warp
the mouse pointer until After the ee->prop.window has been set else
E will not process the mouse_move event

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-27 11:57:53 -04:00
Mike Blumenkrantz da8bcbc7c6 ecore-drm2: update to latest elput 2016-05-27 11:57:53 -04:00
Derek Foreman 5535c049cd evas-drm: Fix occasoinaly freezes
We need to continue to tick even if we can't find a buffer - otherwise
we'll stop updating forever.

We also need to reset buffer busy bits to 0 if we run out of buffers or
we'll never try to assign one.  (The page flip handler would eventually
clear the busy bit for the current buffer, but a few lines ago we just
set that to NULL so it will never happen...)
2016-05-27 11:57:53 -04:00
Derek Foreman bdcd84cd2c evas-drm: Don't re-use the current buffer immediately
If we don't block the current buffer from being assigned to the new
current buffer we'll end up rendering into the same buffer over and over
and never actually double buffer.
2016-05-27 11:57:53 -04:00
Chris Michael 93178199a6 ecore-evas: Port ecore_evas drm engine to use Ecore_Drm2 library
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-27 11:57:53 -04:00
Chris Michael ccb573ec7b evas-engines: Port evas drm engines to use Ecore_Drm2 library
This patch ports the evas drm and gl_drm engines to use the new
Ecore_Drm2 library

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-27 11:57:53 -04:00
Carsten Haitzler 072674dbe2 efl - ecore c+ ecore-imf - fix odd case input when faking a real event
so ibus module for ecore-imf likes to send an x event back to
ourselves faking a key... this works unless we are looking at
modifiers that make make for odd combos with keysyms turned into
keycodes. so actualyl use the correct original keycode plus state
unless we are having to explicitly send a keysym from ibus core.

this fixes T3703

@fix
2016-05-27 23:57:30 +09:00
Jean-Philippe Andre 2af9f15bf9 Evas: Fix compilation warning
Missing initializers. Damn C and {0}.
I could also have used GCC's {} form.
2016-05-26 20:53:53 +09:00
Jean-Philippe Andre 3d6ea827b9 Evas GL: Fix compilation warning, use func pointer
GLES 3 support should be a runtime-only requirement, so
no direct call to a GLES3 function should appear in evas.
Use our dlsym() pointer instead.
2016-05-26 20:50:53 +09:00
Jean-Philippe Andre 56a7a66e97 Evas GL common: Simplify GLPIPES... trying to prevent a crash
An unknown crash happened in glDrawArrays() where color_ptr is
a non-reachable pointer that looks like a valid malloc() zone.

Unreproducible issue. I can only hope this patch doesn't actually
break anything.

This cleans up rectangle and line in particular, that were not
using common code to use GLPIPES. I honestly couldn't find a
problem though.
2016-05-26 18:35:07 +09:00
Nicolas Aguirre 85682678e6 evas: gl_common add define for missing EGL_WAYLAND_Y_INVERTED_WL 2016-05-22 23:41:18 +02:00
Derek Foreman d93db5bcaa gl_drm: switch to GLERRV macro for error reporting
eglGetError() is actually somewhat heavy, so hide it behind the GLERRV
macro which compiles out the test by default.
2016-05-20 15:53:20 -05:00
Derek Foreman f8976aed13 gl_drm: Fix silly run time warning for wayland dmabuf
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.
2016-05-20 15:47:21 -05:00
Mike Blumenkrantz 7510e42c1b elm_win: implement v2 of teamwork api using window-based display protocol
this adds support for wayland and makes teamwork integration trivial for any
application

@feature
2016-05-20 14:54:06 -04:00
Carsten Haitzler a52c7da714 evas 3d - fix mesh savers/loaders to not leave memory unset
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
2016-05-20 21:46:50 +09:00
Jean Guyomarc'h 147ef32b2b efl: fix misleading indentation
GCC's -Wmisleading-indentation is complaining...
It is a warning flag introduced in GCC 6.x, and
is enabled by -Wall.
2016-05-18 21:57:02 +02:00
Derek Foreman d485e1f161 software_generic: Add wayland dmabuf native surface support 2016-05-18 11:52:24 -05:00
Derek Foreman 5f0aea2e24 gl_drm: Add wayland dmabuf native surface support 2016-05-18 11:52:24 -05:00
Derek Foreman 72b1997f06 evas: Add wayland dmabuf native surface type
Add the structures required for supporting dmabuf native surfaces
2016-05-18 11:52:24 -05:00
Derek Foreman 0a6cdcc58c software_generic: Call native surface free callbacks
In the near future this will prevent leaking native surface data for
wayland dmabuf buffers.
2016-05-18 11:52:23 -05:00
Derek Foreman c59eb1ce62 wayland_shm: Attempt to create mmappable dmabuf objects
To composite from dmabuf buffers without GL we need to be able to mmap them
in the compositor - create the buffers in a way that makes that possible.
2016-05-18 11:52:23 -05:00
Derek Foreman dfd9159a53 wayland_shm: Fix dmabuf failed allocation handling
We frequently attempt to generate multiple buffers before any come back
as failed - the orphaned buffers need to be handled more carefully.
2016-05-18 11:52:23 -05:00
Cedric Bail 75a53ece10 eo: for consistency use object like all our API. 2016-05-18 08:18:04 -07:00
Jihoon Kim 2b8d93a5d1 ecore_imf: Add multiline hint in input hint
@feature
2016-05-18 15:21:12 +09:00
Daniel Kolesa 7782c0bcb9 eolian: add event_prefix and have classes follow that or eo_prefix by default
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
2016-05-17 17:50:43 +01:00
Tom Hacohen 546ff7bbba Eo: Remove eo_del() and make eo_unref() the replacement.
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.
2016-05-17 16:23:23 +01:00
Jihoon Kim 988fe37232 ecore_imf/wayland: Change sequence to call preedit changed and end callback
preedit changed and end callback should be called before commit callback
2016-05-17 08:34:17 +09:00
Nicolas Aguirre 21da8f1475 Evas: gl_common remove gl3.h and gl3ext.h includes 2016-05-16 00:58:52 +09:00
Nicolas Aguirre 436a9db6a6 Evas: gl_common add define for missing GL_DEPTH_COMPONENT24 2016-05-16 00:58:52 +09:00
Tom Hacohen 96c4c88070 Efl: Remove "legacy_prefix: null;" as it's now the default. 2016-05-12 17:27:35 +01:00
Tom Hacohen 0253d91ade Evas object smart: Fix namespace to use . and not _. 2016-05-12 11:12:15 +01:00
Tom Hacohen 28a2d34ae2 Ector generic: Remove .Generic and .Base (hack no longer needed). 2016-05-11 12:57:55 +01:00
Cedric BAIL 0c4880e99d efl: everyone should now rely on Eina MIN/MAX redefinition. 2016-05-09 16:58:53 -07:00
Mike Blumenkrantz 9d5caf00b6 wayland: implement session recovery
add support for reconnecting wayland applications if the compositor dies

disconnect -> destroy gl ctx + image textures -> block rendering ->
reconnect -> create gl ctx -> create image textures -> unblock rendering ->
sprinkle special seasoning on top -> just like ma used to make

 #SamsungFeatures

@feature
2016-05-05 10:49:31 -04:00
Mike Blumenkrantz bdfbd4a4e1 wayland_egl: return immediately in eng_window_free() when null is passed 2016-05-05 10:49:31 -04:00
Mike Blumenkrantz 4f4556be35 wayland_egl: unset global egl context if used wl_display changes
as long as evas uses a global gl context any change to the wl_display
must trigger a full re-create on that context
2016-05-05 10:49:30 -04:00
Mike Blumenkrantz 217551e92b wayland_egl: ensure gl context destruction when unsetting wl_display
extra refcounting during setup in this case will prevent the context
destruction, leading to a dead gl context which is unable to render
2016-05-05 10:49:30 -04:00
Derek Foreman d6818131c0 wayland_shm: Fix extra buffer allocation on client shutdown
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.
2016-05-03 14:24:45 -05:00
Derek Foreman 16108a972f wayland_shm: Fix bad indenting 2016-05-03 14:24:45 -05:00
Derek Foreman 4f6e7a8ab3 wayland_shm: Fix dmabuf fallback to shm
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.
2016-05-03 14:24:45 -05:00
Derek Foreman 6ef0fdfe2b wayland_shm: Fix uninit variable
also make it an Eina_Bool
2016-05-03 14:24:45 -05:00
Chris Michael eefee97c2a ecore-evas-wayland: Remove include for old Ecore_Wayland library
This include is leftover from the porting to Ecore_Wl2. Remove
unused include for old Ecore_Wayland library

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-03 11:21:31 -04:00
Derek Foreman bb036dbceb wayland_shm: Remove debug detritus
Should've been removed before push.  Oops.
2016-04-19 16:40:27 -04:00
Derek Foreman 45a662c91c wayland_shm: Add dmabuf support
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.
2016-04-19 15:11:10 -04:00
Derek Foreman 0d684d4559 wayland_shm: Refactor surface creation
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.
2016-04-19 15:11:10 -04:00
Derek Foreman 8635f56aeb wayland_shm: pass engine info to shm_surface_create
Gratuitous change to pass less parameters and make some code prettier.
2016-04-19 15:11:10 -04:00
Derek Foreman 0ada4d3d56 wayland_shm: Pull the damage stuff out of evas_shm
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
2016-04-19 15:11:10 -04:00
Derek Foreman 11cf0206e4 wayland_shm: Minor clean up of _evas_shm_surface_post
Some gratuitous cosmetic fixes
2016-04-19 15:11:10 -04:00
Derek Foreman 2c33bae2d5 wayland_shm: Don't pass num_buff to reconfigure
We can't really reconfigure the number of buffers after they're created,
there's nothing above us that would try to do it...
2016-04-19 15:11:10 -04:00
Derek Foreman e5fb4cada7 wayland_shm: Gratuitous code simplification
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.
2016-04-19 15:11:09 -04:00
Derek Foreman 405b278528 wayland_shm: Pass Evas_Engine_Info_Wayland_Shm directly to setup functions
We pretty much pass all its contents anyway.
2016-04-19 15:11:09 -04:00
Derek Foreman 34e539a3c1 wayland_shm: Add dmabuf to engine info
Get the dmabuf protocol object from ecore_wl2 and store it in engine info
2016-04-19 15:11:09 -04:00
Derek Foreman ed665ee6ee wayland_shm: Abstract the actual shm operations
Make the Surface carry function pointers and the shm surface create
function set them.  This refactor makes implementing dmabuf operations
simpler.
2016-04-19 15:11:09 -04:00
Derek Foreman 63a255750b wayland_shm: Remove outbuf_reconfigure function pointer
We only ever call it from one place, and we only ever initialize it
to one value, so there's no need for a function pointer.
2016-04-19 15:11:09 -04:00
Derek Foreman 4c61ec5e05 wayland_shm: Remove unused dx, dy params from resize functions
We don't appear to actually use these for anything except long term storage
2016-04-19 15:11:09 -04:00
Derek Foreman 7cd2693075 wayland_shm: Drop ifdefs around damage_buffer
We now depend on wayland 1.10.0 so damage_buffer is always going to be
present in the headers - we no longer need ifdef checks.
2016-04-19 15:11:09 -04:00
Derek Foreman cd124f938f wayland_shm: Make new Surface abstraction to wrap Shm_Surface
Wraps the Shm_Surface allocator in a new Surface type that will
potentially use different allocators, such as dmabuf in a future commit.
2016-04-19 15:11:09 -04:00
Derek Foreman 78688b226f wayland_shm: Move Shm private structures into evas_shm
Refactor all the shm specific stuff into evas_shm so it can better
co-exist with upcoming dmabuf allocations
2016-04-19 15:11:09 -04:00
Derek Foreman 7e2f5e759e wayland_shm: Remove flags
We only used this for resize, and didn't actually even need it then.
2016-04-19 15:11:09 -04:00
Derek Foreman 745435deab wayland_shm: Don't use number of buffers in swap mode calculation
The number of allocated buffers shouldn't change a thing...
2016-04-19 15:11:09 -04:00
Derek Foreman f92c2d2330 wayland_shm: Return buffer age from shm_surface_assign
This makes refactoring the Surface abstraction a little easier.
2016-04-19 15:11:09 -04:00
Jihoon Kim 8c1776d177 ecore_imf/wayland: Fix bug language changed event is always called 2016-04-18 14:51:46 +09:00
Carsten Haitzler b7d882515d eina mempool: don't allow 0 sized mempools
there is no point in having a mempool with a max 0 size. this leads to
us mallocing 0 bytes for the base. not good. make minimim size 1. :)

@fix
2016-04-18 09:31:08 +09:00
Vitalii Vorobiov a69903e3b2 datetime_input_ctxpopup: delete previously created ctxpopup if theme is broken
Summary:
Or else it will create dozens of ctxpopup's if user applied wrong or broken
theme that do not remove ctxpopups at all (lack of programs/signals or whatever
brokes ctxpopup behaviour)

@fix

Reviewers: cedric, reutskiy.v.v, NikaWhite, raster, an.kroitor, wc, Hermet

Reviewed By: Hermet

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D3885
2016-04-14 20:35:42 +09:00
Oleksandr Shcherbina 172cfa0f04 evas.canvas3d: Change shade_mode to shader_mode
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
2016-04-14 20:28:20 +09:00
Tom Hacohen f14305024e Eo event: rename Eo_Event->event_info to Eo_Event->info.
The previous naming was redundant and too long.
2016-04-12 15:23:55 +01: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
Carsten Haitzler 53c66c98c2 ecore - system modules - fix eldbus interdependency and complaints
so ecore uses ecore system modules ... that use eldbus. eldbus inits
ecore. this is a vicious cycle. eldbus shouldnt init ecore. it's a
dependency but should be provided outside of initting eldbus. this all
led to hack-arounds on initting eldbus in these ecore modules that
just break things like shutting down eldbus when still in use.

this ensures any pending messages are canceled on ecore module shutdown.
this ensures every ecore module fully inits and shuts down eldbus as
they should so refcounting the inits works.
this stops eldbus from inittign ecore to avoid the circuluar dependency.

this stops lots of CRI/ERR complaints eg if you run elua with no
cmdline options.

this is just better.

@fix
2016-04-12 14:11:32 +09:00
Carsten Haitzler f54a2eb570 ecore system upower - silence if service doesnt exist
this silences come complaint warnings that should not be noisy - eg if
upower dbus service doesn't exist.
2016-04-12 12:51:48 +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
Oleksandr Shcherbina 1f66a9e731 evas.canvas3d: Add FXAA post processing render.
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
2016-04-12 00:50:46 +09:00
Jean-Philippe Andre f253f9a7bc Evas 3d: Fix compilation for Windows
near and far are #defined in windows.h. Old legacy stuff.
To be sure the code compiles, rename the variables.

Fixes T3423
2016-04-08 11:13:06 +09:00
Mike Blumenkrantz 0712218537 wayland: hook engine data from elm_win and update rect with evas size
the only way to accurately calculate the "evas" size in the engine from
window geometry is to have the size of the frame available to subtract from
window geometry

window geometry is NOT framespace--framespace is the entire csd region, possibly
containing a shadow, and window geometry is explicitly the region occupied by the
window, ie. not the shadowed part.

not my ideal solution to the synchronization issue here, but I guess this is a
benefit of the unified tree

fix T3396
2016-04-07 14:19:25 -04:00
Mike Blumenkrantz 5292b3de05 ecore-wl2: redo Ecore_Wl2_Event_Window_Configure entirely
this is an event representing the "new" state of the surface after a
configure event. it must contain the exact states which could potentially
have changed in the configure in order to ensure synchronization between
csd states and window size.

ecore events for xdg-shell configures must be sent only upon receiving a
configure event since states are set by the compositor and not by the client

@fix

 #hoorayforbeta
2016-04-07 14:19:25 -04:00
Chris Michael fb3b6ac327 evas-wayland-shm: Update copyright notice
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>
2016-04-05 07:44:19 -04:00
Jean-Philippe Andre f57da20b88 Evas: Fix GL shader selection for afill
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.
2016-04-05 18:20:36 +09:00
Derek Foreman 406c234346 wayland_shm: Fix resize optimization
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.
2016-04-04 18:00:40 -04:00
Derek Foreman 2760afbb0e wayland-egl: Fix use after free
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.
2016-04-04 14:11:28 -04:00
Derek Foreman c937248eac wayland_egl: Fix redirect to texture
Previous redirect to texture approach broke multiple window applications
by having only a single redirect per context.  This approach allows
multiple redirections.
2016-04-04 12:13:23 -04:00
Jean-Philippe Andre cf2804a220 Evas x11: Fix warnings and invalid calls in engine
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.
2016-04-04 14:42:34 +09:00
Carsten Haitzler db4ff548d3 evas - gif loader - handle missing colormap
follow on from dd90b6afad - this handled
if a gif file has no colormap (it'll decode as blank now as a colormap
of all 0's is used instead).

@fix
2016-04-04 09:51:12 +09:00
Jean Guyomarc'h 8fb153cf8c evas_gl_cocoa: fix segmentation fault at program exit
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.
2016-04-02 22:27:12 +02:00
Carsten Haitzler f56e33f429 evas - gif loader - be a little more optimal in pixel lookups on decode 2016-04-02 13:32:36 +09:00
Carsten Haitzler dd90b6afad evas: gif loader - fix out of bounds access on cmap of invalid pixels
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
2016-04-02 13:32:28 +09:00
Chris Michael e84b2e50f7 evas-software-generic: remove native.func.data variable and data argument of native calblacks.
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>
2016-04-01 07:56:54 -04:00
Derek Foreman c67f50b40a evas-wayland-egl: Add www protocol handling to wayland-egl engine
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>
2016-04-01 06:49:50 -04:00
Derek Foreman 0f7f4b6de0 gl_common: Add API for redirecting render to texture
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>
2016-04-01 06:49:50 -04:00
Mike Blumenkrantz 17bb2d60ca ecore_evas wayland: store relevant www data in engine info
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>
2016-04-01 06:49:49 -04:00
Mike Blumenkrantz afd083788b ecore-evas wayland: use www protocol when available
handle www protocol events and store the provided data into engine data

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
2016-04-01 06:49:49 -04: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
Mike Blumenkrantz a6924ced9d wayland: add comment for ref T3396 2016-03-30 16:00:10 -04:00
Mike Blumenkrantz f70649a13d wayland: ignore resize from no-op surface configure events, send events always
this fixes the case where a configure event with the current window geometry
would cause (inaccurate) resizes

@fix
2016-03-30 15:42:21 -04:00
Minkyoung Kim fb3368111d evas: Move engine data to native.
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
2016-03-30 15:09:27 +09:00
Cedric BAIL 95808a226a elementary: add back modules. 2016-03-29 14:53:38 -07:00
Li Zhang 7ad6c34a2c Add ECORE_IMF_CALLBACK_DELETE_SURROUNDING
Change-Id: I0e1ab14736a3d3849becb7cbeea81fe7b61053b7
2016-03-29 20:17:13 +09:00
Carsten Haitzler 5f307809b1 efl - evas - sw engine - donmt free spinlock because cache always needed
never free the shm pool cache spinlock as it is alwasy needed once
initiialized. this likely fixes a bsd hardlock issues

@fix
2016-03-29 12:11:10 +09:00
Minkyoung Kim a536f068dd evas/wayland_egl: Remove redundant function call.
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
2016-03-29 11:04:12 +09:00
Thomas Guillem 3f1686d01e emotion/libvlc: fix url opening 2016-03-28 16:40:02 +09:00
Thomas Guillem b12c2a2cfd emotion/libvlc: replace libvlc_mp_is_ready with ev->started 2016-03-28 16:40:02 +09:00
Thomas Guillem a6bd5dda42 emotion/libvlc: use vlc vout display module
The vlc vout display module adds key and mouse event support. It improves
performances since a video filter is not needed anymore to scale the image, and
direct rendering with vlc avcodec module is now possible (less memcpy).
2016-03-28 16:40:02 +09:00
Thomas Guillem 50d9f63c2e emotion/libvlc: log: print vlc module and id 2016-03-28 16:40:02 +09:00
Thomas Guillem 7d3e96757d emotion/libvlc: fix C89 2016-03-28 16:40:02 +09:00
Thomas Guillem f5296e8afc emotion/libvlc: set libvlc args from "EMOTION_LIBVLC_ARGS" env 2016-03-28 16:40:02 +09:00
Thomas Guillem 941ccc4324 emotion/libvlc: fix video/audio/spu mute 2016-03-28 16:40:02 +09:00
Thomas Guillem f04903119c emotion/libvlc: set libvlc_log static 2016-03-28 16:40:02 +09:00
Jean-Philippe Andre cb93c26db7 Evas proxy: Implement buffer map/unmap 2016-03-28 16:40:02 +09:00
Jean-Philippe Andre 22353e31e1 Efl.Canvas.Image: Remove object data for maps
The engine is responsible for the complete tracking of
maps.

Also, make buffer_unmap return bool.
2016-03-28 16:40:02 +09:00
Jean-Philippe Andre 488854af2b Efl.Gfx.Buffer: Switch to void* data and signed ints
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.
2016-03-28 16:40:01 +09:00
Jean-Philippe Andre d5b0b1e683 Evas: Add SW engine map/unmap functions
Also, fix some of the code using them.
2016-03-28 16:40:01 +09:00
Jean-Philippe Andre 39a970835b Evas: Remove unimplemented border_set/get (engine internal) 2016-03-28 16:40:01 +09:00
Jean-Philippe Andre 28a03d6e19 Evas: Remove unimplemented image comment (internal)
This is a minor cleanup of RGBA_Image.
2016-03-28 16:40:01 +09:00
Jean-Philippe Andre 326ff9ae82 Efl.Canvas.Image: Implement support for map/unmap
Now the real hard work is to actually implement support inside
the engines: SW and GL generic.
2016-03-28 16:40:01 +09:00
Jean-Philippe Andre 91e0bdb1e7 Evas: Simplify direct access to image data
This should avoid issues with image_data_get from the engines,
when we really just want to fetch the original data pointer.
2016-03-28 16:40:01 +09:00
Tom Hacohen 5bcb9fe528 Merge Elementary into the EFL
Some things may still be broken, but Cedric will progressively fix
things as they pop. Default configuration works as expected.
2016-03-24 18:50:47 +00:00
Jihoon Kim 161883291c ecore_imf/wayland: fix IME flickering issue when input_panel_hide and show is called sequentially
Change-Id: Ieafa9cd921cc8d68c64af6b72404ef52e7bbf724
2016-03-24 20:46:15 +09:00
Jean-Philippe Andre 959e6de3e7 Evas 3d: Fix typo in previous commit
I didn't reject so I can push this now.
2016-03-24 11:12:30 +09:00
Oleksandr Shcherbina 35a64ecae7 evas.canvas3d: Remove repeated code in e3d_drawable_new function
Reviewers: cedric, Hermet, raster

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D3824
2016-03-24 11:07:54 +09:00
Cedric BAIL b1f28ef697 elementary: removing webkit2 module as it should now be built outside of tree.
A later new repository will show up with it.
2016-03-23 14:05:36 -07:00
Cedric BAIL c2a1c49ab2 elementary: move all legacy files to their expected new location. 2016-03-23 13:24:41 -07:00
Jean-Philippe Andre 2ba92c07e9 Evas: Add missing cspaces to data_get/put (sw engine)
Also, remove abort() in default case. Leftover abort()
can actually make applications crash.
2016-03-22 14:16:15 +09:00
Chris Michael 6a1a1305b5 evas-wayland-shm: Fix rotation for wayland shm engine
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>
2016-03-21 09:29:32 -04:00
Jihoon Kim ce17d5d987 ecore_imf/wayland: use default preedit style
Change-Id: Iffb2d450923bbde191c4928253f133b13608a8e8
2016-03-21 19:51:31 +09:00
Nicolas Aguirre 290fc88e3f evas: add eglfs evas module.
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>
2016-03-18 10:17:49 -07:00
Chris Michael 6418810307 evas-wayland-shm: Override image_native init and shutdown functions
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>
2016-03-18 08:53:35 -04:00
Chris Michael 67db4d7c1a evas-wayland-egl: Override image_native init and shutdown functions
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>
2016-03-18 08:50:54 -04: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 8367f497b8 Evas.Image: Create Efl.Canvas.Image for file & data images
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...)
2016-03-17 13:10:35 +09:00