aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas/canvas/evas_clip.c
diff options
context:
space:
mode:
authorRafael Antognolli <rafael.antognolli@intel.com>2013-04-26 15:01:44 -0300
committerRafael Antognolli <rafael.antognolli@intel.com>2013-04-29 11:29:43 -0300
commit59c37d1c7b6e6df497f0c81bcc4f5fc0aa6130bf (patch)
tree1d46161b0d03dd0746f0b92a1d1f538b34258e64 /src/lib/evas/canvas/evas_clip.c
parentevas/framespace: Remove framespace offset from position set/get. (diff)
downloadefl-59c37d1c7b6e6df497f0c81bcc4f5fc0aa6130bf.tar.gz
evas/framespace: Add support for framespace offset rendering translation.
Instead of moving the objects by adding the framespace offset to them, use this offset when rendering them. This way there's no change in the object's geometry/position, it works correctly with map, and will be automatically updated in case that the framespace values change (for instance if one sets a window to borderless). There are 2 main places where changes were needed: - output redraws, when they come from an object being changed, must be add the framespace offset to their damaged area; - checks to see if the object is inside a given rendering area, must also add this offset, since the object is actually being rendered on a different position;
Diffstat (limited to 'src/lib/evas/canvas/evas_clip.c')
-rw-r--r--src/lib/evas/canvas/evas_clip.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/lib/evas/canvas/evas_clip.c b/src/lib/evas/canvas/evas_clip.c
index 67d575b07b..2256e360b3 100644
--- a/src/lib/evas/canvas/evas_clip.c
+++ b/src/lib/evas/canvas/evas_clip.c
@@ -192,6 +192,7 @@ _clip_set(Eo *eo_obj, void *_pd, va_list *list)
Evas_Object_Protected_Data *clip;
Evas_Object *eo_clip = va_arg(*list, Evas_Object *);
Evas_Object_Protected_Data *obj = _pd;
+ Evas_Public_Data *e;
if (!eo_clip)
{
@@ -256,10 +257,11 @@ _clip_set(Eo *eo_obj, void *_pd, va_list *list)
}
EINA_COW_STATE_WRITE_END(obj->cur->clipper, state_write, cur);
+ e = obj->cur->clipper->layer->evas;
if (obj->cur->clipper->cur->visible)
- evas_damage_rectangle_add(obj->cur->clipper->layer->evas->evas,
- obj->cur->clipper->cur->geometry.x,
- obj->cur->clipper->cur->geometry.y,
+ evas_damage_rectangle_add(e->evas,
+ obj->cur->clipper->cur->geometry.x + e->framespace.x,
+ obj->cur->clipper->cur->geometry.y + e->framespace.y,
obj->cur->clipper->cur->geometry.w,
obj->cur->clipper->cur->geometry.h);
}
@@ -277,9 +279,11 @@ _clip_set(Eo *eo_obj, void *_pd, va_list *list)
{
/* Basically it just went invisible */
clip->changed = 1;
- clip->layer->evas->changed = 1;
- evas_damage_rectangle_add(clip->layer->evas->evas,
- clip->cur->geometry.x, clip->cur->geometry.y,
+ e = clip->layer->evas;
+ e->changed = 1;
+ evas_damage_rectangle_add(e->evas,
+ clip->cur->geometry.x + e->framespace.x,
+ clip->cur->geometry.y + e->framespace.y,
clip->cur->geometry.w, clip->cur->geometry.h);
}
EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
@@ -387,11 +391,14 @@ _clip_unset(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED)
EINA_COW_STATE_WRITE_END(obj->cur->clipper, state_write, cur);
if (obj->cur->clipper->cur->visible)
- evas_damage_rectangle_add(obj->cur->clipper->layer->evas->evas,
- obj->cur->clipper->cur->geometry.x,
- obj->cur->clipper->cur->geometry.y,
- obj->cur->clipper->cur->geometry.w,
- obj->cur->clipper->cur->geometry.h);
+ {
+ Evas_Public_Data *e = obj->cur->clipper->layer->evas;
+ evas_damage_rectangle_add(e->evas,
+ obj->cur->clipper->cur->geometry.x + e->framespace.x,
+ obj->cur->clipper->cur->geometry.y + e->framespace.y,
+ obj->cur->clipper->cur->geometry.w,
+ obj->cur->clipper->cur->geometry.h);
+ }
}
evas_object_change(obj->cur->clipper->object, obj->cur->clipper);
}