Commit Graph

76 Commits

Author SHA1 Message Date
Jean-Philippe Andre c45ae022c8 Evas masking: Fix crash in async rendering
There was a FIXME comment... >_<

Improper management of image resources in async render led to
a rare crash. This should fix that.

@fix
2015-07-27 14:15:09 +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
Daniel Kolesa 48936722f9 gl_generic: fix unintended behavior (we want to assign the value we point to) 2015-07-15 16:13:39 +01:00
Carsten Haitzler ecc17e621e evas gl - dont crash if gl image internal im is null
new crash i saw today
2015-07-05 18:01:06 +09:00
Jean-Philippe Andre b5c9350805 Evas: Replace image_map_surface_free by common image_free
Those two functions were doing exactly the same thing[1], which
is free an image, so this commit only attempts to simplify the code
a little bit.

[1] Actually image_map_surface_free() might even not have worked
properly with cserve2 sw (calling unload instead of close).
2015-07-02 12:05:50 +09:00
Jean-Philippe Andre fd4e133cc1 Evas: Implement image_data_get for FBO images 2015-07-02 11:58:50 +09:00
Oleksandr Shcherbina d409df1caa evas: change interface evas_3d to evas_canvas3d
Summary:
Regard to https://phab.enlightenment.org/T2479 it is need for right generation
Eolian files

Reviewers: cedric

Subscribers: cedric, tasn

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-06-17 17:52:17 +02:00
Dongyeon Kim 291fcca181 evas/gl_x11, gl_cocoa: remove static variable in eng_font_draw
Summary:
When evas is recreated, this static variable value remains,
so it references already freed memory.

Test Plan: Local tests

Reviewers: cedric, jpeg

Reviewed By: jpeg

Subscribers: wonsik, mer.kim, cedric

Differential Revision: https://phab.enlightenment.org/D2678
2015-06-15 17:48:11 +09:00
Subhransu Mohanty aac9bee035 evas/engines : renamed ector native engine to "default" from "freetype" 2015-06-12 19:56:57 +09:00
Dongyeon Kim 3e39bf3638 Evas GL: support surfaceless make current
Summary:
Evas GL now supports surfaceless make current, where
evas_gl_make_current can be called with sfc parameter NULL.
This closely resembles EGL_KHR_surfaceless_context extension,
where applications that only want to render to client API targets
can make current to NULL surface instead of creating a dummy egl surface.
@feature
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
Jean-Philippe Andre 777f7f2047 Evas masking: Fix rare issue of invalid rendering (GL)
Thanks Dongyeon for finding out this solution. Now that was
one nasty bug :)

Somehow the currently bound texture id would not match what
Evas expected, so Evas would not call glBindTexture when
required. As a result it was drawing black (sampling from tex 0).

@fix
2015-06-03 11:03:29 +09:00
se.osadchy 684c51360f evas: fix color pick compatibility of Evas_3D with GLES.
Summary:
Use fourth component texture. Update mechanism generation pixels, scene renderer
to texture and geting color pixels from texture. Update shader for color pick.

Reviewers: Hermet, raster, cedric

Reviewed By: cedric

Subscribers: Oleksander, cedric

Differential Revision: https://phab.enlightenment.org/D2549
2015-05-27 00:31:07 +02:00
Jean-Philippe Andre 7a614c80f3 Evas filters: Fix glReadPixels usage for EGL
EGL might very well not support RGBA read mode, so we
need to check for it first.

Also remove some error logs (see previous commit), and useless
initialization of the Evas GL engine.

@fix
2015-05-13 10:45:13 +09:00
Subhransu Mohanty 1ce417eb8b evas/engine: Fix the ector drawing for gl backend 2015-05-09 20:00:01 +09:00
Oleksandr Shcherbina d88ccf06a5 evas: use Evas_GL_image for generate texture unit for Evas_3D_Texture.
Summary:
Used engine function for load image/data and use texture unit through
Evas_GL_Image object
Used Evas_ColorSpace format instead Evas_3D_Color/Pixel format
Added transformation matrix for adjusting texture unit coordinates in shader
Added property in Evas_3D_Texture for mark possibility get texture without atlas
(see https://phab.enlightenment.org/conpherence/54/, I suppose it will done
after this patch)

Reviewers: Hermet, cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-07 09:53:09 +02:00
Oleksandr Shcherbina 0f6d101ad5 evas: add to Evas_GL_Image flag disable generate atlas.
Summary:
It is need in case Evas_3D_Mesh created with not normileze texture coordinate
and flag repeat mode for Evas_3D_Texture
Additional info see here https://phab.enlightenment.org/conpherence/54/
Use Evas_GL_Image for generation texture unit for Evas_3D_Texture
see here https://phab.enlightenment.org/D2371

Reviewers: jpeg, cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-07 09:53:09 +02:00
Cedric BAIL 8a7b73ccbc evas: fix reference counting of Evas_GL_Image during orient_set. 2015-05-05 10:17:00 +02:00
Cedric BAIL 1b91101966 evas: fix usage of the same ressource in the GL backend with orient.
When we set orient we actually need to return a new image or it will confuse
evas a lot.
2015-04-25 10:15:13 +02:00
Jean-Philippe Andre 1ffe82fb7c Evas GL masking: Improve performance with scaled images
The GL scaled images is a fast path for masking where
the shader scales masks on the fly.
This optimization actually fixes some issues where the current
texture binding was incorrect.
2015-04-24 11:12:30 +09:00
kabeer khan ce45d443c1 evas: fix rotation and flipping of image in gl engine
Summary:
fix rotation(90, 180, 270) and flipping(vertical, horizontal, transpose,
transverse) of evas image in gl engine backend.

@fix

T2338

Signed-off-by: kabeer khan <kabeer.khan@samsung.com>

Reviewers: cedric, jpeg

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-04-22 15:10:19 +02:00
Jean-Philippe Andre 1804d460ee Evas: Fix memory leak
Fixes CID 1293000
2015-04-20 17:34:15 +09:00
Cedric BAIL c006f64f79 evas: more fix for include order in an attempt to fix Windows build. 2015-04-17 11:54:11 +02:00
Cedric BAIL 74d27d6a27 evas: split ector surface from gl generic backend in an attempt to fix windows build. 2015-04-14 21:40:32 +02:00
Jean-Philippe Andre 5e832dfa76 Evas GL: Disable direct rendering if there is a map
The engine itself (gl_generic) will detect whether the target
surface (canvas where to draw the gl stuff) is the window
backbuffer or not.
2015-04-14 21:19:13 +09:00
Jean-Philippe Andre c2f5d41f39 Evas GL generic: Fix log domain
The log domain EvasGL is used by evas_gl_common and initialized
only when an Evas GL surface is created.
2015-04-14 17:29:59 +09:00
Jean-Philippe Andre 78cd7336aa Evas GL masking: Skip fast path if colorspace is not supported
Masking in GL assumes only one texture to sample from. This means
RGB+Alpha and YUV types are not supported. While it would
make sense for RGB+Alpha, it doesn't make any sense for YUV (because
masks are alpha planes and YUV is opaque...)
2015-04-14 16:37:12 +09:00
Dongyeon Kim 3228c376ec Evas GL: remove direct surfaces hash
Summary:
Evas GL surface buffers are allocated at make current time now
rather than surface creation time, and since we pass evas gl surface handle
to the backend, we do not need direct surfaces hash anymore.

Test Plan: elementary test and evas gl test cases

Reviewers: cedric, jpeg

Reviewed By: jpeg

Subscribers: cedric, mythri, mer.kim, wonsik

Differential Revision: https://phab.enlightenment.org/D2320
2015-04-10 16:47:08 +09:00
Cedric BAIL 39f7ce192c ector: implement surface size property. 2015-04-03 16:34:24 +02:00
Subhransu Mohanty 7d0944bda5 evas: handle mul_col for ector drawing in gl backend.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-04-03 16:34:21 +02:00
Cedric BAIL de08a3bc04 ector: add reference point to define (0, 0) and don't repeat the same value everywhere. 2015-04-03 16:33:19 +02:00
Cedric BAIL f8cd006b2f evas: and now fix Evas GL backend to display Evas_Object_VG correctly. 2015-04-03 16:31:49 +02:00
Cedric BAIL fbc2261048 evas: fix creation of cairo context with GL backend. 2015-04-03 16:31:12 +02:00
Cedric BAIL 44d5a17485 evas: eina array macro don't work well on NULL array. 2015-04-03 16:30:50 +02:00
Cedric BAIL 23c34b96d3 evas: add theoric GL backend support. 2015-04-03 16:30:44 +02:00
Jean-Philippe Andre 740995e089 Evas GL generic: Simplify "scaled" images (used for masking)
Invert the meaning of scaled (w,h), so that im->(w,h) corresponds
to the final scaled size, and the original size is stored directly
in the texture itself.

This simplifies code a little bit.

Also, lift the limitation on the maximum texture size, as those
virtual textures are not limited by GPU texture size.
2015-04-01 09:59:49 +09:00
Jean-Philippe ANDRE 5bc4b89115 Revert "evas/gl_x11: Optimize out calls to make current"
This reverts commit 0585540bb3.

This broke Evas 3d examples. I also suspected some weird things and
wasn't 100% confident with this patch.

Closes T2215.
Thanks for the report.
2015-03-24 06:27:20 +09:00
Youngbok Shin e197f8804f evas: Support bitmap embedded color font.
Summary:
Add the code for getting bitmap buffers from embedded color font,
And draw the bitmap buffers as images.
For drawing the bitmap buffers as images,
evas_common_draw_context_font_ext_set internal API is changed to
pass additional gl engine functions.
T2139
@feature

Test Plan:
1. Set a bitmap embedded color font to textblock.
2. Set a unicode emoticon text.
3. See the result.

Please check the sample unicode in the following link.
http://www.fileformat.info/info/unicode/char/1f3af/index.htm
http://www.fileformat.info/info/unicode/char/1f555/index.htm
http://www.fileformat.info/info/unicode/char/2600/index.htm
http://www.fileformat.info/info/unicode/char/263a/index.htm

Reviewers: tasn, woohyun, jpeg, raster

Reviewed By: raster

Subscribers: herdsman, cedric

Differential Revision: https://phab.enlightenment.org/D2084
2015-03-19 19:02:03 +09:00
Minkyoung Kim 0585540bb3 evas/gl_x11: Optimize out calls to make current
Summary: Reducing the number of calling eglMakeCurrent.

Reviewers: jpeg

Subscribers: wonsik, cedric, spacegrapher

Differential Revision: https://phab.enlightenment.org/D2094
2015-03-17 11:47:35 +09:00
Dongyeon Kim 0ff8936de8 Evas GL: Adjust function naming and remove macros
Summary:
Change function and variable names to more suitable ones.
Remove FBO_FUNC macros.
Little tidying up from previous commit.

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

Reviewers: jpeg

Subscribers: cedric, mer.kim, mythri, wonsik

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

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
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
mythri.venugopal 4d1a45627f Evas GL: Add support for Evas GL 3.0
Summary:
This should enable applications to use GLES 3.0 through evas gl.
Todo: Fix indirect rendering issue occuring because texture objects
cannot be shared between different version of GLES contexts.
Todo: extension pointers need to be updated for GLES 3.0

Reviewers: wonsik, spacegrapher, jpeg

Subscribers: cedric

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

@feature
2015-03-16 15:56:43 +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
Dongyeon Kim 753b2b6e78 Evas GL: remove evgl_init in gl_get_pixels_set
Summary:
gl_get_pixels_set is called in evas_object_image_render
even when evas gl is not used.
As gl_get_pixels_set does not actually call evas gl functions,
we can safely remove evgl_init macro here.

Reviewers: raster, cedric, jpeg, Hermet

Subscribers: cedric, mer.kim, wonsik

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

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2015-03-02 16:29:22 +09:00
Dongyeon Kim a32edfaf19 evas/gl: implement dynamic hint set using tbm surface
Summary:
Currently dynamic hint set is implemented using eglMapImageSEC extension,
which is no longer supported by any drivers (should be deprecated)
This patch implements dynamic hint set using Khronos extension EGL_TIZEN_image_native_surface.
Since tbm surface library is required for this, libtbm.so is queried at context new.

Test Plan: Local tests

Reviewers: raster, Hermet, cedric, jpeg

Subscribers: mer.kim, wonsik, cedric

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

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>

jpeg: I also fixed a few minor style issues and two warnings (bad function
names, glsym instead of secsym).
2015-03-02 15:55:47 +09:00
Jean-Philippe Andre 2e3ee0e658 Evas masking: Fix double free() with scaled images
The function image_scaled_update() frees() the old scaled image
passed as input if it doesn't match the old dimensions. This commit
will avoid double frees.
2015-02-27 17:56:49 +09:00
Jean-Philippe Andre fddaf62fcc Evas masking: Add fast path for image-only masks in GL.
This will currently optimize most of the masks when using the
GL engine[1].

This is a very special case that adds a highly optimized path
for masking in GL. It works by creating a virtual image, containing
a pointer to the original image and a new geometry[2].

Instead of creating a new FBO-based surface (image_map_surface),
we refer to the original image and adjust the mask geometry on
the fly.

KNOWN BUGS:
- masking a map with such a scaled image is now broken.

[1] Right now all masks are simple Evas Object Image, so that means
    all cases of masking, except masks of masks, or masks of maps,
    will be optimized with this new method.

[2] This virtual image mechanism is still quite hackish and may
    be improved (for memory usage, refcounting, etc...)
2015-02-27 13:06:09 +09:00