Commit Graph

102 Commits

Author SHA1 Message Date
Elyes HAOUAS 47b71d898e Get rid of trailing whitespaces (13 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12012
2020-06-23 10:31:36 +02:00
Vincent Torri d135957ffa Use __func__ C99 identifier instead of __FUNCTION__ compiler extension
Summary: see http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf section 6.4.2.2 page 52

Test Plan: compilation

Reviewers: raster, devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11785
2020-05-07 09:27:07 -04:00
Carsten Haitzler 9149767184 getenv - reduce continually calling getenv for the same vars do once
do it once and remember the result from the first one. drops overhead
for sure by a chunk i actually could see in perf reports like about 1-2%
of cpu...
2019-08-08 23:57:02 +01:00
Chris Michael 4e2287ecaf evas-gl-common: Remove cserve2 support
ref T7226

Depends on D6927
2018-08-30 13:39:31 +09:00
Jean-Philippe Andre d6c95d1e4b evas gl: Rename secsym_ to eglsym_
eglDestroyImage has nothing to do with SEC...
This is a cosmetic change.
2017-07-20 13:31:34 +09:00
Jean-Philippe Andre 2ef8d6f39a evas filters: Refactor ector and gfx filters A LOT
Alright, so this is a massive patch that is the result of
trying to get rid of unused or poorly implemented classes in
ector. Originally ector was meant to support VG but extend to
things like filters as well. At the moment, ector's design
makes it quite hard to plug in the filters.

For now I think it's easier to implement the GL support for
the filters directly in the engine, where I hope to interfere
as little as possible.

This massive patch keeps only the required minimum to support
a versatile gl buffer that can be mapped, drawn or rendered to (FBO).
It's extremely inefficient as it relies on glReadPixels and lots
of texture uploads, as well as conversions between ARGB and Alpha.

Another type of GL buffer is a wrap around an existing GL image,
but that one is read-only (map or draw: no write map, no FBO).

No, all the filters run fine, and the high-level implementation
(evas_filters.c) does not need to know whether the underlying engine
is SW or GL. One problem though appears with the blending or blurring
of some Alpha buffers, the colors are wrong.

This patch removes more lines than it adds so it must be good ;)
2017-04-14 11:26:43 +09:00
Carsten Haitzler 9f535a3f3c emotion - fix empty video data frame update when using vdpau accel
fixes a segfault when using vdpau+gst and where the first frame seems to
be empty/zero.

@fix
2017-03-02 15:31:07 +09:00
Carsten Haitzler 473d431241 evas gl common - fix nv12 text upload with upack row length
we segv'd because our testure width was wrong... i was row span
length in bytes and we use luminance+alpha texture... this fixes it.

@fix
2017-02-26 11:44:38 +09:00
Chris Michael f026055630 evas-gl-common: Fix incorrect expression
Coverity reports this as in incorrect expression because it was
checking cache_entry width <= 0 twice. Fairly safe to assume that the
proper check should be width || height.

Fix CID1368336

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-08 19:48:26 -05:00
Carsten Haitzler bb6c324e73 evas gl - avoid a possible crash of tex upload of invalid sized image
so i had a crash where my bt said the image size is 1x1 but the img
struct said its 0x0, so put in protection to not upload a texture from
a 0x0 image... just for now... because this is odd - the image data is
a real ptr i can access and there should be at least 1 pixel... but i
can't be sure this fixes it as this is one of those "one offs" i cant
reproduce...

@fix
2017-01-06 17:46:13 +09:00
Derek Foreman 74a456253a gl_common: Make secsym_eglCreateImage a wrapper
eglCreateImage and eglCreateImageKHR are subtly different.  Now we try to
handle them both properly by exposing an abstraction.
2016-12-19 15:52:58 -06:00
Carsten Haitzler 254919d6d4 evas gl common engine - handle render to texture atlases properly 2016-11-22 20:01:25 +09:00
Carsten Haitzler 3eb0df1022 evas engines - add more support for noscale pixel buffers esp in gl
for gl noscale buffers are texture atlases that are fbo's. the point
is never to scale or transofmr them but to render them pixel for pixel
and just store pre-rendered data where its cheaper to do this than
rebuild every time. this is the enigne infra for sw and gl with the gl
code... it SHOULD work... in theory...
2016-11-17 18:41:32 +09:00
Subhransu Mohanty 16cb5f7af9 evas/gl: Added support for stencil buffer creation while creating gl Surface.
Reviewers: jpeg, cedric

Reviewed By: jpeg, cedric

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-11-16 13:46:40 -08:00
Minkyoung Kim f10672dd74 evas : remove native.func.data variable and data argument of native calblacks.
Summary:
Evas Image should be independent of render engine.
So remove native.func.data member of RGBA_Image, Evas_GL_Image struct.
And remove data argument,too.

Test Plan: Local test, Tizen3.0 mobile, Desktop englitenment

Reviewers: jpeg, spacegrapher, wonsik

Subscribers: cedric, dkdk

Differential Revision: https://phab.enlightenment.org/D3850
2016-04-01 12:09:06 +09:00
Mike Blumenkrantz 1bf0bbfae9 gl_common: remove incorrect EINA_UNUSED for evas_gl_common_texture_free 2016-03-11 16:08:43 -05:00
Jean-Philippe Andre dc4790e08b Ector GL: Add skeletton for Evas.Ector.GL.Image.Buffer
This is an ector buffer backed by an existing Evas_GL_Image
2016-01-05 15:43:44 +09:00
Minkyoung Kim 25ebd91555 evas/gl : Do not re-preload image data if texture is successfully uploaded with image data.
Summary:
'cached' flag is not enough to check whethere data is loaded and texture is uploaded.
so check more options for prevent re-preload image data on gl-backend.

Test Plan: Local Test (elementary_test : elm images)

Reviewers: jpeg, eunue

Reviewed By: jpeg

Subscribers: cedric, jiin.moon, wonsik, spacegrapher

Differential Revision: https://phab.enlightenment.org/D3446
2015-12-18 16:49:17 +09:00
Dongyeon Kim 7db0e20661 evas/gl: Bind texture with external target for tbm surface
egl images created using tbm surface for native surface set use
GL_TEXTURE_EXTERNAL_OES as texture target, so we should bind to
this target when rendering.
Dynamic hint set using tbm surface also creates egl images, but
as we only use RGB* colorspace for this we can use GL_TEXTURE_2D.
So, keep track of texture target in shader array, and bind to the
appropriate one.
This also fixes the bug that image_data_get only worked when BOTH
sec_image_map and sec_tbm_surface extensions are supported.
2015-11-12 13:56:17 +09:00
Carsten Haitzler 7b568a6152 evas gl fix color on bigendian with gl engine
this fixes rendering on ppc (bigendian) where we have thnigs swizzled
oddly. not bgra -> argb but rgba -> grab ...

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

this should fix T2721

it fixes it in the visual screenshots i can get remotely.
2015-10-18 12:49:11 +09:00
Dongyeon Kim b6649f6c6e evas/gl_common: Fix memory leak for font glyph extension image
Evas_GL_Image created for font glyphs in evas_common_font_rgba_draw
is sometimes freed after Evas_Engine_GL_Context is freed.
Since gc is already freed, pt_unref returns and leaves pt behind.
2015-10-01 10:05:28 +09:00
Subhransu Mohanty 8fe5e277e5 evas - fix texture context bind reset in gl common using wrong texture
evas gl common was simply resetting to the wrong texture id in the gl
context struct - it was using pipe[0] not state.current. why i don't
know. i know i wrote the pipe[0] code many years ago - really don';t
know. it may have been a transitional piece of code that just happened
t6o work 99% of the time that never got fixe when i added pipes.

@fix
2015-09-02 18:55:43 +09:00
Carsten Haitzler 133ab7f58c evas - gl common - make yuv gl textures double-bufffered like yuy2
this pulls yuv in line with yuy2 textures and dobule buffers them.
this is a workaround some driver bugs where either the driver doesnt
block and wait for the gpu to finish with a texture when updating OR
it does wait, and when it does it blocks and spins using cpu.
2015-08-31 10:25:02 +09:00
Oleksandr Shcherbina 1f758ad96d evas: fix size of borders in case need generate texture without atlases
Summary:
Set size of texture unit without 2 pixels for borders in case use it without
atlses. Just one case if texture for 3D use repeat mode and non-normalized
tuxture coordinates

Reviewers: Hermet, cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-07-28 22:33:52 +02:00
WooHyun Jung 1390f65beb Evas gl_common: Fix up error handling 2015-07-06 14:18:36 +09:00
WooHyun Jung ea6a31ac55 Evas gl_common: Fix up error handling 2015-07-02 21:54:51 +09:00
Carsten Haitzler cc49c1702b evas - fix yuv support to no longer ignore 709 colorspace params
if yuou use 709 instead of 601 yuv (ycbcr) evas will just be wrong and
use 601. this fixes that and implements 709. it also fixes a scaling
bug for yuv in the gl engine. no one noticed but me, so i won't call
this a bug fix, and it can go into the next efl release - no need to
backport unless it actually bothers peolpe (which it seemingly doesn't)
2015-05-27 20:19:46 +09:00
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