Commit Graph

368 Commits

Author SHA1 Message Date
Jean-Philippe Andre f663980111 Evas GL: Add some debug
It will be triggered when EVAS_GL_API_DEBUG is set.
Yeah, that's abusing the variable a bit, as it was intended for
GL calls only, but this is pretty harmless.

Also add string  "GL_DEPTH_STENCIL".
2014-11-18 18:46:58 +09:00
Jean-Philippe Andre cd8d68cda4 Evas GL: Import a few more extensions and fix a name 2014-11-14 11:32:46 +09:00
Jean-Philippe Andre 0be124ca4d Evas GL: Add extension string for ETC2 2014-11-14 10:43:00 +09:00
Jean-Philippe Andre 198a508f9d Evas GL: Scan extensions for OpenGL-ES 1.1 2014-11-14 10:43:00 +09:00
Jean-Philippe Andre cd63cb0215 Evas GL: Enable some more GLES2 extension APIs
NOTE: The draw_buffers extension might need to be checked more and
wrapped, if it can have adverse effects on how Evas works (could
it replace the default render target?).

This adds support for the following extensions:
- disjoint_timer_query
- occlusion_query_boolean
- alpha_test
- draw_buffers
- read_buffer
- read_buffer_front
- framebuffer_blit
2014-11-14 10:43:00 +09:00
Jean-Philippe Andre d2aee4e5ca Evas GL: Add support for some required extensions
- debug
- debug_label
- debug_marker
2014-11-14 10:43:00 +09:00
Jean-Philippe Andre 56a64756eb Evas GL: Introduce concept of safe extensions
This will mark some extension functions as "safe", which means
we don't need to wrap them in order to expose them.

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

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

@feature
2014-11-14 10:43:00 +09:00
Jean-Philippe Andre aff423e3bd Evas GL: Introduce macro _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
It will be used to link to extension functions that need no
wrapping.
2014-11-14 10:43:00 +09:00
Jean-Philippe Andre 9741f298c0 Evas GL: Scan for GL-ES 1.1 extensions 2014-11-14 10:42:59 +09:00
Jean-Philippe Andre ce3146b262 Evas GL: Add original extension names to the EVAS_GL_EXTENSIONS string
The idea is that normal opengl applications might very well want to
check for an extension using the usual string and not have to do
something special just because they're using evas_gl and not egl.
2014-11-14 10:42:59 +09:00
Jean-Philippe Andre e18886a2a3 Evas GL: Fix list of shaders to distribute
Some shader files (shd) were not included in EXTRA_DIST. This didn't break
the build because the .x file was correctly generated.
I guess the missing files in previous releases also had no impact because
the .h files would be generated and shipped.

Also generate the enum automagically. New shaders need to be added
to Makefile_Evas.am.
2014-11-14 10:01:30 +09:00
Jean-Philippe Andre ae4f7f4e61 Evas shaders: Auto-generate the shaders from Makefile
Let's regenerate the shaders when a SHD file changes.
I've removed the Git commit id because only touching a file
would insert a code change.
2014-11-12 16:28:56 +09:00
Jean-Philippe Andre 8e52ade2e2 Evas shaders: Write new shader generator script
All shaders will be in a single .x (C) file.
There shall be no more useless .h files.

This also removes the need for awk (replaced by sed and bash stuff)
2014-11-12 16:28:52 +09:00
Jean Guyomarc'h 704c448141 warnings: remove 2 "equality comparison with extraneous parentheses"
Reviewers: stefan_schmidt, cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2014-11-05 00:15:52 +01:00
ChunEon Park 3ffcdb67de evas/gl_common: remove dead code. 2014-10-31 19:19:15 +09:00
Chris Michael 40247decd3 evas-gl-3d: Fix compiler warning about 'ld' may be used uninitialized
Summary: This commit fixes compiler warning:
modules/evas/engines/gl_common/evas_gl_3d.c:1322:48: warning: 'ld' may
be used uninitialized in this function [-Wmaybe-uninitialized]. We
declare 'ld' as NULL now, and check it is valid before using it.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-29 12:12:39 -04:00
Chris Michael cc4921a873 evas-gl-3d: Fix formatting
Summary: No functional changes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-29 12:11:21 -04:00
Jean-Philippe Andre f3226f5e81 Evas GL: Fix potential crash
Welp, it looks like this crash actually happened once even though
it should not. glGetString() seems to have returned NULL somehow.
2014-10-29 15:12:53 +09:00
Jean-Philippe Andre 0198fbfee4 Evas: Fix lock usage around async_current (gl preload)
Fixes Coverity:
 - CID 1039361
2014-10-28 11:19:24 +09:00
Jean-Philippe Andre 8e4dafcf28 Evas GL: Set umask before calling mkstemp
Fixes Coverity issues:
 - CID 1039609
 - CID 1039608
2014-10-28 10:54:51 +09:00
Jean-Philippe Andre 3fe232cd95 Evas GL: Fix typo in an extension's name
This could potentially break applications relying on this
typo to check for the extension. The chances are very slim.
2014-10-27 16:12:38 +09:00
Jean-Philippe Andre c17cfbd13e Evas GL: Add support for PBuffer surfaces with GLX
Not fully tested, but allows calling evas_gl_make_current, so
it works for dummy surfaces (eg. 1x1 for a render thread).
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre 47ddb889ad Evas GL: Add support for OpenGL-ES 1.1 (part 3)
This introduces XPixmap usage for indirect rendering.
Of course this works only for the gl_x11 engine... and for
now only when using EGL... and only on some drivers...
damn limitations.
Direct rendering should work on more platforms (eg. some desktop
nvidia cards with the EGL drivers).
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre 4315537820 Evas GL: Add support for OpenGL-ES 1.1 (part 2)
Add version param to context_create.
Add support for 1.1 contexts in the GL_X11 engine, and checks
for version in all other engines (return NULL).
Add API wrappers for all OpenGL-ES 1.1 APIs (normal and debug
modes).
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre f30f55f9f4 Evas GL: Fix compilation for EGL/GLES
Configure with --with-opengl=es --enable-egl
Fixes runtime link dependencies
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre a0712e25e1 Evas GL: Add support for pbuffer surfaces
Supports only EGL for now :(

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

@feature
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre 81bf993c6c Evas GL: Add support for fence_sync and similar extensions
This should add support for the following EGL extensions:
- EGL_KHR_fence_sync
- EGL_KHR_reusable_sync (eglSignalSyncKHR)
- EGL_KHR_wait_sync (eglWaitSyncKHR)

@feature
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre 6848cf40b6 Evas GL: Add evasglCreateImageForContext + import defs
evas gl CreateImage function was assuming the current context
should be used to create an image, while the equivalent EGL function
specifically requires the context to be specified.

This also imports some definitions for CreateImage.

And fixes typo in glEGLImageTargetRenderbufferStorageOES.

This adds new functions in Evas_GL_API struct. The version
number will be bumped to 2 in a later commit.

@feature
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre 29e572cdfb Evas GL: Add support for client-side rotation
This is a new feature allowing direct rendering even when
the view is rotated. In that case, the application is responsible
for rotating its view and rendering it properly given the object
geometry.

This implements support for the flag
EVAS_GL_OPTIONS_CLIENT_SIDE_ROTATION

@feature
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre 28a76266c6 Evas GL: Fix runtime linking issues
There is some mess with gl common functions that need to be
called from the engine itself, eg. error set/get.
2014-10-20 12:16:07 +09:00
Jean-Philippe Andre 49f79f0a73 Evas GL: Skip glClear() with direct rendering & transparent color
When using direct rendering, glClear() should not do anything
if the ClearColor was (0,0,0,0). The application would indeed
expect a transparent output (so, see the widgets below the view),
but glClear would erase the pixels instead. So add a quick check
to skip glClear entirely in that specific case.
2014-10-20 12:16:07 +09:00
Jean-Philippe Andre 8d6f873354 Evas GL: Add API evas_gl_error_get()
Similar in meaning to eglGetError()

@feature
2014-10-20 12:16:06 +09:00
Jean-Philippe Andre 08889de92b Evas GL: Add some thread safety
This is only the core evas gl support.
TODO: gl_x11 and other engines
2014-10-20 12:16:06 +09:00
ChunEon Park 5718763ca3 evas/gl: code refactoring.
improve code readibility.
2014-10-19 15:39:51 +09:00
Chris Michael 6480b8b75d evas-gl-common: Fix compile for EGL due to missing GL_LINE_SMOOTH
Summary:
When compiling for EGL, GL_LINE_SMOOTH ends up not being defined so
compile breaks. This fix just checks if GL_LINE_SMOOTH is missing and
if so it defines it.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-08 09:04:21 -04:00
ChunEon Park 026e767b86 evas: support anti-alias for gl line drawing. 2014-10-08 15:47:58 +09:00
Daniel Zaoui cabdbb2f3c Warning-- 2014-09-11 08:35:15 +03:00
Cedric BAIL 6bb522cc6b evas: let's bet consistent and not break the build. 2014-09-04 08:54:08 +02:00
Dmytro Dadyka 0d2f4dbc11 [Evas/evas-3d] Add shadow maps. Added two scene-API functions for enable and disable shadows on the scene. Added 6 light-API function for set and get the light projection.
Reviewers: raster, cedric, Hermet

Subscribers: raster, cedric

Differential Revision: https://phab.enlightenment.org/D1330
2014-09-03 21:19:16 +09:00
Carsten Haitzler 75a04d6c7f evas gl - remove unused pointer variable return
fixes CID1039920
2014-08-25 12:55:40 +09:00
Carsten Haitzler 0b6fb19b77 evas - fix unused variable
fixes CID 1039921
2014-08-25 12:51:17 +09:00
Carsten Haitzler b21d6cfd0c evas gl common - remove logically dead code
fix CID 1039444
2014-08-22 20:14:59 +09:00
Cedric Bail 396433bbc2 evas: handle GL_LUMINANCE_ALPHA.
This fix T1459. I have added an ERR to catch this kind of issue earlier.
I am wondering if that should not be even a CRI.

The reason why we do see the problem only after the introduction of the
use of Eina_Rectangle_Pool is due to how efficiently they pack data, resulting
in ressource ending up in the wrong format bucket. Nothing wrong with the
patch itself.
2014-08-16 15:15:07 +02:00
Cedric Bail dde9a1e977 evas: allocate enougth atlas for all supported format. 2014-08-16 15:15:07 +02:00
Carsten Haitzler 2098e8c856 evas gl - fix yuv smooth rendering
i found that we are not setting u and v to be smooth (linear
interpolate) for yuv reendering, even when asked. they remain at a
default "nearest". this enables linear for u and v always, meaning
even when smooth is off, we still interpolate u and v (not y), and
even when at 1:1 with no scaling u and v get interpolation for better
quality.

@fix!
2014-08-15 12:11:33 +09:00
Carsten Haitzler 31045df0d2 evas gl - fix possible null tls resource access in bindframebuffer
this fixes CID 1181887
2014-08-14 17:41:55 +09:00
Chris Michael 4ad176e481 evas-gl-common: Fix invalid use of Texture
We cannot use the texture to find a valid format Before the texture is
actually created. This is invalid, leads to "warning: tex is used
uninitialized' message from the compiler, and just plain wrong.
Instead, use the alpha property of the Evas_GL_Image to find the
proper texture format, Then create the texture.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-08-13 09:38:33 -04:00
Carsten Haitzler 2ac4f520d6 fix resource leak on format lookup fail
so in fixing one CID for a format lookup failing and thus invalid mem
access, a possible leak was made in this case. fix that by doing
lookup before any allocation and if lookup fails, return there

this fixes CID 1230999 1230998 1230997
2014-08-13 08:49:07 +09:00
Carsten Haitzler a97f5d7bb8 evas gl common - fix possible negative array accesses if search format fails
this should fix CID 1223506, 1223505, 1223504
2014-08-12 17:32:04 +09:00
Carsten Haitzler 8845ecb2b2 evas gl common - fix potential invalid access during texture free
this should address CID 1223507
2014-08-12 17:25:15 +09:00
Stefan Schmidt 9283575490 evas/gl_common: Use the right list when removing aptt
Another classical copy and paste error. All references but one replaced.

CID: 1223502
2014-08-08 14:54:56 +02:00
Carsten Haitzler f5cff9490e evas gl - did not free all atlas formats - fix
we have expanded atlas formats long since - so use #define to free
correct amount instead of 6
2014-08-07 18:25:20 +09:00
Carsten Haitzler 8b796edce7 evas gl - fixz minor leak on exit of rectangles
these were static rect cutouts, so they stayed around on exit and thus
we "lost" them. this nukes them on context free and each new frame.
fixes the "leak"
2014-08-07 18:15:50 +09:00
Cedric BAIL 9a9d78dfcb evas: provide GetProcAddress by the engine. 2014-07-25 20:24:28 +02:00
Cedric BAIL cec904cd03 evas: make gl_x11 rely on gl_generic.
Note that we can't access gl_common directly as it is not possible to link it
2 times. I also didn't want to force evas to be linked with GL/EGL. So I rely
now on dlsym on about 20 symbols to get that backend going.
2014-07-11 15:32:51 +02:00
Cedric BAIL 0d00b476cb evas: export symbol from gl_common so that loading gl_generic can expose them. 2014-07-11 15:32:51 +02:00
ChunEon Park 7e8d43ee85 Revert "evas/gl: improve the rendering quality."
This reverts commit 5e18223f67.

Conflicts:

	src/modules/evas/engines/gl_common/evas_gl_context.c

we've got a side effect(another quality issue) of the patch. so revert it.
2014-07-11 14:50:20 +09:00
Jean-Philippe Andre 7512a54954 Evas gl: Fix upload of RGB+A textures [INCOMPLETE]
The textures have duplicated borders, take them into account.
2014-07-11 13:41:38 +09:00
Jean-Philippe Andre 24f38eaf6d Evas gl: Replace all remaining references to mask stuff by alpha
Masking is not used (there even was a recent commit by Hermet to
remove most of the occurences of mask shaders in GL), and I've
introduced a new ETC1+Alpha feature. Replace the old texm and
associated variables by texa for alpha texures.
2014-07-11 12:20:07 +09:00
Jean-Philippe Andre c65918eaed Evas gl: Add errors when using ETC1+Alpha as a normal texture 2014-07-09 14:01:11 +09:00
Jean-Philippe Andre ec9ffd0ae8 Evas gl: Fix invalid number of atlasses
Left-over from a local experiment where ETC1+Alpha had its own
texture pool. Not required.
2014-07-09 12:39:18 +09:00
Jean-Philippe Andre c7d290b447 Evas gl: Remove non-existent filters from compile.sh 2014-07-09 10:40:25 +09:00
Jean-Philippe Andre 698f7f1770 Evas gl: Don't use glCompressedTexSubImage2D for ETC1
Eeeeh. Not only we don't support atlasses with this RGB+A thing
yet, but ETC1 does not even support SubImage2D (according to the
current spec).

Also, fix a few typos in that same function.
2014-07-09 10:18:34 +09:00
Jean-Philippe Andre cb0eef29c8 Evas gl: Fix potential memleak
Fixes CID 1224765.
This CID reports a potential memleak in an "assert" situation.
2014-07-09 09:41:40 +09:00
Jean-Philippe Andre c0b7957d17 Evas gl: Simplify cspace matching for textures
Some colorspaces (ETC, S3TC, GRY, ...) don't care about the value
of BGRA support or the alpha flag. So, let's introduce the
new boolean^Wenum value MATCH_ANY ;)

Note: the compressed texture formats with alpha support have been
marked as matching both TRUE and FALSE for alpha. The images
should always have the alpha flag set to TRUE, though.
The BGRA flag really doesn't matter.
2014-07-09 09:05:37 +09:00
Jean-Philippe Andre 48bcf182b4 Evas gl: Add support for ETC1+Alpha textures
Compile-in the required shaders, add support for the
new EVAS_COLORSPACE_ETC1_ALPHA, and upload textures as RGB+A
pairs.

@feature
2014-07-09 09:04:55 +09:00
Jean-Philippe Andre 224506171f Evas gl: Add shaders for RGB+Alpha mode
These shaders take two textures as input and sample RGB from
texture 1 and alpha from texture 2. This is the non-premultiplied
version, so RGB' = RGB*A.

This includes only the GLSL code.
2014-07-09 09:04:55 +09:00
Jean-Philippe Andre 23e60bd6ff Evas gl: Fix path resolution in compile.sh
Let's make compile.sh work from anywhere (not just from its
containing directory). Also fix problem with calling make-c-str.sh
without setting PATH.
2014-07-09 09:04:55 +09:00
Dmytro Dadyka 8e496570a7 evas: Evas_3D - add fog effect. add two API function for enable and disable fog effect for given mesh.
Reviewers: Hermet, raster, cedric

CC: cedric

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

Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
2014-07-07 19:26:48 +02:00
ChunEon Park b3d11fae4c evas/gl - removed MASK ramains. 2014-07-07 17:08:22 +09:00
ChunEon Park dad74f7455 evas/gl - removed redundant shader masking code. 2014-07-04 21:10:20 +09:00
Carsten Haitzler 1eaf26989b evas - gl common - fix drop of image on cache hit in gl engine images
@fix - this fixes a leak (reference count leak)
2014-07-04 12:26:16 +09:00
Jean-Philippe Andre b0df307927 Evas gl: Add support for S3TC textures
Add support for DXT1, DXT3 and DXT5 textures (4 formats in total).

@feature Add support for S3TC textures if the GPU supports them
2014-07-03 15:36:22 +09:00
Jean-Philippe Andre 644de1f93f Evas gl: Remove hack around CompressedTexImage2D
A compressed texture should be created with glCompressedTexImage2D
only, and not with glTexImage2D (This returns GL_INVALID_VALUE).
2014-07-03 11:37:48 +09:00
Jean-Philippe Andre b0f353cc38 Evas gl: Fix texture allocation (missing Y offset)
I saw some GL error messages (with the GLERR() macro activated),
that were caused by GL_INVALID_VALUE.

For some (many) textures, tex->y was 0 but since we now use a 2D
atlas (rectangle allocator), the first row of pixels should be
repeated. This caused uploads to Y = tex->y - 1 = -1, which is
invalid.
2014-07-03 11:37:48 +09:00
Jean-Philippe Andre a2de0a0bc9 Evas: Support duplicated borders in surface alloc
Now, the evas loader is supposed to advertise the actual border
size in case of compressed texture formats.

The only case where the border was non zero was ETC formats,
from the TGV loader, so I think we don't need to keep the
previous behaviour (auto-calculate borders for ETC).
2014-07-03 11:37:48 +09:00
ChunEon Park 4cbc73ce1d evas/gl - ... removed white trailing. 2014-06-27 21:47:00 +09:00
ChunEon Park 7341887851 evas/gl: fix indentation. 2014-06-27 21:38:30 +09:00
ChunEon Park 5e18223f67 evas/gl: improve the rendering quality.
To avoid texture bleeding in the texture atlas,
we adjust texture uv point as much as a half uv point.
Especially, this improves the rendering quality when the image has the border
area.

Unless apply this patch,
You might find the rendering result is different with software backened,
if the image has the borders.

In the software backened,
the border line was clear but the gl wasn't.
because the border line was interpolated so the rendering result was not the one we expected.

@fix
2014-06-27 21:29:24 +09:00
ChunEon Park 5ade5ca433 evas/png - better way to support png grayscale with transparency format.
suggested by cedric.
2014-06-26 17:00:37 +09:00
ChunEon Park d69e4fbe20 evas/gl - fix to render grayscale with transparency format in gl backened.
In case of png, grayscale with transparency format (transparency doesn't mean the png has alpha channel)
gl doesn't prepare that format render.
In this case, set it argb8888 to convert the data in the png loader.

@fix
2014-06-25 21:50:35 +09:00
ChunEon Park 836c0535f0 evas/gl: eeeek. i missed removing one unnecessary checking 2014-06-23 12:07:41 +09:00
ChunEon Park cca1c500d5 evas/gl: increase message level and avoid unnecessary checking
the checking is introduced previous my commit 5f52f5c9e5.
2014-06-23 12:02:31 +09:00
ChunEon Park 5f52f5c9e5 evas/gl: don't go forward if the format is not supported. 2014-06-23 10:07:39 +09:00
ChunEon Park 65cebb614c evas/gl: abort is so cruel. print error and let it don't die there. 2014-06-23 09:50:55 +09:00
Cedric BAIL 35f0cd2680 evas: fix crash when preloading Evas_Object_Image.
This was a left over from the Eina_Rectangle patch improvement from Rajeev,
thanks Chris for spotting it.
2014-06-19 22:40:50 +02:00
Rajeev Ranjan bd65b5db5d evas: improvement of Eina Rectangle Pool and integration with Evas GL backend.
Summary:
This patch introduce various new logic for packing/unpacking of Eina Rectangle in a pool.
It is then used by Evas GL backend texture allocation to improve how efficiently we pack
image in texture atlas. This lead to improved memory usage and reduced power consumption
with usually a more stable higher FPS (as it use less texture to do the same task, their
is less texture switch, so saving memory and speed at the same time).

This patch was developped on Cedric's suggestions to optimize the packing logic using Skyline
algorithm. This patch is based on master and is a new submission for earlier phab link
https://phab.enlightenment.org/D774.

Signed-off-by: Sanjay Nirankari <sanjay.n1@samsung.com>
Signed-off-by: Rajeev Ranjan <rajeev.r@samsung.com>
Signed-off-by: Sreedeep Moulik <sreedeep.m@samsung.com>

Reviewers: cedric, raster

CC: wonsik, jpeg, sreedeep.m, sanjay, govi

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

Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
2014-06-19 16:48:45 +02:00
Raoul Hecky 101929b3f4 evas_gl: add more matching formats to make cocoa_gl happy 2014-06-18 11:34:07 +02:00
Raoul Hecky 5f80f1fe09 evas_cocoa: correct include for GL 2014-06-18 11:34:07 +02:00
Nicolas Aguirre 7182f87d51 evas: force equality in check otherwise i get debug output even if the environnement variable is not set. 2014-06-18 11:34:07 +02:00
Carsten Haitzler 121f234e4e fix whitespace like trailing spaces and tabs 2014-06-18 16:23:23 +09:00
Jean-Philippe Andre a691b2ebf9 Evas gl: Fix ETC2 texture atlasses
ETC2 textures were allocated using the same empty slots pool
as RGBA textures.

ETC1 texture atlasses should still be tested.
An extension string is required to avoid using the bad
fallback in place right now. But there is no such thing yet.
2014-06-16 20:11:41 +09:00
Carsten Haitzler c1345ade8f partial fix for T518 - fix blank display on 2+ windows with gl
this fixes @draisch's report of blankness, but doesn't fix the
garbage. it's something to do with the always render move in elm gl -
it just doesn't seem to be rendering before evas renders, or if it is,
it's failing to work/produce content.
2014-06-16 19:24:33 +09:00
Jean-Philippe Andre d0d9dbfdba Evas: Add encoding parameter to the savers
ecore_evas_convert: Add -e/--encoding option

This uses directly the encoding parameter.
For now, used only by the TGV saver, but there is no other way
to specify between ETC1 and ETC2. And we don't have a mixed ETC1+2
mode (yet).

@feature
2014-06-13 16:05:48 +09:00
Jean-Philippe Andre dbd576b858 Evas gl: Enable texture atlasses with ETC1/2
We prefer ETC2 textures when ETC2 support has been detected.
According to the spec, glCompressedTexSubImage2D should work
for ETC2.

Try even with ETC1. This may fail at runtime. The fallback path
is very dubious right now but without a proper test case I'm
not sure which approach to take.

We can also imagine cases where the GPU supports TexSubImage for
ETC1 but ETC2 is not supported at all. This will need testing, as
this case is not handled.

@feature
2014-06-12 14:47:16 +09:00
Jean-Philippe Andre 90985d2282 Evas gl: Remove dlsym of glCompressedTexImage2D
The function was used directly in evas_gl_texture.c
It must be part of OpenGL core functions (since GLES 1.1
and OpenGL 2 I think).
2014-06-12 14:47:16 +09:00
Carsten Haitzler 03983be687 fix whitespace 2014-06-10 19:22:04 +09:00
Dongyeon Kim acc95afbd8 evas gl: distinguish between IMG and EXT MSAA extensions
Summary:
For drivers that support IMG_multisampled_render_to_texture,
GL_MAX_SAMPLES_IMG should be used to query max supported samples
Likewise, for drivers that support EXT_multisampled_render_to_texture,
GL_MAX_SAMPLES_EXT should be used to query max supported samples

@fix

Reviewers: seoz, Hermet, raster, cedric

Reviewed By: cedric

CC: cedric

Differential Revision: https://phab.enlightenment.org/D948
2014-06-10 19:20:17 +09:00
Jaehyun Cho bc446e37c1 evas_gl_rectangle: Remove unnecessary conditional expression
Summary: The comparison gc->dc with NULL is not necessary. So the unnecessary conditional expression is removed.

Reviewers: Hermet

CC: seoz, cedric

Differential Revision: https://phab.enlightenment.org/D909
2014-05-28 14:29:22 +09:00
Jean-Philippe Andre 5d560dd2b9 Evas: Fix abort() when using ETC2 with alpha 2014-05-12 14:44:55 +09:00
Cedric Bail 6a3913b41e evas: remove logically dead code.
CID 1211984.

Note that in error case, the calloc is either not passed or
returned NULL so free will never be called.
2014-05-10 13:18:55 +02:00
Cedric Bail 7c1679550b evas: fix uninitialized value usage in Evas_3D.
This code look suspiciously similar to src/lib/evas/canvas/evas_3d_mesh.c
line 682.
2014-05-10 12:08:45 +02:00
Cedric Bail 4bf0a64358 evas: let's not leak on failure.
CID 1210815
2014-05-04 00:20:12 +02:00
Cedric Bail 202b3ad6ba evas: behave nicely with unitialized data.
CID 1210818

It would be a better and more working fix to use Evas_GL_Image, sadly
no time to do it right now and may be to intrusive for an alpha release.
2014-05-04 00:16:35 +02:00
Cedric Bail ede36d8382 evas: fix use of uninitialized pointer.
CID 1210819
2014-05-04 00:14:52 +02:00
Cedric Bail 36e8daf187 evas: protect against lacking light. 2014-05-01 12:05:37 +02:00
Jean-Philippe Andre fa9f7a4c89 Evas: Fix stretching of ETC1/2 textures
ETC1/2 textures are (for now) allocated one by one for each image,
because we use only glCompressedTexImage (not SubImage). So,
the texture height must fit that of its content.

This commit bypasses the usual pool allocation logic where textures
are rounded up to the next multiple of 16 pixels in height, in
case of ETC1/2.
2014-04-29 15:48:47 +09:00
Daniel Zaoui f10d8c42bb Evas_3d: Fix warning.
The variable was defined twice.
2014-04-27 11:12:06 +03:00
Cedric Bail 53a9fcf301 evas: remove Evas_3D legacy API. 2014-04-25 19:29:08 +02:00
Cedric Bail a4fd5ac3dd evas: fix broken build with OpenGL ES backend.
This is a temporary fix, once we move to Evas_GL_Image, it shouldn't
be needed anymore. Thanks to Cédric "chep" Chépied for reporting the
issue.
2014-04-25 16:46:46 +02:00
ChunEon Park 27c1b12825 evas3d: fixed grammartical break. 2014-04-25 17:03:19 +09:00
ChunEon Park 6ecdc5cbd2 evas/evas3d - use the image loader of the evas instead of the png lib. 2014-04-25 17:02:51 +09:00
subhransu e84e28fc22 Evas_3D : Eolian change
Conflicts:

	src/Makefile_Evas.am
	src/lib/evas/Evas_3D.h
	src/lib/evas/Evas_Eo.h
2014-04-25 16:58:47 +09:00
Jean-Philippe Andre 86ce491a86 Evas gl_x11: Add ETC2 support to the GL/X11 engine
This should allow texture upload with ETC2 RGB8 or RGBA8 formats.
Untested for now...

@feature
2014-04-25 16:50:29 +09:00
Taekyun Kim 26e43f938f Evas: 3D: Fix typo error in preprocessor for GLES 2014-04-25 16:19:29 +09:00
Taekyun Kim 8fda631730 Evas: 3D: Introducing 3D scene rendering features
Enable 3D features using --enable-evas-3d=yes when configuring.
APIs are exposed through Evas_3D.h.
Currently, evas-3d is being supported only on gl_x11 engine.

Conflicts:

	src/lib/evas/Evas_Eo.h
2014-04-25 16:15:41 +09:00
Jean-Philippe Andre c0aa0b3410 Evas gl: Don't swap RGBA colors with ETC1
Since rg_etc1 now outputs proper BGRA data, the shaders should not
swizzle the colors around. Stick to the normal fragment shaders.

Note: This is not tested.
2014-04-22 19:53:55 +09:00
Jean-Philippe Andre 558e7827f1 Evas gl: Fix texture border drawing
Since the introduction of color spaces other than RGBA8888 in
the GL engines, there was an issue with border images scaled in
GL. The left and right edges were simply not properly copied.

This would then show artifacts when scaling very thin images
(typically 2px wide).
2014-04-17 15:01:54 +09:00
Jean-Philippe Andre 54fb9b2346 Evas: Use Evas_Colorspace to declare cspace
Why use int when we have a proper type?
All these APIs are internal.
2014-04-15 18:50:37 +09:00
Jean-Philippe Andre 198b33c69a Evas gl: Remove unused variable 2014-04-08 17:50:21 +09:00
Jean-Philippe Andre ecb8ce8748 Evas gl: Fix colors when using ETC1 textures
We need to use the RGBA shader to invert R and B otherwise
those will be inverted on the screen.
2014-04-04 10:16:01 +09:00
Jean-Philippe Andre c67db4c47b Evas gl: Fix dlsym usage for glCompressedTexImage2d
This symbol should be part of the loaded libraries, can be found
using dlsym, even if eglGetProcAddress() returns NULL.

Add etc1 flag in the debug output.
2014-04-04 10:08:09 +09:00
Jean-Philippe Andre 018e2d33b2 Evas gl: Use implicit cast to DATA8 with image.data8
data8 is there precisely to avoid casting the iamge data when
handling it as DATA8.

This is purely a cosmetic change
2014-04-04 10:08:09 +09:00
Cedric BAIL 854dd14474 evas: add ETC1 texture format support to Evas. 2014-04-01 22:00:54 +09:00
Cedric BAIL d1581f8ca9 evas: support uploading AGRY88 and GRY8 directly to GPU. 2014-04-01 22:00:15 +09:00
Cedric BAIL 3684b749be evas: add support for GL_LUMINANCE_ALPHA and GL_LUMINANCE when loading image from disk. 2014-04-01 22:00:15 +09:00
Anand caabcbe408 evas: Fixed warning for uninitialized variables
Summary:
Warning fixed of evas

modules/evas/engines/gl_common/evas_gl_context.c: In function 'evas_gl_common_context_new':
modules/evas/engines/gl_common/evas_gl_context.c:392:32: warning: 'minor' may be used uninitialized in this function [-Wuninitialized]
modules/evas/engines/gl_common/evas_gl_context.c:314:8: note: 'minor' was declared here
modules/evas/engines/gl_common/evas_gl_context.c:392:16: warning: 'major' may be used uninitialized in this function [-Wuninitialized]
modules/evas/engines/gl_common/evas_gl_context.c:313:8: note: 'major' was declared here
@fix
Compilation Warning Fixed

Test Plan: Compile efl

Reviewers: singh.amitesh

CC: seoz, cedric

Differential Revision: https://phab.enlightenment.org/D656
2014-03-24 17:03:32 +09:00
Cedric BAIL a9d38e6df7 evas: cleaner fail handler. 2014-03-24 11:41:20 +09:00
Jihoon Kim 014183a1b7 evas_gl: fix memory leak in case that version doesn't include dot
fix CID 1193479
2014-03-23 13:36:00 +09:00
ChunEon Park 461555e4cc evas/gl - fill up missed blend mode.
Still there few mode are unsatisfied.

@fix
2014-03-22 21:09:58 +09:00
ChunEon Park f556cd1328 evas/gl - don't set blend function in RENDER COPY mode.
it's enough that just disabling the blend mode.
2014-03-22 20:30:27 +09:00
Cedric BAIL 837391c5da evas: let's be more resistant even with things that should never happen.
Fix CID 1193212.
2014-03-20 16:53:13 +09:00
Jean-Philippe Andre 7cbe636311 Evas gl: Fix clip in image_draw if it's not set
In evas_gl_common_image_draw, if an image is drawn with a fresh context,
containing no clip and no cutouts, then it will be wrongly clipped to
the source image size instead of the destination surface size.

This case seems to never happen, ever, since the contexts are always
fully set by the render functions.

@fix
2014-03-18 18:03:40 +09:00
Jean-Philippe Andre 1a9b58f083 Evas gl: Fix buffer dump filenames
evas_gl_common_buffer_dump can be used to dump all frames into
a series of PNG files. But the filename contained some garbage
characters (and potential segv, too).

(cherry picked from commit a0f886138ed5a28d0d1596df3b805fca06d1ae31)
2014-03-18 15:44:13 +09:00
Jean-Philippe Andre 7ad4a269e0 Evas gl_x11: Fix usage of glReadPixels
It is not necessary to dynamically link to glReadPixels since
this is not an extension. This code wouldn't even work on some
devices.

Also, the pixels returned are not premultiplied (yeah >_<)

And some devices (EGL) don't support GL_BGRA... so glReadPixels
would just fail and not fill in the pixels. Conversion is required.
2014-03-13 17:04:42 +09:00
Jean-Philippe Andre 59f5216391 Evas gl_x11: Add support for glReadPixels
This will be needed by the filters for proxy rendering,
for textures and maps (displacement).

Add new engine functions to unleash the (sluggish) power of glReadPixels.
The idea is to be able to bypass glReadPixels later, so 3 new APIs are
added:
- surface_lock
- surface_read_pixels
- surface_unlock
They must be called in that order.

Note (for history):
glReadPixels was always getting the wrong data during first draw,
but the right data during a redraw...
Why? Well simply because for OpenGL itself, the image had never
been drawn in teh first place! Only the Evas GL context knew
about the image drawing, as it was queued somewhere in the pipe.

One line solution: Call evas_gl_common_context_flush before
doing anything else.
2014-03-07 11:07:09 +09:00
Sung W. Park 2b4a7b438d evas gl: added partial rendering support for qcom extension
When running in direct rendering mode, properly support partial
rendering if the extension is properly supported.

Also, fixed the SwapBufferwWithDamage rectangle coordinate bug.
It wasn't properly y-inverted before.
2014-02-15 02:33:47 +09:00
Carsten Haitzler 93da35c5ab evas - gl - core - checke for wrong context in error check
this fixes CID 1135266
2014-02-13 19:38:13 +09:00
Carsten Haitzler 153bbd8003 evas - gl core - don't access null ptr on init
this fixes CID 1135270
2014-02-13 19:19:59 +09:00
Jean-Philippe Andre 0135b45c12 Evas filters: OpenGL support part 1.
Quick and dirty solution to support the OpenGL engine:
[1] Allocate CPU buffers
[2] Render text and process all effects to these buffers
[3] Push final image as an OpenGL texture.

This patch implements [1].
2014-02-07 17:33:17 +09:00
Carsten Haitzler 93fd2263fc evas gl - fix egl/gles build after alpha4 change for fonts 2014-01-13 07:02:24 +09:00
Carsten Haitzler 86a97efeea evas - fonts - move to using 4bit and rel 4 bit compressed font glyphs
this changes the internal encoding of font glyphs in evas to use 4bit
uncompressed if small, or 4bit rle (run length encoded) if larger.
this caves at least 50% of memory on fonts - and more if bigger. with
large fonts (40-80pixel size) we can save in the region of 80% of
memory used for glyphs. this also happesn to allow speedups in
rendering too.
2014-01-13 05:15:32 +09:00
Carsten Haitzler f21b0ee6c3 evas gl - prefer alpha4 format for font textures if possible (save memory)
if alpha4 is possible (desktopgl) then use it for fonts as this should
cut memory in half for them and possibly speed things up due to less
memory bandwidth needed
2014-01-13 05:15:32 +09:00
Carsten Haitzler 3de45a2c4b evas gl - comment out unreachable code
fixes CID 1132634
2014-01-10 19:00:54 +09:00
Carsten Haitzler e8c13118eb fix mingw build for setuid fix/checks 2014-01-08 22:06:41 +09:00
Carsten Haitzler b95ef3801f setuid safeness - ensure if an app that is setuid doesn't do bad things
this makes efl ignore certain env vars for thnigs and entirely removes
user modules (that no one ever used) etc. etc. to ensure that *IF* an
app is setuid, there isn't a priv escalation path that is easy.
2014-01-08 19:46:23 +09:00
Carsten Haitzler acf7dfa579 evas - gl engine - glerr should be off by default for performance
stable release - cherry-pick me!
2013-12-27 17:32:15 +09:00
Carsten Haitzler 153a744e67 evas gl engine - ensure on texture delete we never leave a cur tex id dangling 2013-12-26 21:04:25 +09:00
Daniel Juyung Seo 76d8532b54 efl: Unified eina critical manro to CRI.
Being annoyed by different types of eina critical macros - CRI, CRIT,
 CRITICAL -, I concluded to unify them to one. Discussed on IRC and
 finally, CRI was chosen to meet the consistency with other macros -
 ERR, WRN, INF, DBG - in terms of the number of characters.
If there is any missing bits, please let me know.
2013-12-26 12:27:13 +09:00
Carsten Haitzler 6a75806e54 evas - evas gl - fix realloc failure case to handle it properly
patched shader string realloc failure not handled right - could leak
patched string and p.
2013-12-11 22:44:42 +09:00