Commit Graph

82 Commits

Author SHA1 Message Date
Hermet Park 423d8a2296 evas image: fix a bug in image preloading.
Summary:
Current preloading is too buggy since it's on thread-based.
This is a fundamental improvement to fix a bug.

The critical issue here is,
When preloading img object suddenly cancel its preloading,
the object possibly cannot render image next then because
renderer doesn't have any idea when async cancelling is
finished. Renderer just tries to render regardless of
image loading status, and this could occur no-texture(in gl case)
image object.

So, here improvement is, adding a notification for async cancelled
so that putting img objects to redraw images properly after their preloading is
cancelled.

The best scenario to reproduce this bug is this one.

Evas_Object *img2 = evas_object_image_filled_add(evas);
evas_object_image_file_set(img2, "test.jpg", NULL);
evas_object_image_preload(img2, EINA_FALSE);
evas_object_resize(img2, 200, 200);
evas_object_show(img2);

Evas_Object *img = evas_object_image_filled_add(evas);
evas_object_image_file_set(img, "test.jpg", NULL);
evas_object_image_preload(img, EINA_FALSE);
evas_object_move(img, 200, 200);
evas_object_resize(img, 200, 200);
evas_object_show(img);

evas_object_image_preload(img2, EINA_TRUE);
If you run this on gl backend, occasionally happens rendering fail.

Yet there other bugs on preloading feature....

@fix

Reviewers: #committers, raster

Subscribers: cedric, #reviewers, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6919
2018-09-03 17:12:55 +09:00
Chris Michael 4e2287ecaf evas-gl-common: Remove cserve2 support
ref T7226

Depends on D6927
2018-08-30 13:39:31 +09:00
Hermet Park 54f2a554da evas cache: refactor internal logic.
Summary:
Adding cache targets in other modules are inproper.
This can't be managed by cache module inside.

One representive scenario is,
when preload cancel is triggered, preload canceling sequence
can't be performed properly because cache targets implicitly were
increased by backend modules.

And then, Cache itself couldn't get notified it.
see this condition.

if ((!ie->targets) && (ie->preload) && (!ie->flags.pending))
in _evas_cache_image_entry_preload_remove()

Consequently, I move preloaded callbacks to sync with adding cache targets,
not to add by backed engines themselves.

This will bring Cache to manage cache targets properly.

Reviewers: #committers, raster

Subscribers: cedric, #reviewers, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6912
2018-08-30 13:26:06 +09:00
Hermet Park 43d8c853aa evas gl: skip twice texture upload.
Summary:
While debugging a problem,
found a hole that upload texture twice unnecessary.

Here is the scenario.

Set up two objects with same image resource plus both preloading - obj1, obj2;

After image preloading,
_evas_cache_image_async_end() will be triggered.
=> ie->flags.update_data = true;

then first obj1 is gonna drawing,
Since it doesn't have any texture uploaded yet,
it will create a texture and upload texture data as well.
along with below sequence.
=> else if (!im->tex && !ie->load_error)

After it, second obj2 is gonna drawing.
But actually its texture is already readied after obj1,
it doesn't need to upload texture agin.

But still ie->flag.update_data == true, it will do dumbly.

Reviewers: #committers, devilhorns, raster

Subscribers: cedric, #reviewers, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6902
2018-08-30 13:14:13 +09:00
Hermet Park 78fb9cf124 evas gl: remove redundant code.
Reviewers: devilhorns, #committers, raster

Subscribers: cedric, #reviewers, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6901
2018-08-29 13:57:45 +09:00
Hermet Park 43fcca4acd evas cache: code refactoring.
rename to proper internal variables.
Differential Revision: https://phab.enlightenment.org/D6911
2018-08-27 21:25:29 +02:00
Mike Blumenkrantz 5b043be1db gl_common: fix invalid memory access
Summary:
code was added which ignores the comment explicitly warning not to
do what was done here

ref 9e01cf2698

ref T6970

==4829== Invalid read of size 1
==4829==    at 0x246D8F06: evas_gl_common_image_update (evas_gl_image.c:907)
==4829==    by 0x246DAA7B: evas_gl_common_image_draw (evas_gl_image.c:1417)
==4829==    by 0x246A2AB6: eng_image_draw (evas_engine.c:1240)
==4829==    by 0x6A87842: _draw_image (evas_object_image.c:1403)
==4829==    by 0x6A8A1BF: _evas_image_render (evas_object_image.c:2171)
==4829==    by 0x6A890C1: evas_object_image_render (evas_object_image.c:1868)
==4829==    by 0x6B09C82: evas_render_mapped (evas_render.c:2292)
==4829==    by 0x6B0CE90: evas_render_updates_internal_loop (evas_render.c:3079)
==4829==    by 0x6B0EACA: evas_render_updates_internal (evas_render.c:3522)
==4829==    by 0x6B1087C: evas_render_updates_internal_wait (evas_render.c:3946)
==4829==    by 0x6B10A4D: _evas_canvas_render_updates (evas_render.c:3971)
==4829==    by 0x6A7A234: evas_canvas_render_updates (evas_canvas.eo.c:212)
==4829==    by 0x6A7BBD4: evas_render_updates (evas_canvas.eo.c:758)
==4829==    by 0x808A7D8: ecore_evas_render (ecore_evas.c:177)
==4829==    by 0x808AA58: _ecore_evas_idle_enter (ecore_evas.c:284)
==4829==    by 0x5CC1E46: _ecore_call_task_cb (ecore_private.h:442)
==4829==    by 0x5CC1EAE: _ecore_factorized_idle_process (ecore_idler.c:35)
==4829==    by 0xBFA4DD4: _event_callback_call (eo_base_class.c:1663)
==4829==    by 0xBFA50A6: _efl_object_event_callback_call (eo_base_class.c:1747)
==4829==    by 0xBFA514C: efl_event_callback_call (eo_base_class.c:1750)
==4829==    by 0x5CC661B: _ecore_main_loop_iterate_internal (ecore_main.c:2352)
==4829==    by 0x5CC3F65: _ecore_main_loop_begin (ecore_main.c:1175)
==4829==    by 0x5CCC856: _efl_loop_begin (efl_loop.c:83)
==4829==    by 0x5CCEF6D: efl_loop_begin (efl_loop.eo.c:28)
==4829==    by 0x5CC40DF: ecore_main_loop_begin (ecore_main.c:1248)
==4829==    by 0x5480EE: main (e_main.c:1090)
==4829==  Address 0x2bfc30f8 is 328 bytes inside a block of size 560 free'd
==4829==    at 0x4C30D18: free (vg_replace_malloc.c:530)
==4829==    by 0x540AE91: _eina_freeq_free_do (eina_freeq.c:118)
==4829==    by 0x540B7B0: eina_freeq_ptr_add (eina_freeq.c:372)
==4829==    by 0x6BCD23C: _evas_common_rgba_image_delete (evas_image_main.c:555)
==4829==    by 0x6B41538: _evas_cache_image_entry_delete (evas_cache_image.c:205)
==4829==    by 0x6B43503: evas_cache_image_drop (evas_cache_image.c:945)
==4829==    by 0x6B43F4F: evas_cache_image_size_set (evas_cache_image.c:1166)
==4829==    by 0x246D6548: evas_gl_common_image_alloc_ensure (evas_gl_image.c:17)
==4829==    by 0x246D8EA8: evas_gl_common_image_update (evas_gl_image.c:869)
==4829==    by 0x246DAA7B: evas_gl_common_image_draw (evas_gl_image.c:1417)
==4829==    by 0x246A2AB6: eng_image_draw (evas_engine.c:1240)
==4829==    by 0x6A87842: _draw_image (evas_object_image.c:1403)
==4829==    by 0x6A8A1BF: _evas_image_render (evas_object_image.c:2171)
==4829==    by 0x6A890C1: evas_object_image_render (evas_object_image.c:1868)
==4829==    by 0x6B09C82: evas_render_mapped (evas_render.c:2292)
==4829==    by 0x6B0CE90: evas_render_updates_internal_loop (evas_render.c:3079)
==4829==    by 0x6B0EACA: evas_render_updates_internal (evas_render.c:3522)
==4829==    by 0x6B1087C: evas_render_updates_internal_wait (evas_render.c:3946)
==4829==    by 0x6B10A4D: _evas_canvas_render_updates (evas_render.c:3971)
==4829==    by 0x6A7A234: evas_canvas_render_updates (evas_canvas.eo.c:212)
==4829==    by 0x6A7BBD4: evas_render_updates (evas_canvas.eo.c:758)
==4829==    by 0x808A7D8: ecore_evas_render (ecore_evas.c:177)
==4829==    by 0x808AA58: _ecore_evas_idle_enter (ecore_evas.c:284)
==4829==    by 0x5CC1E46: _ecore_call_task_cb (ecore_private.h:442)
==4829==    by 0x5CC1EAE: _ecore_factorized_idle_process (ecore_idler.c:35)
==4829==    by 0xBFA4DD4: _event_callback_call (eo_base_class.c:1663)
==4829==    by 0xBFA50A6: _efl_object_event_callback_call (eo_base_class.c:1747)
==4829==    by 0xBFA514C: efl_event_callback_call (eo_base_class.c:1750)
==4829==    by 0x5CC661B: _ecore_main_loop_iterate_internal (ecore_main.c:2352)
==4829==    by 0x5CC3F65: _ecore_main_loop_begin (ecore_main.c:1175)
==4829==    by 0x5CCC856: _efl_loop_begin (efl_loop.c:83)
==4829==    by 0x5CCEF6D: efl_loop_begin (efl_loop.eo.c:28)
==4829==    by 0x5CC40DF: ecore_main_loop_begin (ecore_main.c:1248)
==4829==    by 0x5480EE: main (e_main.c:1090)
==4829==  Block was alloc'd at
==4829==    at 0x4C31A1E: calloc (vg_replace_malloc.c:711)
==4829==    by 0x6BCCF2F: _evas_common_rgba_image_new (evas_image_main.c:509)
==4829==    by 0x6B41588: _evas_cache_image_entry_new (evas_cache_image.c:261)
==4829==    by 0x6B44861: evas_cache_image_empty (evas_cache_image.c:1447)
==4829==    by 0x246D845B: evas_gl_common_image_native_disable (evas_gl_image.c:624)
==4829==    by 0x253F3C09: eng_image_native_set (evas_engine.c:1234)
==4829==    by 0x6A86204: _evas_image_native_surface_set (evas_object_image.c:1021)
==4829==    by 0x6A7E110: evas_object_image_native_surface_set (evas_image_legacy.c:509)
==4829==    by 0x6A8609A: _on_image_native_surface_del (evas_object_image.c:998)
==4829==    by 0x6A55190: _eo_evas_object_cb (evas_callbacks.c:184)
==4829==    by 0xBFA4EB7: _event_callback_call (eo_base_class.c:1686)
==4829==    by 0xBFA51F8: _efl_object_event_callback_legacy_call (eo_base_class.c:1759)
==4829==    by 0xBFA529E: efl_event_callback_legacy_call (eo_base_class.c:1762)
==4829==    by 0x6A968ED: _efl_canvas_object_efl_object_event_callback_legacy_call (evas_object_main.c:1229)
==4829==    by 0xBFA529E: efl_event_callback_legacy_call (eo_base_class.c:1762)
==4829==    by 0x6A55C3D: evas_object_event_callback_call (evas_callbacks.c:413)
==4829==    by 0x6A96D3E: _efl_canvas_object_efl_object_invalidate (evas_object_main.c:1279)
==4829==    by 0xBFA7BAB: efl_invalidate (efl_object.eo.c:72)
==4829==    by 0xBFA0A09: _efl_invalidate (eo_base_class.c:170)
==4829==    by 0xBFA2737: _efl_object_parent_set (eo_base_class.c:734)
==4829==    by 0xBFA6BDA: efl_parent_set (efl_object.eo.c:12)
==4829==    by 0xBFA2537: efl_del (eo_base_class.c:686)
==4829==    by 0x6A96082: evas_object_del (evas_object_main.c:1041)
==4829==    by 0x2C9D519F: _bar_icon_preview_del (bar.c:762)
==4829==    by 0x6A55190: _eo_evas_object_cb (evas_callbacks.c:184)
==4829==    by 0xBFA4EB7: _event_callback_call (eo_base_class.c:1686)
==4829==    by 0xBFA51F8: _efl_object_event_callback_legacy_call (eo_base_class.c:1759)
==4829==    by 0xBFA529E: efl_event_callback_legacy_call (eo_base_class.c:1762)
==4829==    by 0x6A968ED: _efl_canvas_object_efl_object_event_callback_legacy_call (evas_object_main.c:1229)
==4829==    by 0xBFA529E: efl_event_callback_legacy_call (eo_base_class.c:1762)
==4829==    by 0x6A55C3D: evas_object_event_callback_call (evas_callbacks.c:413)
==4829==    by 0x6A96D3E: _efl_canvas_object_efl_object_invalidate (evas_object_main.c:1279)
==4829==    by 0xBFA7BAB: efl_invalidate (efl_object.eo.c:72)
==4829==    by 0x7BE9326: _efl_access_object_efl_object_invalidate (efl_access_object.c:634)
==4829==    by 0xBFA7BAB: efl_invalidate (efl_object.eo.c:72)
==4829==    by 0xBFA0A09: _efl_invalidate (eo_base_class.c:170)
==4829==    by 0xBFA2737: _efl_object_parent_set (eo_base_class.c:734)
==4829==    by 0xBFA6BDA: efl_parent_set (efl_object.eo.c:12)
==4829==    by 0xBFA2537: efl_del (eo_base_class.c:686)
==4829==    by 0x6A96082: evas_object_del (evas_object_main.c:1041)
==4829==    by 0x7CD5F2C: _efl_ui_widget_efl_canvas_group_group_del (efl_ui_widget.c:855)
==4829==    by 0x6AAD303: efl_canvas_group_del (evas_object_smart.c:1862)
==4829==    by 0x7AFF104: _elm_box_efl_canvas_group_group_del (elm_box.c:362)
==4829==    by 0x6AAD303: efl_canvas_group_del (evas_object_smart.c:1862)
==4829==    by 0x6AABB79: evas_object_smart_del (evas_object_smart.c:1288)
==4829==    by 0x6A97179: _efl_canvas_object_efl_object_invalidate (evas_object_main.c:1336)
==4829==    by 0xBFA7BAB: efl_invalidate (efl_object.eo.c:72)
==4829==    by 0x7BE9326: _efl_access_object_efl_object_invalidate (efl_access_object.c:634)
==4829==    by 0xBFA7BAB: efl_invalidate (efl_object.eo.c:72)
==4829==    by 0xBFA0A09: _efl_invalidate (eo_base_class.c:170)
==4829==    by 0xBFA2737: _efl_object_parent_set (eo_base_class.c:734)
==4829==    by 0xBFA6BDA: efl_parent_set (efl_object.eo.c:12)
==4829==    by 0xBFA2537: efl_del (eo_base_class.c:686)
==4829==    by 0x6A96082: evas_object_del (evas_object_main.c:1041)
==4829==    by 0x2C9D41DA: _bar_icon_preview_hide (bar.c:450)
==4829==    by 0x5CFE14C: _ecore_call_task_cb (ecore_private.h:442)
==4829==    by 0x5CFE5C4: _ecore_timer_legacy_tick (ecore_timer.c:160)
==4829==    by 0xBFA4DD4: _event_callback_call (eo_base_class.c:1663)
==4829==    by 0xBFA50A6: _efl_object_event_callback_call (eo_base_class.c:1747)
==4829==    by 0xBFA514C: efl_event_callback_call (eo_base_class.c:1750)
==4829==    by 0x5CFF880: _efl_loop_timer_expired_call (ecore_timer.c:634)
==4829==    by 0x5CFF6AF: _efl_loop_timer_expired_timers_call (ecore_timer.c:587)
==4829==    by 0x5CC6522: _ecore_main_loop_iterate_internal (ecore_main.c:2317)
==4829==    by 0x5CC3F65: _ecore_main_loop_begin (ecore_main.c:1175)
==4829==    by 0x5CCC856: _efl_loop_begin (efl_loop.c:83)
==4829==    by 0x5CCEF6D: efl_loop_begin (efl_loop.eo.c:28)
==4829==    by 0x5CC40DF: ecore_main_loop_begin (ecore_main.c:1248)
==4829==    by 0x5480EE: main (e_main.c:1090)

Reviewers: ManMower

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6234
2018-05-31 13:12:18 -05:00
WooHyun Jung 07f7fee2d0 evas_gl_image: add null check 2018-04-05 11:10:43 +09:00
Jean-Philippe Andre 88bfba1fdd evas filters: Add "alphaonly" flag for blend and blur
This is very useful to specify precisely which kind of RGBA -> Alpha
conversion you want. If all you wanted was the alpha layer to use as a
mask, set this flag to true.

@feature
2017-12-14 18:03:49 +09:00
Cedric BAIL fc7e244e99 evas: remove unused fonction evas_gl_common_image_load. 2017-10-05 09:36:45 -07:00
Chris Michael 7b7161ea13 evas-gl-image: Fix dereference after null check
Coverity reports passing a null pointer 'im->gc' to
evas_gl_common_context_flush which directly dereferences it, so lets
be sure that 'im->gc' is valid before passing it to context_flush

Fixes CID1374273

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-10-05 09:54:03 -04:00
Chris Michael cec6793db4 evas-gl-common: Fix dereference after null check
Coverity reports that there may be a null pointer dereference here so
check that 'error' exists before trying to set it.

Fixes CID1374272

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-10-05 09:51:00 -04:00
Cedric BAIL c436cf6931 evas: gl_common should not segv on freeing a NULL gl_image. 2017-08-25 10:50:59 -07:00
Thiep Ha 4f77bb2f5a evas_map: support map with number of points as multiples of 4
Currently, in evas map, we only support map with 4 points.
This patch adds support for map with number of points as
multiples of 4.

@feature
2017-06-08 16:53:45 +09:00
Jean-Philippe Andre e7eb97f3b0 evas gl: Make sure a deleted image can't be the target
If we delete the image that was the target surface for gl
rendering, a crash would occur on the next render cycle.
Unlikely but not impossible to trigger from app side.

@fix
2017-04-14 11:26:44 +09:00
Jean-Philippe Andre 3d2f1a3d9b evas filters: Implement mask filter in pure GL
This reuses the existing mask infrastructure, but adds a color
flag to use the whole RGBA range, rather than just the Alpha
channel.

Filters are still very slow (glReadPixels and non-optimized use of
GL buffers...), but this is progress :)
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre 92dfe1831c evas filters: Fix blur logic and GL buffer handling
This corrects two things:
- the blur filter high-level logic, that lead to reusing some
  temporary buffers which contained garbage;
- the versatile gl buffer implementation so that it now properly
  switches between the RGBA_Image and the FBO content (yes, this
  is insanely slow and inefficient... but it works and that was
  the only point).
2017-04-14 11:26:43 +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
Youngbok Shin f83ce20e1c evas: clean up GL images for emojis when GL context is free'd
If GL context is free'd before processing font shutdown,
textures for emoji glyph's GL images will be free'd without clean
up its GL images. It causes eina mempool infinite loop issue when
emoji's GL images are free'd in shutdown process.

So, the patch will make a list for emoji's GL images in context and
clean up them when the context is free'd. Just like font textures in
context.

@fix

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

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2017-03-08 19:35:03 +09:00
Carsten Haitzler 9e01cf2698 evas image async preload - add option to also make header load async
to date if you use async preload we still load the header
synchronously and this can be horrible especially with generic
loaders. there is no way to farm this off to the preload thread. now
there is. youhave to set it as a skip head load option before doing a
file_set AND you need to issue a preload ... but now it's possible.

@feature
2017-01-02 18:53:56 +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
Jean-Philippe Andre b2d92f2626 evas: Implement support for external buffers
This brings support for the eo api for external buffers (like
the old data_set / data_get). The new API now works with slices
and planes.

The internal code still relies on the old cs.data array for
YUV color conversion. This makes the code a little bit too
complex to my taste.

Tested with expedite for RGBA and YUV 422 601 planar, both
SW and GL engines (x11).
2016-09-06 16:55:00 +09: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 437ba4c46d gl_common: call evas_gl_common_texture_free() before dropping image cache
texture_free() accesses struct members which can be freed if image cache entry
reaches zero references

@fix

==30989== Invalid read of size 1
==30989==    at 0x23BA2934: evas_gl_common_texture_free (evas_gl_texture.c:1506)
==30989==    by 0x23BA9117: evas_gl_common_image_free (evas_gl_image.c:724)
==30989==    by 0x23B80DA1: eng_image_data_put (evas_engine.c:988)
==30989==    by 0x872681A: _evas_image_data_set (evas_object_image.c:1264)
==30989==    by 0x87360B5: evas_obj_image_data_set (evas_image.eo.c:236)
==30989==    by 0x8736B43: evas_object_image_data_set (evas_image.eo.c:741)
==30989==    by 0x4820A4: e_comp_object_render (e_comp_object.c:3746)
==30989==    by 0x477B92: _e_comp_object_pixels_get (e_comp_object.c:909)
==30989==    by 0x872CF52: evas_process_dirty_pixels (evas_object_image.c:3154)
==30989==    by 0x872DD16: _evas_image_render (evas_object_image.c:3389)
==30989==    by 0x872DB01: evas_object_image_render (evas_object_image.c:3351)
==30989==    by 0x879C524: evas_render_mapped (evas_render.c:1802)
==30989==    by 0x879E82A: evas_render_updates_internal_loop (evas_render.c:2380)
==30989==    by 0x87A005D: evas_render_updates_internal (evas_render.c:2770)
==30989==    by 0x87A140D: evas_render_updates_internal_wait (evas_render.c:3122)
==30989==    by 0x87A1502: _evas_canvas_render_updates (evas_render.c:3144)
==30989==    by 0x871ED0D: evas_canvas_render_updates (evas_canvas.eo.c:354)
==30989==    by 0x8720C5F: evas_render_updates (evas_canvas.eo.c:1089)
==30989==    by 0x22F65C35: _ecore_evas_drm_render (ecore_evas_drm.c:1072)
==30989==    by 0x7416F7B: _ecore_evas_idle_enter (ecore_evas.c:172)
==30989==    by 0xDDE3577: _ecore_call_task_cb (ecore_private.h:282)
==30989==    by 0xDDE3A5E: _ecore_idle_enterer_call (ecore_idle_enterer.c:174)
==30989==    by 0xDDE836B: _ecore_main_loop_iterate_internal (ecore_main.c:2261)
==30989==    by 0xDDE67B8: ecore_main_loop_begin (ecore_main.c:1284)
==30989==    by 0x4407B6: main (e_main.c:1087)
==30989==  Address 0x23a9e1d2 is 338 bytes inside a block of size 552 free'd
==30989==    at 0x4C29E00: free (vg_replace_malloc.c:530)
==30989==    by 0x882B2E2: _evas_common_rgba_image_delete (evas_image_main.c:343)
==30989==    by 0x87B1E17: _evas_cache_image_entry_delete (evas_cache_image.c:205)
==30989==    by 0x87B3C52: evas_cache_image_drop (evas_cache_image.c:950)
==30989==    by 0x23BA90F5: evas_gl_common_image_free (evas_gl_image.c:722)
==30989==    by 0x23B80DA1: eng_image_data_put (evas_engine.c:988)
==30989==    by 0x872681A: _evas_image_data_set (evas_object_image.c:1264)
==30989==    by 0x87360B5: evas_obj_image_data_set (evas_image.eo.c:236)
==30989==    by 0x8736B43: evas_object_image_data_set (evas_image.eo.c:741)
==30989==    by 0x4820A4: e_comp_object_render (e_comp_object.c:3746)
==30989==    by 0x477B92: _e_comp_object_pixels_get (e_comp_object.c:909)
==30989==    by 0x872CF52: evas_process_dirty_pixels (evas_object_image.c:3154)
==30989==    by 0x872DD16: _evas_image_render (evas_object_image.c:3389)
==30989==    by 0x872DB01: evas_object_image_render (evas_object_image.c:3351)
==30989==    by 0x879C524: evas_render_mapped (evas_render.c:1802)
==30989==    by 0x879E82A: evas_render_updates_internal_loop (evas_render.c:2380)
==30989==    by 0x87A005D: evas_render_updates_internal (evas_render.c:2770)
==30989==    by 0x87A140D: evas_render_updates_internal_wait (evas_render.c:3122)
==30989==    by 0x87A1502: _evas_canvas_render_updates (evas_render.c:3144)
==30989==    by 0x871ED0D: evas_canvas_render_updates (evas_canvas.eo.c:354)
==30989==    by 0x8720C5F: evas_render_updates (evas_canvas.eo.c:1089)
==30989==    by 0x22F65C35: _ecore_evas_drm_render (ecore_evas_drm.c:1072)
==30989==    by 0x7416F7B: _ecore_evas_idle_enter (ecore_evas.c:172)
==30989==    by 0xDDE3577: _ecore_call_task_cb (ecore_private.h:282)
==30989==    by 0xDDE3A5E: _ecore_idle_enterer_call (ecore_idle_enterer.c:174)
==30989==    by 0xDDE836B: _ecore_main_loop_iterate_internal (ecore_main.c:2261)
==30989==    by 0xDDE67B8: ecore_main_loop_begin (ecore_main.c:1284)
==30989==    by 0x4407B6: main (e_main.c:1087)
==30989==  Block was alloc'd at
==30989==    at 0x4C2AA98: calloc (vg_replace_malloc.c:711)
==30989==    by 0x882B0A0: _evas_common_rgba_image_new (evas_image_main.c:295)
==30989==    by 0x87B1F1B: _evas_cache_image_entry_new (evas_cache_image.c:253)
==30989==    by 0x87B4170: evas_cache_image_data (evas_cache_image.c:1079)
==30989==    by 0x23BA7EDE: evas_gl_common_image_new_from_data (evas_gl_image.c:333)
==30989==    by 0x23B7F972: eng_image_new_from_data (evas_engine.c:531)
==30989==    by 0x23B80D81: eng_image_data_put (evas_engine.c:984)
==30989==    by 0x872681A: _evas_image_data_set (evas_object_image.c:1264)
==30989==    by 0x87360B5: evas_obj_image_data_set (evas_image.eo.c:236)
==30989==    by 0x8736B43: evas_object_image_data_set (evas_image.eo.c:741)
==30989==    by 0x4820A4: e_comp_object_render (e_comp_object.c:3746)
==30989==    by 0x477B92: _e_comp_object_pixels_get (e_comp_object.c:909)
==30989==    by 0x872CF52: evas_process_dirty_pixels (evas_object_image.c:3154)
==30989==    by 0x872DD16: _evas_image_render (evas_object_image.c:3389)
==30989==    by 0x872DB01: evas_object_image_render (evas_object_image.c:3351)
==30989==    by 0x879C524: evas_render_mapped (evas_render.c:1802)
==30989==    by 0x879E82A: evas_render_updates_internal_loop (evas_render.c:2380)
==30989==    by 0x87A005D: evas_render_updates_internal (evas_render.c:2770)
==30989==    by 0x87A140D: evas_render_updates_internal_wait (evas_render.c:3122)
==30989==    by 0x87A1502: _evas_canvas_render_updates (evas_render.c:3144)
==30989==    by 0x871ED0D: evas_canvas_render_updates (evas_canvas.eo.c:354)
==30989==    by 0x8720C5F: evas_render_updates (evas_canvas.eo.c:1089)
==30989==    by 0x22F65C35: _ecore_evas_drm_render (ecore_evas_drm.c:1072)
==30989==    by 0x7416F7B: _ecore_evas_idle_enter (ecore_evas.c:172)
==30989==    by 0xDDE3577: _ecore_call_task_cb (ecore_private.h:282)
==30989==    by 0xDDE3A5E: _ecore_idle_enterer_call (ecore_idle_enterer.c:174)
==30989==    by 0xDDE836B: _ecore_main_loop_iterate_internal (ecore_main.c:2261)
==30989==    by 0xDDE67B8: ecore_main_loop_begin (ecore_main.c:1284)
==30989==    by 0x4407B6: main (e_main.c:1087)
==30989==
==30989== Invalid write of size 1
==30989==    at 0x23BA293E: evas_gl_common_texture_free (evas_gl_texture.c:1506)
==30989==    by 0x23BA9117: evas_gl_common_image_free (evas_gl_image.c:724)
==30989==    by 0x23B80DA1: eng_image_data_put (evas_engine.c:988)
==30989==    by 0x872681A: _evas_image_data_set (evas_object_image.c:1264)
==30989==    by 0x87360B5: evas_obj_image_data_set (evas_image.eo.c:236)
==30989==    by 0x8736B43: evas_object_image_data_set (evas_image.eo.c:741)
==30989==    by 0x4820A4: e_comp_object_render (e_comp_object.c:3746)
==30989==    by 0x477B92: _e_comp_object_pixels_get (e_comp_object.c:909)
==30989==    by 0x872CF52: evas_process_dirty_pixels (evas_object_image.c:3154)
==30989==    by 0x872DD16: _evas_image_render (evas_object_image.c:3389)
==30989==    by 0x872DB01: evas_object_image_render (evas_object_image.c:3351)
==30989==    by 0x879C524: evas_render_mapped (evas_render.c:1802)
==30989==    by 0x879E82A: evas_render_updates_internal_loop (evas_render.c:2380)
==30989==    by 0x87A005D: evas_render_updates_internal (evas_render.c:2770)
==30989==    by 0x87A140D: evas_render_updates_internal_wait (evas_render.c:3122)
==30989==    by 0x87A1502: _evas_canvas_render_updates (evas_render.c:3144)
==30989==    by 0x871ED0D: evas_canvas_render_updates (evas_canvas.eo.c:354)
==30989==    by 0x8720C5F: evas_render_updates (evas_canvas.eo.c:1089)
==30989==    by 0x22F65C35: _ecore_evas_drm_render (ecore_evas_drm.c:1072)
==30989==    by 0x7416F7B: _ecore_evas_idle_enter (ecore_evas.c:172)
==30989==    by 0xDDE3577: _ecore_call_task_cb (ecore_private.h:282)
==30989==    by 0xDDE3A5E: _ecore_idle_enterer_call (ecore_idle_enterer.c:174)
==30989==    by 0xDDE836B: _ecore_main_loop_iterate_internal (ecore_main.c:2261)
==30989==    by 0xDDE67B8: ecore_main_loop_begin (ecore_main.c:1284)
==30989==    by 0x4407B6: main (e_main.c:1087)
==30989==  Address 0x23a9e1d2 is 338 bytes inside a block of size 552 free'd
==30989==    at 0x4C29E00: free (vg_replace_malloc.c:530)
==30989==    by 0x882B2E2: _evas_common_rgba_image_delete (evas_image_main.c:343)
==30989==    by 0x87B1E17: _evas_cache_image_entry_delete (evas_cache_image.c:205)
==30989==    by 0x87B3C52: evas_cache_image_drop (evas_cache_image.c:950)
==30989==    by 0x23BA90F5: evas_gl_common_image_free (evas_gl_image.c:722)
==30989==    by 0x23B80DA1: eng_image_data_put (evas_engine.c:988)
==30989==    by 0x872681A: _evas_image_data_set (evas_object_image.c:1264)
==30989==    by 0x87360B5: evas_obj_image_data_set (evas_image.eo.c:236)
==30989==    by 0x8736B43: evas_object_image_data_set (evas_image.eo.c:741)
==30989==    by 0x4820A4: e_comp_object_render (e_comp_object.c:3746)
==30989==    by 0x477B92: _e_comp_object_pixels_get (e_comp_object.c:909)
==30989==    by 0x872CF52: evas_process_dirty_pixels (evas_object_image.c:3154)
==30989==    by 0x872DD16: _evas_image_render (evas_object_image.c:3389)
==30989==    by 0x872DB01: evas_object_image_render (evas_object_image.c:3351)
==30989==    by 0x879C524: evas_render_mapped (evas_render.c:1802)
==30989==    by 0x879E82A: evas_render_updates_internal_loop (evas_render.c:2380)
==30989==    by 0x87A005D: evas_render_updates_internal (evas_render.c:2770)
==30989==    by 0x87A140D: evas_render_updates_internal_wait (evas_render.c:3122)
==30989==    by 0x87A1502: _evas_canvas_render_updates (evas_render.c:3144)
==30989==    by 0x871ED0D: evas_canvas_render_updates (evas_canvas.eo.c:354)
==30989==    by 0x8720C5F: evas_render_updates (evas_canvas.eo.c:1089)
==30989==    by 0x22F65C35: _ecore_evas_drm_render (ecore_evas_drm.c:1072)
==30989==    by 0x7416F7B: _ecore_evas_idle_enter (ecore_evas.c:172)
==30989==    by 0xDDE3577: _ecore_call_task_cb (ecore_private.h:282)
==30989==    by 0xDDE3A5E: _ecore_idle_enterer_call (ecore_idle_enterer.c:174)
==30989==    by 0xDDE836B: _ecore_main_loop_iterate_internal (ecore_main.c:2261)
==30989==    by 0xDDE67B8: ecore_main_loop_begin (ecore_main.c:1284)
==30989==    by 0x4407B6: main (e_main.c:1087)
==30989==  Block was alloc'd at
==30989==    at 0x4C2AA98: calloc (vg_replace_malloc.c:711)
==30989==    by 0x882B0A0: _evas_common_rgba_image_new (evas_image_main.c:295)
==30989==    by 0x87B1F1B: _evas_cache_image_entry_new (evas_cache_image.c:253)
==30989==    by 0x87B4170: evas_cache_image_data (evas_cache_image.c:1079)
==30989==    by 0x23BA7EDE: evas_gl_common_image_new_from_data (evas_gl_image.c:333)
==30989==    by 0x23B7F972: eng_image_new_from_data (evas_engine.c:531)
==30989==    by 0x23B80D81: eng_image_data_put (evas_engine.c:984)
==30989==    by 0x872681A: _evas_image_data_set (evas_object_image.c:1264)
==30989==    by 0x87360B5: evas_obj_image_data_set (evas_image.eo.c:236)
==30989==    by 0x8736B43: evas_object_image_data_set (evas_image.eo.c:741)
==30989==    by 0x4820A4: e_comp_object_render (e_comp_object.c:3746)
==30989==    by 0x477B92: _e_comp_object_pixels_get (e_comp_object.c:909)
==30989==    by 0x872CF52: evas_process_dirty_pixels (evas_object_image.c:3154)
==30989==    by 0x872DD16: _evas_image_render (evas_object_image.c:3389)
==30989==    by 0x872DB01: evas_object_image_render (evas_object_image.c:3351)
==30989==    by 0x879C524: evas_render_mapped (evas_render.c:1802)
==30989==    by 0x879E82A: evas_render_updates_internal_loop (evas_render.c:2380)
==30989==    by 0x87A005D: evas_render_updates_internal (evas_render.c:2770)
==30989==    by 0x87A140D: evas_render_updates_internal_wait (evas_render.c:3122)
==30989==    by 0x87A1502: _evas_canvas_render_updates (evas_render.c:3144)
==30989==    by 0x871ED0D: evas_canvas_render_updates (evas_canvas.eo.c:354)
==30989==    by 0x8720C5F: evas_render_updates (evas_canvas.eo.c:1089)
==30989==    by 0x22F65C35: _ecore_evas_drm_render (ecore_evas_drm.c:1072)
==30989==    by 0x7416F7B: _ecore_evas_idle_enter (ecore_evas.c:172)
==30989==    by 0xDDE3577: _ecore_call_task_cb (ecore_private.h:282)
==30989==    by 0xDDE3A5E: _ecore_idle_enterer_call (ecore_idle_enterer.c:174)
==30989==    by 0xDDE836B: _ecore_main_loop_iterate_internal (ecore_main.c:2261)
==30989==    by 0xDDE67B8: ecore_main_loop_begin (ecore_main.c:1284)
==30989==    by 0x4407B6: main (e_main.c:1087)
2016-03-11 16:08:43 -05:00
Jean-Philippe Andre 6696112691 Evas filters: Add GL buffer backed by RGBA_Image
Dumb implementation of a "smart" buffer capable of wrapping an
RGBA_Image but that can still be rendered on screen (ie, an
Evas_GL_Image is attached to it).
2016-01-05 15:43:44 +09:00
Dongyeon Kim 74e556febc evas/gl_common: Enable dynamic hint set using tbm surface only when egl extension is supported
Summary:
Dynamic hint set using tbm surface can only be used when EGL_TIZEN_image_native_surface
extension is supported by the driver. So check for both tbm surface and egl extension.
2015-11-12 08:56:29 +09:00
Dongyeon Kim 3d97c4c5a8 Revert "Evas GL: Fix crash with dynamic hint set using tbm surface"
Upcoming patch will fix this crash issue in a more proper way, so I revert this patch here.

This reverts commit 8b1b8d5cf0.
2015-11-12 08:56:29 +09:00
Joogab Yun 8b1b8d5cf0 Evas GL: Fix crash with dynamic hint set using tbm surface
Summary:
if device support sec_tbm_surface, but doesn't support the EGL_NATIVE_SURFACE_TIZEN
then below api called cause crash!
evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
evas_object_image_alpha_set(o, 0);

1. evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);

 [evas_gl_image.c]
        if (im->im)
          {
             if (evas_cache2_image_cached(&im->im->cache_entry))
               evas_cache2_image_close(&im->im->cache_entry);
             else
               evas_cache_image_drop(&im->im->cache_entry);
             im->im = NULL;  // im->im now NULL!!!
          }

        im->tex = evas_gl_common_texture_dynamic_new(im->gc, im); // im->tex also NULL!!

im->text also NULL!! because If driver does not support the EGL_NATIVE_SURFACE_TIZEN
then below code return NULL at _pool_tex_dynamic_new();

  pt->dyn.img = secsym_eglCreateImage(egldisplay,
                                      EGL_NO_CONTEXT,
                                      EGL_NATIVE_SURFACE_TIZEN,
                                      pt->dyn.buffer, attr);

2. evas_object_image_alpha_set(o, 0);

 [gl_generic/evas_engine.c]
static void * eng_image_alpha_set()
{
  now im->im and im->tex are null so crash happend at eng_image_alpha_set()
}

bug fixed in case of the tbm surface create fails so device cannot support the dynamic hit set,

Test Plan: experdite

Reviewers: jpeg, cedric, spacegrapher

Subscribers: dkdk, scholb.kim, wonsik

Differential Revision: https://phab.enlightenment.org/D3318
2015-11-11 14:38:07 +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
Carsten Haitzler 7d1a27bae9 evas gl engine - dont complain if refs are still there in cache on trim 2015-05-22 17:12:14 +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
Cedric BAIL 28e66c23b6 evas: prevent infinite loop when there is no image we can remove. 2015-05-05 10:17:00 +02:00
Jean-Philippe Andre 52c7cbddf5 Evas GL common: Avoid excessive pipe flushes in image free
This should boost performance a little bit when an image is
just unref'ed but not deleted (thus doesn't need a pipe flush).
2015-04-24 11:12:30 +09:00
kabeer khan ce45d443c1 evas: fix rotation and flipping of image in gl engine
Summary:
fix rotation(90, 180, 270) and flipping(vertical, horizontal, transpose,
transverse) of evas image in gl engine backend.

@fix

T2338

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

Reviewers: cedric, jpeg

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-04-22 15:10:19 +02:00
Jean-Philippe Andre e38f5cafd5 Evas masking: Ensure texture is up-to-date before drawing (GL) 2015-04-01 11:02:18 +09:00
Jean-Philippe Andre 740995e089 Evas GL generic: Simplify "scaled" images (used for masking)
Invert the meaning of scaled (w,h), so that im->(w,h) corresponds
to the final scaled size, and the original size is stored directly
in the texture itself.

This simplifies code a little bit.

Also, lift the limitation on the maximum texture size, as those
virtual textures are not limited by GPU texture size.
2015-04-01 09:59:49 +09:00
Jean-Philippe Andre 32009a0e8c Evas masking: Refactor GL code
Use the same method as for map masking:
- Pass absolute geometry of the mask to the push functions,
- Compute absolute position in the shader (like gl_Position)
  and apply scaling factor + offset to sample the mask.

Masking now uses a single vec4 attribute instead of hi-jacking
other vertices.

This way, all masking shaders share the same code and are way
simpler. On the other hand, the vertex shaders have a little bit
more work to do.
2015-04-01 09:53:55 +09:00
Cedric BAIL dd6db2b603 evas: fix use after free.
Thanks to Thanatermesis for tracking this in T2135.
2015-03-24 23:10:51 +01:00
Youngbok Shin e197f8804f evas: Support bitmap embedded color font.
Summary:
Add the code for getting bitmap buffers from embedded color font,
And draw the bitmap buffers as images.
For drawing the bitmap buffers as images,
evas_common_draw_context_font_ext_set internal API is changed to
pass additional gl engine functions.
T2139
@feature

Test Plan:
1. Set a bitmap embedded color font to textblock.
2. Set a unicode emoticon text.
3. See the result.

Please check the sample unicode in the following link.
http://www.fileformat.info/info/unicode/char/1f3af/index.htm
http://www.fileformat.info/info/unicode/char/1f555/index.htm
http://www.fileformat.info/info/unicode/char/2600/index.htm
http://www.fileformat.info/info/unicode/char/263a/index.htm

Reviewers: tasn, woohyun, jpeg, raster

Reviewed By: raster

Subscribers: herdsman, cedric

Differential Revision: https://phab.enlightenment.org/D2084
2015-03-19 19:02:03 +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 ab89dc401c Evas masking: Check fill properties to consider image as filled
Edje may not set the filled flag on an image even if its fill
properties make it fill the whole object. For masking, it can
then be considered as a filled image.
2015-02-27 15:57:36 +09:00
Jean-Philippe Andre 0da6278af8 Evas masking: Fix masking of maps in GL
This completes the transition to auto-scaled mask images when
using the GL engine. Now the shaders do the work on-the-fly of
resizing the mask.
2015-02-27 13:06:09 +09:00
Jean-Philippe Andre fddaf62fcc Evas masking: Add fast path for image-only masks in GL.
This will currently optimize most of the masks when using the
GL engine[1].

This is a very special case that adds a highly optimized path
for masking in GL. It works by creating a virtual image, containing
a pointer to the original image and a new geometry[2].

Instead of creating a new FBO-based surface (image_map_surface),
we refer to the original image and adjust the mask geometry on
the fly.

KNOWN BUGS:
- masking a map with such a scaled image is now broken.

[1] Right now all masks are simple Evas Object Image, so that means
    all cases of masking, except masks of masks, or masks of maps,
    will be optimized with this new method.

[2] This virtual image mechanism is still quite hackish and may
    be improved (for memory usage, refcounting, etc...)
2015-02-27 13:06:09 +09:00
Jean-Philippe Andre 1874ea9890 Evas masking: Fix evas map masking in GL
While this may look like a feature, it's definitely a fix.
2015-01-14 16:35:20 +09:00
Jean-Philippe Andre bb923d5586 Evas masking: Minor fixes in GL masking 2015-01-07 15:06:03 +09:00
Jean-Philippe Andre 61b847d47a Evas masking: Simplify and fix vertex logic in GL
There was some geometry problem, and this commit also
simplifies a lot of code by factorizing it a lot.
2015-01-07 15:06:03 +09:00
Jean-Philippe Andre a2604956f9 Evas masking: Add support for BGRA/ARGB masking
Also, refactor font & image GL masking.
2015-01-07 15:06:03 +09:00
Jean-Philippe Andre 124ab102b7 Evas masking: Implement image masking for GL engines 2015-01-07 15:06:02 +09:00
Jean-Philippe Andre f902de616e Evas: Check load_error before loading again (GL)
This is a new attempt at avoiding reload of an image
that failed to load during async preload.

See 42d2f8a12b (reverted).

I still can't figure out why setting load_error does not
work as expected (E pager becomes blank).
2014-11-19 19:47:33 +09:00