There was a problem when checking whether the current surface
is compatible with direct rendering. In case of client-side
rotation (it's a flag set on the surface by the app), a surface
can be directly rendered even if the rotation is not 0.
But, before this patch, it was assumed that the surface was
current. Which doesn't make sense because make_current is
called by the pixel callback, from the application, and this
happens *after* we check for direct rendering.
As a consequence, it was not possible to mix directly rendered
surfaces with FBO-based ones, and use client-side rotation.
This patch should solve that issue.
Summary:
Move check visibility of node from evas_3d_node to evas_3d_camera
Move functionality (normalize, check distance, calculate frustum)
in evas_3d_utils.h (we are planing use evas_is_sphere_in_frustum in evas_gl_3d.c -
don't render mesh if it non visible)
Add possibility check frustum by box, aabb, central point
Refactor example frustum culling
@feature
Reviewers: Hermet, raster, cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1420
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
This patch set adds the necessary code to expose device axis state to applications. This was primarily written with graphics tablets in mind, which -- in addition to acting like a mouse -- also provide information about pen pressure, tilt, etc. Other devices could potentially benefit from this API as well: touchscreens, joysticks, knob controllers, "spaceballs", etc.
Whenever an update to the device state is recieved, an "Axis update" event is synthesized. This event contains the updated information, typically scaled and normalized to a particular logical range (e.g. zero to one for pressure, -pi to pi radians for angles, etc.). Information about the tool which generated the event is also stored so that applications can disambiguate events from multiple devices (or in the case of multitouch screens, individual fingers).
This API is only wired up for use with X11 at the moment. Support for other backends (e.g. Wayland) should be easy to add for those familiar them.
**Note**: The following is a list of changes from the "v2" patches originally sent to the mailinglist
//Define and implement new Ecore_Event_Axis_Update events//
* Harcode axis labels instead of including xserver-properties.h
* Use C89-style comments
* Use doxygen comments
* Update comment text to note axes with unbounded/undefined ranges/units
* Create "Ecore_Axis" and "Ecore_Axis_Label" typedefs
* Reference typedef'd instead of raw types
* Adjust how we count through valuators to support tilt/az
* Add support for tilt and azimuth
* Tweak memory management in case number of valuators differ
* Expand TWIST axis normalization to declared range
* Only normalize TWIST axis if resolution == 1 (wacom bug)
* Cache label atoms on first use to minimize round-trips
//Implement EVAS_CALLBACK_AXIS_UPDATE event and friends//
* Update to doxygen comments
* Update comment text to note axes with unbounded/undefined ranges/units
* Typedef 'Evas_Axis_Label', 'Evas_Axis'
* Move typedef for 'Evas_Event_Axis_Update'
* Reference typedef'd instead of raw types
//Wire the Ecore and Evas implementations of axis update events together//
* Expose ecore_event_evas_axis_update in Ecore_Input_Evas.h
* Move ecore_event_evas_axis_update to more logical position
//DEBUG: Add axis update logging to evas-multi-touch.c//
* Removed from patch set
//Make evas-multi-touch demo use new axis functionality//
* Have pressure adjust rectangle brightness instead of size
* Use more available axis data when rendering rectangle (azimuth, tilt, twist)
Test Plan: The evas-multi-touch demo was updated to support axis update events. A graphics tablet was then used to verify that the pressure, azimuth, tilt, and twist data was coming through correctly.
Reviewers: cedric, raster
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1514
Conflicts:
src/lib/ecore_input/Ecore_Input.h
Carsten Haitzler -
** fixed forward enum typedefs (make things unhappy)
** fixed conflict above
** fixed wrong param type for _evas_canvas_event_feed_axis_update()
** fixed @sinces to be 1.13
** fixed formatting/indeting
** fixed order of operation reliance in if's with ()'s to be clear
** fixed functions to be static that should have been
Summary:
.ply format is important for relation blender and EFl, because in blender exist only two mesh export API: bpy.ops.import_mesh.ply and bpy.ops.import_mesh.stl. One of them is necessary for .edc 3D generator. Which I writing now.
Sorry, it isn't like image loader. Refactoring of import/export will be soon.
Reviewers: Oleksander, artem.popov, Hermet, raster, cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1544
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Idea originated from Cedric the b0rker.
This is a big fat search-and-replace commit.
This commit also introduces space changes... Sorry for the mix.
NOTE: This commit may have one side effect as there was some very
dubious code chaning the dst image's alpha flag in the
Gfx get functions. Logically this didn't make sense (at
draw time the dst alpha should already be well defined),
so it should be safe.
Here's a macro that's used for debugging in some of the ugliest
ways possible: avoid passing an extra argument to a function when the
cost of always passing it is negligible (it's an int).
Fixes T1749.
Thanks cedric for the report.
We'll need a new function (after 1.12) to detect if the current
cow pointer is the default data or not. Maybe eina_cow_default_get()
or maybe something just returning a bool.
Add version param to context_create.
Add support for 1.1 contexts in the GL_X11 engine, and checks
for version in all other engines (return NULL).
Add API wrappers for all OpenGL-ES 1.1 APIs (normal and debug
modes).
When using EGL, this function should return the properties of
a surface. Limited to a subset of known attributes.
Right now, this function will only work fine with EGL.
GLX support or any other engine is not implemented.
@feature
This will be used to increase the chances of having direct
rendering (no fallback to FBO) even if the window is rotated.
The client is then responsible for handling the view rotation.
@feature
Summary:
This is a fix of those warnings. Sorry for existence of them.
CC lib/evas/common/lib_evas_libevas_la-evas_alpha_main.lo
../../src/lib/evas/canvas/evas_3d_mesh_loader_eet.c:113:13: warning:
assignment from incompatible pointer type
eet_file = _evas_3d_eet_file_new();
^
CC lib/evas/common/lib_evas_libevas_la-evas_blend_main.lo
CC lib/evas/common/lib_evas_libevas_la-evas_blit_main.lo
CC lib/evas/common/lib_evas_libevas_la-evas_convert_color.lo
../../src/lib/evas/canvas/evas_3d_mesh_saver_eet.c: In function
'evas_3d_mesh_save_eet':
../../src/lib/evas/canvas/evas_3d_mesh_saver_eet.c:159:13: warning:
assignment from incompatible pointer type
eet_file = _evas_3d_eet_file_new();
^
CC lib/evas/common/lib_evas_libevas_la-evas_convert_colorspace.lo
CC lib/evas/common/lib_evas_libevas_la-evas_convert_gry_1.lo
../../src/lib/evas/canvas/evas_3d_eet.c: In function
'_evas_3d_eet_file_new':
../../src/lib/evas/canvas/evas_3d_eet.c:28:4: warning: return discards
'const' qualifier from pointer target type
return creating_file;
Reviewers: cedric, artem.popov
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1527
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary: The first version of .eet format is added. All changes due to discussion in D1307 are done.
Reviewers: artem.popov, se.osadchy, reutskiy.v.v, Hermet, raster, cedric, Oleksander
@feature
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1477
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary: The first version of .eet format is added.
Reviewers: Hermet, raster, cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1307
Summary: Fix not to clean and re-render if the position of an object enabled map is changed.
Reviewers: raster, cedric, Hermet
Reviewed By: Hermet
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1220
ecore_evas_convert: Add -e/--encoding option
This uses directly the encoding parameter.
For now, used only by the TGV saver, but there is no other way
to specify between ETC1 and ETC2. And we don't have a mixed ETC1+2
mode (yet).
@feature
Summary: First function is used for intersection of ray and parallelepiped, the second one - for intersection of ray and rectangle in two-dimensional case.
@feature
Reviewers: Hermet, cedric, raster
CC: cedric
Differential Revision: https://phab.enlightenment.org/D956
Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
This adds filter support to Image objects as well.
The exact same filters can run on Text and on Images
(provided some colorspace limitations are respected).
This basically adds:
- Support for RGBA input buffer
- Eo entry points for Image filter support
- Implement basic filter support in Evas_Image
Enable 3D features using --enable-evas-3d=yes when configuring.
APIs are exposed through Evas_3D.h.
Currently, evas-3d is being supported only on gl_x11 engine.
Conflicts:
src/lib/evas/Evas_Eo.h
Summary:
This problem occurred due to xkb_keysym_t value of libxkbcommon by e wl server.
e wl server should pass keycode from evdev input device on to wl client.
In order that e wl server receives valid keycode Ecore_Event_Key should have
an extended data member. This patch should be applied with server side patch.
@fix
Test Plan: run e wl server -> create wl client -> type keys
Reviewers: raster, devilhorns, zmike
CC: cedric
Differential Revision: https://phab.enlightenment.org/D712
This will allow forcing a specific value for the filter padding,
instead of relying on auto calculation.
Two advantages:
- Auto calculation can't be perfect, since it will add as much
padding as required for the full blur effect
- This prepares the path for animations with effects, where the
object size does not change over time
BOX blur is a lot faster (and easier to optimize, too)
than GAUSSIAN blur. Repeating 2x or 3x BOX blur will also
give similar results to GAUSSIAN blur (very smooth), but
in much less time.
Add a count parameter to the BOX blur instruction.
Make use of glReadPixel to access the source's pixel data.
Use all classic CPU functions to blend and use that data.
Save pointer to the GL image and update it with the latest data
during target render.
Use ENFN's surface_lock, read_pixels, unlock.
Also, add some more error checks to make sure the images are valid,
or return an error at runtime.
This will be needed by the filters for proxy rendering,
for textures and maps (displacement).
Add new engine functions to unleash the (sluggish) power of glReadPixels.
The idea is to be able to bypass glReadPixels later, so 3 new APIs are
added:
- surface_lock
- surface_read_pixels
- surface_unlock
They must be called in that order.
Note (for history):
glReadPixels was always getting the wrong data during first draw,
but the right data during a redraw...
Why? Well simply because for OpenGL itself, the image had never
been drawn in teh first place! Only the Evas GL context knew
about the image drawing, as it was queued somewhere in the pipe.
One line solution: Call evas_gl_common_context_flush before
doing anything else.
This will inform the client whether an asynchronous filter properly
rendered or not.
I actually don't know any case where rendering can fail at runtime.
The structure should not be changed, despite the union modification.
I am renaming for consistency with older branches that had a mask
field in RGBA_Image. Also, the mask.data or data8 is really just
a way to avoid casting between DATA8 and DATA32 (and it shows
clearly what kind of data you are dealing with).
Summary:
There's nothing SSE3-specific about that macro, let's use a more generic name
for it. Since that's just a generic macro, we can also allow non-SSE (eg.
NEON) code to use it if they want to
Reviewers: cedric
CC: cedric
Differential Revision: https://phab.enlightenment.org/D528
Proxy sources & objects were not properly unset.
This results either in crashes (especially in the Edje tests)
or dangling objects with tons of references.
Remove the refcount increase/decrease, as it is redundant.
Store pairs proxy+source instead of just the source in all hashes,
so we can unset the is_proxy flag on the proxy when there are no
sources anymore.
Remove compilation warnings: we don't really need cubic
interpolation at this point, we can still add it back
later if wanted.
Also, make it clear that buffer #2 is the output buffer.
Remove meaningless FIXME.
This patch implements the final draw from RGBA_Image to the
OpenGL surface. We can even steal the output buffer and
redraw it quickly, without having to re-render everything
(same as in SW).
Since the filters will have to decide on which engine (SW, GL) to
choose from to render the font and the effects, move the font
draw call inside the filters module.
It is not possible to logically handle padding and offset at the same
time for a proper mirror effect, unless this is handled directly at the
transformation level.
Also, add support for blend() operation padding computation.
This is the simplest solution I can come up with for "mirror" effects.
Displacement maps are HARD to generate and use properly, since the buffer
size is unknown until runtime.
Even if we align the map to the text itself (using the padding information),
it's still hard to describe properly how to apply the displacement map, and
to generate it... So let's just add a simple flip operation.
The displacement effect is way too complicated. Let's keep it
simple and have only one displacement map format (RG + Alpha).
Here's what's missing now:
- Alpha support, to blend in the input with a variable intensity
- Extra padding (see below)
Also, the intensity VS. map values are not perfectly defined yet.
Problems: How to create a complete mirror effect (map needs to go
over boundaries... add extra padding to the buffers).
Evas is an RGBA only engine, BUT we also use some alpha masks,
especially in the font rendering pipeline.
This commit adds basic support for alpha buffer operations
(blend and copy).
RGBA_Image can then point to either alpha-only data, if
its colorspace is grey.
This doesn't work nicely, as for some reason fontconfig doesn't work
nicely with ':spacing=mono' without a font name.
Doesn't work with fc-match either. It does work with fc-list, but that's
not what we'd like to use. It could be just an issue with my local
fontconfig configuration.
This fixes T865 although the problem is now with freetype.
this changes the internal encoding of font glyphs in evas to use 4bit
uncompressed if small, or 4bit rle (run length encoded) if larger.
this caves at least 50% of memory on fonts - and more if bigger. with
large fonts (40-80pixel size) we can save in the region of 80% of
memory used for glyphs. this also happesn to allow speedups in
rendering too.
since the map_changed is reset right after the map is updated,
it could not decide to redraw the map surface properly.
now map_update() returns the value to redraw the map surface properly.
Being annoyed by different types of eina critical macros - CRI, CRIT,
CRITICAL -, I concluded to unify them to one. Discussed on IRC and
finally, CRI was chosen to meet the consistency with other macros -
ERR, WRN, INF, DBG - in terms of the number of characters.
If there is any missing bits, please let me know.
Perhaps they are insane, but as the comments imply it defines
USE_HARFBUZZ which is needed afterwards. You just broke everything. I
know it's a mess there, but it's a mess that works. Your change doesn't.
This reverts commit d4b9e3b287.
We need a function in DnD for the overlapping feature to retrieve all
the objects at a specific position.
A private function exists in Evas (evas_event_objects_event_list) for
that purpose.
We need an access to this function for Elementary but we don't
want the is_frozen flag to be checked.
If we are running on async render, some operations must be delayed, so
they will happen at the same time that the canvas rendering result gets
updated on the window/surface.
Tracking only the async rendering canvases and just waiting for the last one
to finish rendering. This should be enough to sync all canvases since the
render thread orderly executes the commands.
evas_render_sync() will loop through all canvases and wait for their
rendering to finish. Since this function will execute from the main
thread that will sync all of them.
This is not the perfect solution at this moment. This doesn't consider the cached clipper's visibility at all.
But at least this would be better than exist works. Should be improved.
NOTE: when using Evas_Object image preload infrastructure the GL texture
upload was uploaded from the main loop during the rendering stage. This
could lead to some frame drop during fast animation due to the time needed
to upload that texture.
This patch fix this problem by uploading a small texture quickly (16x16)
and waiting for going back to the main loop to be able to use the same GL
context from another thread to do the texture upload asynchronously without
blocking the main loop.
Evas_Common.h should be used for the public header, and rather rename
evas_common.h internal header to another name.
Sa:
Evas_Common_Header.h -> Evas_Common.h
evas_common.h -> evas_common_private.h
Shouldn't have both Evas_Common.h and evas_common.h because of case
insensitive filesystems.
Evas_GL Direct rendering is an optimization path that renders
directly to the window if conditions are met. Because evas gl
backend used to re-render the entire screen, evas_gl direct
rendering didin't have to concern with partial region rendering.
Now that partial rendering/swapping has been applied to evas gl-
backend, evas_gl direct rendering also had to take into account
clip regions. in order to properly apply it, some adjustments
were made to the engine functions and etc.
This is an astonishing bug, I wonder since how long it has been there. It
is basically due to the use of void * and a wrong cast. Type checking is
clearly useful, let's use it more !
For native surface rendering (glX, egl) in gl-backend, if pixel get callback
function is called for native rendering, there is a case where evas will
try to call evas_gl_common_context_flush() to flush its remaining commands
in its command queue while the context is set current to the native surface/
context that is called within the pixel get callback. So, I've added an
engine function that forces a flush before it enters the pixel get callback
function.
Goal is to be able to remove all internal Evas call from inside all
loader module. To do so we are going to open and hold a reference to the
file from outside of the module, read the header, create the image data,
load the data, close that reference.
Once that done, the next step is to let the file remain open as soon as
the filename/key is set and add an API to set an Eina_File directly. This
way edje can maintain the same file open as it use for an edje object,
keeping things in sync and avoid rendering glitch during update.
This function should be used internally by the input system
(Ecore_Evas_Input) to feed Evas with move events. The x,y event info is
relative to the base of the window/surface, instead of the 0,0 of the
canvas.
This case only happens for now under Wayland, where the 0,0 of the
canvas is translated due to the window decorations that are drawn by the
client.
Instead of moving the objects by adding the framespace offset to them,
use this offset when rendering them. This way there's no change in the
object's geometry/position, it works correctly with map, and will be
automatically updated in case that the framespace values change (for
instance if one sets a window to borderless).
There are 2 main places where changes were needed:
- output redraws, when they come from an object being changed, must be
add the framespace offset to their damaged area;
- checks to see if the object is inside a given rendering area, must
also add this offset, since the object is actually being rendered on
a different position;
This clipper caused several bugs already, and there are some bugs still
not fixed. Let's remove it and try to fix any remaining with some other
kind of solution that does not depend on adding or clipping objects
during the evas render phase, which causes unexpected behavior.
These objects should be clipped only during rendering, since keeping
them clipped after that allows for unexpected behavior on the
application side. For instance, an application could check if objects
have clippers before doing something to them, assuming that some objects
should have no clipper, but under wayland, after the first render
iteration, there will be no objects without a clipper.
This commit fixes this behavior by unclipping objects that had no
clipper prior to the render iteration.
Additionally, it fixes a bug where a maximized/fullscreen window could
have not all of its content rendered immediately. This was occuring
because some objects could be clipped to the framespace clipper, but
considered invisible in the beginning of the render phase, where they
are evaluated. They were considered invisible because the framespace
clipper object was not resized at that phase yet, and thus these objects
were being clipped out from the viewport.