Commit Graph

170 Commits

Author SHA1 Message Date
Cedric BAIL 46082eb13d evas: make sure that the context is only relevant to the surface we are currently manipulating. 2015-08-05 15:12:33 +02:00
Cedric BAIL c5c94ce027 evas: we now need to force mark the object as changed. 2015-08-05 15:12:33 +02:00
Cedric BAIL 033658d1ca evas: implementation of snapshot feature.
This should theorically work, need some test. Design is easy to understand. Render
every part of a snapshot object by rendering the content below it, before rendering
the stack above it using that object content.
2015-08-05 15:12:33 +02:00
Cedric BAIL 8b31b7c33a evas: prepare refactoring necessary for snapshot. 2015-08-05 15:12:33 +02:00
Jean-Philippe Andre c45ae022c8 Evas masking: Fix crash in async rendering
There was a FIXME comment... >_<

Improper management of image resources in async render led to
a rare crash. This should fix that.

@fix
2015-07-27 14:15:09 +09:00
Carsten Haitzler e0c81ed35f evas render - fix up debug macros so they don't generate any code
if render debug is not enabled make sure they end up totally empty to
avoid any possible overhead from the optimizer not stripping them out
2015-07-24 22:11:40 +09:00
Jean-Philippe Andre 29de62cd13 Evas: Fix no_render flag when in a map
no_render objects would still show up in a map surface
because of a different logic.
2015-07-15 17:51:18 +09:00
Carsten Haitzler ec6ddf59e2 evas - image core - fix unloading of images to work again
i think this has been disabled for a while. image unloading is broken
- esp with gl enigne as due to async move it was effectively disabled.

this re-enables it. unloading is deferred with a managed list of things
needing unloading and then when any async sw renders are not busy any
more - do the unload then in the mainloop of all pending/flagged
images to unload

@fix
2015-07-07 21:38:21 +09:00
Jean-Philippe Andre b5c9350805 Evas: Replace image_map_surface_free by common image_free
Those two functions were doing exactly the same thing[1], which
is free an image, so this commit only attempts to simplify the code
a little bit.

[1] Actually image_map_surface_free() might even not have worked
properly with cserve2 sw (calling unload instead of close).
2015-07-02 12:05:50 +09:00
Jean-Philippe Andre 8c47364846 Evas render: Fix rendering of objects with no_render
Well yeah, those objects should still be rendered in their
proxy or mask surface :)
2015-06-25 14:36:08 +09:00
Jean-Philippe Andre 111e51a6ff Evas: Add "no-render" flag for proxy sources & clippers
Those objects should never be rendered on the canvas, even if they
are visible. On the other hand, they need to be rendered in mask or
proxy surfaces.

note: this patch includes some extra whitespaces changes :(

@feature
2015-06-15 16:59:41 +09:00
Carsten Haitzler 25983dcedd evas render2 work - begin to make rectangles deal with render 2 basic
infra
2015-06-09 17:34:39 +09:00
Carsten Haitzler 8a101cd8f0 efl - add more evlog points
@feature
2015-05-14 17:35:22 +09:00
Jean-Philippe Andre 5209aaebdb Evas masking: Free mask surfaces during evas dump
On minimizing, free all mask surfaces. This could save a lot
of memory.

Also, write "proxy" COW only when there is a surface (the "proxy"
pointer itself is always valid and non-NULL).
2015-04-27 16:40:34 +09:00
Jean-Philippe Andre a871ac96a8 Evas masking: Skip GL fast path for border images
Right now the engines don't support mask tiles so we can't
just scale up an image on-the-fly when doing a masking operation.

Skip fast path and force render of border images into their own surface.
2015-04-17 09:33:37 +09:00
Jean-Philippe Andre 4227bae2b6 Evas render: Fix debug logs
Those are only printed out if REND_DBG is set to 1 in evas_private.h
--> Non functional change.
2015-04-17 09:26:49 +09:00
Jean-Philippe Andre b0c6a32d68 Evas render: Fix double-clipping issue with maps
Situation:
 - Evas Object A has a clip C and a map M.

Problem:
 - Clip C will be applied once inside the map surface S and
   again when the surface S is drawn to the canvas.

Solution:
 - Track whether the current object is the mapped object
   or a child of the mapped object. In the first case,
   discard the clipper when rendering to the map surface.
   In the second case, the child's clipper is PROBABLY[*]
   inside the map, so it should be applied when rendering the
   map surface itself.

Note: This also applies to masks.

[*] This is clearly not the ultimate clipping fix.
2015-04-14 16:37:12 +09:00
Subhransu Mohanty 1c093f3660 evas: fix EVAS_RENDERER_DEBUG_TIMING implementation for async rendering
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-04-03 16:34:15 +02:00
Carsten Haitzler 2347c6ff01 evas render2 - restructure it to be an explicit api call - cleaner to do 2015-03-20 18:03:54 +09:00
Jean-Philippe Andre 29be7a36c7 Evas masking: Fix rendering of masks into invalid surfaces (GL)
In some rare cases, a mask would be rendered (from mask_subrender)
into a surface that is NOT an FBO. This would happen because the
previous surface was a "scaled GL image" and its size would
match the required geometry.

That took a while to figure out...
http://thecodinglove.com/post/111546429281/when-i-finally-solve-a-nasty-bug
2015-03-12 11:32:15 +09:00
Jean-Philippe Andre 2e3ee0e658 Evas masking: Fix double free() with scaled images
The function image_scaled_update() frees() the old scaled image
passed as input if it doesn't match the old dimensions. This commit
will avoid double frees.
2015-02-27 17:56:49 +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 0d794e0b37 Evas masking: Skip GL fast path if image has fill options
If the image is not "filled", then we can't assume its image
source geometry is the same as its texture geometry.

Note: Implementing a fast path for non-filled images would
      require a hell of a lot more work (need to cut the render
      into a lot more triangles) for little real-life use.
2015-02-27 13:33:51 +09:00
Jean-Philippe Andre fab0d7f9d3 Evas masking: Simplify previous commit
Call object's function to get the private engine_data (here, the
image object). Thanks Dongyeon for your patch which inspired me to
do that instead of forcing pre_render.
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
Carsten Haitzler 7c5f92d702 evas - render - have lock point to allow for async obj walk + update add
this adds a lock for when walking all the objects to generate render
commands for an async render. this allows even the object tree walk
plus update area caluclation to be moved off into async if every oject
that can change canvas state actually does so correctly. this change
adds all those lock block calls to synchronise with an async object
tree walk.
2015-02-12 11:06:40 +09:00
Jean-Philippe Andre 7a50f5827f Evas render: Improve debug output with REND_DBG
Better formatting and less code clutter.

This is a purely non-functional change as all the
changed lines are ifdef'ed out by default.
2015-02-10 12:00:37 +09:00
Jean-Philippe Andre 69818e7c45 Evas masking: Fix another issue with masking
Fixes rendering in the following case:
- Object with a map has a mask
- Object is child of smart object which also has a map (eg. transit)
--> Masking did not apply to the children before this patch.

NOTE: This works fine in SW but still didn't work in GL, see the
      following commit...
2015-02-05 22:31:16 +09:00
Jean-Philippe Andre 9466f32dae Evas masking: Fix rendering of restacked masks of masks in a map
I know. This title does not explain anything. Whatever.

This fixes the following issue:
- Mask a genlist (big mask)
- Each item has an icon masked (small mask)
- Apply a map to the genlist
- Scrolling the genlist
--> The big mask still works but totally screws up the
    small icons with masks.

Note: Once again this patch only affects code paths where an
      object is a mask.
2015-02-04 15:03:41 +09:00
Jean-Philippe Andre a688ba45c8 Evas masking: Fix some remaining issues with animations
Yeah, mixing maps and masks of masks in a genlist leads
to tons of amazing bugs :)

This commit removes x,y from the "mask" field in an object,
as they are duplicates of cur->geometry.{x,y} but were not
properly kept in sync.

This patch fixes a situation of:
- A genlist in a map
- Each item has an icon masked
- Scrolling the genlist
--> The masked items would not render properly before this
    patch.

Remaining known problem:
- Mask a genlist (big mask)
- Each item has an icon masked (small mask)
- Apply a map to the genlist
- Scrolling the genlist
--> The big mask still works but totally screws up the
    small icons with masks.

Note: These changes look scary just before the release
      but I would have to backport them to 1.13.x as they
      definitely are bug fixes. Also, they only concern
      code paths used exclusively by masking.
2015-02-04 15:03:37 +09:00
Jean-Philippe Andre fbacbf7350 Evas masking: Fix masking of multiple objects in a map
All those masking bug fixes become harder to explain. But here goes:

 - Take a genlist, apply a mask to it (for example put everything
   in an elm_layout). Also play with various objects in the genlist.
 - Also apply a map to it (for instance, elm_transit zoom).

 --> Now some elements will be masked, some others will not,
     and some may even not render at all.

This patch restores a mask in the current drawing context, instead
of just unsetting it.
2015-02-04 12:48:10 +09:00
Jean-Philippe Andre 5fb43d3559 Evas masking: Forward previous mask where needed
In a situation where an object with mask of mask is in a map
(Yes! It can happen!) the masks would not get properly "multiplied".

Now the problem is that some objects still seem to bypass some
masks... Hmm...
2015-02-04 12:48:10 +09:00
Jean-Philippe Andre 89ee8e1446 Evas masking: Prevent drawing masks in the wrong surface
Masks should be actually rendered only to their specific target
surface.
2015-02-04 12:39:49 +09:00
Jean-Philippe Andre 5afa07bf6c Evas masking: Check only the variable we want to set
This is a left-over from a previous fix a few weeks ago.
The point of this "if" is just to avoid writing the COW value
if not needed.

For reference:
  commit f876cf31f8
  Author: Jean-Philippe Andre <jp.andre@samsung.com>
  Date:   Tue Dec 23 18:57:45 2014 +0900
    Evas masking: Fix invalid geometry after mask redraw
2015-02-03 11:12:20 +09:00
Jean-Philippe Andre 5b4e0ece68 evas: fix some clipping issues before/after Evas_Map animations
Summary:
This is an attempt at fixing:
 - T1767: The ultimate evil map & clip bug

Force recalculation and re-propagation of clipper geometry
after or just before a map is applied (only when transiting
between map enabled and map disabled).

I realized that doing clip_unset+clip_set in the E widget
code would fix the issue, but this is not a solution that
makes a lot of sense.

Unfortunately I have no idea about the side effects of this
patch, especially in terms of performance.

Fixes T1767 and maybe T1630.

Test Plan:
Open PackageKit popup in E, check the animations
and that clipping works fine both during, before and after
the animations.

Reviewers: raster, cedric

Reviewed By: cedric

Subscribers: cedric, Hermet

Maniphest Tasks: T1767

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-01-28 09:28:39 +01:00
Jean-Philippe Andre bd818f7eca Evas render: Remove useless code
While invesigating some clip & map issues, I found some very
strange piece of code:
{
  tmp = a;
  a = c;
  a = tmp;
}

This actually comes from a very old code refactoring where a
line in-between was removed:

   tobj = obj->cur.map_parent;
   obj->cur.map_parent = obj->cur.clipper->cur.map_parent;
 - evas_object_clip_recalc(obj);
   obj->cur.map_parent = tobj;

Adding this line back there doesn't seem to do anything anyways.
So, let's just remove useless code.

For the record (legacy evas):
  commit e1f6f3c5f239dfd95a307949acd5f98831c0c3c0
  Date:   Fri Aug 17 06:16:04 2012 +0000
  evas/render - code refactoring.
  SVN revision: 75351
2015-01-27 12:28:08 +09:00
Jean-Philippe Andre a376582b4f Evas masking: Fix masking of mapped sub-objects
Some complex examples of masking with mapped smart objects
would fail miserably, rendering the object without any mask,
and/or showing the mask itself somewhere in white color...
2015-01-26 19:25:36 +09:00
Jean-Philippe Andre 77feb96dd7 Evas masking: Fix rendering of masked objects with maps 2015-01-26 19:25:36 +09:00
Jean-Philippe Andre 4c864f757a Evas masking: And another case of bad mask rendering
A masked object just can't be considered as opaque. As such,
it can't generate an obscure area. This fixes some super
rare rendering bug.
2015-01-23 17:24:51 +09:00
Jean-Philippe Andre 15f7cefa68 Evas masking: Fix major memory leak
The memory usage graph was going up and to the right!
I was told this is always a good thing!

... maybe not this time :)

Hopefully I didn't forget a case. An intense session of
genlist scrolling with masks all over the place and masks
of masks didn't show any glitch, crash or memory leak.
2015-01-21 17:51:15 +09:00
Jean-Philippe Andre 0793dee86a Evas masking: Try to reduce memory footprint a little
Move some mask object pointers around to spare a few
bytes of memory.

Fixes T2025.
2015-01-21 17:38:22 +09:00
Jean-Philippe Andre f876cf31f8 Evas masking: Fix invalid geometry after mask redraw
The proper geometry should be set when rendering the mask,
otherwise we can't create a new surface if it changed dimensions.
2015-01-07 15:06:03 +09:00
Jean-Philippe Andre 73919ea437 Evas masking: Implement mask support in evas_render
This implements supports for masking inside evas_render, which
means:
- Render the mask itself into a surface (ALPHA if possible)
- Pass this mask surface to the draw context
- Apply mask recursively in case a masked object is contained
  by another masked object.

@feature
2015-01-07 15:06:02 +09:00
Jean-Philippe Andre 5a13e97c1b Evas: Use ENFN/ENDT in proxy subrender
Again, just a code readability change.
2014-11-12 19:25:21 +09:00
Jean-Philippe Andre a56cc8a8c1 Evas: Avoid creating an extra context for proxy rendering 2014-11-12 19:18:09 +09:00
Jean-Philippe Andre fe677a0518 Evas: Use common function for proxy_subrender
Merges functions from:
- filters
- image object
2014-11-12 17:11:49 +09:00
Jean-Philippe Andre 4fb138a65f Evas: Remove ugly REND_DBG
Here's a macro that's used for debugging in some of the ugliest
ways possible: avoid passing an extra argument to a function when the
cost of always passing it is negligible (it's an int).

Fixes T1749.
2014-11-12 15:26:59 +09:00
ChunEon Park 4cc893f0af evas/render: don't make children active unless the active object has the proxies.
the src change sholud be true only if the object has any proxies.
otherwise, the children will be pushed in active objects unnecessarily.
2014-09-01 19:54:21 +09:00
Carsten Haitzler 5ca08e65d8 evas render - checking if can overlay was broking checking parent maps
brought out by CID 1039454 - fix!
2014-08-27 12:46:43 +09:00
Tom Hacohen 7f3a44894b Evas canvas eolian: Fix namespace and class name for the evas canvas. 2014-06-30 17:47:06 +01:00