Commit Graph

1105 Commits

Author SHA1 Message Date
pierre lamot c380812496 evas: bypass lockfocus in NSView on OSX
this patch bypass calls to (un)lockFocus, avoid segv
when closing windows

This is certainly not the cleanest way to do it but it seems
to be working correctly at the moment. this may leads to
unexepected behavior which haven't been identified now

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-17 10:42:51 +01:00
pierre lamot e573d65424 evas: make current context on lockFocus for gl_cocoa backend.
make current context on lockFocus as suggested by (following best practice):
https://developer.apple.com/library/mac/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-17 10:42:51 +01:00
pierre lamot 6ea9b476ad ecore_cocoa: release resources on window close event
@fix this patch:

catch the window close event from cocoa and send an ecore event
this event is catched by a handler in ecore_evas wich will
call the registered fn_delete_request (from elementary for instance)

/!\ this patch is currently incomplete and leads to a segv when
closing the last window

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-17 10:42:51 +01:00
Jean-Philippe Andre 358bd3eb25 Evas GL: Fallback to safe GL configs with GLX as well 2015-03-17 18:42:19 +09:00
Jean-Philippe Andre 9e0095a53c Evas GL: Fallback to safe values of depth, stencil & msaa if not supported
Depth32, Stencil16 and MSAA are known to be unsupported on many platforms.
While applications should try not to request them, we can try to fallback
nicely and still render using depth24+stencil8 (which is often supported),
or reducing the number of MSAA samples (until 0 if not supported at all).
2015-03-17 18:16:40 +09:00
Cedric BAIL 1ab8cc75c4 evas: use emile to decompress JPEG files. 2015-03-17 09:58:18 +01:00
Cedric BAIL b900e1787f evas: simplify structure. 2015-03-17 09:58:18 +01:00
Cedric BAIL a865d41181 emile: remove use of custom structure and prefer Eina_Rectangle.
Get rid of warning inside of the jpeg loader that result of it. I do believe
this is not an ABI break on the loader API. If you disagree, please raise your
voice.
2015-03-17 09:58:18 +01:00
Cedric BAIL 8cac4ce5e7 evas: use Emile to decode TGV. 2015-03-17 09:58:18 +01: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
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
Jean-Philippe Andre 13c3d3d7d6 Evas GL: Fix GL_X11 engine when using GLX
eglGetProcAddress is obviously not supported in that case.
2015-03-16 17:44:20 +09:00
Jean-Philippe Andre a4b649ca8c Evas GL: Fallback to depth24, stencil8 if GL_GLES is used
If depth32 or stencil16 are requested, those are most likely to
fail with GLES. In that case, fallback automatically to 24+8.
2015-03-16 17:44:20 +09:00
Jean-Philippe Andre e271727c01 Evas GL: Add more debug logs
Print some INFormation for app developers.
2015-03-16 17:01:51 +09:00
Jean-Philippe Andre 7e92ab76b1 Fix a previous commit: remove binary files and garbage in src/
When rebasing the commits, I have been lazy and did a git add src/ that
actually added the files that were not ignored. My bad, sorry about that.
The original patch was fine.

Thanks sung.
2015-03-16 16:09:47 +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 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
Dongyeon Kim eae786917c Evas GL: change function naming and small bug fixes
Summary:
Remove gles1 prefixes for functions that are also used by gles3.
Refactor evgl_make_current a little bit.
Destroy indirect context properly.
Some log message changes and typo fixes.

Test Plan: Local tests on desktop PC

Reviewers: jpeg

Subscribers: mythri, mer.kim, wonsik, cedric

Differential Revision: https://phab.enlightenment.org/D2104
2015-03-16 15:56:48 +09:00
Jean-Philippe Andre 8cf1dda9df Evas GL: Fix logic in debug check 2015-03-16 15:56:48 +09:00
Jean-Philippe Andre 8f57cbcdd6 Evas GL: Fix build errors and warnings from previous commit 2015-03-16 15:56:48 +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 bb134a5cc3 Evas GL: Remove excessive debug
- Check debug flag before warning that a surface is not direct
- Remove notes about surface reconfigure, as this will not be implemented
  (see previous commit).
2015-03-16 14:55:40 +09:00
Wonsik Jung 25502e37f8 evas_gl: Add feature to set depth/stencil/msaa bit to window surface.
Summary:
When Evas GL runs with direct rendering, it can not set depth, stencil and msaa to Window surface.
This patch is possible to use "option" input paramater of ecore_evas_gl_x11_options_new.
So, new API is not needed.

The other patch is in elementary. The elementary patch will be used this patch.

Test Plan: Test elm gl veiw in elementary_test and JP's test app.

Reviewers: spacegrapher, cedric, raster, jpeg

Reviewed By: jpeg

Subscribers: cedric, mer.kim

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

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
Note: jpeg changed the original patch a bit (fix style and depth value)
2015-03-16 14:50:56 +09:00
kabeer khan af48f3455d evas: correcting transpose and transverse of software_generic image rotation support.
Summary:
Current definition of transpose and transverse was wrong. Corrected it by
interchanging both definitions.

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

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-13 09:33:29 +01:00
Nicolas Aguirre cf730014cf evas: symetric lock/unlock calls in gl_cocoa backend.
this code add symetric calls to lock and unlock focus view

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-12 07:43:59 +01:00
Nicolas Aguirre 3c14cab0c6 evas: free EvasGlView when the evas is freed in gl_cocoa backend.
EvasGLView is now correctly freed when the Evas is destroyed

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-12 07:43:58 +01:00
Romain Perier 6e193e2006 evas: lock and unlock focus on Cocoa view when drawing surface
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-12 07:43:58 +01:00
Romain Perier c80d7adbc2 evas: use a shared OpenGL context in gl_cocoa backend.
Evas GL backend uses a global OpenGL context for all windows inside
an application. Each window has its own texture to render its
content. We use a singleton NSOpenGLContext shared between all
NSOpenGLView, it solves rendering issues for multiple windows.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-12 07:43:58 +01:00
Nicolas Aguirre 1818f96004 evas: remove warnings due to unused variables from gl_cocoa backend.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-12 07:43:58 +01:00
Jean-Philippe Andre b7d1615be7 Evas GL texture: Fix invalid interpolation pixel
The pixel on the top-right of a texture was set using an invalid offset.
"luckily" this never crashed but probably could have with wide
single-row images.

Also, the output was not perfectly correct.
2015-03-09 20:32:01 +09:00
Jean-Philippe Andre 03ab2e27c8 Evas GL common: Create OpenGL ES 3.x contexts by default
Automatically fallback to OpenGL ES 2.0 if OpenGL ES 3 is not supported.
This is a first step in trying to support GLES 3 for Evas GL.

This commit is also a wild test to see whether using GLES 3 contexts
by default will break anything. The theory says that GLES 3 is
backwards compatible with GLESv2.

So, if anything GL breaks for you... scream loudly!
But before reporting any bugs, please set the env variable:
- export EVAS_GL_DISABLE_GLES3=1

This does not add any requirement for GLESv3 support.
2015-03-05 20:59:53 +09:00
Jean-Philippe Andre 611741e65d Evas GL: Fix list of extensions with GLESv1
EGL/EvasGL extensions are also valid with GLESv1.
This means evasglCreateImage could be used.

@fix
2015-03-05 20:59:50 +09:00
Jean-Philippe Andre fecc487b3b Evas GL: Fix CRI message on shutdown
Just a simple log domain issue (EvasGL was not initialized, so
ERR() would trigger a fatal error). EvasGL is now initialized
on demand when a new GL surface is requested.
2015-03-05 16:19:18 +09:00
Jean-Philippe Andre f020171bf2 Evas GL common: Disable evas gl preload by default
Unfortunately, this "feature" has many problems and does not really
fix those it was supposed to address:

- Elm Photocam becomes horrible to use (the transition from
  low-res to high-res tiles triggers this miniature path).

- Evas async preload callback is called before the full image
  is ready (ie. the texture is not uploaded yet), when really
  the preload callback should be triggered only once the image
  is 100% ready. (TODO)

- Sometimes the miniature image keeps being used even though the
  main image has been uploaded (eg. with E background). Maybe the
  object image is not redrawn when it should.

- This uses a separate thread for the upload, which is both a good
  and bad idea because we need to do a make current. Also, this does
  not upload the full-res image tile by tile, but only in one pass,
  thus blocking the render loop until finished.

This patch changes the env var from "EVAS_GL_NOPRELOAD" to
"EVAS_GL_PRELOAD" (and only "1" will enable).

Sorry Cedric, we can talk later about how to improve this.
2015-03-04 17:31:31 +09:00
Jean-Philippe Andre 53d3cb4fec Evas GL common: Improve quality of miniature image
Sample in the middle of the "macro pixels" and fool around with the
borders (usually used to limit linear sampling artifacts) to improve
image quality on the edges.

Those miniatures are still 16x16 but MAAAYYYYYBE they will look a bit
less awful.

NOTE: The first row still doesn't scale properly (interpolates with
      garbage above y=0).
2015-03-04 17:31:07 +09:00
Jean-Philippe Andre b19d3599a5 Evas GL common: Force smooth scaling on miniature images
When evas GL uploads textures, it will first upload a 16x16 miniature
image, and then wait for some idle time in the main loop to upload the
high-res image.

Some images may not have smooth scaling enabled which results in the
miniature scaled with GL_NEAREST, showing big ugly squares. Let's
force smooth scaling instead, for a blur image rather than a
checkerboard.
2015-03-04 15:27:21 +09:00
Jean-Philippe Andre be3b011822 Evas GL: Fix build error on some systems w/o Wayland
Thanks Mythri for the report.
wl_display and wl_resource is declared in eglmesaext.h but older
systems may not have that.
2015-03-03 20:57:59 +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 21051d3252 Evas masking: Use mask_smooth to differentiate "shaders"
If mask_smooth changes, it should trigger a flush of
the pipeline (and call glDrawArrays).

This may or may not fix some potential bugs with masking.
2015-03-02 20:47:17 +09:00
Jean-Philippe Andre e531ab9bc0 Evas GL: Use Eina_Strbuf for the extensions list
The usage of strcat/strncat was not safe, and even Coverity reported
about it.

Fixes CID 1256197:
CID 1256197 (#1 of 2): Buffer not null terminated (BUFFER_SIZE_WARNING)
1. buffer_size_warning: Calling strncpy with a maximum size argument
of 10240 bytes on destination array _gl_ext_string of size 10240 bytes
might leave the destination string unterminated.
2015-03-02 19:51:30 +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 80b21a7d3f evas/gl_x11: fix duplicated egl error check
Summary:
When egl window surface creation fails, eglGetError() is called twice,
thus removing error state.

Reviewers: cedric, Hermet, jpeg

Reviewed By: jpeg

Subscribers: mer.kim, wonsik, cedric

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

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2015-03-02 16:22:12 +09:00
Minkyoung Kim de797bbd3b Evas GL: Fix abnormal extension name.
Summary: Fix abnormal extension name.

Test Plan: local test.

Reviewers: jpeg

Reviewed By: jpeg

Subscribers: wonsik, cedric, spacegrapher

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

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2015-03-02 16:20:07 +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 433d24cfa0 Evas GL common: Remove uniform-related stuff
Remove last traces of the uniforms stuff for shaders, that was
removed in the following commits: 6b48c106d3 and cfd337a758.

Don't use uniforms in the evas GL pipeline, at least not like that.
2015-03-02 11:30:34 +09:00
Chris Michael d7a8626f5b evas-gl-drm: Fix T2158: compile fails when --with-opengl=full is passed
Summary: This fixes compile for the gl_drm engine if
--with-opengl=full is passed on the cmd line. These changes are
based on the diff provided by spotrh in the above ticket.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-03-01 10:49:10 -05:00
Chris Michael f14a893ce5 evas-gl-drm: Cleanup compiler warnings for dbg/err messages
Summary: This commit compiles out the debug messages that were
generating compiler warnings during build. You can reenable these
messages if you uncomment GL_DRM_DBG in evas_engine.h

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-03-01 10:45:39 -05:00
Chris Michael 3bb11b938c evas-software-x11: Provide TBM Native Surface support for xcb engine
Summary: This adds support for native surfaces in xcb. Previously when
the TBM Native Surface support was added, it broke the xcb build.
These commits fix that issue.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-27 10:36:58 -05:00