Commit Graph

34 Commits

Author SHA1 Message Date
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
Stefan Schmidt e99dbd1dbb evas gl_common: use void to force empty function parameters
We have to use void in a function declaration if we want no function
parameters. Using just empty parenthesis means the function takes an
unspecified number of parameters.

We had it correct for most declarations and this series fixes it for
the rest.
2015-11-26 17:26:07 +01:00
Dongyeon Kim 65b2a43639 Evas GL: Minimize internal resource creation
Summary:
Evas GL maintains internal resource (XWindow, EGL Window Surface, EGL Context)
per thread to be used for make current when indirect rendering is used.
Currently this internal resource is created regardless of current rendering mode,
and always created when a new Evas GL thread is created by the application.
Internal resource created in a new thread is not freed until evas shuts down
in the main thread, so this causes memory/fd leak.
This can be fixed by creating internal resource only in necessary cases (ie. indirect rendering),
and adding tls resource destructor to be called when thread exits.
2015-11-11 15:59:52 +09:00
Jean-Philippe Andre b80d7fa302 Evas GL: Fix linking to 'context_restore_set'
There was a terribly complex mechanism to call this function
from the gl_x11 engine to gl_common (evas gl core)... and it
simply didn't work because the function pointer would be NULL.
2015-11-10 16:12:20 +09:00
Jean-Philippe Andre 8942c0c29b Evas GL: Fix sync, wlbuffer and image egl ext functions
Before this patch, those EGL/EvasGL functions can not work
without a current context. But EGL does not require any
current context for those to work, or at least, this should
be left to the driver to decide.

Evas GL was only able to get a pointer to the display
if a context was current.

The display pointer should be infered from Evas_GL unless
we can find a current display. EGL does not require a
context to be current in most of these function calls.

This should bring evasgl a little bit closer to EGL in terms
of behaviour (those are EGL-only extensions, btw).

Thanks @spacegrapher for the quick review

@fix
2015-07-17 14:47:42 +09:00
Jean-Philippe Andre 9db20800a2 Evas GL: Fix glClear(0,0,0,0) with DR and COPY
When glClear is called in direct rendering move (DR), we usually
have to skip the call altogether because clearing out transparency
would erase the pixels in the evas backbuffer. This means Evas
would not be able to blend an RGBA GLView on top of other objects.

But COPY mode should allow Evas GL to poke holes in a window
backbuffer.

Thanks @spacegrapher for the review :)

NOTE: Elm GLView also needs to pass the render op to its Evas.Image.

@fix
2015-07-16 19:50:38 +09:00
Jean-Philippe Andre b439fafa17 Evas GL: Fix internal function pointer
evas_gl_native_context_get is an internal function
passed around from an evas engine to evas_gl so that we can
implement evasglCreateImageForContext without exposing
any evas engine internal structure to evas_gl.

It's all a ittle bit ugly but the previous solution with
dlsym(DEFAULT) didn't work.
2015-07-16 19:50:38 +09:00
Dongyeon Kim e4e67732c2 Evas GL: return correct context for context_get with indirect context
Summary:
When evas gl falls back to using indirect context,
evas_gl_current_context_get() should return the indirect context.
@fix
2015-06-03 11:30:22 +09:00
Dongyeon Kim 411bc27390 Evas GL: Share texture id in case EGL image is not supported
Summary:
When EGL image is not supported, Evas GL should share texture id
to the gl backend for indirect rendering to work.
2015-06-03 11:30:22 +09:00
Dongyeon Kim b0d2643f93 Evas GL: Add indirect surface fallback and yinvert callback
Summary:
When either FBO or EGL image from texture extension is not supported,
we can use pixmap surface as indirect surface fallback.
Since native pixmaps have (0,0) in the upper left while
FBOs have (0,0) in the lower left, we should invert the y coordinates
when native pixmaps are used as the render target.
To accomodate run-time y-invert check we add a new callback for
EVAS_NATIVE_SURFACE_EVASGL type.

Reviewers: cedric, jpeg

Subscribers: wonsik, mer.kim, cedric
2015-06-03 11:30:22 +09:00
Dongyeon Kim e789b24ff4 Evas GL: 1.x support for GLX
Summary:
Now we can support EVAS_GL_GLES_1_X version for GLX backend
with both direct and indirect rendering.
Refactored api get functions to have similar code path for each version.
@feature

Test Plan: Evas GL test case

Reviewers: cedric, jpeg

Subscribers: cedric, mer.kim, mythri, wonsik

Differential Revision: https://phab.enlightenment.org/D2342
2015-06-03 11:30:21 +09:00
Cedric BAIL 71b7fc982a evas: remove the need to order the header correctly for Windows. 2015-05-07 09:53:10 +02:00
Dongyeon Kim 61758b8281 Evas GL: use texture for native surface in glx backend
Summary:
EVAS_NATIVE_SURFACE_EVASGL uses egl image, but egl image is
not supported in glx backend, so use texture instead.

Test Plan: Local tests on pc

Reviewers: jpeg

Subscribers: cedric, mer.kim, mythri, wonsik

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

jpeg: fixed casts
2015-03-17 11:47:50 +09:00
Dongyeon Kim 1a2c6ba1e1 Evas GL: Fix build errors for glx backend
Summary:
Fix build errors for glx backend made from previous commit
Revert parameter naming

Test Plan: Local Evas GL tests for 1.1, 2.0, and 3.0

Reviewers: jpeg

Subscribers: mythri, wonsik, cedric, mer.kim

Differential Revision: https://phab.enlightenment.org/D2117
2015-03-16 15:56:49 +09:00
Dongyeon Kim d8fc60e0e6 Evas GL: Use EGL image to share between Evas GL and GL backend
Summary:
When the context version between Evas GL and GL backend differs,
we cannot share texture between them.
So, when the driver has support for KHR_gl_texture_2D_image extension,
use EGL image to share between Evas GL and GL backend

Test Plan: Local Evas GL tests for 1.1, 2.0 and 3.0

Reviewers: jpeg

Subscribers: mythri, mer.kim, wonsik, cedric

Differential Revision: https://phab.enlightenment.org/D2115
2015-03-16 15:56:49 +09:00
Jean-Philippe Andre bea9567d0e Evas GL: Kill runtime warnings caused by auto fallback
The previous commit modifies the concept of direct rendering
vs. indirect rendering, so some runtime checks (in debug mode
only) will fail.

This commit introduces two new engine functions:
 - gl_get_pixels_pre
 - gl_get_pixels_post

The latter will be used in a later patch for optimization.
2015-03-03 20:08:16 +09:00
Jean-Philippe Andre a14492ef73 Evas GL: Automatic fallback to indirect rendering when the scene has
not changed.

Automatically fallback to indirect rendering on FBO or X11 Pixmap
if the Evas Object Image is not marked as dirty. This should
improve the performance and/or power consumption in those
rare cases where this area of the canvas needs to be redrawn
but the GL content has not changed.

@feature
2015-03-03 18:11:32 +09:00
Jean-Philippe Andre 93d167ac87 Evas GL: Add hidden config values for direct rendering options
Those 2 new values are here to avoid using environment variables
that have side effects on the whole application.

I'm actually wondering if we shouldn't just kill off the env
vars altogether. Also, direct override is a terrible option that
should never be used.
Memory optimization can make sense (needs more testing tho).
2015-02-24 22:12:00 +09:00
Jean-Philippe Andre 4cf2d75715 Evas GL: Fix direct rendering with client-side rotation
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.
2014-12-10 10:52:22 +09:00
Jean-Philippe Andre 56a64756eb Evas GL: Introduce concept of safe extensions
This will mark some extension functions as "safe", which means
we don't need to wrap them in order to expose them.

All the known extensions from Evas_GL_API have been marked as safe
for now.

In the future, we may encounter extensions that are not safe
out of the box, but can be wrapped. At that time, we will have
to mark them as safe but return the pointer to the wrapper instead.
Until then, only whitelisted extensions will be supported.

@feature
2014-11-14 10:43:00 +09:00
Jean-Philippe Andre 4315537820 Evas GL: Add support for OpenGL-ES 1.1 (part 2)
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).
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre a0712e25e1 Evas GL: Add support for pbuffer surfaces
Supports only EGL for now :(

These pbuffer surfaces can be used to create dummy surfaces for
make_current and render threads.

@feature
2014-10-20 12:16:08 +09:00
Cedric BAIL 0d00b476cb evas: export symbol from gl_common so that loading gl_generic can expose them. 2014-07-11 15:32:51 +02:00
Sung W. Park 2b4a7b438d evas gl: added partial rendering support for qcom extension
When running in direct rendering mode, properly support partial
rendering if the extension is properly supported.

Also, fixed the SwapBufferwWithDamage rectangle coordinate bug.
It wasn't properly y-inverted before.
2014-02-15 02:33:47 +09:00
Sung W. Park 9bb4c48691 EvasGL: cleaning up unnecessary code.
Cleaning up unnecessary code.
2013-10-30 10:47:52 +09:00
Sung W. Park 7dc102c55f EvasGL: Fixed direct rendering not clipping issue
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.
2013-10-24 17:42:21 +09:00
Sung W. Park 8e6f0aa11c Evas: add partial rendering support for evasgl direct rendering
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.
2013-06-17 18:32:00 +09:00
Sung W. Park 316be3e6c7 Revert "Saving evasgl direct partial rendering fix temporarily"
This reverts commit e6359132de.
2013-06-17 18:22:15 +09:00
Sung W. Park e6359132de Saving evasgl direct partial rendering fix temporarily 2013-06-17 17:52:16 +09:00
Sung W. Park 289a666333 evas: Fixed evas_gl multi-window support design issue.
Evas engine is created per window but evas_gl engine was not properly
updating the engine info for new windows that are created. So, addressed
the design issue by passing engine_data to evas_gl engine apis..
2013-05-08 18:39:12 +09:00
Sung W. Park 64aa5a2670 evas: evas_gl - Got rid of resource pool in favor of creation on demand.
Resource contexts/surfaces are used for creating resources within Evas_GL.
In oder to handle Evas_GL runnig from different thread than the main one,
a resource context/surface pool was used. This turned out to be unnecssary
as they are not used very frequently.  So, I got rid of the pool and
made the resources create as needed.
2013-03-04 20:23:49 +09:00
Carsten Haitzler 683e5d7d08 Fix evas GL common engine to have a shader to do oversampling on
downscaling. This makes quality much better and "at best"
equates to a 16 point sample (2x2 linear interpolation samples,
where a linear interpolation sample equates to a 2x2 sample).
This will have perfomance impact, but the quality is worth it and
makes it closer to software downscaling in quality. It supports
2x2, 2x1 and 1x2 oversampling. YUV not done, nor image mask
(font shaders not needed).
2013-02-26 22:07:30 +09:00
Sung Park 995e0a6613 Fixed Evas GL direct rendering bug from refactoring. The conditions
weren't set properly where if a program uses evas_gl to do GL rendering
in direct rendering mode and then use a pixmap to do native 
GL rendering in the same program, native pixmap rendering would 
also fall into the direct rendering path and not render anything for 
image object. It's been fixed.


SVN revision: 79493
2012-11-21 04:59:52 +00:00
Vincent Torri c15e9c6575 merge: and now Evas
I've tested make -j 3 install and it works nicely

I've tested expedite with software and opengl xlib,
and it works. Not tested other engines, so please
report any problems (engines or other) on the ML.

TODO: examples and tests, I'll add them later

ISSUE: Eina_Unicode size check. It indirectly depends on
       eina_config.h, which is created at the end of the
       configure script. So its size is always 0. I don't
       know how that size is used, so I can't do a lot,
       for now.


SVN revision: 78895
2012-11-04 11:51:42 +00:00