Commit Graph

2553 Commits

Author SHA1 Message Date
Derek Foreman 26a718b07e wayland_shm: Use surface flush instead of setting dirty
The dirty bit was a dirty hack to let session recovery force reconfigures
on startup.

Now that we have a surface flush we can achieve the same thing by just
discarding all buffers immediately.
2018-01-26 15:53:59 -06:00
Derek Foreman 79f3eaa68b wayland_shm: Clean up duplicate prototypes
These were supposed to be removed when I moved the associated functions
into ecore_wl2.
2018-01-19 12:37:10 -06:00
Vincent Torri f5b01ac5ce all: Simplify definition of EAPI
This will help in the transition from Autotools to Meson. This has been
tested on Windows for which EFL_XXX_BUILD were first introduced.
2018-01-18 18:04:03 +09:00
Jean-Philippe Andre 24447641d3 evas gl: Properly verify that Evas GL works
For SW engine we need to verify that OSMesa is present. The patch
fb048e7312 broke the logic.

Tested by temporarily removing OSMesa from my system.

Fixes T6617 (again)
2018-01-17 15:22:46 +09:00
Carsten Haitzler fb048e7312 evas sw generic - don't dlopen osmesa until first needed.
osmesa needs llvm. llvm apparently just by dlopening or linking to the
lib (libLLVM...) gets you 3.5mb of dirty pages just in this lib. that's
a whole lib entirely dirty pages. odd and horrible. in fact once i
stoppd dlopening OSMesa all the time on engine init (and only when gl
is needed)... the amount of dirty pages went from 17208 to 8860.
that's a whopping drop of 8mb! 8mb saved! in fact just dlopening
osmesa and doing the other gl init stuff led to more anonymuse
mappings with dirty pages. 2 of them (2072k and 2076k) which baffled
me as that didn't seem like heap or efl's own data. these disappeared
along with libLLVM-5.0.so (3520k + 60k dirty pages). we stopped
linking/loading libedit (12k dirty), libglapi (20k dirty),
libLLVM-5.0 (3580k dirty), libncursesw (72k dirty),
libOSMesa.so (260k dirty), libtinfo (20k dirty). ... or at least
stopped until absolutely needed. total 17208k of dirty pages went down
to 8860.

my test case was just launching terminology (and doing nothing with it).

@fix memory bloating
2018-01-12 03:02:43 +09:00
subhransu mohanty d838220d56 evas/vg: Use always blending op while drawing the vector.
Summary:
The default backend overrides this operation depending on the fill color
but the cairo backend dosen't hence cairo will always use bled mode while drwaing the vector.

Reviewers: jpeg

Subscribers: vtorri, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5724
2018-01-08 19:16:59 +09:00
Marcel Hollerbach 01df8b7f78 evas: make tbm_surface api fields static
When building statically this breaks build, since both symbols would be
defined globally.
2018-01-04 14:31:22 +01:00
Jean-Philippe Andre 88bfba1fdd evas filters: Add "alphaonly" flag for blend and blur
This is very useful to specify precisely which kind of RGBA -> Alpha
conversion you want. If all you wanted was the alpha layer to use as a
mask, set this flag to true.

@feature
2017-12-14 18:03:49 +09:00
Ross Vandegrift 71e5c74eb6 efl: drop deprecated Encoding key from desktop files
Summary:
The Encoding key is no longer required, all desktop files are assumed to
be UTF-8 encoded.  See details at:
https://standards.freedesktop.org/desktop-entry-spec/1.1/apc.html

Fix various typos and misspellings

lintian, Debian's package checker, uses strings to check for common typos
in compiled binaries.  This change fixes the ones it identified in 1.20.6.

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-12-13 10:27:48 -08:00
Chris Michael e4d5528e34 evas-gl-drm: Don't pass invalid surface or bo to gbm function
This small patch just checks that we have a valid surface and bo that
we can pass to gbm_surface_release_buffer. If they are not valid, this
causes a hard crash.

NB: This does not actually Fix the ticket issue....

ref T6483

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-12-12 11:28:36 -05:00
Pawel Aksiutowicz 5e3c641438 evas: removed "clobbered" warnings from image_savers/png/evas_image_save_png
Reviewers: stanluk, lukasz.stanislawski, cedric, jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5536
2017-12-11 17:18:55 +09:00
Derek Foreman 8a3b983c53 ecore_wl2 wayland_shm: Move surface functions into ecore_wl2
Finish pushing these all into ecore_wl2
2017-12-01 10:58:44 -06:00
Derek Foreman dd5edfae03 wayland_shm: Rename all the evas_dmabuf functions
These are going to find a home in ecore_wl2, and this is the last
step before moving them all over there.
2017-12-01 10:58:44 -06:00
Derek Foreman 4e3016070a wayland_shm: No longer include dmabuf header in engine.h
There's no longer any need for code outside of evas_dmabuf.c to
know anything about dmabuf.
2017-12-01 10:58:44 -06:00
Derek Foreman e1031f5249 wayland_shm: move surface structure to evas_dmabuf.c
This is no longer needed by the outbuf code.
2017-12-01 10:58:44 -06:00
Derek Foreman 57622713de wayland_shm: Use wrapper functions instead of function pointers
switch to the new "API"
2017-12-01 10:58:44 -06:00
Derek Foreman 594fef7dd3 wayland_shm: Wrap function pointers for surface
This is going to be an API soon.
2017-12-01 10:58:44 -06:00
Derek Foreman dd8d60ad28 wayland_shm: Move surface free into surface_destroy
The caller shouldn't have to free this.
2017-12-01 10:58:44 -06:00
Derek Foreman 5b4b18836a wayland_shm: Remove struct _Dmabuf_Surface
It's all piled into Surface now.
2017-12-01 10:58:44 -06:00
Derek Foreman 8a6c4fe5ff wayland_shm: Stop using outbuf and engine info in surface code
The surface stuff now no longer needs knowledge of those structures.
2017-12-01 10:58:44 -06:00
Derek Foreman 7eb0af45d6 wayland_shm: Pass alpha to surface_create
Stop extracting it from other structures, pass it directly.
2017-12-01 10:58:44 -06:00
Derek Foreman 2b3654c1fd wayland_shm: pass the ecore_wl2_window to surface create
No longer extract this from the engine info.
2017-12-01 10:58:44 -06:00
Derek Foreman d1a4f38a96 wayland_shm: Store width and height in surface struct
No longer query these from the outbuf.
2017-12-01 10:58:44 -06:00
Derek Foreman 15fdbca653 wayland evas: Remove Ecore_Wl2_Display from engine info
We've got the Ecore_Wl2_Window so we can always get the display from
that.
2017-12-01 10:58:44 -06:00
Derek Foreman 73d1ab0cd5 wayland_shm: Remove Shm_Surface
only Dmabuf_Surface is used, so let's remove this and lose the union.
2017-12-01 10:58:44 -06:00
Derek Foreman e3d6626c0d wayland_shm: Move surface create into dmabuf code
These functions can be combined since there's now only the dmabuf
path.
2017-12-01 10:58:44 -06:00
Derek Foreman d1bb026195 wayland_shm: remove useless wrapper function
This no longer has multiple call sites.  Goodbye.
2017-12-01 10:58:44 -06:00
Pawel Aksiutowicz 56abebf236 evas: remove warning from image_loaders/png/evas_image_load_png
Reviewers: stanluk, lukasz.stanislawski, cedric

Reviewed By: cedric

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-11-23 15:43:38 -08:00
Derek Foreman 2c559a1ee9 wayland_shm: Fix partial redraws
I accidentally the age tracking.
2017-11-21 16:48:30 -06:00
Derek Foreman cbbac076f4 gl_drm: Use the same gbm_device for multiple instances
If we want to share a gl context (we do) between multiple instances of
gl_drm, we need to make sure they all use the same gbm_device.

This resolves a blocker for multi-output on the gl_drm backend.
2017-11-21 12:28:52 -06:00
Derek Foreman ea1f76f980 drm ee: Allow more than 4 buffers
Multi-head is hitting corner cases where there are lots of locked buffers
and it looks like right now 5 is the magic number that makes the problem
go away.

Make it possible to set 5 or more (via env var) for testing, make a macro
for MAX_BUFFERS instead of just a number.
2017-11-20 16:54:00 -06:00
Derek Foreman 796de8cb86 wayland_shm: Don't use a fixed number of buffers
We no longer allocate 3 buffers at startup, we now allocate only as needed.

Trimming the queue will come later, as there are some situations where we
might need 3 buffers and later drop down to 2 (when on a hardware plane)

Most clients will only ever need 2 buffers, so this is a reasonable RAM
savings.
2017-11-17 14:33:36 -06:00
Derek Foreman 04cebba623 ecore_wl2: Filter buffer types by compositor capabilities
It does us no good to be able to allocate dmabuf capable memory if the
compositor can't handle it.  This should fix failures on systems where
allocation is possible but the compositor doesn't advertise dmabuf.
2017-11-15 11:54:37 -06:00
Derek Foreman 9fdcf7d0eb wayland_shm/ecore_wl2: Move buffer allocation into ecore_wl2
This moves all the platform specific buffer allocation into ecore_wl2
instead of the engine.

Note that this makes an internal struct available in the header.  This
will be removed shortly.
2017-11-15 11:54:37 -06:00
Derek Foreman f6ec5b961b wayland_shm: Move wl_buffer creation function further up file
It just looks nicer when it's here and doesn't require a prototype.
2017-11-15 11:54:37 -06:00
Derek Foreman 46539ce26d wayland_shm: Make the buffer_manager static
Should always have been, oops.
2017-11-15 11:54:37 -06:00
Derek Foreman 66f85dd06c wayland_shm: Become unhoseable
Now that shm is handled through these paths the dmabuf_totally_hosed state
is nonsense.
2017-11-15 11:54:37 -06:00
Derek Foreman 2071122f01 wayland_shm: rename Surface_Type to Ecore_Wl2_Buffer_Type 2017-11-15 11:54:37 -06:00
Derek Foreman f9ff2e4fa5 wayland_shm: Remove surface_type from surface
This has become not only a write-only variable, but also incorrectly set.

Just remove it.
2017-11-15 11:54:37 -06:00
Derek Foreman c6b0328150 wayland_shm: Pass ecore_wl2_display instead of surface to buffer_create
The display was the only thing we used through the surface.  Pass just
the display to break the dependency between surface and buffer.
2017-11-15 11:54:37 -06:00
Derek Foreman 2042e4bc21 wayland_shm: Remove surface from buffer struct
All users are now removed so we no longer need this.
2017-11-15 11:54:36 -06:00
Derek Foreman 36f0a9a814 wayland_shm: Stop looking up alpha on surface
We've got it in the buffer now.
2017-11-15 11:54:36 -06:00
Derek Foreman 15173c3436 wayland_shm: Store alpha in buffer
Currently the buffer code looks up the alpha stats from the surface code.
This won't be possible when we move the buffer code into a library, so
prepare for it now.
2017-11-15 11:54:36 -06:00
Derek Foreman 8c7086dc31 wayland_shm: Make ecore_wl2_buffer_init return bool
Nothing uses the returned pointer, and nothing will.
2017-11-15 11:54:36 -06:00
Derek Foreman 7c3fb6ae74 wayland_shm: Rename types and functions
We're going to move this into ecore_wl2, so I'll start by renaming it all
here before moving large chunks with minimal change.

No functional changes.
2017-11-15 11:54:36 -06:00
Derek Foreman c1a9dacbad wayland_shm: Remove extra display flush
Since we're using create_immed now we shouldn't need to force a flush here
anymore.
2017-11-15 11:54:36 -06:00
Derek Foreman 8cf0bfc9ef wayland: stop tracking compositor_version in engine
We don't need it anymore now that damage is posted from inside ecore_wl2.
2017-11-10 13:43:45 -06:00
Derek Foreman 6ea82f9f7e wayland_shm: Remove surface damage function
This is now in ecore_wl2
2017-11-10 13:43:45 -06:00
Derek Foreman fe41727bc3 wayland_shm: cosmetic code simplification
We already have this value in a temp, so use it.
2017-11-10 13:43:45 -06:00
Derek Foreman 77212021f3 waylamd_shm: Use ecore_wl2_window_damage
The new library function provides the same functionality and will allow
us to stop tracking things in the engine that the library already knows
about windows (compositor_version)
2017-11-10 13:43:45 -06:00
Derek Foreman cf345cff74 wayland_shm: Respect the alpha
The dmabuf code has been creating ARGB buffers all the time.  The old
wl_shm code correctly respected the alpha field, but that was lost in
the new version.

I'm not sure we ever create non-alpha wayland buffers, since CSD has
to have alpha to do shadows, but if there's any way to do it it'll
work now.
2017-11-10 09:55:58 -06:00
subhransu mohanty 41062cb15d evas/vg: use surface cache for efl vg canvas 2017-11-10 11:20:38 +09:00
subhransu mohanty f0b8c37d80 evas/vg: refactor ector engine api and backend . 2017-11-10 11:20:38 +09:00
subhransu mohanty befb7701a7 evas/engine: added new engine api for ector 2017-11-10 11:20:38 +09:00
subhransu mohanty aacf277c3a evas/vg: added support for engine surface cache. 2017-11-10 11:20:38 +09:00
Derek Foreman ba2abb2eb9 wayland_shm: Don't require dmabuf support to use wl_shm
Unintended side effect of my merging of the two code paths.  We should
still try to use wl_shm if we can't use dmabuf here.
2017-11-09 16:08:30 -06:00
Derek Foreman c2fe37a46d wayland_shm: Remove old shm code
The new shm code should be equally capable - minus one surface resize
optimization that probably didn't buy us much performance at the cost
of memory.
2017-11-08 15:12:51 -06:00
Derek Foreman a5c7fbd006 wayland_shm: Return oldest buffer for new renders
This is what the old shm code has been doing, and it's probably better
than what the dmabuf code was doing.

We currently allocate 3 buffers.  The usual case has us swapping between
two of those buffers and saving that third buffer for emergencies - if
we ever need that third buffer it'll require a full redraw.

If we return the oldest available buffer the usual case requires a little
more damage but we should never hit the full redraw case, which can cause
a frame drop on slow hardware.
2017-11-08 15:12:51 -06:00
Derek Foreman 4adf87ae91 wayland_shm: Simplify surface commits
We no longer have the concept of a "pre" buffer (allocated but not yet
registered as a wayland buffer)
2017-11-08 15:12:51 -06:00
Derek Foreman b5674b7885 wayland_shm: Remove useless function
This serves no purpose anymore.
2017-11-08 15:12:51 -06:00
Derek Foreman 566c3f328a wayland_shm: Remove dmabuf fallback
Now that we're dependent on create_immed there's no possibility of falling
back to non dmabuf allocation.

The only failing case we really need to handle is failing the first
allocation, which is currently broken and I'll be adding an advance test
for it shortly.
2017-11-08 15:12:51 -06:00
Derek Foreman 73bddb4471 wayland_shm: Make EVAS_WAYLAND_SHM_DISABLE_DMABUF use new code
Use the new wl_shm allocation functions making the old wl_shm code
unreachable even with the use of the disable env var.
2017-11-08 15:12:51 -06:00
Derek Foreman c54a12aca6 wayland_shm: Add wl_shm to dmabuf
wl_shm and dmabuf only really need to differ in how they allocate a buffer,
but right now we've got them in separate files.  This dramatically
reduces the complexity of the wl_shm code and shares much more
implementation with the dmabuf code.

This throws away at least one "optimization" wl_shm used - over-allocating
buffers so that window resizing doesn't always require a new buffer
allocation.  If people feel that window resizing has become too slow now
this can be added to the dmabuf code to the benefit of both allocators.

Disabling dmabuf by env var still uses the old wl_shm implementation for
now, but soon that code will be removed entirely and the env var disable
will use this path.
2017-11-08 15:12:47 -06:00
Derek Foreman d346ac7b2e wayland_shm: Track size of buffer 2017-11-08 15:12:44 -06:00
Derek Foreman 381bb0e798 wayland_shm: move buffer release callback to top of file
Code motion with no functional changes.
2017-11-08 15:12:42 -06:00
Derek Foreman ef1279465f wayland_shm: make creating a wayland buffer back end specific
This way we can have shm and dmabuf share the same framework.
2017-11-08 15:12:37 -06:00
Derek Foreman 7e1805ada1 wayland_shm: Factor out wl_buffer creation code 2017-11-08 15:12:34 -06:00
Vitalii Vorobiov ee93543799 evas_vg_load_svg: get rid of static Evas_SVG_Parsing
Summary:
Refactoring.
It is good to store values from that struct in a parsing/loading context

static variable is a big NO NO:
1. Ugly code design,
2. Might not work when trying to load more than one SVG file.

@fix

Reviewers: jpeg, smohanty

Subscribers: jenkins, cedric

Differential Revision: https://phab.enlightenment.org/D5399
2017-11-07 11:54:09 +09:00
Vitalii Vorobiov 66e0caccb7 evas_vg_load_svg: default stop opacity color should be 255, not 0
@fix
2017-11-07 11:54:09 +09:00
Vitalii Vorobiov d98e2323ad vg_common: property apply "objectBoundingBox" morphings to radial gradient
When objectBoundingBox flag is set up, all gradients should morphed into
multiple gradients for every entity that has gradient to be applied on
2017-11-07 11:54:09 +09:00
Vitalii Vorobiov 6bf5d9d96e svg_parse: parse correct values for radialGradient
Especially Radius calculation which was a huge pain to find formula
within SVG documentations!
2017-11-07 11:54:09 +09:00
Vitalii Vorobiov 405e56ac55 svg_parse: parse linear gradient variables accroding to gradientUnits
There are difficult cases according to
https://www.w3.org/TR/2000/CR-SVG-20000802/pservers.html
2017-11-07 11:54:09 +09:00
Vitalii Vorobiov 6139aa78d5 svg_parse: implement <length> parse
Accodring to https://www.w3.org/TR/SVG/types.html#Length
length ::= number ("em" | "ex" | "px" | "in" | "cm" | "mm" | "pt" | "pc" | "%")
This is still work in progress since some of lengths should be treated
differently, for example gradient lengths
2017-11-07 11:54:09 +09:00
Vitalii Vorobiov 1354c1c8ab svg_parse: save global size variable to use when gradient size recalc
For example while userSpaceOnUse it uses not figure's x,y,w,h
but entire canvas, so we need to save it publically and recalc while
parsing (or after)
2017-11-07 11:54:09 +09:00
Vitalii Vorobiov fac649c7f4 vg_common: parse and store userSpaceOnUse (for gradient) when it is set
So it can be calculated during the draw later on
2017-11-07 11:54:09 +09:00
Vitalii Vorobiov 532557cabd vg_loaders/svg: set up default focal values for radialGradient
Since when not specified, focal values same as center points
fx = cx, fy = cy by default

@fix
2017-11-07 11:54:09 +09:00
Vitalii Vorobiov 78bc406640 saver/svg: parse loaded tree data into svg XML file and save it
Just base source code which will parse all structures of svg tree into
xml text to save current vector image into file

@feature
2017-11-07 11:54:09 +09:00
Vitalii Vorobiov 7d9c1256a3 vg_savers/svg: empty (for now) module that will save svg in original file
Just as a starter to make a working background that, later on, will go
through Svg_Node's and build a certain source code to be saved in SVG
picture as a file
2017-11-07 11:54:09 +09:00
Chris Michael fd79e32dbd evas-wayland-shm: Do not dereference a potentially freed pointer
Coverity reports that _evas_dmabuf_buffer_init function here can
potentially free the surface that was passed into it. If that happens,
we should not be calling the _fallback function with surface as the
parameter as that will directly dereference the freed pointer.

Fixes Coverity CID1381707

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-06 10:02:35 -05:00
Chris Michael de1e18ef7d evas-gl-cocoa: Remove need for useless region_free function
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-06 09:28:53 -05:00
Chris Michael 3ae469e648 evas-gl-drm: Remove need for useless region_free function
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-06 09:27:39 -05:00
Chris Michael 85a9716c8f evas-gl-sdl: Remove need for useless free_region function
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-06 09:26:13 -05:00
Chris Michael c8e5614830 evas-gl-x11: Remove need for useless free_region function
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-06 09:25:19 -05:00
Chris Michael e04ad61ab4 evas-wayland-egl: Remove need for useless free_region function
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-06 09:23:13 -05:00
Chris Michael 39184e78af evas-wayland-shm: Remove need for useless free_region function
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-06 09:21:59 -05:00
Chris Michael 31a7963196 evas-software-x11: Remove need for useless free_region function
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-06 09:19:20 -05:00
Chris Michael 5edae8b9c1 evas-software-gdi: Remove need for useless free_region function
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-06 09:17:02 -05:00
Chris Michael f32c1ece7e evas-software-ddraw: Remove need for useless free_region function
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-06 09:15:54 -05:00
Chris Michael 9f5555a887 evas-eglfs: Remove need for useless free_region function
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-06 09:14:14 -05:00
Chris Michael 5f897542aa evas-drm: Remove need for useless free_region function
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-06 09:13:12 -05:00
Chris Michael 6016ce8133 evas-software-generic: Check for render engine function before calling
In most engines which inherit from software_generic, they do not
implement the outbuf_free_region_for_update function. Most engines
have it as an unused function. If we simply add a check here, then we
can reduce the need for having useless function in multiple engines.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-06 09:10:28 -05:00
Chris Michael 0a25543ed5 evas-wayland-shm: Fix formatting
Make this line readable in 80 columns

NB: No functional changes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-01 12:39:09 -04:00
Chris Michael 945764eb7c evas-drm: Fix formatting
NB: No functional changes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-01 12:38:44 -04:00
Subhransu Mohanty bf79ec359d vg_savers/eet: Added implementaion of vg saver to eet file 2017-10-27 14:58:38 +09:00
Subhransu Mohanty 24ac2d6516 vg_loaders/svg: Copied svg loading implementation from edje_cc 2017-10-27 14:58:38 +09:00
Subhransu Mohanty 079838e926 vg_loaders/eet: Added implementaion for loading from eet file 2017-10-27 14:58:38 +09:00
Cedric BAIL abd41c93ea evas: image_native_set actually receive a context, not an output. 2017-10-26 13:01:56 -07:00
Jean-Philippe Andre 98622623a0 evas: Prevent crash with image_data_get
If the image has no data, it may get an allocated surface of 1x1 but it
is not sane to return the pointer to that data, as the user would expect
a normally sized image (in my case, 1920x1080).

I do not fully understand what is going on with this image. But at least
this transforms a crash into a simple ERR in ~/.xessions-errors

Two similar crashes happened:
 - SIGSEGV by writing data outside of the image data
 - abort() in free() because the malloc metadata has been overridden
   when writing outside of the image data (newly allocated 1x1).

Fixes T5957

@fix
2017-10-18 22:12:57 +09:00
Carsten Haitzler 6cd3d4026c jp2k module - dont print ERR on llading if format wrong
this is normal - brute force trying loaders until one succeeds is
normal is etn doesnt help identify it or it fails the first
guess-by-extension. printing errors is not good as this is an ok and
EXPECTED error. slience!

@fix
2017-10-16 08:42:13 +09:00
Cedric Bail 7e00ab4222 evas: mark parameter unused now that it is not necessary anymore. 2017-10-13 12:58:01 -07:00
Prince Kumar Dubey df5f404f09 evas: to avoid warning unused variable and unnecessary assignment is removed.
Reviewers: raster, cedric

Subscribers: rajeshps, jpeg

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-13 12:14:26 -07:00
Prince Kumar Dubey 41197981ab efl: unsigned int/long never be less than zero. Fixed.
Reviewers: raster, cedric

Subscribers: rajeshps, jpeg

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-13 12:07:28 -07:00
Derek Foreman 159a5beb27 wayland_dmabuf: Clean up unused variable
Pending is useless now that we use immediate buffer creation.
2017-10-12 12:24:03 -05:00
Derek Foreman b93319b10e wayland_dmabuf: Use create_immed
We've really always needed to do immediate creates.  On a surface resize
there's no place to wait for the round trip for the new buffers to exist.

We've gotten away with this until now by good luck because we dispatch
wayland events during asynchronous render.  However, with async render off
or if schedule happens in an unfortunate order, we can end up with
tearing.
2017-10-12 12:24:03 -05:00
Derek Foreman 7f27237171 wayland_shm: Make some function static
Only used in this file.
2017-10-12 12:24:03 -05:00
Derek Foreman 46146caa43 wayland_shm: Kill stale comment
This comment doesn't make sense now, as all the frame callback stuff
is in ecore_wl2.
2017-10-12 12:24:03 -05:00
Derek Foreman 9bcc24dbb8 wayland_dmabuf: make dlsym queried symbols static
We only need these in this file.
2017-10-12 12:24:03 -05:00
Derek Foreman e207e05067 wayland_shm: Remove hidden from the outbuf
Outbuf shouldn't have to track its hidden status, that should be ecore_evas
problem.  Until now we were doing this because our kludgey wayland
ticking made things difficult, but I think it's safe to remove now.
2017-10-12 12:24:03 -05:00
Derek Foreman 656d892581 wayland_shm: Remove hidden from surface posting calls
Now that we tick based on frame callbacks it should be impossible to post
an update while hidden.
2017-10-12 12:24:03 -05:00
Derek Foreman c72b0b44ad wayland_shm: stop storing wl_display in dmabuf_surface
Query it through the engine info's ecore_wl2_display instead.
2017-10-12 12:24:03 -05:00
Derek Foreman ceb90779ff evas_shm: Remove wl_dmabuf and wl_shm from engine info
All queries for these are now on the ecore_wl2_display
2017-10-12 12:24:03 -05:00
Derek Foreman 4a23e69bcc wayland_shm: Remove surface_set function
Now that we use the display's shm and dmabuf pointers we don't need to
update them.
2017-10-12 12:24:03 -05:00
Derek Foreman 2b9a22e3a9 wayland_dmabuf: Query zwp_linux_dmabuf_v1 from display
Get it from the display instead of using our stored copy.
2017-10-12 12:24:03 -05:00
Derek Foreman f421521bed evas_shm: query wl_shm from ecore_wl2_display
Stop using the internally stored copy, always query from active display.

This fixes session recovery.
2017-10-12 12:24:03 -05:00
Derek Foreman 3f576e8436 wayland_shm: Add Outbuf to Surface struct
We're going to need that soon.
2017-10-12 12:24:03 -05:00
Derek Foreman 5fa7263440 wayland_shm: Pass Surface instead of Shm_Surface
Surface has some variables we'll need later.
2017-10-12 12:24:03 -05:00
Derek Foreman 7faa20f3c8 wayland_shm: Handle dirty bit outside of the backends
We don't have to query that deeply to know whether we need to redraw the
buffer or not, we can make that decision in more generic code.
2017-10-12 12:24:03 -05:00
Derek Foreman 2a15d7b730 wayland_shm: Store the ecore_wl2_display in the Outbuf
We'll need it soon.
2017-10-12 12:24:03 -05:00
Cedric BAIL fc7e244e99 evas: remove unused fonction evas_gl_common_image_load. 2017-10-05 09:36:45 -07:00
Chris Michael 7b7161ea13 evas-gl-image: Fix dereference after null check
Coverity reports passing a null pointer 'im->gc' to
evas_gl_common_context_flush which directly dereferences it, so lets
be sure that 'im->gc' is valid before passing it to context_flush

Fixes CID1374273

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-10-05 09:54:03 -04:00
Chris Michael cec6793db4 evas-gl-common: Fix dereference after null check
Coverity reports that there may be a null pointer dereference here so
check that 'error' exists before trying to set it.

Fixes CID1374272

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-10-05 09:51:00 -04:00
Cedric Bail 867d826395 evas: remove image_load from the engine. 2017-10-04 21:48:26 -07:00
Carsten Haitzler 246d8dbda5 evas ector gl - fix leak of image data on data put
@fix

fix coverity found leak CID 1374645
2017-09-29 12:26:57 +09:00
Carsten Haitzler 9f91d0d284 evas ector gl - make coverity happy about leaks on data put
fix CID 1374646
2017-09-29 12:26:57 +09:00
Youngbok Shin 1750410650 evas: Add scale feature for embedded bitmap fonts.
Summary:
When evas selects a strike of embedded bitmap font,
calculate ratio and use it for scaling embedded bitmap.
@feature

Reviewers: jpeg, tasn, woohyun, raster, herdsman

Reviewed By: raster

Subscribers: charlesmilette, Francesco149, cedric

Differential Revision: https://phab.enlightenment.org/D2713
2017-09-26 11:31:31 +09:00
Vincent Torri 0cdd501246 EFL For WIN32: Replace HAVE_EVIL define with _WIN32 2017-09-22 05:06:10 -05:00
Chris Michael b1d831c552 evas-drm: Fix uninitialized variables
Small patch to fix Coverity reported issues of uninitialized variables

Fixes CID1381306, CID1381305, CID1381304, CID1381303

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-09-20 06:26:05 -04:00
Chris Michael 7198fe568b evas-drm: Support rotations other than 0
This patch adds support for software rotation in the evas drm engine.
This is a fallback codepath in case hardware rotation is not supported
for a given rotation amount. This patch also fixes a leak of and
pending updates during output buffer free.

ref T5999

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-09-19 13:10:33 -04:00
Chris Michael 8a516c4d4f evas-drm: Override eng_output_resize function
This patch provides an override in the evas drm engine for the output
resize function. We override this function so that we can reconfigure
the output buffer.

ref T5999

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-09-19 13:10:27 -04:00
Jean-Philippe Andre 4b10cf2e40 filters: Fix GL support aka. cedric's bork 2017-09-06 09:12:28 +09:00
Carsten Haitzler d42ec53154 wayland_shm - clean out ptrs after free - seeing invalid mem/ptr access
enlightenment internal windows insta segv e on rpi. after much hunting
it seems a fallback is happening and bunk ptrs are being used. this at
least will make the problems more reliable with null ptrs.
2017-09-02 21:53:23 +09:00
Derek Foreman 6e30535a3c wayland_shm: Try a little harder to verify exynos dmabuf capabilities
Turns out the "device_open" function pretty much just tests calloc
functionality, and doesn't open any device.  So let's allocate a
tiny bo and discard it to make sure we're actually on exynos.
2017-09-01 14:50:40 -05:00
Mykyta Biliavskyi 8c4e4811fd Software gdi: fix build on Windows.
Summary:
Function argument was renamed, but in function body still uses old
variable name.

Test Plan: Build on Windows host

Reviewers: cedric, vtorri

Reviewed By: vtorri

Subscribers: jpeg

Tags: #windows, #efl

Differential Revision: https://phab.enlightenment.org/D5152
2017-09-01 13:50:34 +03:00
Derek Foreman f886a76dae wayland: Force a display flush when committing surfaces
We had a hack in place to flush the display from an idle enterer instead
of after a surface commit.  This led to a problem where the idle
enterer dispatch order was:

renderer for main canvas
wayland dispatch idle enterer
renderer for mouse cursor canvas

The surface commit for the mouse cursor was never dispatched, so the mouse
cursor animation would only update at the rate other events occurred.

By flushing at the appropriate times instead we ensure a proper update.

ref T5850
2017-08-30 14:11:47 -05:00
Derek Foreman 388f8c41c8 wayland: Store Ecore_Wl2_Display instead of wl_display in engines
We'll need to call ecore_wl2 functions on it soon, and anything that
really needs the wl_display can query it.
2017-08-30 14:11:47 -05:00
Derek Foreman f2756f92e8 walyand_shm: Remove unused variable
Nothing in here actually cares about the wl_display anymore.
2017-08-30 14:11:47 -05:00
Cedric Bail 5e935a8ca9 evas: handle new API use correctly for gl_drm backend. 2017-08-28 11:32:13 -07:00
Cedric Bail 2ac0a755e1 evas: fixup warning. 2017-08-28 11:13:40 -07:00
Cedric BAIL 6d1d47d50d evas: fix build with egl. 2017-08-25 15:55:26 -07:00
Cedric BAIL 7453980ccf evas gl: fix glview by avoiding make current
gl_generic_context_find() returns the gl shared context struct but
this is not just a read-only operation. It in turn calls window_use
which may call make_current. This can invalidate the work of evas gl
when the API tried to switch to a specific context.

This fixes evas gl with multiple outputs.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-08-25 10:54:55 -07:00
Cedric BAIL 545c1a70f4 evas: make Evas_GL work with multi output. 2017-08-25 10:54:19 -07:00
Cedric BAIL 84c6d3332e evas: remove unused engine data from error set/get code. 2017-08-25 10:52:26 -07:00
Cedric BAIL e682f64193 evas: make vector graphic support multi output. 2017-08-25 10:52:14 -07:00
Cedric BAIL a0c58276c3 evas: do not use default output or any other during render pre. 2017-08-25 10:52:10 -07:00
Cedric BAIL 68b846c1f4 evas: remove unecessary use of output in filter code. 2017-08-25 10:52:07 -07:00
Cedric BAIL cc4d41c890 evas: make image_native_set use engine context not output. 2017-08-25 10:52:03 -07:00
Cedric BAIL 39d4e343b0 evas: make all window GLES3 or none. 2017-08-25 10:51:59 -07:00
Cedric BAIL 89c34cda21 evas: make function to find evas gl context from engine shared across backend. 2017-08-25 10:51:56 -07:00
Cedric BAIL f3f6a7e535 evas: make Evas_GL start to use engine and output separately. 2017-08-25 10:51:47 -07:00
Cedric BAIL bf0ad88144 evas: convert Evas3D use of output to engine when meaningful. 2017-08-25 10:51:44 -07:00
Cedric BAIL e9cd3e4c7c evas: remove image_content_hint_get from backend as it is unused. 2017-08-25 10:51:27 -07:00
Cedric BAIL ef55155e0e evas: switch font backend function to rely on engine instead of output. 2017-08-25 10:51:24 -07:00
Cedric BAIL d8871109d3 evas: convert evas backend cache function call to use Engine context. 2017-08-25 10:51:17 -07:00
Cedric BAIL fc603df8d1 evas: remove image_surface_noscale_region_get from engine backend as it is unused. 2017-08-25 10:51:13 -07:00
Cedric BAIL 1d57cb2627 evas: move all image object related function to use the engine instead of the output. 2017-08-25 10:51:10 -07:00
Cedric BAIL c436cf6931 evas: gl_common should not segv on freeing a NULL gl_image. 2017-08-25 10:50:59 -07:00
Cedric BAIL b6296c6fb4 evas: add infrastructure to find a gl_context from a GL_Engine. 2017-08-25 10:50:45 -07:00
Cedric BAIL 3a8d98a54f evas: introduce a engine_new/free in gl_generic backend. 2017-08-25 10:50:35 -07:00
Cedric BAIL 46e2e103d7 evas: refactor the call to window_use. 2017-08-25 10:50:31 -07:00
Cedric BAIL 326ff87216 evas: refactor gl_generic use of window_use with context_get. 2017-08-25 10:49:59 -07:00
Cedric BAIL 28397e7206 evas: differentiate engine from output. 2017-08-25 10:49:53 -07:00
Cedric BAIL 94dbcf3e0d evas: simplify drm output cleanup code. 2017-08-25 10:49:46 -07:00
Cedric BAIL 1626b5b8cd evas: refactor ddraw engine to have less useless indirection function call. 2017-08-25 10:49:42 -07:00
Cedric BAIL aa88a4f6ab evas: refactor gdi to have less useless function redirection. 2017-08-25 10:49:37 -07:00
Cedric BAIL 8b95fdbfd3 evas: refactor drm engine to have useless function redirection. 2017-08-25 10:49:32 -07:00
Cedric BAIL 262ab2bd54 evas: refactor wayland_shm backend to have less useless function redirection. 2017-08-25 10:49:28 -07:00
Cedric BAIL 8c16402a2c evas: refactor fb engine to have less useless function redirection. 2017-08-25 10:49:23 -07:00
Cedric BAIL 93531868c7 evas: refactor buffer engine to have less indirect useless call. 2017-08-25 10:49:19 -07:00
Cedric BAIL 3e88aa37bc evas: Render_Engine_Swap_Mode is actually about output swap. 2017-08-25 10:49:15 -07:00
Cedric BAIL e31707743a evas: Render_Engine_Merge_Mode is actually about output. 2017-08-25 10:49:11 -07:00
Cedric BAIL f4afd5f1bd evas: reduce duplication of merge_mode getenv logic. 2017-08-25 10:49:06 -07:00
Cedric BAIL d179a5c2a9 efl: remove PS3 backend.
This backend has received no patch and maintenance from anyone who could
actually test it over the last few years. After talking with KaKaRoTo it
is best to remove it. If anyone want to take over its maintenance, you
are welcome to revert this patch.
2017-08-25 10:48:42 -07:00
Cedric BAIL e6b4878a9e evas: follow all other engines convention and use ORD macro. 2017-08-25 10:48:37 -07:00
Cedric BAIL 29cde0ee81 evas: make the info size a parameter of the function to make it safer to roll in. 2017-08-25 10:48:20 -07:00
Cedric BAIL 46e1df839b evas: factorize call to info and info_free. 2017-08-25 10:48:13 -07:00
Cedric BAIL 1e2bbf8fea evas: all this function (info, setup and update) are really output related. 2017-08-25 10:48:09 -07:00
Cedric BAIL 8017fab100 evas: nobody actually call the tile size set API. 2017-08-25 10:48:05 -07:00
Cedric BAIL 6f3980f55e evas: Render_Engine_GL_Generic is actually an output. 2017-08-25 10:48:00 -07:00
Cedric BAIL cac667e402 evas: do not loose tile size when resizing output. 2017-08-25 10:47:56 -07:00
Cedric BAIL 8ffc0f2b9e evas: prevent double tilebuf creation/destruction during window resize. 2017-08-25 10:47:52 -07:00
Cedric BAIL 600a5fa76c evas: all GL backend require strict tilebuf, let's make that the default. 2017-08-25 10:47:48 -07:00
Cedric BAIL 741ecaf2cf evas: no need to double init tilebuf as it is created by software generic. 2017-08-25 10:47:39 -07:00
Cedric BAIL bf2439b501 evas: Render_Engine_Software_Generic is actually Render_Output_Software_Generic. 2017-08-25 10:47:11 -07:00
Cedric BAIL 268d9984b4 evas: engine should not access Evas canvas directly. 2017-08-25 10:47:03 -07:00
Jean-Philippe Andre 9da7e98dcf evas gl: Improve GL_ERRORS (internal debug code) 2017-08-21 13:53:30 +09:00
Derek Foreman f95f17ae37 wayland_egl: Call ecore_wl2_window_buffer_attach
This lets ecore_wl2 know that there's a buffer attached - even if we don't
know what it is because it's hidden by gl.
2017-08-18 14:27:32 -05:00
Derek Foreman 3290e6da10 wayland_shm: Use ecore_wl2_window_buffer_attach
No longer calling wl_surface_attach directly.
2017-08-18 14:27:32 -05:00
Derek Foreman 5f0fa08467 wayland_shm: Don't attach null buffers from surface_post
This is protected against elsewhere.
2017-08-18 14:27:32 -05:00
Derek Foreman 90a032587a wayland_egl: Add ecore_wl2_window_commit
Use ecore_wl2_window_commmit() in addition to eglSwapBuffers in order
to set up a frame callback and handle pending update tracking.
2017-08-18 14:27:32 -05:00
Derek Foreman a8c44938f3 wayland: Switch to ecore_wl2_window_commit()
Use ecore_wl2_window_commit() instead of directly calling wl_surface_commit
2017-08-18 14:27:32 -05:00
Derek Foreman 972633e7e8 wayland_shm: Remove direct access to wl_surface
Querying it through Ecore_Wl2_Window now
2017-08-18 14:27:32 -05:00
Derek Foreman e3b9fbaed8 wayland: Put Ecore_Wl2_Win instead of wl_surface into the engines
We'll need to track some state in a common way, so attaching it to the
window seems like a good idea.
2017-08-18 14:27:31 -05:00
Derek Foreman ccc4ffc80d wayland: Make the wayland evas engines dependent on ecore_wl2
Seems like the best place to put some common code.
2017-08-18 14:27:31 -05:00
Jean-Philippe Andre b3722c05f9 evas: Fix crash with filters
Since the EO APIs are defined as weak symbols, invalid definitions of
EAPI lead to runtime crashes on non-public APIs. This is a fix following
a series of changes wrt. EAPI definitions.
2017-08-16 14:06:51 +09:00
Vincent Torri ff0d8ef0a4 evas GDI engine: improve speed
expedite mean value goes from ~125 to ~205

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-08-14 10:16:05 -07:00
Derek Foreman 135ac29817 gl_drm: Remove some stale comments
We do planes now, so this comment isn't helpful anymore.
2017-08-09 14:56:58 -05:00
Derek Foreman 8ff59b2c55 ecore_drm2: Pass Ecore_Drm2_Device instead of fd to most functions
Intended to simplify the upcoming commit that merges device find and
device open into a single function that returns a device.

The fd is something callers shouldn't really need to get their hands on,
right now there are still a few places where it's needed, but those will
be gone soon too.
2017-08-09 14:56:58 -05:00
Vincent Torri db29ee1cd6 Evas Jpeg2000 loader: port it to openjpeg 2.*
Test Plan: files in https://github.com/uclouvain/openjpeg-data/tree/master/baseline/nonregression

Reviewers: jpeg, raster, cedric

Differential Revision: https://phab.enlightenment.org/D5033
2017-08-08 11:46:35 +09:00
Mike Blumenkrantz bc28c4b579 evas wayland: always create gl context when non-existent 2017-08-07 10:50:08 -04:00
Mike Blumenkrantz 77c4ee161d evas wayland: call makecurrent before querying gl attrs
fix T5845
2017-08-07 10:50:08 -04:00
Carsten Haitzler 800b877ed7 evas model loader - restructure code to silence warning
keep our build quiet warnings-wise and change the code to be so... so
we see real warnings. not a bug... just a warning.
2017-08-02 18:48:06 +09:00
Derek Foreman d4e69af383 wayland-shm: Set CLOEXEC for dmabuf
Stop leaking the render node fd to child processes.
2017-07-31 10:55:47 -05:00
Carsten Haitzler a0ed0483fc evas gl gnenric engine - dont check w and h ptrs - will never be null
analyser unhappiness.

found by PVS studio
2017-07-29 12:06:20 +09:00
Carsten Haitzler 157caee2c0 evas psd loader - remove unneeded extra check in if
one if condition is always true by virtual of previous if statements
and drop-through so can remove. not actually any bug but analysers
don't like it

found by PVS studio
2017-07-29 10:37:51 +09:00
Carsten Haitzler c0764e153e evas git loader - move findo reset inside else as only that changes it
only the else changes finfo so reset inside there. not really any bug
at all byt style-wise a bit better and analysers don't like it

found by PVS studio
2017-07-29 09:42:44 +09:00
Carsten Haitzler 2930bc0b06 evas pmap loader - remove pointless extra assign of end of string to 0
not an actual bug - just analysis impacting

found by PVS studio
2017-07-29 09:08:40 +09:00
Carsten Haitzler 64dc6ab056 evas bmp loader - fix warnings about same type handled twice
so a type we handle earlir inan if we re-handle as invalid later. this
wouldnt lead to a crash or bugs as the if's would ned to be evaluated
in order normally, but it's good to get it right.

found by PVS studio
2017-07-29 09:08:40 +09:00
Mike Blumenkrantz 93bac8ce4a wayland: stop creating 1x1 surfaces on init
fix T5226

 #IGot99TicketsBut1x1AintOne
2017-07-21 16:17:54 -04:00
Mike Blumenkrantz 9a56b267cd evas sw x11: formatting 2017-07-21 16:17:53 -04:00
Derek Foreman 736c63be34 gl_drm: half fix eglGetPlatformDisplayEXT usage
Just because the #define is present doesn't mean the extension is, so we're
BAILing on egl completely on some systems for no good reason at all. (saw
this on an SGX stack)

This is still wrong.  I don't want to try too hard until after the upcoming
release, though.

We should actually be testing for the presence of client extensions before
attempting to do any of this.  It's entirely possible that a gl stack will
return bogus functions for these from eglGetProcAddress
2017-07-21 14:34:50 -05:00
Carsten Haitzler 97c3eedbab evas xpm loader - don't error print for files that cant be mmaped
no point complaining because we can't mmap... it'd be an unloadable
file.
2017-07-21 16:35:21 +09:00
Jean-Philippe Andre 7bb14727af evas: Fix a crash in emotion with GL
Ooops! When mapping for writing we can't use the same code
path as when tofree is true. This restores the path for image
writing. This basically fixes rage with GL engine.

See also 45c8e5e983
2017-07-20 16:43:52 +09:00
Jean-Philippe Andre d6c95d1e4b evas gl: Rename secsym_ to eglsym_
eglDestroyImage has nothing to do with SEC...
This is a cosmetic change.
2017-07-20 13:31:34 +09:00
Jean-Philippe Andre 0c78783045 evas gl: Check EGL version before using dlsym
A recent commit broke texture_from_pixmap for NVIDIA EGL
(again), because eglCreateImage is a symbol in libEGL.so
but isn't in fact implemented by the driver.

That's because eglCreateImage() is exposed by libglvnd but
the underlying EGL implementation is NVIDIA and its version
is only 1.4, not 1.5 (where the API was introduced as core).

Instead of reverting the patch, it's better to cover our
bases properly and use dlsym() only if the version is right.

Note that GetProcAddress() may return garbage function
pointers for ALL functions as dynamic virtual functions may
be created on the fly by libglvnd. So it is absolutely
necessary to check the extension string as well.

See 0255f14dc2
2017-07-20 13:31:15 +09:00
Derek Foreman ef9bd41831 gl_common: extsn is no longer unused
Also, we should throw an error when it's NULL, since it's important
for finding symbols for extended egl/gl.
2017-07-19 13:05:53 -05:00
Derek Foreman 0255f14dc2 gl_common: Prefer unextended eglCreateImage
eglCreateImage is objectively better than eglCreateImageKHR - it allows
attributes large enough to hold pointer values.  We should use it when
available and only use the older extension version as fallback.

Also, eglCreateImage is core EGL functionality so don't depend on extensions
to be present to use it.  Theoretically we should be testing for
EGL version >= 1.5 but it's probably safe not to.
2017-07-19 12:24:19 -05:00
Derek Foreman d31f5038e2 gl_common: Remove fallback hack for wayland
This was only necessary due to bugs in the wayland_egl and gl_drm engine
that have been corrected.

Wayland has no bizarre requirements making this necessary.
2017-07-19 12:09:33 -05:00
Derek Foreman eda81c6dff gl_drm: Defer gl symbol lookups until they're possible
See previous commit for details.
2017-07-19 12:02:03 -05:00
Derek Foreman c7fe083a57 wayland_egl: Defer gl symbol lookups until they're possible
Commit 2e6587a14b adds a gl extension string to glsym_evas_gl_symbols()
to prevent using functions that are provided by extensions that aren't
available in the current gl context.

However, we can't query the extension strings until after we create an egl
context.

Split the regular symbol lookup stuff from the gl symbol lookup stuff so
we can query at the appropriate time.
2017-07-19 12:00:07 -05:00
Derek Foreman 86377caa0e wayland_egl: de-wtf the eglGetProcAddress prototype 2017-07-19 11:44:00 -05:00
Derek Foreman 7fd66e84d9 gl_drm: de-wtf the eglGetProcAddress prototype
This doesn't seem to serve any purpose other than rigorous proof that
typecasts can make literally anything compile.
2017-07-19 11:43:25 -05:00
Derek Foreman 855f59da8d gl_common: Stop looking for eglCreate/DestroyImageOES
These aren't a thing.  the GL_OES_EGL_image_base extension doesn't exist
and the GL_OES_EGL_image extension doesn't extend egl, because it's a gl
extension.

So let's stop being the only google match for these nonsense strings.
2017-07-19 10:33:06 -05:00
Jean-Philippe Andre 897d81acb1 evas engine gl: Add missing image unlock
This is a rare error path. Unlikely and not very important as
the lock/unlock doesn't actually perform any meaningful operation.
2017-07-19 13:59:42 +09:00
Jean Guyomarc'h 2f9cbb3a35 evas-gl_cocoa: fix compilation
Booo for commit 2e6587a14b.
2017-07-16 17:26:41 +02:00
Carsten Haitzler 2e6587a14b evas gl - fix compositing/native surface with egl/gles after glvnd
this fixes an issue that has cropped up in the past few months - only
nvidia drivers with egl/gles in x11... and compositing won't work
(native surface) and the introduction of libglvnd

it's a combination of libglvnd lying that it has symbols it can't
later find, new features to get core functions via procaddress that we
hadn't migrated to use AND use preferring core functions that libglvnd
will expose, so switching to KHR extensions by preference. we also
need to symmetrically use destroy image khr too...

oddly enough using procaddress purely for create/destroy image makes
wayland fail ... sofor now i'm taking advantage of the fact that
wayland has no extensions string passed in at the moment and still
doing dlsym... this is odd though.

@fix
2017-07-16 15:56:02 +09:00
Carsten Haitzler ff67dd25e3 evas mesh save - use alloca for tmp strings instead of heap
this reduces code and means we dont have to handle NULL exceptions as
alloca always "works".

@fix
2017-07-16 15:56:02 +09:00
Uma Devika d4ab6ff90a Evas and Eolian : Freed string buffer
Summary:
Summary : String buffer returned by eina_strbuf_new() is not freed in some cases

@Fix

Signed-off-by: Uma Devika <u.bodapati@samsung.com>

Reviewers: cedric, tasn, jpeg, raster, singh.amitesh

Subscribers: tanwar.umesh07, yashu21985, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5000
2017-07-07 13:22:53 +09:00
Jean-Philippe Andre b0caec04fb drm: Fix compilation warnings 2017-07-03 16:23:41 +09:00
Derek Foreman 81420d76e0 software_generic: Improve dmabuf validity tests
Now that upper layers set load errors this can be less gruesome.

Also, add some checks that were in E here where they belong.
2017-06-30 14:54:12 -05:00
Derek Foreman b8165098dc gl_drm: Improve dmabuf validity test
Now that higher layers are setting load errors this can be less gruesome.
2017-06-30 14:52:54 -05:00
Derek Foreman fbb676584e drm: Implement hardware plane support
Adds the ability for drm to place native surfaces on harware planes.

ref 33b50238d2
2017-06-29 17:20:23 -05:00
Derek Foreman dc3873c8db software_generic: fix eng_image_native_get
This has been a stub for a long time, but now we have a native_set, so
we should have a native_get too.

This is required for hw plane usage on the software engine.
2017-06-29 17:20:23 -05:00
Derek Foreman 944a4065e8 gl_drm: Check dmabuf attribute version before trusting attributes
We shouldn't do anything with a dmabuf structure until confirming the
version matches the one we know.
2017-06-29 16:12:35 -05:00
Derek Foreman 2e0e017b87 software_generic: Check dmabuf attribute version during set
We should check here instead of only at time of usage.
2017-06-29 16:11:45 -05:00
Derek Foreman 892bfe7c98 dmabuf: Make a define for the version of the dmabuf attribute struct
I should've done this in the first place, and the version checks are
starting to spread out a bit.
2017-06-29 13:51:07 -05:00
Jean-Philippe Andre 1ef1c04f42 gl_drm: Fix a few compilation warnings
warning: expression which evaluates to zero treated as a null
pointer constant of type 'void *' [-Wnon-literal-null-conversion]
2017-06-29 16:02:36 +09:00
Derek Foreman 33b50238d2 gl_drm: Implement hardware plane support
Adds the ability for gl_drm to place native surfaces on hardware planes.
2017-06-23 08:15:42 -05:00
Derek Foreman 7e2c8c1cbd software_generic: Add plane assign/release function pointers
Functions to assign a plane for a native surface, and release a plane
that's been assigned to a native surface.

These are empty for now as they'll need to be overridden in any backend
that can handle planes.
2017-06-23 08:15:42 -05:00
Derek Foreman 4d058ad323 gl_drm ee: Move to new per fb status callbacks
Switch over to the per fb status callbacks as the old per output api is
about to be removed.
2017-06-23 08:15:40 -05:00
Derek Foreman bd0774206f gl_drm ee: move release fb callback
No functional change, just code motion.
2017-06-23 08:15:40 -05:00
Carsten Haitzler 205ef8a756 evas xpm loader - remove tabs and clean up formatting
just non-code changes here...
2017-06-14 17:15:49 +09:00
Carsten Haitzler 4a9f28a677 evas xpm loader - remove the rgb txt file db loading and compile in
so modern systems seem to have abandoned rgb.txt files. this leads to
us breaking the loading of xpm files tha use color names ... i added
the rgbt.txt from vim but that didn't seem to help... odd... so to just
stop adding path after path to load... ship our own. we could ship the
file... but then we'd still have to load and parse it... every time we
look up a color. so i munged the data with awk and now we compile it
in. it should consume the same space the rgb.txt does in the shared lib
binary. if not read it shouldn't be paged in. it should end up cheaper
than our floaing of the file and mmaping it when xpm module is
loaded/initted... so either way more efficient, uses a little less ram
(12306 bytes vs 17780 for the rgb.txt) ... and bonus - dont have
an extenral out-of-code data blob to find, manage install etc...

this means we should load xpms with colornames correctly again on
systems without an rgb.txt provided by x11 ... which seems to be the
common case now. :(

@fix
2017-06-14 17:04:43 +09:00
Chris Michael 2aa9538f73 evas-gl-drm: Fix uninitialized variable
Small patch to fix an uninitialized variable when using
eglGetConfigAttrib()

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-08 10:01:52 -04:00
Chris Michael faf6041ca7 evas-gl-drm: Be sure to initialize ncfg variable
This could lead to an uninitialized variable or use of ncfg variable
without a value.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-08 10:01:52 -04:00
Thiep Ha 4f77bb2f5a evas_map: support map with number of points as multiples of 4
Currently, in evas map, we only support map with 4 points.
This patch adds support for map with number of points as
multiples of 4.

@feature
2017-06-08 16:53:45 +09:00
Carsten Haitzler cc0e17d32b evas xpm loader - add more rgb.txt file locations...
2 more. /etc/X11/rgb.txt /usr/share/vim/vim80/rgb.txt  ...what i do notice
is that this file seems to have vanished from modern systems... so we'll have
lots of un-fun loading old xpm's with colornames if we cant figure out what
color names map to what colors...
2017-06-08 12:11:43 +09:00
Chris Michael 45656ccb80 evas-gl-drm: Fix potential memory leak
If/When we exit _evas_outbuf_egl_setup function, we should be freeing
the allocated cfgs variable else we leak it.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-07 12:38:12 -04:00
Cedric BAIL fd38c09735 evas: reuse code for colorspace logic by using switch case statement fallthrough. 2017-06-05 12:07:57 -07:00
Cedric BAIL 447a9056d0 evas: use switch case statement fallthrough to handle colorspace logic reuse. 2017-06-05 12:07:57 -07:00
Cedric BAIL 7832e02b2d evas: TGA does use switch case statement fallthrough to factorize code. 2017-06-05 12:07:57 -07:00
Jean-Philippe Andre ebb9cad1ed evas gl: Add an env var to debug GLSL version issues
Set this env var to "300 es" to test GLSL 300 ES as shader
version. This is for brokenshakles.

Example:
  export EVAS_GL_GET_PROGRAM_BINARY=0
  export EVAS_GL_SHADER_GLSL_VERSION="300 es"
  export ELM_ACCEL=gl
  elementary_test
2017-05-30 11:15:41 +09:00
Derek Foreman a5fae67e9c dmabuf: Drop requirement that buffer be writeable
We don't need to write to it, and some clients don't create their buffers
in a way that we can.

@fix
2017-05-19 16:59:27 -05:00
Derek Foreman 1c60ac3bc9 ee_drm: Remove some commented out code
I think this was intended as a reminder to do something that's already
been done.  Or something.
2017-05-12 17:51:34 -05:00
Derek Foreman edcbff59b7 ecore_drm2: refcount fbs
Removes the previous "busy" flag, as now we might have an fb attached to
multiple outputs at once, and need to be careful to destroy them only
after they've been removed from all outputs.

Removed the old "busy_set" API which nothing used, and renames fb_destroy
to fb_discard to make it more clear that it's not immediately destroyed.

It's all beta api, so I can do this.
2017-05-12 17:51:34 -05:00
Cedric BAIL 69b941f018 evas: simplify fb engine. 2017-05-12 15:24:45 -07:00
Cedric BAIL a660ee9e19 evas: simplify buffer engine. 2017-05-12 15:24:45 -07:00
Cedric BAIL 35e54acc46 evas: stat introducing a concept of engine and output in the backend. 2017-05-12 15:24:45 -07:00
Jean-Philippe Andre 7e2e6e8aa4 evas gl: Fix typo and revert hack (GLES 3.1)
Omg... Thanks Daekwang Ryu for pointing me to my error. I remember
struggling a lot with this OpenGL API and libGLdispatch (glvnd) when
in fact this was all just a typo in the code.

GLES 3.1 and the upcoming 3.2 support need a proper test case...

See c68a409874

@fix
2017-05-12 16:34:38 +09:00
Derek Foreman 2653fd3fda gl_drm: Fix rendering problems with dmabuf
Somehow this long standing bug wasn't obvious until wayland 1.13.0 made
some additions to an opaque structure.

This changed the frequency that new buffers came to us with the exact
same pointer value of a buffer that had just been freed.

This shortcut in eng_image_native_set has always been wrong - we need to
proceed to the end to make sure we pick up new dmabuf attributes.
2017-05-10 16:24:11 -05:00
jiin.moon c89bf7b2d8 evas: Fix can't open tiff file on loader
Summary:
Evas can't open tiff file because of no implement in client read api.
I wrote codes simply for open.

Test Plan: self

Reviewers: jpeg, cedric, jypark

Subscribers: stefan_schmidt

Differential Revision: https://phab.enlightenment.org/D4857
2017-05-08 15:20:01 +02:00
Derek Foreman 699ed066ea ecore_drm2: Require x and y value in plane assign
Saves us a flip test, and gaurantees that we're always testing with a
reasonable x, y and not something leftover from a previous assignment.
2017-05-05 12:53:25 -05:00
Derek Foreman 769271a66a drm-ee: Use a plane for the evas
Assign a plane at startup and update it in flip.
2017-05-05 12:53:24 -05:00
Derek Foreman 27fc7d5f83 gl_drm: Support atomic updates
Grab a plane and lock it down for displaying the canvas, update it on
page flip.
2017-05-05 12:53:24 -05:00
Derek Foreman 755577c423 wayland engines: Don't store evas in engine info
We don't need it anymore.
2017-04-26 14:20:47 -05:00
Derek Foreman 92e65ba3c7 wayland_shm: Stop using the evas directly to block for async render
Use the new fence function instead.

This makes Cedric less unhappy.
2017-04-26 14:16:37 -05:00
Derek Foreman a4ed205071 gl_drm:Rename import_simple_dmabuf to gl_import_simple_dmabuf
There's also an ecore_drm2 function to import dmabuf as fb, so it's a
little less confusing to be a little more explicit here.
2017-04-26 13:47:46 -05:00
Stefan Schmidt 40f30f0f31 evas: gl_filters: fix leak of evas image
Make sure we free the allocated use_map evas image before leaving scope.

CID: 1374275
2017-04-26 14:27:30 +02:00
Cedric BAIL 7f5ec0c8ea evas: do not rely on Evas canvas for Evas Ector engine backend. 2017-04-25 16:16:30 -07:00
Cedric BAIL 55e1b3f205 evas: remove engine.data.output.
This is the first step toward handling multi output. This patch
remove engine.data.output from Evas structure and use an Eina_List
for it instead. It also start moving code around to fetch an output
or an engine context (which are the same at the moment, but will be
split in a later patch).
2017-04-24 15:10:48 -07:00
Carsten Haitzler b9991b045c evas gl filter blur - fix uninitialized vare warning for sum 2017-04-21 16:40:36 +09:00
Carsten Haitzler d5848d0dc4 gl filter blur - fix warning about possible uninit vars by initting them 2017-04-21 16:39:20 +09:00
Jean-Philippe Andre d87a65e825 evas gl: Fix compilation for EGL 2017-04-14 13:57:04 +09:00
Jean-Philippe Andre 30ac315631 evas filters: Cleanup unused buffers
This might not be used as over two consecutive runs all the
same buffers should be used. But it could happen if some
parameters in the filter change (eg. blur radius).

Fixes major (GPU) memory leaks. Reuse mode is still leaking.
2017-04-14 13:57:04 +09:00
Jean-Philippe Andre 01a4ecd92c evas filters: Adjust downscale coordinates to avoid artifacts
This avoids sampling artifacts when moving or resizing a
snapshot object over a region with sharp content (eg. text).
2017-04-14 13:57:04 +09:00
Jean-Philippe Andre 5467d1eb3e evas filters: Fix artifacts when scaling up & down
An odd-sized image scaled down by 2 was losing 1 pixel during the
downscale, and it was not restored after scaling up. The same
happened with downscaling by 4 except the effect was even more
visible.

This meant that a moving snapshot with a large blur would trigger
some really ugly sampling issues if the content below was precise
(such a text).
2017-04-14 11:26:44 +09:00
Jean-Philippe Andre fc92a1c0f6 evas filters: Enable down scaling with GL blur
This dramatically improves the performance and now seems
to give acceptable results. Eventually we need a quality flag
in order to enable this or not. Alternatively, "gaussian" blur
mode would skip this optimization, while "default" would trigger
it.
2017-04-14 11:26:44 +09:00
Jean-Philippe Andre 45548e8358 evas filters: Implement obscure support for gl blur
This can help with performance when a large region of the
filtered image (eg. snapshot) is fully hidden by an opaque
object. For instance the window border is hidden by the
opaque window content.
2017-04-14 11:26:44 +09:00
Jean-Philippe Andre c53f1526f1 evas: Make save() work on snapshots
This make save() work on snapshot objects, provided the call
is done from inside render_post.

Also, this saves the filtered output of an image, rather than
its source pixels. Any call to save() on a filtered image must
be done from post-render as well.

Fixes T2102

@feature
2017-04-14 11:26:44 +09:00
Jean-Philippe Andre e7eb97f3b0 evas gl: Make sure a deleted image can't be the target
If we delete the image that was the target surface for gl
rendering, a crash would occur on the next render cycle.
Unlikely but not impossible to trigger from app side.

@fix
2017-04-14 11:26:44 +09:00
Jean-Philippe Andre 06a7beec52 evas filters: Switch to uniforms in GL blur
This was a poor attempt at improving the performance but
obviously the root cause isn't fixed (too many texel fetches).

Uniform should (theoretically) work better than an attribute
the for loop. Just a guess here.

This also makes GL blur use a float value as radius, allowing
future extension to non-integer blur radii, as well as using
linear scaling as a fast blur approximation.
2017-04-14 11:26:44 +09:00
Jean-Philippe Andre 7407a0d073 evas filters: Reduce one log level 2017-04-14 11:26:44 +09:00
Jean-Philippe Andre ebeead4681 evas filters: Optimize GL blur with interpolation
This optimizes the GL blur algorithm by reducing the number of
texel fetches (roughly half the number of before this patch). This
works by exploiting GL's interpolation capabilities.
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre 6af3c20aeb evas filters: Pass gaussian values to GL blur shader 2017-04-14 11:26:43 +09:00
Jean-Philippe Andre a9ddeeb4fb evas filters: Use GL downscaling for blur
This will improve the performance a lot. Now remains to figure
out the best values for downscaling and improve the actual blur
shader as well.
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre e52a04ef8f evas filters: Use obscured region in box blur (SW)
Box blur is used by the default blur (in 2 or 3 passes) so it
is one of the most important and cpu-consuming filters in the
software engine.
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre b90246a619 evas: Improve blur filter perf by using 2 passes
By simply splitting X and Y blurs in two passes we can improve
the performance of the blur filter a lot.

There is still much to be done to make it really fast and nice
looking:
- implement true gaussian blur (not sine-based approximation,
  right now the actual blurs look different in SW and GL)
- exploit linear interpolation for R tap instead of R*2+1 taps
  (a tap being a texel fetch)
- downscale & upscale large images with large blur radii
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre 5bce7120f1 evas filter: Implement blur filter in pure GL
Wait a second though, this implementation is not only incomplete
(no support for box vs. gaussian blur), it's also insanely bad in
terms of performance. Small radii may work fine, but at least blurs
render properly in GL with this patch (no more glReadPixels!).

The shader needs a lot of love, including in particular:
- support for 1D box blur single pass
- support for 1D gaussian (or sine) blur
- use linear interpolation and N-tap filters
- separation of 2D blur in two passes (high-level logic)
- potentially separation of large 1D blurs in 2 or more passes
  knowing that 2sigma == sigma + sigma when it comes to the gaussian
  bell curve.
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre 125c7d956e evas filters: Implement displace filter in pure GL
This one was a bit more... "fun". I had to add a new vertex
attribute and obviously using a VertexAttribPointer led to
incomprehensible crashes. But a simple glVertexAttrib2fv makes
it work like a charm!

A rare option is not handled yet.
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre ac8812665b evas filters: Implement fill filter in pure GL
Now that one was trivial. Could also be done with glClear and
glScissor instead, but the rectangle infrastructure works well
enough.
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre 3d2f1a3d9b evas filters: Implement mask filter in pure GL
This reuses the existing mask infrastructure, but adds a color
flag to use the whole RGBA range, rather than just the Alpha
channel.

Filters are still very slow (glReadPixels and non-optimized use of
GL buffers...), but this is progress :)
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre 92dfe1831c evas filters: Fix blur logic and GL buffer handling
This corrects two things:
- the blur filter high-level logic, that lead to reusing some
  temporary buffers which contained garbage;
- the versatile gl buffer implementation so that it now properly
  switches between the RGBA_Image and the FBO content (yes, this
  is insanely slow and inefficient... but it works and that was
  the only point).
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre 2ef8d6f39a evas filters: Refactor ector and gfx filters A LOT
Alright, so this is a massive patch that is the result of
trying to get rid of unused or poorly implemented classes in
ector. Originally ector was meant to support VG but extend to
things like filters as well. At the moment, ector's design
makes it quite hard to plug in the filters.

For now I think it's easier to implement the GL support for
the filters directly in the engine, where I hope to interfere
as little as possible.

This massive patch keeps only the required minimum to support
a versatile gl buffer that can be mapped, drawn or rendered to (FBO).
It's extremely inefficient as it relies on glReadPixels and lots
of texture uploads, as well as conversions between ARGB and Alpha.

Another type of GL buffer is a wrap around an existing GL image,
but that one is read-only (map or draw: no write map, no FBO).

No, all the filters run fine, and the high-level implementation
(evas_filters.c) does not need to know whether the underlying engine
is SW or GL. One problem though appears with the blending or blurring
of some Alpha buffers, the colors are wrong.

This patch removes more lines than it adds so it must be good ;)
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre fb52c15e85 evas filters: Prepare GL support for blend operation
No implementation yet, this is just the skeletton!
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre 190d84e84b evas: Rename software filter function type
From Evas_Filter_Apply_Func to Software_Filter_Func.
Also fix include dir for out-of-tree builds of non-static sw generic.
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre a8d283567a evas filters: Move blur to software generic (8/8)
This completes the series of refactoring patches, where only the
filter implementation is moved to the engine rather than inside
evas itself.
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre 46542ea748 evas filters: Move transform to software generic (7/8) 2017-04-14 11:26:42 +09:00
Jean-Philippe Andre 1b95d22c2c evas filters: Move bump to software generic (6/8) 2017-04-14 11:26:42 +09:00
Jean-Philippe Andre b56a788e96 evas filters: Move displace to software generic (5/8) 2017-04-14 11:26:42 +09:00
Jean-Philippe Andre c9eec74002 evas filters: Move fill to software generic (4/8)
This also moves the header evas_engine_filter.h to its subdir.
2017-04-14 11:26:42 +09:00
Jean-Philippe Andre b6df13b024 evas filters: Move curve to software generic (3/8)
This moves the RGBA premul/unpremul functions to static_libs/draw.
2017-04-14 11:26:42 +09:00