Commit Graph

1616 Commits

Author SHA1 Message Date
Vincent Torri 3b44645363 efl: add binary mode to f(re)open() calls
This allows better compatibility with Windows

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-05 21:04:36 +01:00
Jean-Philippe Andre c09199f0e0 Ector: use uint32_t instead of uint
This fixes the build for Windows. Thanks @vtorri for the report.

I'm not using "unsigned int" as uint was mostly used like DATA32,
ie. color data (one pixel color or a pixel buffer).
2015-12-03 20:28:27 +09:00
Jean-Philippe Andre 4bcea3eada Ector: Move cairo surface back to ector
The original plan was to have two different surfaces for GL and SW,
but this is probably not going to happen anytime soon. So, move
the implementation back to lib/ector. This avoid a file duplication.
2015-12-03 18:42:50 +09:00
Jean-Philippe Andre 52ec3d2d7e Ector: Rename C files to match their EO counterparts 2015-12-03 18:42:50 +09:00
Jean-Philippe Andre 615b2442b7 Ector: Move drawhelper to static_libs
Rename a few things:
 - draw helper -> efl_draw
 - Ector_Rop -> Efl.Gfx.Render_Op
 - ECTOR_ bla bla -> DRAW_ bla bla (base pixel ops)
 - ector_memfill -> draw_memset32 (and invert arg order to match memset)

The main rasterizer file is now draw.h in static_libs/draw
This is a non functional change, simple code refactor.
2015-12-03 18:42:50 +09:00
Jean-Philippe Andre bad7911cd0 Ector: Use Ector Buffer inside SW and Cairo renderers
Ector Surface now inherits from Ector Buffer, and the current
two renderers (SW and Cairo SW) use Ector.Software.Buffer
implementations for pixel surfaces.

Basic pixel handling is merged and will allow easy extension
(color conversion, etc...).

Buffer classes are Mixins to be fully implemented by the final
class, such as: Ector.Software.Buffer, Ector.Software.Surface
or Ector.Cairo.Surface.

This is a large ugly commit. Sorry.
The code is quite a mess right now.
2015-12-03 18:42:50 +09:00
Jaeun Choi 6768c38de4 evas: rewrite gl image transformation logic in a very simple way
all we need to do for image transformation such as rotation or flipping in gl
is to map the vertices of source image to destination in a changed order.
this commit not only enhances readability but also fixes bugs in rotation.

@fix
2015-12-03 16:28:09 +09:00
Oleksandr Shcherbina e82baf2703 evas: set visible texcolorpick texture in 3D shaders
Summary:
Add uniform varialble uColorTexture. Generate sampler count for textcolorpick
and pass to renderer for bind additional texture unit to gl.
It can be used for different 3D effects - blur, wave distortion, heat haze, etc.
T2761

Reviewers: Hermet, raster, cedric

Reviewed By: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-02 14:47:31 -08:00
Amitesh Singh cb227cb5fb evas_gl_shader: refractor shader/program compile check code.
Summary:
    Call respective shader/program functions on shader/program target only.

Reviewers: cedric, raster, wonsik, spacegrapher, jpeg

Reviewed By: jpeg

Subscribers: alok25, sachin.dev, cedric, seoz

Differential Revision: https://phab.enlightenment.org/D3388
2015-12-02 16:54:25 +09:00
perepelits.m 32c33ed64d evas: refactor model's savers and loaders.
Summary:
Move common part to a separated document.
Make code more readable using smaller functions. (from Task T2713)

Reviewers: cedric, raster, Hermet

Subscribers: artem.popov

Differential Revision: https://phab.enlightenment.org/D3373
2015-12-01 16:39:29 -08:00
Jean Guyomarc'h 905d3c710a evas_gl_cocoa: make sure focus is always unlocked after locking it
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 12:15:32 -08:00
Stefan Schmidt bc5c239d2d evas software_x11: 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:36 +01: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
Cedric BAIL 49b8d0e852 evas: avoid double eet_close call while caching GL shader. 2015-11-24 14:33:20 -08:00
Deepjyoti Dutta 2a4877a597 Evas 3d: Initialized local variables
Summary:
The OpenGL functions  assigns a value to the local variable. However,
in case of error it would take the uninitialized garbage value. So, the
correct solution would be to initialize it to 0.

Signed-off-by: Deepjyoti Dutta <deepjyoti.d@samsung.com>

Reviewers: Hermet, singh.amitesh, raster, jpeg

Reviewed By: jpeg

Subscribers: yashu21985, mvsovani, alok25, sachin.dev, cedric

Differential Revision: https://phab.enlightenment.org/D3375
2015-11-24 17:05:20 +09:00
Srivardhan Hebbar ecb40c64b5 evas_fb: Handling memory leak on realloc failure.
Summary:
I thought its better to fail and return null if realloc fails than to
continue. So returning by closing all openend file.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric, illogict

Differential Revision: https://phab.enlightenment.org/D3232
2015-11-23 20:44:28 +09:00
Jean-Philippe Andre 51a65c970f Evas 3d: Remove left over debug message from recent commit 2015-11-23 19:44:04 +09:00
perepelits.m bcf38c5817 evas: fix PLY loader and saver.
Summary:
Use less memory by indexation vertices and not keeping more than one copy of it (from task T2713).

[Fix]

Reviewers: cedric, raster, Hermet

Subscribers: artem.popov

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-23 08:28:27 +01:00
Cedric BAIL 412191e5f8 ector: improve uploading of GL texture for vector graphism
This rely on a faster code path to upload dynamic texture. Once we get support
for gbm, we should see significant performance improvement in speed, but this
first step is already a 5 times improvement (Ok, we get from really bad, to not
really useful...).
2015-11-19 14:52:10 +01:00
sunghyun kim c418910948 Evas GL: XFreeColormap when window free
When gl window is created, XCreateColormap is called in eng_best_visual_get
but when gl window is freed, Colormap is not freed.

See original patch: D3342.
2015-11-18 11:40:39 +09:00
Chris Michael 9a542d0dcc evas-gl_drm: Remove set but unused variable
Variable 'osurface' is not actually being used inside the code here,
so remove it.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-17 16:07:14 -05:00
Chris Michael e29da3ca69 evas-software-x11: Fix resource leak
If we end up leaving evas_xlib_image_dri_native_set due to a failure
to allocate memory, we should free the previously allocated
Evas_DRI_Image so that we don't leak

NB: Fixes Coverity CID1339782

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-17 10:02:03 -05:00
Chris Michael 59ffefb9c1 evas-software-x11: Fix returning NULL pointer
evas_xlib_image_dri_native_set should be returning a pointer to an
RGBA_Image on success, or NULL on failure. Returning EINA_FALSE here
leads to an expression which evaluates to zero being treated as a null
pointer constant

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-17 09:07:45 -05:00
Chris Michael 2f0349f697 evas-software-x11: Fix formatting
NB: No functional changes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-17 09:06:51 -05:00
Chris Michael a043f8d04d evas-gl: Remove extra parentheses
clang warns of equality comparison with extraneous parentheses in
these cases. Remove the extra parens as they are not needed anyway

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-17 09:03:53 -05:00
Jean-Philippe Andre e11bdbafa2 Evas GL: Remove invalid call inside make current pbuffer
There was some confusion as color_buf is a texture but it was used
as an fbo. Not sure was this call was for.

@fix
2015-11-17 18:04:43 +09:00
Jean-Philippe Andre 12292183d0 Evas GL: Ignore compilation warning
Desktop OpenGL doesn't care about the version here (GLES 2 or 3)
2015-11-17 18:04:43 +09:00
Jean-Philippe Andre f7aa6b33b0 Evas GL: Fix BadMatch with pbuffer make current
This is the kind of horrible things you'll encounter when working
with GL. The surface and context need to have matching configuration
otherwise make current will fail, and the only way to get a matching
config is to reuse the config selected to create the context. Gah.

This is the same fix as for EGL. More a hack than a fix, to be honest.

@fix
2015-11-17 18:04:43 +09:00
Jean-Philippe Andre cc4b54ec0a Evas GL: Fix failing make check test case
The version field was not properly set for GLES 1 and 3 (but not tested),
double free() could happen on the API structs, and empty API structs
could be returned.
2015-11-16 19:44:20 +09:00
Stefan Schmidt 85f6b49044 evas buffer engine: use Eina_Bool for one-bit bitfield
Make sure we are using a unsigned var here. Best go with a Eina_Bool directly.
Fix the indent where needed as well.
2015-11-13 13:31:34 +01:00
Stefan Schmidt 6939963e76 gif loader: use Eina_Bool for one-bit bitfield
Make sure we are using a unsigned var here. Best go with a Eina_Bool directly.
2015-11-13 13:00:04 +01:00
Dongyeon Kim 8c2f9a2669 evas/gl_generic: Check for errors when calling tbm surface map/unmap
tbm_surface_map/unmap might fail and return error, so we need to check
the return value of these APIs.
2015-11-12 17:32:55 +09:00
Dongyeon Kim 7db0e20661 evas/gl: Bind texture with external target for tbm surface
egl images created using tbm surface for native surface set use
GL_TEXTURE_EXTERNAL_OES as texture target, so we should bind to
this target when rendering.
Dynamic hint set using tbm surface also creates egl images, but
as we only use RGB* colorspace for this we can use GL_TEXTURE_2D.
So, keep track of texture target in shader array, and bind to the
appropriate one.
This also fixes the bug that image_data_get only worked when BOTH
sec_image_map and sec_tbm_surface extensions are supported.
2015-11-12 13:56:17 +09:00
Dongyeon Kim 16eb3942bb evas/gl: Do not check for egl errors with glEGLImageTargetTexture2DOES
Summary:
glEGLImageTargetTexture2DOES is a GL extension API, so we need to use
glGetError instead of eglGetError!
2015-11-12 10:03:10 +09:00
Dongyeon Kim 74e556febc evas/gl_common: Enable dynamic hint set using tbm surface only when egl extension is supported
Summary:
Dynamic hint set using tbm surface can only be used when EGL_TIZEN_image_native_surface
extension is supported by the driver. So check for both tbm surface and egl extension.
2015-11-12 08:56:29 +09:00
Dongyeon Kim 3d97c4c5a8 Revert "Evas GL: Fix crash with dynamic hint set using tbm surface"
Upcoming patch will fix this crash issue in a more proper way, so I revert this patch here.

This reverts commit 8b1b8d5cf0.
2015-11-12 08:56:29 +09: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
Joogab Yun 8b1b8d5cf0 Evas GL: Fix crash with dynamic hint set using tbm surface
Summary:
if device support sec_tbm_surface, but doesn't support the EGL_NATIVE_SURFACE_TIZEN
then below api called cause crash!
evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
evas_object_image_alpha_set(o, 0);

1. evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);

 [evas_gl_image.c]
        if (im->im)
          {
             if (evas_cache2_image_cached(&im->im->cache_entry))
               evas_cache2_image_close(&im->im->cache_entry);
             else
               evas_cache_image_drop(&im->im->cache_entry);
             im->im = NULL;  // im->im now NULL!!!
          }

        im->tex = evas_gl_common_texture_dynamic_new(im->gc, im); // im->tex also NULL!!

im->text also NULL!! because If driver does not support the EGL_NATIVE_SURFACE_TIZEN
then below code return NULL at _pool_tex_dynamic_new();

  pt->dyn.img = secsym_eglCreateImage(egldisplay,
                                      EGL_NO_CONTEXT,
                                      EGL_NATIVE_SURFACE_TIZEN,
                                      pt->dyn.buffer, attr);

2. evas_object_image_alpha_set(o, 0);

 [gl_generic/evas_engine.c]
static void * eng_image_alpha_set()
{
  now im->im and im->tex are null so crash happend at eng_image_alpha_set()
}

bug fixed in case of the tbm surface create fails so device cannot support the dynamic hit set,

Test Plan: experdite

Reviewers: jpeg, cedric, spacegrapher

Subscribers: dkdk, scholb.kim, wonsik

Differential Revision: https://phab.enlightenment.org/D3318
2015-11-11 14:38:07 +09:00
Joogab Yun 8f52b2d877 Evas software_x11: add DRI2-x11 support at image_native_set()
Summary: add DRI2-x11 feature at image_native_set() on Software-x11

This is based on TBM, which means Tizen platform.

Reviewers: spacegrapher, wonsik, raster, jpeg

Subscribers: scholb.kim, dkdk, cedric

Differential Revision: https://phab.enlightenment.org/D3291
2015-11-11 14:37:28 +09:00
Wonsik Jung 84cb06784e Evas sw_generic/x11: Fix calls to native_bind_cb/unbind_cb
Summary:
In Evas-SW-Generic/X11, native_unbind_cb is not called sometimes, although
native_bind_cb was called.
Some native surface's cases, both native_bind_cb and native_unbind_cb should
be called for mapping and unmapping, eg. with tbm_surface.

@fix

Test Plan:
Evas Native Surface with pixmap sample.
Evas Native Surface with tbm(this sample can work in Tize Device)
elementary_test

Reviewers: raster, jpeg, cedric, spacegrapher

Subscribers: JoogabYun, scholb.kim, dkdk

Differential Revision: https://phab.enlightenment.org/D3317
2015-11-11 14:36:20 +09:00
Wonsik Jung 64890d260f EvasGL: Add error handling for GL_OES_EGL_image/EGL_Image_KHR
Summary:
Add code for exception case for GL_OES_EGL_image/EGL_Image_KHR
These EvasGL's extension functions does not have the code for exception case.
e.g. EvasGLImage is NULL.

Test Plan: Native Pixmap surface's example is created and changed EvasGLImage's value(e.g. valid data or NULL)

Reviewers: raster, spacegrapher, jpeg

Subscribers: scholb.kim, JoogabYun, dkdk, cedric

Differential Revision: https://phab.enlightenment.org/D3284
2015-11-11 14:35:56 +09:00
DaeKwang Ryu 5ccd783069 Evas GL: implement GLES2/GLES3 wrapper functions
Summary:
I found some bugs in EvasGL with OpenGL ES conformance test.

6 wrapper functions are added for GLES2,
(glDeleteFramebuffers, glFramebufferRenderbuffer
glFramebufferTexture2D, glGetError
glGetFloatv, glGetFramebufferAttachmentParameteriv)

3 wrapper fucntions are added for GLES3.
(glDrawbuffers, glGetStringi, glReadBuffer)

Test Plan:
GLES3 sample app,
EvasGL(OpenGL ES CTS) for 2.0 is passed.
For 3.0, 10 TCs are failed (Total : 2994TCs).

Reviewers: wonsik, spacegrapher, jpeg

Subscribers: cedric, JoogabYun, scholb.kim

Maniphest Tasks: T2621

Differential Revision: https://phab.enlightenment.org/D3301
2015-11-11 14:35:50 +09:00
Oleksandr Shcherbina 13b1756394 evas: add possibility to render current 3D scene to texture in Evas.Canvas3d
Summary:
Refactoring code of functions e3d_drawable_scene_render,
e3d_drawable_scene_render_to_texture,_shadowmap_render to have possibility
render in scene to additional texture
See T2761

Reviewers: Hermet, cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-10 15:10:13 -08:00
Joogab Yun c20457e33d evas: fix error checking of eglBindAPI.
Summary:
if eglGetError sequencially called, second eglGetError() doesn't give
the information of real Error.

Reviewers: jpeg, spacegrapher, cedric

Reviewed By: cedric

Subscribers: wonsik, scholb.kim, cedric, dkdk

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-10 14:43:02 -08:00
Jean-Philippe Andre 9f7fc377ea Evas GL: Fix oopsie in the shaders selection
Thanks @raster
2015-11-10 20:08:36 +09:00
Jean-Philippe Andre 7974f674aa Evas: Allow edje_decc to work with ETC images
This reuses the internal function data_get, data_put, image_save
respecting the border information and adding support for ETC
formats.

@fix
2015-11-10 16:12:21 +09:00
Jean-Philippe Andre 64de2f6ce5 Evas: Add some internal engine APIs
- image_file_colorspace_get
   This will be used to determine the best loading format, especially
   targeted at edje_cc / edje_decc so we can avoid ETC re-encoding.

- image_data_has
   Checks whether the image is currently loaded in (CPU) memory,
   and also returns the current colorspace.
2015-11-10 16:12:21 +09:00
Jean-Philippe Andre c55c7c0a0d Evas GL: Optimize out calls to eglGetCurrent from the main loop
This is an optimization for EGL only and for the main loop only.

eglGetCurrent{Display,Context,Surface} are expensive calls (they
shouldn't be, but they are). eglMakeCurrent is also very expensive,
so we want as much as possible to avoid calling those functions.
Store the pointers for the main loop as static variables.

Valgrind stats for a quick scrolling session in elm_test:

Before this patch:
 - eglGetCurrentContext ~ 0.4%
 - eglGetCurrentDisplay ~ 0.4%

After this patch:
 - evas_eglGetCurrentContext ~ 0.02%
 - evas_eglGetCurrentDisplay ~ 0.02%
2015-11-10 16:12:21 +09:00
Jean-Philippe Andre c70ba9e13b Evas GL: Save all binary shaders during idle_flush 2015-11-10 16:12:21 +09:00
Jean-Philippe Andre 0ba13ae7a2 Evas GL: Precompile common shaders
The whole list contains 238 shaders. That's a bit too many, but they
really just take up only ~270K on disk (24Mb of uncompressed data).
2015-11-10 16:12:21 +09:00
Jean-Philippe Andre 31b8fd1649 Evas GL: Delete shaders after linking programs
The shaders eat up some memory and we don't need them after linking
the shader program.
2015-11-10 16:12:21 +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 c22c25c9ef Evas GL: Release shader compiler during evas_render_idle_flush
It is safe to release the compiler at any time since the next
call to glCompileShader will restore it. This may even be a no-op
for all we know (this is driver-dependent).
2015-11-10 16:12:20 +09:00
Jean-Philippe Andre 38ad8fda8d Evas GL: Implement runtime generation and load of shaders
Instead of generating the shaders at compile-time, do this at
runtime. Also load only the required shaders in memory.

This saves 25000 LOC, lots of strings inside the .so files
and save a non negligible amount of memory since those shader
binaries can weigh a few megabytes in total.

The current shader selection mechanism is a bit complex and
uses eina_hash_int32 but this can be optimized later if it's
deemed too slow.
2015-11-10 16:12:20 +09:00
Oleksandr Shcherbina 35d942829a evas: fix inverted texture coordinate in Evas.Canvas3d.
Summary: Fix T2820

Reviewers: cedric, raster, Hermet

Maniphest Tasks: T2820

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 16:26:59 -08:00
Srivardhan Hebbar 04260b446b evas: preventing unlikely memory leak.
Summary:
Returning from default would result in memory leak of f. Now the memory
is not leaked.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 16:09:18 -08:00
Srivardhan Hebbar 445f56741c evas: preventing possible NULL dereference in evas xcb backend.
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 16:08:01 -08:00
Oleksandr Shcherbina 3af65dd4e2 evas: unification of color pick mechanism.
Summary:
Use same way using color pick under GLES and not:
 Use GL_RGBA texture insted of GL_RED
 Generate and pass to engine 3 components color of mesh
See T2761

Reviewers: cedric, Hermet

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 15:27:26 -08:00
se.osadchy 3d77f55f91 evas: refactor duplicated data structure with eina_matrix.
Summary: Move data structure and functionality to eina_matrix from evas_mat.

Reviewers: raster, Hermet, cedric

Subscribers: Oleksander, cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 15:27:26 -08:00
Nicolas Aguirre aab530e347 ecore_cocoa/evas_gl_cocoa: fix indent, remove printf, and add DBG messages
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 10:42:34 -08:00
Mike Blumenkrantz 6b1af3c55a evas gl-x11: add missing EVAS_NATIVE_SURFACE_WL support
copy/pasted from other engines, only functional with gles+wayland,
A Thoroughly Tested Calculated Risk™

ref 1dbecbb676
2015-11-04 14:14:16 -05:00
Chris Michael 962059dd0a evas-gl-drm: Implement eglSetDamageRegionKHR
Summary: In efforts to reduce tearing in the gl_drm engine, implement
support for eglSetDamageRegionKHR to mark parts of a surface as being
damaged.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-04 11:20:39 -05:00
Chris Michael b2785f01c5 evas-gl-drm: Find symlink for eglSetDamageRegionKHR
In efforts to reduce tearing in the gl_drm engine, find and link to
the eglSetDamageRegionKHR function so we can mark damaged regions of a
surface

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-04 11:18:25 -05:00
Chris Michael f55d0a3d07 evas-gl-drm: Set Outbuf vsync according to engine
The engine setup code already checks if we are disabling vsync
(defaults to on), so we should be setting the Outbuf vsync according
to what the engine info has

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-04 09:24:18 -05:00
Jean-Philippe Andre a2b64d9772 Evas: minor whitespace and debug changes 2015-11-04 15:15:05 +09:00
Mike Blumenkrantz 99d0f03c6f evas gl_drm: don't deref null ptr on output free 2015-11-02 16:21:56 -05:00
Chris Michael 2469106831 evas-wayland-egl: Add missing include header for gl_common
@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-02 16:15:21 -05:00
Chris Michael 1dbecbb676 evas-wayland-egl: Fix missing support for EVAS_NATIVE_SURFACE_WL
Summary: Support for using EVAS_NATIVE_SURFACE_WL was missing/incomplete in the
wayland_egl engine. This commit addresses that issue so that now the
wayland_egl engine can support both EVAS_NATIVE_SURFACE_OPENGL and
EVAS_NATIVE_SURFACE_WL.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-02 16:08:27 -05:00
Chris Michael 0c9011d9e0 evas-gl-drm: Fix issue of gl_drm engine not working
Summary: With linux kernels >= 4.2.x, the gl_drm engine was not
functional. This is due to the egl config returning an improper config
which did not match the expected pixel format. This commit fixes that
issue and gl_drm evas engine works again. Should fix ticket T2807

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-02 09:30:30 -05:00
Srivardhan Hebbar 78c723b2ed evas: removing redundant if case in gl_cocoa backend.
Summary:
According to my understanding of this function, this check of im_old is
redundant, as im_old will never be NULL. For im_old to be NULL, image should be
NULL. But that is checked at line 637. im is assigned image and im is checked for NULL. At line 654 im_old is assigned image and it is not modified till line 673. So this check would always return true and enter if case and would never
enter else case. So removing the redundant code.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

Reviewed By: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-31 02:36:17 +01:00
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
Srivardhan Hebbar 5964a44826 evas: removing redundant assignment in gl_drm.
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-31 02:12:06 +01:00
Srivardhan Hebbar 4c8ccc211c evas: removing redundant assigment in gl_common.
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-31 02:12:06 +01:00
Srivardhan Hebbar b9d8426eb7 evas: removing redundant check in gl_x11 backend.
Summary:
Checking for NULL is redundant here, because if cfgs was NULL, then at
line 760 it would fail.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-31 02:12:06 +01:00
Chris Michael b1bbe1f47c evas-gl-drm: Resize gbm surface when canvas size changes
Summary: When we are told to resize the canvas, we should also be
resizing the gbm_surface. This should fix the issue of wl_drm module
in E not working when the canvas gets resized (WFM now)

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-10-30 14:49:01 -04:00
Chris Michael 5746f792af evas-gl-drm: Move definition of Render_Engine out to header
@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-10-30 14:47:20 -04:00
Jean-Philippe Andre 509ee0f275 Evas: Disable TGV save debugging and fix error log
Disable time stats & quality check
Remove an invalid error message (was logged in case of success)
2015-10-29 21:18:32 +09:00
Jean-Philippe Andre cc5cccc511 Eet: fix decoding of embedded ETC images
Typos, lack of NULL check, excessive sizeof(type) not matching
the object type, no border set, etc... This all lead to a crash
and then no render (with an error message and then without...).

This also simplifies the implicit loading of ETC1 as ETC2 when
supported by the driver.

@fix
2015-10-29 17:58:34 +09: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
Carsten Haitzler c3a866837c evas gl - rect draws didnt obey cutout max like font and img - fix
this fixes cutout handling consistency for gl common
2015-10-24 10:31:28 +09:00
Carsten Haitzler de33ab24c5 evas - software render async - fix async render to actually be all async
so the evas thread renderer didnt START rendering until evas FINISHEd
walking all objects generating a render queue. this means all the cpu
time spend generating commands couldn't allow a parallel thread
actually go and DO the rendering.

this flushes the render thread every render command thus waking up the
render thread to work in parallel to the mainloop generating commands.
this actually means int he traces i see the render thread finished byt
he time evas_render completes thus brinign forward the frame display
by quite a bit.

thanks to evlog for pointing this out.

@fix
2015-10-22 15:18:16 +09:00
Jean-Philippe Andre 4a830877f0 Evas GL shaders: Simplify a bit the shaders code
Following raster's change, the Program_Source struct is useless.
This is a big commit, again, but really all is auto-generated.
2015-10-19 20:27:22 +09:00
Carsten Haitzler 2eaf33d9cf evas gl common - remove unused struct fields from shader src to save mem
we use a bit more memory than we need by having unused fields for
shaders. the old binary data ptrs and size fields we just have not
used for years now as we dont compile in shader binaries anymore as no
living drivers need this anymore. so this removes that with no actual
side-effects.
2015-10-19 17:06:06 +09:00
Carsten Haitzler 548addbb02 evas gl - fix big endian fully by adding a host of new img shaders
no shortcuts. we used the same img sharder for pixles as for native
surf. so need new shaders to do the swiszzling. add them all,
generation scripts metadata and enums etc.

@fix (along with previous 3 commits)
2015-10-18 18:45:11 +09:00
Carsten Haitzler b70f02a652 evas bigendian fix - only fix img shaders as only these src pixels 2015-10-18 15:49:23 +09:00
Carsten Haitzler 7b568a6152 evas gl fix color on bigendian with gl engine
this fixes rendering on ppc (bigendian) where we have thnigs swizzled
oddly. not bgra -> argb but rgba -> grab ...

so generate a bigendian shader file and use if on bigendian.

this should fix T2721

it fixes it in the visual screenshots i can get remotely.
2015-10-18 12:49:11 +09:00
Jean-Philippe Andre 561481f6ad Evas GL: SW engine CID fixes
Following previous changes, there was unreachable code.
- CID 1327421
- CID 1327420
2015-10-16 10:49:34 +09:00
Jean-Philippe Andre c927f6e4ea Evas: Fix image orientation with GL engine
Fixes T2738

Not sure what to do if yinvert is true. How to handle image
orientation then? Flip vertically on top of the current orientation?
2015-10-16 10:49:34 +09:00
Jean-Philippe Andre e09a4094be Evas GL: Add EGL_KHR_surfaceless_context since it is supported
See 3e39bf3638.
Surfaceless contexts are supported even if the driver does not
support them.
2015-10-15 16:20:53 +09:00
Jean-Philippe Andre 9c69d4c1e1 Evas GL: Error out on surfaceless make_current with OSMesa
While OSMesa may support surfaceless contexts, we don't support
them yet in the SW engine. Instead of switching to NULL, NULL,
let's error out and do nothing instead.
2015-10-15 16:20:53 +09:00
Jean-Philippe Andre 079436d4f1 Evas GL: Don't call eglMakeCurrent if already null
If the current context & surface are already null, avoid
calling eglMakeCurrent again, since it can return an error
(EGL_FALSE but with no error code, thanks Nvidia).
2015-10-15 16:20:53 +09:00
Jean-Philippe Andre 425265ca6d Evas GL: Fix support for the SW engines (OSMesa)
Since @raster changed the behaviour of the dirty flag on images,
damages must be added to redraw the GL surface. Evas_Image checks
if it is an Evas GL surface by looking at its native surface.
But in case of SW engine, there was no native surface information
for Evas GL surfaces. Also, the OPENGL surface type was awfully
abused for OSMesa support. Luckily EVASGL surface type lets us
pass arbitrary pointers :)
2015-10-14 20:14:51 +09:00
Jean-Philippe Andre 045f774c27 Evas GL: Improve ERR log (direct rendering failed) 2015-10-14 20:14:51 +09:00
Jean-Philippe Andre a23fcb8b71 Evas GL: Implement glGetString wrapper for OSMesa
This is only one step into making the software engine actually
work the same as a proper GL engine from Evas GL APIs point of view.

This is necessary for the test suite (coming next).
2015-10-14 19:46:47 +09:00
Jean-Philippe Andre ec7111938c Evas GL: Minor changes inside glGetString 2015-10-14 19:46:47 +09:00
Jean-Philippe Andre 86d1b190c2 Evas GL: Avoid make_current(0,0) during destroy
Show an error message and call make_current(NULL, NULL) only if
the object (context, surface) being destroyed is current.

Otherwise, avoid changing the current context & surface.
2015-10-14 19:46:47 +09:00
Marcel Hollerbach a1be855fe4 gl_x11: val can be everything expected 0 to mean true
For me on a intel driver val is -1 and it needs to be inverted.
So we need to checkout that val is not 0 and not equals to 1.

Thx to raster for helping debugging this thing :).
2015-10-14 11:14:02 +02:00
Carsten Haitzler ef59dc702c evas gl engine - typo remove from previous commit
some typo crept in that... compiled. a stya / on a line. how it
compiled, i don't know.
2015-10-14 15:17:06 +09:00
Carsten Haitzler 620dc45af9 evas - obj destructrion - handle when obj layer is partly destroyed
this should fix T2715 and anything similar as during destruction
object internals are a bit weird.
2015-10-14 14:50:54 +09:00
Jean-Philippe Andre 7b266b5518 Evas render: Fix proxy source_clip logic inversion
As spotted by @FurryMyad I inverted the logic for source_clip.
This should restore the proper behaviour while keeping my previous
fixes working. See D2940.
2015-10-14 11:14:36 +09:00
Nicolas Aguirre d363b88b1c evas: fix build of gl_cocoa engine.
__context_restore and __need_context_restore are undefined when
building gl_cocoa engine.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-13 15:40:01 -07:00
Cedric BAIL 0d6c53268d evas: follow API documentation more closely. 2015-10-13 11:45:52 -07:00
Carsten Haitzler 23f5a5092c Revert "Revert "Revert "evas: fix borked rotation support in GL engine."""
This reverts commit f51168f4ec.

if this is right or not... this RESULTS in enlightenment becoming
totally unusable. put this back WHEN other issues are fixed you think
that exist. last i knew we query yinvert start with glx per native
surface and use that info - so as best i know it is and has been right
for a long time.

:)
2015-10-13 19:43:18 +09:00
Amitesh Singh 16819d37d2 evas: fix compilation error
This is introduced in 5c02935a86
2015-10-13 09:01:47 +05:30
Cedric BAIL f51168f4ec Revert "Revert "evas: fix borked rotation support in GL engine.""
This reverts commit 5bb1c52e3a.

This patch is actually correct, but it highlight a bug in how we
retrieve GLX_Y_INVERTED_EXT value.
2015-10-12 17:47:40 -07:00
Cedric BAIL 5c02935a86 evas: correctly get GLX_Y_INVERTED_EXT. 2015-10-12 17:47:40 -07:00
Carsten Haitzler 5bb1c52e3a Revert "evas: fix borked rotation support in GL engine."
This reverts commit 6153471ac3.

YES. YOU BROKE SOMETHING.... EVERY SINGLE COMPOSITED WINDOW IS NOW
UPSIDE-DOWN!
2015-10-13 08:48:38 +09:00
Cedric BAIL 6153471ac3 evas: fix borked rotation support in GL engine.
This bug was introduced by b0d2643f93. I am
not sure I am not breaking that one instead now. Hopefully not.
2015-10-12 15:46:57 -07:00
Boram Park 62042e6ab2 evas-drm: remove useless condition
Summary: 'ob->priv.last > ob->priv.last' is always false

@fix

Reviewers: devilhorns, stefan_schmidt

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3159
2015-10-12 11:10:39 -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
Tom Hacohen 4a92415d12 Evas engine wayland_shm: pass the correct enum value.
Following this patch, the correct enum type is now passed to this
function. It's also passing the same value (0), but now from the correct
enum. This doesn't change behaviour, and looks like what was intended.

This fixes the clang warning.
2015-10-09 14:24:30 +01:00
Tom Hacohen 3301d869df Evas engine software generic: Fix clang warning.
Double parenthesis comparison is reserved for evaluation for assignment, not just comparison.
So for example you should do ((x = 2)) and (x == 2), but not ((x == 2)) or (x = 2).
2015-10-09 12:41:29 +01:00
Chris Michael 37718b2cf6 evas-wayland-shm: Fix silly typo
Summary: OOpppss, this should be eina_rectangle_free

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-10-08 15:15:00 -04:00
Chris Michael dd8ec36962 evas-wayland-shm: Don't leak rectangles during flush
Summary: As we loop the regions of the output buffer and accumulate
changes to post, we should be freeing the rectangles when we are done
with them.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-10-08 13:35:07 -04:00
Chris Michael bf1eef174b evas-wayland-shm: Fix to add support for MERGE_MODE Smart
Summary: Seems we were never setting any merge_mode for the
wayland-shm engine. This fix implements setting merge_mode

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-10-07 11:01:21 -04:00
Dongyeon Kim b6f8244b0b evas/gl_x11: Fix indentation and invalid error check in native set/bind/unbind 2015-10-06 14:55:20 +09:00
Carsten Haitzler 785564f105 evas sw x11 - xcb code has same changes as xlib with optimizations 2015-10-06 14:47:08 +09:00
Carsten Haitzler f05686c051 evas engines - fix partial swap to not skip swaps if full mode used
@fix
2015-10-06 14:37:10 +09:00
Carsten Haitzler ab1734ea19 evas sw generic - printf debug remove 2015-10-06 12:19:08 +09:00
Carsten Haitzler 966b3c8f23 evas software x11 - set merge mode explicitly to smart or env var
this allows merge mode for software-x11 to be set too like for gl.

@feature
2015-10-05 18:36:18 +09:00
Carsten Haitzler c603f25139 evas software x11 - increase shm buffer size for modern displays
have a bigger shm buffer for larger displays to recycle shm memory more
for sw rendering

@feature
2015-10-05 18:33:03 +09:00
Carsten Haitzler 8a4ddea224 evas render - async sw - fix context duplication by using proper dup call
valgrind pointed this one out. we access freed memory when we dup a
context because the context CONTAINS ptrs to things like rects for
cutouts. we didnt dup these. use the proper context dup call (and
properly ref pixman color image too). this was a random bug/crash
waiting to happen and valgrind caught it. suprising it hasnt turned up
before :/

@fix
2015-10-04 16:58:42 +09:00
Cedric BAIL cb65e6b1fe ector: don't leak cairo context. 2015-10-01 17:18:54 -07:00
Chris Michael dedaf5550a evas-wayland-shm: Reduce size of resize pool during resize events
Summary: We really don't need to be allocating a shm pool this large
during resize, so reduce the size of the pool.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-10-01 16:02:16 -04:00
Chris Michael ba5d3b0480 evas-gl-drm: Add support for 'smart' merge mode
Summary: This just adds support for 'smart' merge mode in the evas
gl_drm engine to keep in line with gl_x11 engine.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-10-01 09:00:44 -04:00
Chris Michael bc9b4e536a evas-wayland-egl: Add support for 'smart' merge mode
Summary: This just adds support for 'smart' merge mode in the wayland
egl engine to keep in line with the gl x11 engine

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-10-01 08:59:00 -04:00
Oleksandr Shcherbina fe92fac05f evas_canvas3d: Unification algorithm generation shadow
Summary:
Change type of texdepth from GL_R(doesn't support with GLES) to GL_RGBA.
Don't use useless additional framebuffers for shadows.
Use same shader code for generation shadow map texture.
Turn always using software alpha-test.
It reduce and simplify code in general.

Reviewers: cedric, Hermet

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3115
2015-10-01 19:08:14 +09:00
Nicolas Aguirre cf2b9ea5ca evas: Add defines for GL_COLOR_EXT, GL_DEPTH_EXT, GL_STENCIL_EXT 2015-10-01 10:05:28 +02:00
Dongyeon Kim b6649f6c6e evas/gl_common: Fix memory leak for font glyph extension image
Evas_GL_Image created for font glyphs in evas_common_font_rgba_draw
is sometimes freed after Evas_Engine_GL_Context is freed.
Since gc is already freed, pt_unref returns and leaves pt behind.
2015-10-01 10:05:28 +09:00
Cedric BAIL 72b13c3ebb evas: move all GL safe define to a common header and use it. 2015-09-30 15:12:48 -07:00
Cedric BAIL fed208061e evas: use void * instead of struct wl_* to avoid compilation issue on system without Wayland extention. 2015-09-30 15:12:48 -07:00
Carsten Haitzler 4b894e01b5 evas - software x11 - lock shmpool as now shm pool entities are threaded
recent changes moved shm buffer pushig to a thread and thus shm pool
has to be locked too
2015-09-28 02:58:54 +09:00
Carsten Haitzler 11c29579d0 evas gl - optimize updates
@feature

this makes the gl engine by default not do bounding box, but instead
try and smartly merge nearby update regions. this means multiple
render passes IF your drivers support buffer age, but it seems to
actually help. in my test case on nvidia drivers which support buffer
age, i saw compositor cpu overhead drop by about 30%
2015-09-25 14:38:21 +09:00
Oleksandr Shcherbina 08ee7d4b8c evas_canvas3d:Broken source file for generation 3D shaders
Summary:
Bug reproduce if delete evas_gl_3d_shaders.x and try re-build.
Source file include.shd for generation shader code consist m4 macro definitions.
After this revision https://phab.enlightenment.org/D3056 order of the quatation
marks in function pcf was broken.
@fix

Reviewers: cedric, Hermet

Reviewed By: Hermet

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3085
2015-09-24 20:37:36 +09:00
Carsten Haitzler 217faeebe8 evas cutouts - optimize to use less cpu
this optimizes draw ctxt cutouts by skipping small ones and
remembering the last cutout added so it isn't double-added as well as
extending the minimum cutout array to 512 and going up in blocks of
512 instead of 128. also optimize the clipping code a bit more.
2015-09-24 14:09:20 +09:00
Carsten Haitzler 601273522e evas gl engines - remove TIMDBG code that is unused entirely 2015-09-23 14:03:33 +09:00
Carsten Haitzler 0369168a44 evas sw generic - comment NULL methods so we know what they should be 2015-09-22 18:49:12 +09:00
Oleksandr Shcherbina 28d69200f9 evas_canvas3d: sets for shadow rendering
Summary:
Add possibility change quality and offsets for shadow.
Add mesh API's to sets size, step and bias constant.
Add scene API to sets depth values.

Reviewers: Hermet, cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-09-21 23:41:29 +02: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
Subhransu Mohanty b6e458804e evas: clip the clip rect to surface boundary in ector draw.
Change-Id: If747a055eb935a7369eaf8d16d1577200a23b54c
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-09-21 22:50:33 +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
Dongyeon Kim 7587645672 Evas GL: Free safe extensions hash when engine shuts down
This fixes the memory leak.
Thanks @rajeev.jnnce for spotting this!
2015-09-17 10:28:59 +09:00
Jean-Philippe Andre 2381d8160a Evas GL shaders: Add mask 21, 12, 22 downsampling modes
This is a huge patch, but keep in mind that 4326 line changes
were automatically generated from the template GLSL files.

This also adds some minor refactors here and there to accomodate
for the new shaders, but nothing crazy.

"GL fast-path" downsampled masks should now look pretty good.
2015-09-14 11:20:21 +09:00
Dongyeon Kim 1b049b6fba evas/gl_common: Do not set minus value to unsigned int
Summary:
cur_tex* are unsigned int, so minus value should not be set.
Also, add cur_texa, cur_texm here.

Test Plan: Local tests

Reviewers: jpeg

Subscribers: mer.kim, wonsik, cedric

Differential Revision: https://phab.enlightenment.org/D3036
2015-09-08 17:41:40 +09: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
Jean-Philippe Andre b7ce5d9c47 Evas: Remove useless include
config.h is already included in the private headers, and should be
included first anyways.
2015-09-04 11:11:38 +09:00