Commit Graph

2658 Commits

Author SHA1 Message Date
Chris Michael 8a24d64030 ecore_evas_wayland: Fix null pointer dereference
Coverity reports a null pointer dereference here because
evas_engine_info_get can return NULL. Check for a valid return before
trying to use it.

Fixes Coverity CID1365655

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-11-08 11:09:00 -05:00
Chris Michael 90dabc831f ecore-evas-wayland: Fix use after free
Coverity reports illegal access here as we are trying to pass a freed
pointer to ecore_evas_free. Rework error handling to avoid this.

Fixes Coverity CID1365657

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-11-08 11:06:36 -05:00
Guilherme Iscaro 8687a23820 Ecore Evas VNC: add client disconnected callback.
Summary:
Ecore Evas VNC: Properly unregister the region push hook callback.

This callback must be unregistered when the VNC server is deleted.

Reviewers: bdilly, barbieri, cedric

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-11-07 14:44:40 -08:00
Carsten Haitzler b1e5539005 swap mode - add evlog logging for querying surface age
more debugging to hunt down possible blocks in getting buffer age if
it happens
2016-11-07 11:47:46 +09:00
Carsten Haitzler ad9cc1676e egl engines (wl, x11, drm) - add buffer age events for debugging
this adds evlog events that give buffer age details for event log
debugging to help hunt down issues.
2016-11-07 11:45:08 +09:00
Carsten Haitzler d762f74962 wl_drm and eayland_egl buffer age fix for gl when age changes
so i was just about to add buffer age debugging evlogs to everywhere
doing buffer age and i found... drm gl and wayland gl engines DONT
HANDLE age change like gl_x11! they dont reset to a "full render" for
that frame. well well. this explains bugs i am seeing for sure. very
very bag! i thought this was handled properly. this does lend some
credence to my thoughts about somehow having a single universal buffer
swapping/update calculating and "applying" api inside efl somewhere...

anyway - this fixes this issue for these 2 engines which is a real
necessary fix to be correct.

@fix
2016-11-07 11:40:02 +09:00
Guilherme Iscaro 70b83ad455 Ecore_Evas VNC: Add frame buffer support. 2016-11-04 18:29:42 -02:00
Guilherme Iscaro 0fa8dc48cd Evas FB: Add support for region push hook.
This will be useful to support the Ecore_Evas VNC server
under FB backend.
2016-11-04 18:29:42 -02:00
Jean-Philippe Andre b8a76e20af evas: Fix masking with window rotation, take 2
The first patch did not work for maps. This explains why the
original code was so weird. But it actually made sense.

After struggling a bit I realized that we really just need
to shuffle around the pixel position on the window to map that
of the position in the canvas (unrotate it).

Note that compatibility with GLSL-ES (for OpenGL ES) implies
we can not use an array initializer like:
  vec2 pos[4] = vec2[4](a,b,c,d);
So the code could probably be optimized. But at least this works.

This patch also avoids calling glGetUniformLocation again and
again.
2016-11-04 15:28:56 +09:00
Jean-Philippe Andre 4071af438a Revert "evas: Simplify GL masking and fix window rotation"
This reverts commit 562528d28c.

This patch did not work with mapped images.
2016-11-04 15:26:41 +09:00
Carsten Haitzler 4ed2e01591 remove xcb support in ecore_x and evas engines as per mailing list
as per mailing list discussion about dropping xcb support now. it
hasn't been complete for a long time, thus not recommented for being
turned on. as we are moving to a wayland world xcbmakes even less
sense. as agreed, time to clean up a bit and remove a distraction as
well as not well tested code. this also updates po's too.

@feature
2016-11-03 22:22:54 +09:00
Jean-Philippe Andre 7f57e23670 ecore_evas/x: Minor code simplification 2016-11-03 17:22:15 +09:00
Jean-Philippe Andre 562528d28c evas: Simplify GL masking and fix window rotation
The original solution was really complex and relied on
transforming the current gl_Position into the screen
coordinate in pixels, and map that to the pixel position
in the mask.

This new solution simply pushes the required vertices for
the mask, based on its geometry. This fixes masks when used
in a rotated window.

Why was it so hard to get right? :(

@fix
2016-11-03 17:22:14 +09:00
Jean-Philippe Andre eb8d9387c1 wayland: Remove support for "draw_frame"
draw_frame is a legacy feature that draws a very ugly window border
with a white rect and a black text as title bar. This could be
used in wayland when using only the ecore_evas APIs, rather than
elm_win.

Note that the API ecore_evas_draw_frame_set() can not possibly work
as the flag is checked when the ecore_evas is created, so changing
the flag has no effect on existing windows.
2016-11-03 17:22:14 +09:00
Amitesh Singh b0d2e987f3 Efl.Ui.Clock: Add elm module & theme
Summary: depends on D3938

Reviewers: yashu21985, bu5hm4n, woohyun, Hermet, raster, jpeg

Subscribers: gohwoon.jeong, cedric, seoz, jpeg

Differential Revision: https://phab.enlightenment.org/D3939
2016-11-03 11:59:32 +05:30
Derek Foreman c425140a67 ecore_evas_wayland: Minimize differences between shm and egl
Finally bring these together as much as possible to avoid future
diversions when bugs are only fixed in one or the other.

There are functional changes - state tracking for client side effects is
now added to the shm engine, some bug fixes for the egl engine have been
brought to the shm engine.
2016-11-02 13:37:02 -05:00
Derek Foreman 4260d5d3a2 ecore_evas_wayland: Make resize code common
Brings resize code into the common implementation - there is a functional
change.  There appears to have been a bug in the egl resize where it
used the same w, h order for portrait evases as for landscape.  This was
fixed in shm.  I've used the shm variant for the common code.
2016-11-02 13:37:02 -05:00
Derek Foreman b23797c55a ecore_evas_wayland: Make rotation_set common
Rotation set can be moved into common now - should be no functional
change.
2016-11-02 13:37:01 -05:00
Derek Foreman 5d2a25a01d ecore_evas_wayland: Make transparent_set common
Moves transparent set into the common implementation - there is a
functional change here - the egl engine now calls transparent_set in
render_updates like the shm engine.

It is probable the this was the intended behaviour all along.
2016-11-02 13:37:01 -05:00
Derek Foreman 9ca6e274a4 ecore_evas_wayland: Make alpha set common
Moves alpha set into the common implementation - there is a functional
change here - the egl engine now calls alpha_do in render_updates like
the shm engine.

It is probable that this was the intended behaviour all along.
2016-11-02 13:37:01 -05:00
Derek Foreman 82277ae6b3 ecore_evas_wayland: Move more functions into the common implementation
Show and hide can be made common with almost no functional changes.
2016-11-02 13:37:01 -05:00
Derek Foreman af4a71bcf0 wayland evas engines: share engine info structure
These engines are incredibly similar - by sharing the same engine info
structure we'll be able to simplify the wayland ecore_evas bits and
make them much more maintainable.
2016-11-02 13:37:01 -05:00
Derek Foreman 55de5c61cd ecore_evas_wayland: Don't include Evas_Engine_Wayland_Egl.h
There doesn't seem to be any need for this.
2016-11-02 13:37:01 -05:00
Derek Foreman 0b9f77ac96 wayland_egl: Remove unused wl_egl_window variables 2016-11-02 13:37:01 -05:00
Derek Foreman 54cf6dac4a wayland evas engines: rename wayland display to wl_display
Continuing to make the shm and egl engines closer to eachother.
2016-11-02 13:37:00 -05:00
Derek Foreman 3f75c45122 wayland_egl: Rename surface to wl_surface
Making this code more closely match the wayland_shm engine
2016-11-02 13:37:00 -05:00
Derek Foreman 9e43a15526 wayland_egl: Remove pre_post_swap_callback_set
This stuff seems copied from gl_x11 which actually has API to use it.

In this engine nothing can actually set it, so it's just all dead code.
2016-11-02 13:37:00 -05:00
Derek Foreman 96aba5021c wayland_egl: Remove Evas_Engine_Info_Wayland_Egl_Swap_Mode enum
Nothing uses this.
2016-11-02 13:37:00 -05:00
Derek Foreman 47718ae3ea wayland_egl: Remove screen from engine info
Doesn't appear to actually be used for anything.
2016-11-02 13:37:00 -05:00
Derek Foreman b898d3f929 wayland ecore evas: move move_resize to common
It's identical in both shm and egl variants, share it.
2016-11-02 13:37:00 -05:00
Derek Foreman d960adee72 wayland_egl: Remove some leftovers from www
The render post callback and "wobbling" variable were only required for
the client side effect.
2016-11-02 13:37:00 -05:00
Bruno Dilly 8bf74da7bc ecore_wl2: associate evas devices to input ecore events
So users would be able to differentiate between source
seats.
2016-11-01 16:06:19 -02:00
Bruno Dilly 7aab35961f ecore_wl2: add ecore event for seat capabilities change
So when mouse / keyboard are present or not it will
generate events.

ecore_evas/wayland will handle that creating or
deleting evas devices for each one (seat device
will be used as parent).
2016-11-01 16:06:19 -02:00
Bruno Dilly d7b1a5dfeb ecore_wl2: add ecore event for seat name change
And handle it on ecore_evas/wayland, properly
setting the evas device names.
2016-11-01 16:06:19 -02:00
Bruno Dilly 44fc1c6ecc ecore_evas/wayland: handle added / removed seats
Create or delete evas_devices with class EVAS_DEVICE_CLASS_SEAT
for seats on each ecore_evas created so far.

Initially it's named considering its Wayland id.
2016-11-01 16:06:19 -02:00
Bruno Dilly 26c1a564d9 ecore_evas/wayland: remove unnecessary NULL attributions
When freeing wdata there is no reason to set each
freed field to NULL.
2016-11-01 16:06:19 -02:00
Carsten Haitzler 163affda37 emotion gst1 module - disable subtitles by default as that should be
there are spu apis to turn subtitles on and off and this should be off
until turned on by api. you really have to be able to choose the
subtitles to display - eg language etc. to use them effectively.

this fixes T4795

@fix
2016-10-31 19:53:34 +09:00
Guilherme Iscaro 4bffa7bfa7 ecore_evas: refactor VNC as an Eina Module.
Summary:
This change removes the necessity to link EFL against the libvncserver

Please ignore the first three commits, they're being reviewed here:

https://phab.enlightenment.org/D4323

Reviewers: bdilly, cedric

Reviewed By: cedric

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2016-10-28 09:56:47 -07:00
Chris Michael 21a8fbde7e evas-wayland-shm: Don't post updates to surface if no surface
In the event that an ecore_evas (using wayland_shm) gets hidden then
the corresponding wl_surface gets destroyed. If evas_norender is
called after that, the outbuf_redraws_clear function follows.
Outbuf_redraw_clear function ends up trying to post updates to the
wl_surface however if that wl_surface is gone, then we end up crashing.

This patch addresses that issue by checking for a valid wl_surface
inside the engine before trying to post updates to that wl_surface.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-28 09:55:27 -04:00
Chris Michael 2c09a35b6c evas-wayland-shm: Fix formatting
NB: No functional changes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-28 09:55:27 -04:00
Chris Michael 001d8255b8 evas-wayland-shm: Remove unused varible
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-26 12:18:30 -04:00
Chris Michael 0fa7abae7b evas-wayland-shm: Get page flips out of the render thread
Now that we have redraws_clear exposed through software generic, we can
use that to do the final buffer swap from the main thread instead of doing
it in outbuf_flush which runs from the render thread.

This becomes more important later when other call sites in the main thread
will perform buffer flips.

Based on 95a00b8e49 by Derek Foreman

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-26 12:00:39 -04:00
Chris Michael f3d1b2d7da evas-wayland-shm: Improve next buffer selection algorithm
When triple buffering it's possible that we'll only need two buffers at
a time for long durations.  When we finally call upon a third buffer it
hasn't been used recently enough to do a partial redraw.
By picking the oldest available buffer when multiple buffers are free we
can increase the likelihood of doing partial redraws.

Based on 79409757c6 by Derek Foreman.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-26 11:53:49 -04:00
Chris Michael bb2a55ead6 evas-wayland-shm: Default to triple buffering
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-26 11:33:07 -04:00
Chris Michael d8600a4f25 evas-wayland-shm: Fix max buffer age
Highest possible buffer age should actually be 4, not the number of
available buffers.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-26 11:19:28 -04:00
Chris Michael 2ceb37e14d evas-wayland-shm: Fix formatting
NB: No functional changes, just formatting

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-26 11:19:06 -04:00
Guilherme Iscaro 8040d20f90 This series fixes two problems in the VNC implementation.
One deadlock and one segfault.

Patch 1:

Software X11 Evas Engine: Fix deadlock

Summary:
The patch bc6e8d2692 introduced a callback responsible to notify the pixels
that were sent to the X server. Since all EFL rendering is done by another
thread, the callback should be called from the main thread context.
To achieve this behaviour evas_software_x11_region_push_hook_call()
was using ecore_thread_main_loop_begin(), which may cause deadlocks, since
evas mainloop waits for the render thread and the render thread waits
the mainloop.

In order to fix this problem, the function
ecore_main_loop_thread_safe_call_async() will be used to
schedule the callback to run in the main loop context.

Since a callback is schedule to run in async manner, the pixels that
were sent to the X server must not be deleted until the user is informed.
In order to avoid more mallocs(), this patch adds the support for refcounts to the
X_Output_Buffer and Xcb_Output_Buffer.

Patch 2:

Ecore_Evas VNC: Use the image size to create the buffer.

In same cases they may differ and may lead to a segfault, since
memcpy() causes a buffer overrun.

Reviewers: bdilly, raster

Reviewed By: raster

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4323
2016-10-21 13:56:00 +09:00
Derek Foreman 1809b3b959 gl_x11: Do KHR Partial Damage properly
KHR partial damage must be set once at the beginning of rendering with
buffer damage for the entire scene to be rendered.  Doing otherwise can
result in graphical anomalies on some GL implementations.
2016-10-20 14:30:00 -05:00
Derek Foreman 6a65253f68 wayland_egl: Remove weirdo buffer age kludge cargo culted from gl_x11
There's no reason why we'd need a full redraw if the buffer age for
this buffer isn't the same as the buffer age for the last buffer, so
let's cut out this thing.
2016-10-19 16:29:05 -05:00
Derek Foreman a44352a10f wayland_egl: Use surface damage instead of buffer damage
We should always pass surface damage to eglSwapBuffersWithDamage.
2016-10-19 16:29:05 -05:00