aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas
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
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')
-rw-r--r--src/lib/evas/canvas/evas_clip.c29
-rw-r--r--src/lib/evas/canvas/evas_object_image.c4
-rw-r--r--src/lib/evas/canvas/evas_object_main.c29
-rw-r--r--src/lib/evas/canvas/evas_render.c29
-rw-r--r--src/lib/evas/include/evas_inline.x20
5 files changed, 67 insertions, 44 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);
}
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index c566c8220f..c7e86e1bd9 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -4311,7 +4311,9 @@ evas_object_image_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *ob
obj->cur->clipper->cur->cache.clip.h);
}
e->engine.func->output_redraws_rect_del(e->engine.data.output,
- x, y, w, h);
+ x + e->framespace.x,
+ y + e->framespace.y,
+ w, h);
}
done:
evas_object_render_pre_effect_updates(&e->clip_changes, eo_obj, is_v, was_v);
diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c
index 87eb903913..e51e9347cb 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -408,6 +408,8 @@ evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *eo_obj, in
/* FIXME: was_v isn't used... why? */
if (!obj->clip.clipees)
{
+ Evas_Public_Data *e;
+ e = obj->layer->evas;
EINA_ARRAY_ITER_NEXT(rects, i, r, it)
{
/* get updates and clip to current clip */
@@ -421,8 +423,10 @@ evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *eo_obj, in
obj->cur->cache.clip.w,
obj->cur->cache.clip.h);
if ((w > 0) && (h > 0))
- obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
- x, y, w, h);
+ obj->layer->evas->engine.func->output_redraws_rect_add(e->engine.data.output,
+ x + e->framespace.x,
+ y + e->framespace.y,
+ w, h);
/* get updates and clip to previous clip */
x = r->x;
y = r->y;
@@ -434,8 +438,10 @@ evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *eo_obj, in
obj->prev->cache.clip.w,
obj->prev->cache.clip.h);
if ((w > 0) && (h > 0))
- obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
- x, y, w, h);
+ obj->layer->evas->engine.func->output_redraws_rect_add(e->engine.data.output,
+ x + e->framespace.x,
+ y + e->framespace.y,
+ w, h);
}
/* if the object is actually visible, take any parent clip changes */
if (is_v)
@@ -455,8 +461,10 @@ evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *eo_obj, in
obj->cur->cache.clip.w,
obj->cur->cache.clip.h);
if ((w > 0) && (h > 0))
- obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
- x, y, w, h);
+ obj->layer->evas->engine.func->output_redraws_rect_add(e->engine.data.output,
+ x + e->framespace.x,
+ y + e->framespace.y,
+ w, h);
/* get updates and clip to previous clip */
x = r->x; y = r->y; w = r->w; h = r->h;
RECTS_CLIP_TO_RECT(x, y, w, h,
@@ -465,8 +473,10 @@ evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *eo_obj, in
obj->prev->cache.clip.w,
obj->prev->cache.clip.h);
if ((w > 0) && (h > 0))
- obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
- x, y, w, h);
+ obj->layer->evas->engine.func->output_redraws_rect_add(e->engine.data.output,
+ x + e->framespace.x,
+ y + e->framespace.y,
+ w, h);
}
clipper = clipper->cur->clipper;
}
@@ -672,7 +682,6 @@ _position_set(Eo *eo_obj, void *_pd, va_list *list)
Evas_Coord x = va_arg(*list, Evas_Coord);
Evas_Coord y = va_arg(*list, Evas_Coord);
- Evas_Public_Data *evas;
Eina_Bool is, was = EINA_FALSE;
Eina_Bool pass = EINA_FALSE, freeze = EINA_FALSE;
Eina_Bool source_invisible = EINA_FALSE;
@@ -680,8 +689,6 @@ _position_set(Eo *eo_obj, void *_pd, va_list *list)
if (obj->delete_me) return;
if (!obj->layer) return;
- evas = obj->layer->evas;
-
if (evas_object_intercept_call_move(eo_obj, obj, x, y)) return;
if (obj->doing.in_move > 0)
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index cbec83c8df..fea47d44d4 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -220,13 +220,13 @@ static void
_evas_render_prev_cur_clip_cache_add(Evas_Public_Data *e, Evas_Object_Protected_Data *obj)
{
e->engine.func->output_redraws_rect_add(e->engine.data.output,
- obj->prev->cache.clip.x,
- obj->prev->cache.clip.y,
+ obj->prev->cache.clip.x + e->framespace.x,
+ obj->prev->cache.clip.y + e->framespace.y,
obj->prev->cache.clip.w,
obj->prev->cache.clip.h);
e->engine.func->output_redraws_rect_add(e->engine.data.output,
- obj->cur->cache.clip.x,
- obj->cur->cache.clip.y,
+ obj->cur->cache.clip.x + e->framespace.x,
+ obj->cur->cache.clip.y + e->framespace.y,
obj->cur->cache.clip.w,
obj->cur->cache.clip.h);
}
@@ -249,7 +249,8 @@ _evas_render_cur_clip_cache_del(Evas_Public_Data *e, Evas_Object_Protected_Data
obj->cur->clipper->cur->cache.clip.h);
}
e->engine.func->output_redraws_rect_del(e->engine.data.output,
- x, y, w, h);
+ x + e->framespace.x,
+ y + e->framespace.y, w, h);
}
static void
@@ -1629,6 +1630,8 @@ evas_render_updates_internal(Evas *eo_e,
if (do_draw)
{
unsigned int offset = 0;
+ int fx = e->framespace.x;
+ int fy = e->framespace.y;
while ((surface =
e->engine.func->output_redraws_next_update_get
@@ -1672,13 +1675,13 @@ evas_render_updates_internal(Evas *eo_e,
obj = (Evas_Object_Protected_Data *)eina_array_data_get
(&e->obscuring_objects, i);
eo_obj = obj->object;
- if (evas_object_is_in_output_rect(eo_obj, obj, ux, uy, uw, uh))
+ if (evas_object_is_in_output_rect(eo_obj, obj, ux - fx, uy - fy, uw, uh))
{
eina_array_push(&e->temporary_objects, obj);
/* reset the background of the area if needed (using cutout and engine alpha flag to help) */
if (alpha)
- _evas_render_cutout_add(e, obj, off_x, off_y);
+ _evas_render_cutout_add(e, obj, off_x + fx, off_y + fy);
}
}
if (alpha)
@@ -1709,7 +1712,7 @@ evas_render_updates_internal(Evas *eo_e,
/* if it's in our outpout rect and it doesn't clip anything */
RD(" OBJ: [%p] '%s' %i %i %ix%i\n", obj, obj->type, obj->cur->geometry.x, obj->cur->geometry.y, obj->cur->geometry.w, obj->cur->geometry.h);
- if ((evas_object_is_in_output_rect(eo_obj, obj, ux, uy, uw, uh) ||
+ if ((evas_object_is_in_output_rect(eo_obj, obj, ux - fx, uy - fy, uw, uh) ||
(obj->is_smart)) &&
(!obj->clip.clipees) &&
(obj->cur->visible) &&
@@ -1730,8 +1733,8 @@ evas_render_updates_internal(Evas *eo_e,
if (!obj->is_smart)
{
RECTS_CLIP_TO_RECT(x, y, w, h,
- obj->cur->cache.clip.x + off_x,
- obj->cur->cache.clip.y + off_y,
+ obj->cur->cache.clip.x + off_x + fx,
+ obj->cur->cache.clip.y + off_y + fy,
obj->cur->cache.clip.w,
obj->cur->cache.clip.h);
}
@@ -1746,12 +1749,12 @@ evas_render_updates_internal(Evas *eo_e,
obj2 = (Evas_Object_Protected_Data *)eina_array_data_get
(&e->temporary_objects, j);
- _evas_render_cutout_add(e, obj2, off_x, off_y);
+ _evas_render_cutout_add(e, obj2, off_x + fx, off_y + fy);
}
#endif
clean_them |= evas_render_mapped(e, eo_obj, obj, e->engine.data.context,
- surface, off_x,
- off_y, 0,
+ surface, off_x + fx,
+ off_y + fy, 0,
cx, cy, cw, ch,
NULL
#ifdef REND_DBG
diff --git a/src/lib/evas/include/evas_inline.x b/src/lib/evas/include/evas_inline.x
index 3229b0073b..88f047aea2 100644
--- a/src/lib/evas/include/evas_inline.x
+++ b/src/lib/evas/include/evas_inline.x
@@ -168,23 +168,27 @@ evas_object_is_active(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
{
if (evas_object_is_visible(eo_obj, obj) || evas_object_was_visible(eo_obj, obj))
{
+ Evas_Public_Data *e = obj->layer->evas;
+ int fx, fy;
+ fx = e->framespace.x;
+ fy = e->framespace.y;
if (obj->is_smart)
{
int mapsmt = 0;
if (obj->map->cur.map && obj->map->cur.usemap) mapsmt = 1;
if (!mapsmt) return 1;
- if (evas_object_is_in_output_rect(eo_obj, obj, 0, 0, obj->layer->evas->output.w,
- obj->layer->evas->output.h) ||
- evas_object_was_in_output_rect(eo_obj, obj, 0, 0, obj->layer->evas->output.w,
- obj->layer->evas->output.h))
+ if (evas_object_is_in_output_rect(eo_obj, obj, -fx, -fy,
+ e->output.w, e->output.h) ||
+ evas_object_was_in_output_rect(eo_obj, obj, -fx, -fy,
+ e->output.w, e->output.h))
return 1;
}
else
{
- if (evas_object_is_in_output_rect(eo_obj, obj, 0, 0, obj->layer->evas->output.w,
- obj->layer->evas->output.h) ||
- evas_object_was_in_output_rect(eo_obj, obj, 0, 0, obj->layer->evas->output.w,
- obj->layer->evas->output.h))
+ if (evas_object_is_in_output_rect(eo_obj, obj, -fx, -fy,
+ e->output.w, e->output.h) ||
+ evas_object_was_in_output_rect(eo_obj, obj, -fx, -fy,
+ e->output.w, e->output.h))
return 1;
}
}