Commit Graph

1661 Commits

Author SHA1 Message Date
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
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
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
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 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
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
Minkyoung Kim f10672dd74 evas : remove native.func.data variable and data argument of native calblacks.
Summary:
Evas Image should be independent of render engine.
So remove native.func.data member of RGBA_Image, Evas_GL_Image struct.
And remove data argument,too.

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

Reviewers: jpeg, spacegrapher, wonsik

Subscribers: cedric, dkdk

Differential Revision: https://phab.enlightenment.org/D3850
2016-04-01 12:09:06 +09:00
Minkyoung Kim 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
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
Jean-Philippe Andre cb93c26db7 Evas proxy: Implement buffer map/unmap 2016-03-28 16:40:02 +09:00