Commit Graph

75 Commits

Author SHA1 Message Date
Jean-Philippe Andre 748e6ad1b9 Evas GL common: Add very basic GL calls tracing method
Rewrap the GL calls to print them out. The arguments are not
interpreted. See the GL_ERRORS #define.
2015-05-13 10:24:24 +09:00
Ji-Youn Park 4a4d5f2705 evas: fix bug in evas gl texture.
Summary: bytecount always 1,2,4. so changed for simple code.
2015-05-11 20:07:12 +09:00
Ji-Youn Park 9bf8a0e56b evas: fix bug in evas gl texture.
Summary: If the pixel size of image is not 32 bit like EVAS_COLORSPACE_AGRY88,
         GL_UNPACK_ALIGNMENT have to be changed.
2015-05-11 19:08:12 +09:00
Oleksandr Shcherbina 0f6d101ad5 evas: add to Evas_GL_Image flag disable generate atlas.
Summary:
It is need in case Evas_3D_Mesh created with not normileze texture coordinate
and flag repeat mode for Evas_3D_Texture
Additional info see here https://phab.enlightenment.org/conpherence/54/
Use Evas_GL_Image for generation texture unit for Evas_3D_Texture
see here https://phab.enlightenment.org/D2371

Reviewers: jpeg, cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-07 09:53:09 +02:00
Jean-Philippe Andre 8e8444bf35 Evas GL common: Fix clang warnings
Mooooarrr!
2015-04-21 20:11:02 +09:00
Jean-Philippe Andre 99347e9178 Evas GL common: Fix texture preload with RGB+Alpha 2015-04-14 16:37:12 +09: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 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
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 651f0ae241 Evas GL common: Improve code readability (simplify macro)
The exact same ugly macro would appear hundreds of times in the GL
code:
  GLERR(__FUNCTION__, __FILE__, __LINE__, "");

Instead, override the common GL functions iif GL_ERRORS is defined.
This greatly simplifies code and removes tons of useless lines.
Also, this will give better debugging output as the exact code line
is printed, and the function name is also printed.

Also, fix linking to the glerr function.

This is a code cleanup. Hopefully I didn't break anything with this
big operation of find & replace.
2015-02-12 11:23:03 +09:00
Daniel Zaoui cabdbb2f3c Warning-- 2014-09-11 08:35:15 +03: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
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
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 c65918eaed Evas gl: Add errors when using ETC1+Alpha as a normal texture 2014-07-09 14:01:11 +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 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 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
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
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
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 5d560dd2b9 Evas: Fix abort() when using ETC2 with alpha 2014-05-12 14:44:55 +09: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
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
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 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
Carsten Haitzler 93fd2263fc evas gl - fix egl/gles build after alpha4 change for fonts 2014-01-13 07:02:24 +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 153a744e67 evas gl engine - ensure on texture delete we never leave a cur tex id dangling 2013-12-26 21:04:25 +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