When an Ecore_Evas is hidden, it will destroy the buffer swapper. When
it's shown again, it will try to attach a new buffer, that can be same
buffer. If that global var is still pointing to the old buffer, it can
match to it again and avoid sending a new buffer. So, just put this sent
buffer var in the buffer swapper, and it will get set to NULL when the
swapper is destroyed and created again.
This should fix an intermitent problem of ecore_evas_show() not always
working after an ecore_evas_hide() on the wayland_shm engine.
Fix phab T392.
Notice that it should reopen T359, as it wasn't really fixed, but a
rotation with resize was being used when a non-resized rotation was
requested. The cause of the "protruding surfaces" is likely the fact
that Elementary is setting the opaque regions manually, instead of
leaving it to Ecore_Evas. This must be fixed either inside Elementary
itself, or adding the "surface extents" (shadow/non-visible surface
parts) info to Ecore_Evas too.
This reduces code duplication for ecore_evas resize routines inside
wayland engines by using a common _ecore_evas_wl_common_resize
function as the resize code for both engines was the same anyway.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
[Problem] When glTextureDelete is called in image_cache_flush(), it sometimes doesn't work.
[Cause] glTextureDelete is called with the wrong eglContext.
[Solution] Call eng_window_use() in image_cache_flush() and image_cache_set() to use the correct eglContext.
Change-Id: Id7ab1aaeb456be6dbc5f09cb2731ace5399a5dce
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
In evas_gl_api_ext_def.h there're calls such as:
_EVASGL_EXT_DRVNAME(EGL_KHR_image_base)
The macro is defined in evas_gl_api_ext.c as:
(strstr(glexts, #name) != NULL || strstr(glueexts, #name) != NULL)
if (_EVASGL_EXT_CHECK_SUPPORT(name)) *ext_support = 1;
But EGL_KHR_image_base is itself a macro, which is defined
in EGL/eglext.h like this:
Thus, the _EVASGL_EXT_CHECK_SUPPORT macro will unwrap into:
(strstr(glexts, "1") != NULL || strstr(glueexts, "1") != NULL)
instead of intended:
(strstr(glexts, "EGL_KHR_image_base") != NULL ||
strstr(glueexts, "EGL_KHR_image_base") != NULL)
This patch fixes this by applying stringification earlier in
_EVASGL_EXT_DRVNAME
Bugfix reported by jinhyung.jo@samsung.com
These two APIs will save the title and class_name inside
Ecore_Wl_Window, so if they are called before the shell surface is
created, the stored names will be used later when the window is finally
shown (shell surface is created).
This way we are also hiding the shell surface from ecore_evas modules.
This is a configure event info, so put it in the right place. Some
places adding edges info were also removed, which means that they were
redundant.
Tested with <Meta> + middle click resize, and with window border resize,
on all the edges. Apparently, nothing breaks.
It's mostly only used inside ecore_wayland library anyway.
The only bit needed outside of the library is the "seat" pointer, but a
new function was added to retrieve such pointer from Ecore_Wl_Input.
This struct is only used inside ecore_wayland itself, so there's no real
reason to expose it. Apparently, hiding it doesn't break anything,
except for the ecore_imf wayland module, which was easily fixed.
If anyone notices a breakage, please let me know.
Previously, a "maximize" of an efl client would not actually resize to
the provided size as it would account for framespace width & height.
This fixes that so now "maximize" is Actually maximized.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
needed.
NB: Currently, this will only work for fullscreen or maximized states
as other ones like sticky, withdrawn, iconic, etc, etc are not
supported via wayland protocol yet.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
after several days of beating head on desk, i gave up trying to find
the exact cause of some gifs not rendering right as animated gifs due
to the loader. it had something to do with dispose mode handling and
which frame it was applied to. i noticed the structure made it also
hard to fix, so this re-structures the entire thing with cleaner code,
less code AND more comments, with a limited memory cache (512k) for
previous frames per image (to avoid eating up huge memory blobs for
big/long animations - though at the expense of cpu), and with some
notes for future fixes - like fixing the "load 2 copies of the same
animated gif" issue... that's another day.
this does fix https://phab.enlightenment.org/T443 along with many
other things.
At the end of the ecore_wl_init() function, send a sync request to the
server, and add a callback listener to the "done" event. When this event
is received, we are sure that all the registry bind requests done so
far were processed already, and that the registry and globals are
available and can be used.
Now, on the functions that request interfaces or registry, we call
_ecore_wl_init_wait(), which will check if the callback was received
already (that means that all requests inside the init were processed).
If it was not yet, then we wait until receiving that callback, before
returning the requested data.
Simply call the appropriate cache2 functions when possible
and check for usage of cache2 whenever an evas_cache_ function
is called.
This effectively adds cserve2 image (data) load support for the
GL engines. Fonts were already working out-of-the-box.
Let's reuse the logic from scalecache and call cserve2
functions when the scalecache should be used.
So, now, cserve2 server will not scale any image... This is
too computationally intensive for the server's main thread.
This is not optimal but makes a hell of a lot more sense for
the moment. (since cserve2 manages the SHM segments)
Pass around "animated" flag for images that can be animated.
Fallback to local cache if the image is animated.
Implementing support for animated images in cserve2 does
not seem to make a lot of sense considering each frame must
be requested independently in real time,... and to be honest
there doesn't seem to be any valid use case anyway :)
cserve2 can't handle virtual files (mmap-only), by design.
Proper support can be added later on, but for now we might want
to just fallback to the normal cache functions.
Fixes photocam test
Evas GL direct rendering mode didn't properly take into account
the image object's clipping information and clip the region that
it was directly rendering to. Hence there were issues with the
direct rendering region drawing over the objects that are sitting
on top of it.
Also, cleaned up the direct rendering coordinate computation code
and a nasty dependency with image object that should have been
removed a long time ago. Basically the evas-gl engine was directly
accessing the image object data structure for its data when it
really should have just passed along necessary information.
This reverts commit 9bfb730ff5.
wrong! on deiconify this will now FORCE a ACTIVATE request to the wm
(which asks the wm to focus the window/hilight it and make it active.
might switch desktops or whatever). this is wrong. de-icoifying a
windows does NOT mean ALSO activating it!. the log message also doesnt
say what "go back to normal state"... means.... do they expect/INSIST
windows MUSt be focused after de-iconification? that's wrong as it's a
window management FOCUS policy, not something to do in the lib.
Is there a title for the commiter with the longest revert of a revert list?
I screwed this one up. Had other local changes that sneaked in.
Resetting and doing it right now.
This reverts commit ee155b771d.
You can bet on reverting makes people speed up the process in fixing it.
Revert the revert here now that Cedric fixed it in eina.
This reverts commit 875e7cf74d.
This patch brings in constant E crash for me. It seems to be timing
related which somehow leads to a mem corruption. Revert it for now
to allow people using E while Cedric looks into it.
This reverts commit 12d34309c7.
This add finally support for JPEG 2000, but be aware that libopenjpeg
is very badly managed. There is currently only version 1.5.x that does
provide the right files, is usable by a third party and portable. You
can seriously forget any other version.
NB: We will still create all new canvases as alpha by setting it in evas,
however this allows the 'state' of ecore_evas_alpha_set/get to retain
it's original functionality and thus accurately report what a client
application May have set alpha value too.
NB: Fixes Phab Ticket T350
Signed-off-by: Chris Michael <cp.michael@samsung.com>
For EvasGL direct rendering, EvasGL does a make_current to the
surface that evas is holding on to. When EvasGL was shutting down
it was wrongly deleting evas' surface. This issue was temporarily
fixed by Raphael before but the proper fix was added.
Remove calls to ecore_wl_window_update_size inside the alpha &
transparent_do functions (this call not needed here anymore).
NB: This is needed due to recent frame "fixes". Basically, even tho we
set the opaque region correctly on a surface now, if the canvas itself
is not alpha, then we will end up with a black "spacer" around the
window.
NNB: Tested Both engines with terminology (both translucent and not) and also the window state test in elementary.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
There was already a surface created by _evgl_tls_resource_create(). If
we assign a new one here, the wrong one will be destroyed at
_evgl_tls_resource_destroy(), and later the GL window will be destroyed
before the surface, causing invalid access errors.
This fixes https://phab.enlightenment.org/T326
If the egl_surface is different from the current one, it may be that the
it has been destroyed already. Removing the below check (and just
checking for different contexts) will avoid calling makecurrent when
destroying a window. That was always failing anyway.
Should fix https://phab.enlightenment.org/T311 for gl_x11 too.
If the egl_surface is different from the current one, it may be that the it has
been destroyed already. Removing the below check (and just checking for
different contexts) will avoid calling makecurrent when destroying a window.
That was always failing anyway.
Should fix https://phab.enlightenment.org/T311 for wayland_egl.
duplicated code.
Resize the frame object before we update the window saved size.
Remove (again) call to _ecore_evas_wayland_resize and set the resize
edge of the window.
NB: The call to _ecore_evas_wayland_resize ends up sending duplicate
configure events here, hence whey it is removed.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
At least on recent mesa (since commit 9f07ca11c17), it will find the
mentioned symbols but they won't really work, leading to error messages,
and possibly some other errors. So far, I just ifdef'ed the
glGenFramebuffer and glBindFramebuffer functions, but it may require
others to be ifdef'ed too.
This is just a workaround, to fix https://phab.enlightenment.org/T246.
NB: Not sure how/why this was here, but it's entirely Not needed and
leads to duplicate calls of wl_shell_surface_resize.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
It's always enabled as it's a dbus module and links to nothing,
actually the daemon doesn't need to be running -- in that case it will
do nothing. In the case the daemon becomes active then it will get the
OnLowBattery property and keep it in sync.
NOTE: I couldn't test the property change as my laptop takes many
hours to get to that situation... let's hope it works :-)
Ecore will now load "system modules" on ecore_init(). The "systemd"
module will use DBus to monitor localed, hostnamed and timedated and
add system events related to those changes.
We don't want to execute any of the function below if t is NULL. Its not
only about strdup but alsa ecore_x_netwm_name_set which might dereference it.
CID 1039400
NB: These calls are NOT needed here (they setup and tear down the
actual wayland display fd connections, and are not necessary in order
to use ecore_wl functions).
Signed-off-by: Chris Michael <cp.michael@samsung.com>
erroneous calls to engine_setup code if we check surface validity.
NB: Short Version: Don't reassign surface if we don't need to.
NB: Prior to this, during a call to ecore_evas_show we would always
Reset the evas engine data (which was basically triggering code to
tear down and reconstruct all the engine internals including the
buffers and the swapper). By checking surface validity first, we can
potentially avoid all that teardown and reconstruction Thus resulting
in faster "show" speed.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
NB: When trying to attach a buffer to a surface, there was a corner
case that could fail in that if we just had 'rects' but count was 0,
then the surface would not get damaged (essentially a call to
wl_surface_damage would get passed 0,0 as the size). This fixes that
problem in that if count is <= 0 now, then we'll damage the whole
surface.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
functions on it.
NB: Wayland (internal) functions typically do not do Any object
validity checking, so lets be proactive and do it here first.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
ecore_wl_globals_get before trying to use them.
After we have bound a text input manager, there is no need to keep
looping the globals, so break out.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Porting commit f10c108283d9b76708418ba172b9ff0b28a09cd6 to wayland
engine.
Added a feature to dump out a png image before calling SwapBuffers.
To turn on the feature, use the following env vars.
EVAS_GL_SWAP_BUFFER_DEBUG_DIR="dir_name" sets the name of the directory
that the files will be output to and enables the debug mode.
EVAS_GL_SWAP_BUFFER_DEBUG_ALWAYS=1 will enable the writing of the
files every frame. This in effect turns on the swap_buffer_debug
variable, which can be set on or off in gdb for debugging. This will
allow dumping of certain frames without having to dump out a ton of
files to track down one frame.
Added a feature to dump out a png image before calling SwapBuffers.
To turn on the feature, use the following env vars.
EVAS_GL_SWAP_BUFFER_DEBUG_DIR="dir_name" sets the name of the directory
that the files will be output to and enables the debug mode.
EVAS_GL_SWAP_BUFFER_DEBUG_ALWAYS=1 will enable the writing of the
files every frame. This in effect turns on the swap_buffer_debug
variable, which can be set on or off in gdb for debugging. This will
allow dumping of certain frames without having to dump out a ton of
files to track down one frame.
- ecore_evas_pixmap_visual_get
- ecore_evas_pixmap_colormap_get
- ecore_evas_pixmap_depth_get
Assign interface functions for above when creating the new interface.
When creating the pixmap, store the visual and colormap for later
retrieval.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Since we take the lock at the start of the function, we should release
the mutex lock if we are going to return.
NB: Fixes Coverity CID1039381
Signed-off-by: Chris Michael <cp.michael@samsung.com>
- Add "pixmap" structure to engine_data.
- Free the front and back pixmaps when the ecore_evas gets freed.
- On resize, drop the backing pixmap if size is different.
- Before we render, check pixmap size vs EE size and create new
backing pixmap if needed.
- After we have rendered into the backing pixmap, flip it to the
front so that any calls to "pixmap_get" will return the proper one.
- Add pixmap_new_internal code (the actual guts for all this)
NB: These can be used to create an internally double-buffered
ecore_evas that renders to a pixmap (not a window).
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Evas loaders' open() function expect the key to be a stringshare,
so declare it as such and keep using ref() without add().
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
If we get an error trying to "make current" an allocated surface, then
we should free that allocated surface.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
If a jpeg image is rotated and we have allocated space for ptr_rotate,
then we should free it Always ... Not Only if the degrees are
180...because we allocate it always
Signed-off-by: Chris Michael <cp.michael@samsung.com>
In case of render_mode == EVAS_RENDER_MODE_ASYNC_INIT we're jumping
directly to end which then calls
evas_gl_preload_render_unlock(eng_preload_make_current, re);
Make sure re is initialized with the render engine data so we don't
dereference junk.
Signed-off-by: Daniel Willmann <d.willmann@samsung.com>