Commit Graph

368 Commits

Author SHA1 Message Date
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
Carsten Haitzler f3d1db0fba evas - evas_gl - fix shader patch to not free static strings
parsing problem with opengl_strtok() which would free the previous
token "p", but in some cases it would be a const string. this should
fix CID 1039653
2013-12-11 22:40:15 +09:00
Jean-Philippe Andre ce166ec223 Evas: Fix crash in GL engine(s) during preload cancel
In my config, running terminology with the GL engine and under
cserve2, some image could not be loaded. The tex argument
in evas_gl_preload_target_[un]register was NULL, leading to
an immediate crash.
2013-12-09 17:28:02 +09:00
Cedric Bail 403098fdb2 evas: add missing define for some target. 2013-11-27 13:51:40 +09:00
Cedric Bail f45a75f925 Revert "Revert "evas: allow fuzziness on the texture format returned by GL.""
This reverts commit 87385b05c3 that is necessary for desktop target.
2013-11-27 13:51:40 +09:00
Rafael Antognolli 87385b05c3 Revert "evas: allow fuzziness on the texture format returned by GL."
This reverts commit 2b5b3438e8.

Breaks gl engines when using GLES + EGL.
2013-11-26 11:49:13 -02:00
Cedric Bail 2b5b3438e8 evas: allow fuzziness on the texture format returned by GL. 2013-11-26 17:00:24 +09:00
Carsten Haitzler e03ab668a1 evas - gl engine - async texture upload - protect null tex handle access
this stops a very blantant segv when accessing async->tex when it is
NULL on _evas_gl_preload_main_loop_wakeup().
2013-11-25 22:29:12 +09:00
Sung W. Park 90bbc21d02 evas_gl : Fixed macro substitution bug in evas_gl
In evas_gl_api_ext_def.h there're calls such as:

    _EVASGL_EXT_DRVNAME(EGL_KHR_image_base)

    The macro is defined in evas_gl_api_ext.c as:

    (strstr(glexts, #name) != NULL || strstr(glueexts, #name) != NULL)

    if (_EVASGL_EXT_CHECK_SUPPORT(name)) *ext_support = 1;

    But EGL_KHR_image_base is itself a macro, which is defined
    in EGL/eglext.h like this:

    Thus, the _EVASGL_EXT_CHECK_SUPPORT macro will unwrap into:

    (strstr(glexts, "1") != NULL || strstr(glueexts, "1") != NULL)

    instead of intended:

    (strstr(glexts, "EGL_KHR_image_base") != NULL ||
     strstr(glueexts, "EGL_KHR_image_base") != NULL)

    This patch fixes this by applying stringification earlier in
    _EVASGL_EXT_DRVNAME

Bugfix reported by jinhyung.jo@samsung.com
2013-11-13 15:39:12 +09:00
Jean-Philippe Andre 82e8028b5d evas/cserve2: Fix image preload with gl-x11 engine
Cserves supports only the SW (xlib) and GL (gl-x11) engines.
Also, improve cs2 support for some lesser used functions in the
gl_x11 engine.
2013-10-30 19:48:17 +09:00
Sung W. Park 9bb4c48691 EvasGL: cleaning up unnecessary code.
Cleaning up unnecessary code.
2013-10-30 10:47:52 +09:00
Jean-Philippe Andre 3889feca24 evas/cserve2: Implement support for GL engine
Simply call the appropriate cache2 functions when possible
and check for usage of cache2 whenever an evas_cache_ function
is called.

This effectively adds cserve2 image (data) load support for the
GL engines. Fonts were already working out-of-the-box.
2013-10-28 15:47:15 +09:00
Sung W. Park 7dc102c55f EvasGL: Fixed direct rendering not clipping issue
Evas GL direct rendering mode didn't properly take into account
the image object's clipping information and clip the region that
it was directly rendering to. Hence there were issues with the
direct rendering region drawing over the objects that are sitting
on top of it.

Also, cleaned up the direct rendering coordinate computation code
and a nasty dependency with image object that should have been
removed a long time ago.  Basically the evas-gl engine was directly
accessing the image object data structure for its data when it
really should have just passed along necessary information.
2013-10-24 17:42:21 +09:00
Carsten Haitzler 7d7f548afc evas - gl - dont allocate image and/or texture until needed on native unset 2013-10-16 22:56:38 +09:00
Carsten Haitzler e383e3096d evas - try cleanup pipe_region_intersects again.. this time without bugs. 2013-10-01 20:57:39 +09:00
Carsten Haitzler 0732fef6ec Revert "evas gl engine - simplify and optimise pipe region intersection checks."
This reverts commit d486150412.
2013-09-27 17:57:41 +09:00
Carsten Haitzler d486150412 evas gl engine - simplify and optimise pipe region intersection checks. 2013-09-26 19:20:22 +09:00
Sung W. Park b9e3e6be57 EvasGL: Fixed a bug where the wrong data variable to buffer alloc func.
It's an optional feature so it's not automatically turned on but
would have caused a segfault somewhere.  Somehow slipped notice
but fixed now.
2013-09-17 17:24:30 +09:00
Sung W. Park 4ece1a1f9f EvasGL: Fix surface destroy mismatch bug.
For EvasGL direct rendering, EvasGL does a make_current to the
surface that evas is holding on to.  When EvasGL was shutting down
it was wrongly deleting evas' surface. This issue was temporarily
fixed by Raphael before but the proper fix was added.
2013-09-10 13:53:56 +09:00
Cedric Bail 5c82716fe8 evas: factorize some code. 2013-09-09 18:59:21 +09:00
Rafael Antognolli 2e2cac43da evas/gl: Do not reassign the surface during make current.
There was already a surface created by _evgl_tls_resource_create(). If
we assign a new one here, the wrong one will be destroyed at
_evgl_tls_resource_destroy(), and later the GL window will be destroyed
before the surface, causing invalid access errors.

This fixes https://phab.enlightenment.org/T326
2013-09-04 15:20:59 -03:00
Rafael Antognolli 3a654f795c evas/gl: Don't look for EXT and ARB extensions when on GLES.
At least on recent mesa (since commit 9f07ca11c17), it will find the
mentioned symbols but they won't really work, leading to error messages,
and possibly some other errors. So far, I just ifdef'ed the
glGenFramebuffer and glBindFramebuffer functions, but it may require
others to be ifdef'ed too.

This is just a workaround, to fix https://phab.enlightenment.org/T246.
2013-08-21 12:39:17 -03:00
Sung W. Park 3074280217 Evas: adding image dump debug feature for gl_x11 backend
Added a feature to dump out a png image before calling SwapBuffers.
To turn on the feature, use the following env vars.

EVAS_GL_SWAP_BUFFER_DEBUG_DIR="dir_name" sets the name of the directory
that the files will be output to and enables the debug mode.

EVAS_GL_SWAP_BUFFER_DEBUG_ALWAYS=1 will enable the writing of the
files every frame.  This in effect turns on the swap_buffer_debug
variable, which can be set on or off in gdb for debugging.  This will
allow dumping of certain frames without having to dump out a ton of
files to track down one frame.
2013-07-23 10:27:28 +09:00
Cedric Bail 906d7adad7 evas: put the test after we had a chance to update the texture. 2013-07-15 19:12:01 +09:00
Carsten Haitzler 3c891b4058 evas gl: cover some more cannot-allocate-texture cases. 2013-07-15 10:59:29 +09:00
Carsten Haitzler edd39272bd evas gl: if img src size == dst on draw, turn smooth off to avoid ghosting 2013-07-11 17:39:08 +09:00
Carsten Haitzler 199fb6523e evas gl engine - paranoia: check max texture size limits on texture alloc 2013-07-11 12:39:44 +09:00
Chris Michael 6229a871de When printing this debug message, check for valid extension string get
function First.

NB: Fixes Coverity CID1039394

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-08 14:30:41 +01:00
Chris Michael 1140dbceeb Add missing eina_lock_release when we exit
Since we take the lock at the start of the function, we should release
the mutex lock if we are going to return.

NB: Fixes Coverity CID1039381

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-08 14:10:44 +01:00
Chris Michael 6198351629 Fix formatting
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-08 14:09:50 +01:00
Chris Michael 1ea718c283 Fix memleak reported by Coverity.
NB: Fixes Coverity CID1039654

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-08 08:38:54 +01:00
Chris Michael 72347e539b Fix copy/paste error in gl_common_context_push. (I beleive that texm
texture was wanted here, not tex texture).

MB: Fixes Coverity 1039670

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-08 08:26:08 +01:00
Cedric Bail 913d56da9e evas: make it possible to disable preload for buggy driver. 2013-07-05 15:39:44 +09:00
Cedric Bail 0f153be0e5 evas: fix bugin Enlightenment triggering a path where data are loaded, but flags is not set.
This fix T187.
2013-07-03 12:48:38 +09:00
Chris Michael f9348a5015 Fix klockwork possible memleak report:
If we get an error trying to "make current" an allocated surface, then
we should free that allocated surface.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-06-28 14:23:57 +01:00
Daniel Willmann adcde1f87e evas gl_common: Fix incorrect number of parameters in functions
_evgl_tls_resource_get() and _surface_context_list_print() don't take
parameters.

Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
2013-06-26 14:42:10 +01:00
Tom Hacohen 182dfb82d4 Evas gl: Fixed double-free when failing gl init. 2013-06-26 10:40:44 +01:00
Cedric Bail d64c808a73 evas: check wether we do have a data or not. 2013-06-26 11:49:16 +09:00
Cedric Bail d06a0982ef evas: add support for asynchronously uploading GL texture.
NOTE: when using Evas_Object image preload infrastructure the GL texture
upload was uploaded from the main loop during the rendering stage. This
could lead to some frame drop during fast animation due to the time needed
to upload that texture.

This patch fix this problem by uploading a small texture quickly (16x16)
and waiting for going back to the main loop to be able to use the same GL
context from another thread to do the texture upload asynchronously without
blocking the main loop.
2013-06-24 12:04:18 +09:00
Sebastian Dransfeld 336f6ec328 efl: formatting 2013-06-20 13:28:18 +02:00
Sebastian Dransfeld 068f1ddc62 efl: formatting 2013-06-20 13:08:36 +02:00
Sebastian Dransfeld 51023d2d4f evas: Keep sane name for public header
Evas_Common.h should be used for the public header, and rather rename
evas_common.h internal header to another name.

Sa:
Evas_Common_Header.h -> Evas_Common.h
evas_common.h -> evas_common_private.h

Shouldn't have both Evas_Common.h and evas_common.h because of case
insensitive filesystems.
2013-06-20 12:53:29 +02:00
Cedric Bail 6adb604dae evas: fix texture allocation bugs. 2013-06-20 17:36:24 +09:00
Sung W. Park 8e6f0aa11c Evas: add partial rendering support for evasgl direct rendering
Evas_GL Direct rendering is an optimization path that renders
directly to the window if conditions are met.  Because evas gl
backend used to re-render the entire screen, evas_gl direct
rendering didin't have to concern with partial region rendering.
Now that partial rendering/swapping has been applied to evas gl-
backend, evas_gl direct rendering also had to take into account
clip regions. in order to properly apply it, some adjustments
were made to the engine functions and etc.
2013-06-17 18:32:00 +09:00
Sung W. Park 316be3e6c7 Revert "Saving evasgl direct partial rendering fix temporarily"
This reverts commit e6359132de.
2013-06-17 18:22:15 +09:00
Sung W. Park 62e146f2fc Revert "Touch for evas gl direct rendering partial rendering/swap fix."
This reverts commit 382ffbb4f5.
2013-06-17 18:22:04 +09:00
Sung W. Park 382ffbb4f5 Touch for evas gl direct rendering partial rendering/swap fix. 2013-06-17 17:52:16 +09:00
Sung W. Park e6359132de Saving evasgl direct partial rendering fix temporarily 2013-06-17 17:52:16 +09:00
Cedric Bail 1403b3a9ad evas: preliminary work on texture destruction for async preload of texture. 2013-06-14 16:38:18 +09:00
Cedric Bail ab9c734b7f evas: cleanup GL texture allocation with some code refactoring. 2013-06-14 16:38:18 +09:00
Eduardo Lima (Etrunko) d3292a7ae9 Split .gitignore into multiple files
Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
2013-06-11 18:18:50 -03:00
Carsten Haitzler fdabe06989 evas - partial rendering support now for qualcomm extn too. 2013-06-11 18:12:07 +09:00
Carsten Haitzler 2bfe58887d evas gl: do not assume querying extension strings are extns in glx and egl. 2013-06-04 15:35:15 +09:00
Cedric Bail 080ce9316b evas: refactorize gl texture creation code. 2013-06-04 15:04:19 +09:00
Chris Michael e232b629a7 At this stage of engine shutdown, the eina log domain has been removed
and is not valid, so don't use ERR to print a message.

Signed-off-by: Chris Michael <devilhorns@comcast.net>
2013-05-24 21:36:05 +01:00
Chris Michael 5f5ab9d9c6 minor formatting fixes.
Signed-off-by: Chris Michael <devilhorns@comcast.net>
2013-05-24 21:34:33 +01:00
Rafael Antognolli 99be49551e evas/gl: Use GL_FRAMEBUFFER_BINDING, which is available on both.
Instead of a define from GL_DRAW_FRAMEBUFFER_BINDING to the above one,
just use it directly since it's available on gles and full gl.
2013-05-20 14:21:56 -03:00
Chris Michael c727ab8088 Fix antognolli build break when --with-opengl=es.
Basically, EGL does not define a GL_DRAW_FRAMEBUFFER_BINDING so we
test for that and if not found then define it to be
GL_FRAMEBUFFER_BINDING

Signed-off-by: Chris Michael <devilhorns@comcast.net>
2013-05-19 07:13:03 +01:00
Chris Michael 31b1e11d8d Revert this, there is no build break apparently. Give cookie back to
antognolli

Revert "include evas_gl_common.h"

This reverts commit 81cee894e1.
2013-05-18 17:52:32 +01:00
Chris Michael 81cee894e1 include evas_gl_common.h
(Bad antognolli, No cookie !!)

NB: Fixes build break !!! If we are going to use defines from glext.h,
let's be sure to have the necessary header included Yes ?? ;)

Signed-off-by: Chris Michael <devilhorns@comcast.net>
2013-05-18 15:56:13 +01:00
Rafael Antognolli 8254bbc5e3 evas/gl: Restore framebuffer after texture creation.
If we don't do this, the framebuffer object used on shader_array_flush()
will be wrong.

NOTE: shader_array_flush() should take care of setting the fbo
correctly.
2013-05-17 20:31:06 -03:00
Stefan Schmidt efb05eb717 evas: No need to finish a block with NULL statement. 2013-05-14 15:45:22 +01:00
Chris Michael 50f446199a Fix 'return' with no value, in function returning non-void
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-05-14 10:49:14 +01:00
ChunEon Park 59429c0e66 evas/gl - and don't try blend as possible. 2013-05-10 01:51:42 +09:00
ChunEon Park 0315565b7b evas - don't try blend on gl backened if the render option is COPY 2013-05-10 01:33:56 +09:00
Sung W. Park 289a666333 evas: Fixed evas_gl multi-window support design issue.
Evas engine is created per window but evas_gl engine was not properly
updating the engine info for new windows that are created. So, addressed
the design issue by passing engine_data to evas_gl engine apis..
2013-05-08 18:39:12 +09:00
Cedric Bail d833244100 evas: add infrastructure to open from Eina_File. 2013-05-08 18:17:00 +09:00
Cedric Bail c3f9d3b8b8 evas: Make Evas_Loader API public. 2013-05-08 18:16:59 +09:00
Carsten Haitzler 2aec9927b3 disable glmap/unmap buffer bu default in evas gl engine
it seems glmapbuffer can be nasty overhead on some drivers, so go back
to gldrawarrays by default until such a time as we know a lot more...
i'm looking at YOU nvidia! YOU!
2013-05-07 16:20:02 +09:00
Cedric Bail c5b0d28d73 evas: move flags and attribute around. 2013-05-06 19:02:04 +09:00
Carsten Haitzler d47a81ce17 last scissor always scissor stuff broke map. fix it to work again
accounting for fbo's and master clip.
2013-05-04 11:43:02 +09:00
Carsten Haitzler 73a088141e oops merge me 2013-05-03 23:28:30 +09:00
Carsten Haitzler e0a78afef0 oh copying way too much data into vbo's... we copied alloc size not
num size.. and alloc size is much bigger as it makes room for 1024
quads per alloc increase (6*1024 vertexes etc.). literally this drops
e17's cpu usage while compositing stuff by 40%...at least in my test
case.
2013-05-03 23:25:15 +09:00
Carsten Haitzler 1a81f0a8c2 force scissor to always be on indicating partial gl update region so
gpu can.. do more sensible things.
2013-05-03 19:31:28 +09:00
Carsten Haitzler f8c9a8d167 revert the revert... damn you git!
Revert "Revert "Efl: replace eo_data_get for objects data referencing.""

This reverts commit b64a2994b3.
2013-05-02 16:47:16 +09:00
Carsten Haitzler b64a2994b3 Revert "Efl: replace eo_data_get for objects data referencing."
This reverts commit 654a3f5f94.
2013-05-02 14:17:19 +09:00
Daniel Zaoui 654a3f5f94 Efl: replace eo_data_get for objects data referencing. 2013-05-01 10:37:08 +03:00
ChunEon Park 529e1d3569 evas/evas_gl - cast arguments properly according to the spec of the gles/gl APIs. 2013-04-21 22:31:58 +09:00
Carsten Haitzler 6e90a37990 comments for sungwoo when he gets back... 2013-04-18 20:30:39 +09:00
Carsten Haitzler 9ec8064638 Work around new intel Mesa/xorg bug where alpha
channel in NON-ARGB windows is not filled in with 0xff
even if all the code does things right.
2013-04-14 01:14:58 +09:00
Sung W. Park 34ce73badd [Evas] Updated eglMap/UnmapImageSEC extension definition
Recently Samsung specific eglMap/UnmapImageSEC has been updated to
support new features.  The extension definition was updated in evas
accordingly.
2013-04-12 17:34:13 +09:00
Carsten Haitzler 9a649bc07a fix valgrind complaint in evas gl caching of surface caps... bad code
bad!
2013-04-10 18:47:44 +09:00
Carsten Haitzler deabd07e4b oops - define GL_UNPACK_ROW_LENGTH not GL_UNPACK_ROW_LENGTH_EXT 2013-03-22 11:35:05 +09:00
Tom Hacohen aef97ce5a5 Evas gl: Fixed warnings in the gl engine. 2013-03-20 15:18:54 +00:00
Carsten Haitzler 797c1a1283 seems tegra has gotten better so up pipe max number in gl engine. 2013-03-17 14:18:52 +09:00
Carsten Haitzler 5a8d82228f update on recent symbol finding changes in evas - use dlsym for fbo's 2013-03-17 13:55:10 +09:00
Carsten Haitzler 3728c60311 Fix opengl-es 2.0 engine support to only use GL_UNPACK_ROW_LENGTH
if the correct gles extension exists.
2013-03-15 13:05:39 +09:00
Carsten Haitzler 5a00aa5b25 evas gl engine -> prefer extn symbols over non-extn symbols 2013-03-15 12:15:19 +09:00
Cedric BAIL d79a2efa39 evas: use Eina_Cow a lot more and we are closer to the memory size of 1.7. 2013-03-13 14:35:25 +09:00
Carsten Haitzler 8b55c24fe8 cleanup some egl/glx/gl extension string matching and proc address
vetos.
2013-03-12 15:30:05 +09:00
Carsten Haitzler 4eed45ae88 Small adjustment to gl engines to use procaddress if found and NOT
fall back to dlsym if such a "getprocaddress" is around.
2013-03-08 19:35:36 +09:00
Sung W. Park 64aa5a2670 evas: evas_gl - Got rid of resource pool in favor of creation on demand.
Resource contexts/surfaces are used for creating resources within Evas_GL.
In oder to handle Evas_GL runnig from different thread than the main one,
a resource context/surface pool was used. This turned out to be unnecssary
as they are not used very frequently.  So, I got rid of the pool and
made the resources create as needed.
2013-03-04 20:23:49 +09:00
Henrique Dante de Almeida 211c33ff6e evas: Deal with double glShaderSource signature
The function glShaderSource may have 2 signatures:
http://stackoverflow.com/questions/12586695/signature-difference-in-openglshadersource-between-opengl-es-2-revisions
http://www.opengl.org/sdk/docs/man/xhtml/glShaderSource.xml
http://www.khronos.org/opengles/sdk/docs/man/xhtml/glShaderSource.xml

This patch changes all internal signatures to use the most restrictive signature.
2013-02-26 10:17:28 -03:00
Carsten Haitzler 683e5d7d08 Fix evas GL common engine to have a shader to do oversampling on
downscaling. This makes quality much better and "at best"
equates to a 16 point sample (2x2 linear interpolation samples,
where a linear interpolation sample equates to a 2x2 sample).
This will have perfomance impact, but the quality is worth it and
makes it closer to software downscaling in quality. It supports
2x2, 2x1 and 1x2 oversampling. YUV not done, nor image mask
(font shaders not needed).
2013-02-26 22:07:30 +09:00
Carsten Haitzler 4452fad7a3 fix up apparent problem with egl context and sizing/rotation... need
to test more though.



SVN revision: 83878
2013-02-14 03:27:23 +00:00
Stefan Schmidt a9b1e78916 efl/evas: Remove stray ; from evas_gl_core.
SVN revision: 83830
2013-02-11 15:03:56 +00:00
Sung Park 0c7425a0aa Add EVAS_GL_DIRECT_MEM_OPT to enable on-demand fallback memory
allocation policy for EvasGL direct rendering.

Also made some variable name changes and some other minor fixes.



SVN revision: 83199
2013-01-24 04:51:51 +00:00
Sung Park d606adf10d Applied on-demand memory allocation policy for Evas GL Surface
for direct rendering optimization.  For direct rendering in EvasGL,
it falls back to FBO rendering if the conditions are not met.  Before,
the fallback resources were created in the beginning but now they are
created and destroyed on need base.



SVN revision: 83057
2013-01-22 07:00:12 +00:00
Gustavo Sverzut Barbieri df701d8ca2 some clang warning cleanups i forgot to commit
SVN revision: 83024
2013-01-21 00:22:35 +00:00
Sung Park edcb4cf295 Pulled out evas gl backend binary shader file caching code from
evas_gl_shader.c file and made an internal generic caching api in 
evas_gl_common.h for use in other places ie. evas_gl.

Then implemented evas_gl surface cap. caching code in gl backend to
accelerate the engine creation. 



SVN revision: 82321
2013-01-07 06:16:18 +00:00
Gustavo Sverzut Barbieri de7dc1c2cc efl/evas: proper glShaderSource() definition as glext.h
it is "const char * const *", not "const char **", and it was triggering a warning in our code.

it's just constness and will not trigger an error in our user's code, just an warning that he should fix.



SVN revision: 82278
2013-01-05 15:55:58 +00:00