Commit Graph

88 Commits

Author SHA1 Message Date
Srivardhan Hebbar 63ded24f98 evas: handling realloc failure in gl_generic.
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-31 02:12:06 +01:00
Jean-Philippe Andre e586b9debc Evas: Fix error message on stride_get with ETC & S3TC 2015-10-29 17:58:34 +09:00
Mike Blumenkrantz 250b09abc5 evas gl: init evgl during eng_gl_get_pixels_pre()
when the first render is an image without a native surface,
evgl_init() will not be called before this point, resulting in an abort()
2015-10-26 13:52:27 -04:00
Jean-Philippe Andre a8243ed382 Evas: Add engine function image_ref
This is to simplify and fix filters. This is an internal function.
2015-10-12 13:44:44 +09:00
Carsten Haitzler 601273522e evas gl engines - remove TIMDBG code that is unused entirely 2015-09-23 14:03:33 +09:00
Subhransu Mohanty 291c3e32af evas: create ector surface per engine instance.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-09-21 22:50:34 +02:00
Dongyeon Kim b11d9b33d9 evas/gl_generic: set draw context in ector_renderer_draw
Change-Id: Ifeedd48bc87d5c8ac353b8bee199604b482b4da0
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-09-21 22:50:33 +02:00
Stefan Schmidt 7c36761e62 evas: gl_generic: fix leak if we return dst and not newdst
In case we still retrun dst we should make sure we free up the newly
allocated newdst.

CID: 1323090
2015-09-07 13:41:47 +02:00
Jean-Philippe Andre 69cbbc2184 evas: Add internal context_dup function
This will simplify some code related to clipping and masking.
2015-09-04 11:11:39 +09:00
Jean-Philippe Andre d69f9e0b84 Evas masking: Fix potential invalid access to mask image
After clip_image_get, the old mask may be replaced by a new one,
and unref'ed, but it is later on set back as the context mask image.
Maybe it's possible that there was 0 reference and the image
got freed in between.

No idea how to test this.

@fix
2015-09-04 11:11:39 +09:00
Jean-Philippe Andre b6abbf1277 Evas masking: Make sure to check alloc before freeing old image
Okay, I'm being paranoid and this can't possibly happen (calloc
fail? yeaaaah) but this makes sure we don't return NULL after
freeing the original image.
2015-09-04 11:11:39 +09:00
Dongyeon Kim bea42e6a00 Evas GL: Restore current context to evas gl context when the backend has taken over
Summary:
When Evas GL apis are called outside of on pixels callback,
evas gl backend context may have been made current, and Evas GL will
render into a wrong context.
So here we provide context restore mechanism of keeping track of
currently bound context and calling make current when needed.
@feature

Test Plan: Run Evas GL test cases

Reviewers: jpeg, cedric

Subscribers: mythri, mer.kim, wonsik, cedric

Differential Revision: https://phab.enlightenment.org/D2956
2015-08-18 18:31:40 +09:00
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