Commit Graph

2384 Commits

Author SHA1 Message Date
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