Commit Graph

921 Commits

Author SHA1 Message Date
Avi Levin fa8f786d44 back 2015-03-16 15:55:32 +02:00
Jean-Philippe Andre bea9567d0e Evas GL: Kill runtime warnings caused by auto fallback
The previous commit modifies the concept of direct rendering
vs. indirect rendering, so some runtime checks (in debug mode
only) will fail.

This commit introduces two new engine functions:
 - gl_get_pixels_pre
 - gl_get_pixels_post

The latter will be used in a later patch for optimization.
2015-03-03 20:08:16 +09:00
Jean-Philippe Andre a14492ef73 Evas GL: Automatic fallback to indirect rendering when the scene has
not changed.

Automatically fallback to indirect rendering on FBO or X11 Pixmap
if the Evas Object Image is not marked as dirty. This should
improve the performance and/or power consumption in those
rare cases where this area of the canvas needs to be redrawn
but the GL content has not changed.

@feature
2015-03-03 18:11:32 +09:00
Dmytro Dadyka 731e6f469c [Evas: Evas_3D] Fix mesh API.
Reviewers: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2075
2015-03-03 11:28:56 +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
Jean-Philippe Andre 93d167ac87 Evas GL: Add hidden config values for direct rendering options
Those 2 new values are here to avoid using environment variables
that have side effects on the whole application.

I'm actually wondering if we shouldn't just kill off the env
vars altogether. Also, direct override is a terrible option that
should never be used.
Memory optimization can make sense (needs more testing tho).
2015-02-24 22:12:00 +09:00
Daniel Juyung Seo 9057f42453 evas: Add more notes about size_hint APIs.
Stop asking why size hint may or may not work on elementary widget.
2015-02-24 09:30:09 +09:00
Tom Hacohen 648ad2591c Fix code to conform to recent Eo changes. 2015-02-23 17:16:02 +00:00
se.osadchy cd4c0324ec evas: Evas_3D - add destructors for clean of memory.
Summary: Update and add new destructors.

Reviewers: Hermet, raster, cedric

Reviewed By: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2029
2015-02-23 15:46:41 +01:00
Dmytro Dadyka 095bab1723 evas: Evas_3D - fix bug with pack meshes data.
Reviewers: cedric

@fix

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-20 18:40:13 +01:00
Cedric BAIL a083703e3d evas: more warning fix. 2015-02-18 22:42:48 +01:00
Oleksandr Shcherbina d28b82be45 evas: Evas_3D - callbacks for Evas 3D.
Summary:
Add class and type Evas_3D_Callback like wrapper under smart object
Incapsulate Evas_3D_Callback in Evas_3D_Object
Add virtual function register and unregister in Evas_3D_Object
Add function evas_3d_callback_call
Add callbacks clicked and collision for Evas_3D_Node

@feature

Reviewers: raster, Hermet, cedric

Reviewed By: cedric

Subscribers: artem.popov, cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-18 22:42:07 +01:00
Dmytro Dadyka 1c74a1afe2 evas: Evas_3D - refactor node shapes update mechanism.
Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-17 15:39:48 +01:00
Yomi 14e65920ff evas: fix misspellings in evas_render2.
Summary: fix misspellings of 'canvas' and 'work' in the comments.

Reviewers: raster

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-16 11:58:58 +01:00
Jean-Philippe Andre 681573c555 Evas: Fix compilation warning (-Wshadow) 2015-02-13 14:00:23 +09:00
Carsten Haitzler 5213599b5a evas 3d - undo async block code - 3d objects dont inherit from evas obj 2015-02-12 22:30:10 +09:00
Carsten Haitzler d3527da0ab evas - image obj - filled mode - never use invalid 0x0 fill
this fixes a lot of noise for filled image objects that set fill to
0x0 if objetc is 0x0. this clamps minimum fill at 1x1 and thus keeps
things silent and sensible. also just silently ignore 0x0 filled image
objects. noise is not that useful.
2015-02-12 22:30:10 +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
Oleksandr Shcherbina dc0b144cf0 evas: Evas_3D - mechanism for finding node by color pick.
Summary:
See first part https://phab.enlightenment.org/D1811 (backend, gl)

Add get/set for color pick mode at evas_3d_mesh and evas_3d_scene
Add evas_3d_node_color_node_mesh_collect function to collect data at force rendering
Add state flag for scene to avoid useless force rendering in case scene wasn't changed
Add functionality for color pick in evas_3d_scene_pick method

Reviewers: Hermet, raster, cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-11 17:44:50 +01:00
kabeer khan 46b9b23144 evas: add image orient set/get API in software backend for now.
Summary:
Added API's to rotate(0, 90, 180, 270), flip(horizontal, vertical, transpose, transverse)
evas image object. Also added example to demonstrate this.

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

Reviewers: raster, stephenmhouston, cedric

Subscribers: stephenmhouston, cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-11 17:30:54 +01: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
Dmytro Dadyka d45d7d3f22 evas: Evas_3D - improve node tree update method.
Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-09 22:03:26 +01:00
Youngbok Shin 2d40315127 evas text: fix _ellipsis_get to return -1.0 on failure.
Summary:
When getting ellipsis value from evas text object fails,
the most reasonable return value is -1.0.
Currently, evas_object_text_ellipsis_get API with NULL returns 0.0.
It means ellipsis is not off. It must return -1.0 when API fails.
@fix

Comments by Tom: until now, this was inconsistent. With this change, it
now returns -1.0 consistently. Also, fixed commit summary.

Reviewers: woohyun, Hermet, seoz, tasn

Reviewed By: tasn

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1944
2015-02-09 17:31:35 +00:00
Oleksandr Shcherbina 8802ce2051 evas: Evas_3D - fix order of transformation while updating bounding object.
Summary:
The order of tranformation changed to scale, orientation, position as
in some cases it can lead to incorrect value for the bounding box.

@fix

Reviewers: cedric, Hermet, raster

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-05 15:37:15 +01:00
Oleksandr Shcherbina 0c4de0235c evas: Evas_3D - fix evas_3d_scene_pick when trying to get empty texcoords from mesh.
Summary:
During filling evas pick public data by API evas_3d_scene_pick
segfault can occur if mesh was created without texcoords.
See functions - _pick_data_mesh_add, _pick_data_texcoord_update

@fix

Reviewers: cedric, Hermet, raster

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-05 15:37:15 +01: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
ChunEon Park d85d9672b5 evas/map: make an internal function to static.
no need this function set external.
2015-01-23 22:52:25 +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 8b889f4892 Evas masking: Fix blending of some border images 2015-01-23 17:24:51 +09:00
Jean-Philippe Andre bc436ba95f Evas masking: Fix another memory leak
When the mask is hidden, free its surface.
This will fix leaks in, say, a genlist full of masked
objects.
2015-01-22 17:44:47 +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
Cedric BAIL c25ba993f6 evas: reduce potential memory hole in Evas_Object_Protected_State.
The main difference between 1.12 and 1.13 memory foot print is actually
related to this two pointer to mask. I am wondering if there is not an
issue here also has we do have a duplicated pointer. We have prev_mask
and mask in both cur and prev state of an Evas_Object, but only mask
and prev_mask from the cur state seems to be accessed.

If we can remove two pointers from those state, we should have a decent
win in expedite benchmark. Hopefully 300KB to win there (Close to half
the additional cost in memory).
2015-01-20 18:46:08 +01:00
Cedric BAIL 201df16d67 evas: reorder structure to avoid structural hole. 2015-01-20 18:46:03 +01:00
Jean-Philippe Andre 6b81f4f220 Evas masking: Fix precise_is_inside for masked smart objects
The flag should be set on the mask itself.
Checking for (x,y) being inside the mask can be an expensive operation,
so further optimization will be required.
2015-01-16 12:09:58 +09:00
Chris Michael b6f74c0a12 evas: Fix unintentional integer overflow
Summary: This fixes CID1261436: unintentional integer overflow

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-09 15:26:32 -05:00