2008-05-26 06:08:54 -07:00
|
|
|
#ifndef EVAS_INLINE_H
|
|
|
|
#define EVAS_INLINE_H
|
|
|
|
|
2014-11-12 17:47:29 -08:00
|
|
|
#include "evas_private.h"
|
|
|
|
|
2016-11-02 03:51:20 -07:00
|
|
|
/* Paranoid safety checks.
|
|
|
|
* This can avoid lots of SEGV with dangling pointers to deleted objects.
|
|
|
|
* Two variants: valid or alive (extra check on delete_me).
|
|
|
|
*/
|
|
|
|
#define EVAS_OBJECT_DATA_VALID(o) ((o) && (o)->layer && (o)->layer->evas)
|
|
|
|
#define EVAS_OBJECT_DATA_ALIVE(o) (EVAS_OBJECT_DATA_VALID(o) && !(o)->delete_me)
|
|
|
|
#define EVAS_OBJECT_DATA_VALID_CHECK(o, ...) do { \
|
|
|
|
if (EINA_UNLIKELY(!EVAS_OBJECT_DATA_VALID(o))) return __VA_ARGS__; } while (0)
|
|
|
|
#define EVAS_OBJECT_DATA_ALIVE_CHECK(o, ...) do { \
|
|
|
|
if (EINA_UNLIKELY(!EVAS_OBJECT_DATA_ALIVE(o))) return __VA_ARGS__; } while (0)
|
2016-11-14 19:17:18 -08:00
|
|
|
#define EVAS_OBJECT_DATA_GET(eo_o) \
|
|
|
|
efl_data_scope_get((eo_o), EFL_CANVAS_OBJECT_CLASS)
|
2016-11-02 03:51:20 -07:00
|
|
|
#define EVAS_OBJECT_DATA_SAFE_GET(eo_o) \
|
2017-08-22 23:16:22 -07:00
|
|
|
efl_data_scope_safe_get((eo_o), EFL_CANVAS_OBJECT_CLASS)
|
2016-11-02 03:51:20 -07:00
|
|
|
|
2012-06-14 02:58:16 -07:00
|
|
|
static inline Eina_Bool
|
2016-01-06 04:52:46 -08:00
|
|
|
_evas_render_has_map(Evas_Object_Protected_Data *obj)
|
2012-06-14 02:58:16 -07:00
|
|
|
{
|
2016-01-06 04:52:46 -08:00
|
|
|
return (obj->map->cur.map && obj->map->cur.usemap);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline Eina_Bool
|
|
|
|
_evas_render_can_map(Evas_Object_Protected_Data *obj)
|
|
|
|
{
|
|
|
|
if (!obj->func->can_map) return EINA_FALSE;
|
|
|
|
return obj->func->can_map(obj->object);
|
2012-06-14 02:58:16 -07:00
|
|
|
}
|
|
|
|
|
2017-04-25 23:11:51 -07:00
|
|
|
static inline void
|
2019-02-20 12:32:41 -08:00
|
|
|
_evas_object_gfx_mapping_update(Evas_Object_Protected_Data *obj)
|
2017-04-25 23:11:51 -07:00
|
|
|
{
|
2019-02-20 12:32:41 -08:00
|
|
|
if (!obj->gfx_mapping_has) return;
|
|
|
|
_efl_gfx_mapping_update(obj->object);
|
2017-04-25 23:11:51 -07:00
|
|
|
}
|
|
|
|
|
2016-08-18 21:33:11 -07:00
|
|
|
static inline int
|
2010-03-04 06:48:21 -08:00
|
|
|
_evas_object_event_new(void)
|
|
|
|
{
|
2016-08-18 21:33:11 -07:00
|
|
|
return (++_evas_event_counter);
|
2010-03-04 06:48:21 -08:00
|
|
|
}
|
|
|
|
|
2016-08-19 00:40:57 -07:00
|
|
|
static inline Eina_Bool
|
|
|
|
_evas_object_callback_has_by_type(Evas_Object_Protected_Data *obj, Evas_Callback_Type type)
|
|
|
|
{
|
2017-07-28 04:08:21 -07:00
|
|
|
return (obj->callback_mask & (((uint64_t)1) << type)) != 0;
|
2016-08-19 00:40:57 -07:00
|
|
|
}
|
|
|
|
|
2009-04-08 04:08:02 -07:00
|
|
|
static inline int
|
2019-05-29 12:36:46 -07:00
|
|
|
evas_object_was_visible(Evas_Object_Protected_Data *obj)
|
2009-04-08 04:08:02 -07:00
|
|
|
{
|
2017-01-23 22:34:24 -08:00
|
|
|
if (EINA_UNLIKELY(!obj->prev)) return 0;
|
2016-07-25 00:45:32 -07:00
|
|
|
if ((obj->prev->visible) && (!obj->no_render) &&
|
2013-03-12 05:58:19 -07:00
|
|
|
((obj->prev->cache.clip.visible) || obj->is_smart) &&
|
|
|
|
((obj->prev->cache.clip.a > 0 && obj->prev->render_op == EVAS_RENDER_BLEND)
|
|
|
|
|| obj->prev->render_op != EVAS_RENDER_BLEND))
|
2009-04-08 04:08:02 -07:00
|
|
|
{
|
2011-10-21 03:10:47 -07:00
|
|
|
if (obj->func->was_visible)
|
2019-05-29 12:36:46 -07:00
|
|
|
return obj->func->was_visible(obj->object);
|
2011-10-21 03:10:47 -07:00
|
|
|
return 1;
|
2009-04-08 04:08:02 -07:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-07-07 14:29:29 -07:00
|
|
|
static inline void
|
2009-04-15 06:40:37 -07:00
|
|
|
evas_add_rect(Eina_Array *rects, int x, int y, int w, int h)
|
2008-07-07 14:29:29 -07:00
|
|
|
{
|
2009-06-23 06:57:27 -07:00
|
|
|
Eina_Rectangle *r;
|
2008-07-07 14:29:29 -07:00
|
|
|
|
2009-04-15 06:40:37 -07:00
|
|
|
NEW_RECT(r, x, y, w, h);
|
|
|
|
if (r) eina_array_push(rects, r);
|
2008-07-07 14:29:29 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline Cutout_Rect*
|
|
|
|
evas_common_draw_context_cutouts_add(Cutout_Rects* rects,
|
|
|
|
int x, int y, int w, int h)
|
|
|
|
{
|
|
|
|
Cutout_Rect* rect;
|
|
|
|
|
|
|
|
if (rects->max < (rects->active + 1))
|
|
|
|
{
|
2015-09-23 22:06:40 -07:00
|
|
|
rects->max += 512;
|
2011-10-21 03:10:47 -07:00
|
|
|
rects->rects = (Cutout_Rect *)realloc(rects->rects, sizeof(Cutout_Rect) * rects->max);
|
2008-07-07 14:29:29 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
rect = rects->rects + rects->active;
|
|
|
|
rect->x = x;
|
|
|
|
rect->y = y;
|
|
|
|
rect->w = w;
|
|
|
|
rect->h = h;
|
|
|
|
rects->active++;
|
|
|
|
|
|
|
|
return rect;
|
|
|
|
}
|
|
|
|
|
2008-05-26 06:08:54 -07:00
|
|
|
static inline int
|
2019-05-29 12:37:07 -07:00
|
|
|
evas_object_is_opaque(Evas_Object_Protected_Data *obj)
|
2008-05-26 06:08:54 -07:00
|
|
|
{
|
2015-05-12 01:37:01 -07:00
|
|
|
if (obj->is_smart || obj->no_render) return 0;
|
2017-03-16 22:54:40 -07:00
|
|
|
if (obj->cur->render_op == EVAS_RENDER_COPY)
|
|
|
|
return 1;
|
2014-11-12 17:47:29 -08:00
|
|
|
/* If clipped: Assume alpha */
|
2013-03-12 05:58:19 -07:00
|
|
|
if (obj->cur->cache.clip.a == 255)
|
2008-05-26 06:08:54 -07:00
|
|
|
{
|
2014-11-12 17:47:29 -08:00
|
|
|
/* If has mask image: Always assume non opaque */
|
|
|
|
if ((obj->cur->clipper && obj->cur->clipper->mask->is_mask) ||
|
2015-01-20 22:14:50 -08:00
|
|
|
(obj->clip.mask))
|
2014-11-12 17:47:29 -08:00
|
|
|
return 0;
|
2011-10-21 03:10:47 -07:00
|
|
|
if (obj->func->is_opaque)
|
2019-05-29 12:37:07 -07:00
|
|
|
return obj->func->is_opaque(obj->object, obj, obj->private_data);
|
2011-10-21 03:10:47 -07:00
|
|
|
return 1;
|
2008-05-26 06:08:54 -07:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-10-22 08:20:28 -07:00
|
|
|
static inline int
|
2019-05-29 12:37:13 -07:00
|
|
|
evas_object_is_on_plane(Evas_Object_Protected_Data *obj)
|
2018-10-22 08:20:28 -07:00
|
|
|
{
|
|
|
|
if (obj->func->is_on_plane)
|
2019-05-29 12:37:13 -07:00
|
|
|
return obj->func->is_on_plane(obj->object, obj, obj->private_data);
|
2018-10-22 08:20:28 -07:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-10-22 08:22:26 -07:00
|
|
|
static inline int
|
2019-05-29 12:37:18 -07:00
|
|
|
evas_object_plane_changed(Evas_Object_Protected_Data *obj)
|
2018-10-22 08:22:26 -07:00
|
|
|
{
|
|
|
|
if (obj->func->plane_changed)
|
2019-05-29 12:37:18 -07:00
|
|
|
return obj->func->plane_changed(obj->object, obj, obj->private_data);
|
2018-10-22 08:22:26 -07:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-10-31 18:41:09 -07:00
|
|
|
static inline int
|
2012-11-04 03:51:42 -08:00
|
|
|
evas_event_freezes_through(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2011-10-27 03:36:09 -07:00
|
|
|
{
|
2011-10-31 18:41:09 -07:00
|
|
|
if (obj->freeze_events) return 1;
|
2011-10-27 03:36:09 -07:00
|
|
|
if (obj->parent_cache.freeze_events_valid)
|
|
|
|
return obj->parent_cache.freeze_events;
|
2011-10-31 18:41:09 -07:00
|
|
|
if (!obj->smart.parent) return 0;
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *smart_parent_pd = efl_data_scope_get(obj->smart.parent, EFL_CANVAS_OBJECT_CLASS);
|
2011-10-31 18:41:09 -07:00
|
|
|
obj->parent_cache.freeze_events =
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_freezes_through(obj->smart.parent, smart_parent_pd);
|
2011-10-31 18:41:09 -07:00
|
|
|
obj->parent_cache.freeze_events_valid = EINA_TRUE;
|
|
|
|
return obj->parent_cache.freeze_events;
|
2011-10-27 03:36:09 -07:00
|
|
|
}
|
|
|
|
|
2008-05-26 06:08:54 -07:00
|
|
|
static inline int
|
2012-11-04 03:51:42 -08:00
|
|
|
evas_event_passes_through(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2008-05-26 06:08:54 -07:00
|
|
|
{
|
2016-03-28 04:10:21 -07:00
|
|
|
if (obj->pass_events || obj->no_render) return 1;
|
2011-10-24 19:26:51 -07:00
|
|
|
if (obj->parent_cache.pass_events_valid)
|
|
|
|
return obj->parent_cache.pass_events;
|
2011-10-31 18:41:09 -07:00
|
|
|
if (!obj->smart.parent) return 0;
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *smart_parent_pd = efl_data_scope_get(obj->smart.parent, EFL_CANVAS_OBJECT_CLASS);
|
2011-10-31 18:41:09 -07:00
|
|
|
obj->parent_cache.pass_events =
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_passes_through(obj->smart.parent, smart_parent_pd);
|
2011-10-31 18:41:09 -07:00
|
|
|
obj->parent_cache.pass_events_valid = EINA_TRUE;
|
|
|
|
return obj->parent_cache.pass_events;
|
2008-05-26 06:08:54 -07:00
|
|
|
}
|
|
|
|
|
2012-10-18 04:30:04 -07:00
|
|
|
static inline int
|
2012-11-04 03:51:42 -08:00
|
|
|
evas_object_is_source_invisible(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2012-10-18 04:30:04 -07:00
|
|
|
{
|
2012-10-25 08:24:27 -07:00
|
|
|
if (obj->parent_cache.src_invisible_valid)
|
|
|
|
return obj->parent_cache.src_invisible;
|
2020-03-25 03:14:02 -07:00
|
|
|
if (obj->proxy->proxies && obj->proxy->src_invisible) return 1;
|
2012-10-18 04:30:04 -07:00
|
|
|
if (!obj->smart.parent) return 0;
|
2015-07-15 00:41:59 -07:00
|
|
|
if (obj->mask->is_mask) return 0;
|
2012-10-18 04:30:04 -07:00
|
|
|
Evas_Object_Protected_Data *smart_parent_pd =
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_data_scope_get(obj->smart.parent, EFL_CANVAS_OBJECT_CLASS);
|
2012-10-25 08:24:27 -07:00
|
|
|
obj->parent_cache.src_invisible =
|
2012-10-18 04:30:04 -07:00
|
|
|
evas_object_is_source_invisible(obj->smart.parent, smart_parent_pd);
|
2012-10-25 08:24:27 -07:00
|
|
|
obj->parent_cache.src_invisible_valid = EINA_TRUE;
|
|
|
|
return obj->parent_cache.src_invisible;
|
2012-10-18 04:30:04 -07:00
|
|
|
}
|
|
|
|
|
2008-05-26 06:08:54 -07:00
|
|
|
static inline int
|
2019-05-29 12:36:53 -07:00
|
|
|
evas_object_is_visible(Evas_Object_Protected_Data *obj)
|
2016-03-28 01:47:02 -07:00
|
|
|
{
|
2017-01-23 22:34:24 -08:00
|
|
|
if (EINA_UNLIKELY(!obj->cur)) return 0;
|
2016-03-28 01:47:02 -07:00
|
|
|
if ((obj->cur->visible) && (!obj->no_render) &&
|
2013-03-12 05:58:19 -07:00
|
|
|
((obj->cur->cache.clip.visible) || (obj->is_smart)) &&
|
|
|
|
((obj->cur->cache.clip.a > 0 && obj->cur->render_op == EVAS_RENDER_BLEND)
|
|
|
|
|| obj->cur->render_op != EVAS_RENDER_BLEND))
|
2008-05-26 06:08:54 -07:00
|
|
|
{
|
2011-10-21 03:10:47 -07:00
|
|
|
if (obj->func->is_visible)
|
2019-05-29 12:36:53 -07:00
|
|
|
return obj->func->is_visible(obj->object);
|
2011-10-21 03:10:47 -07:00
|
|
|
return 1;
|
2008-05-26 06:08:54 -07:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
2012-11-04 03:51:42 -08:00
|
|
|
evas_object_clippers_is_visible(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2008-05-26 06:08:54 -07:00
|
|
|
{
|
2013-03-12 05:58:19 -07:00
|
|
|
if (obj->cur->visible)
|
2008-05-26 06:08:54 -07:00
|
|
|
{
|
2013-03-12 05:58:19 -07:00
|
|
|
if (obj->cur->clipper)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2013-04-06 22:00:10 -07:00
|
|
|
return evas_object_clippers_is_visible(obj->cur->clipper->object,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->cur->clipper);
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
2011-10-21 03:10:47 -07:00
|
|
|
return 1;
|
2008-05-26 06:08:54 -07:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
2019-05-29 12:36:59 -07:00
|
|
|
evas_object_is_proxy_visible(Evas_Object_Protected_Data *obj)
|
2013-07-28 04:24:46 -07:00
|
|
|
{
|
|
|
|
if ((obj->cur->visible) &&
|
|
|
|
//FIXME: Check the cached clipper visible properly.
|
2013-08-18 00:31:43 -07:00
|
|
|
(obj->is_smart || !obj->cur->clipper || obj->cur->clipper->cur->visible) &&
|
2013-07-28 04:24:46 -07:00
|
|
|
((obj->cur->cache.clip.a > 0 && obj->cur->render_op == EVAS_RENDER_BLEND)
|
|
|
|
|| obj->cur->render_op != EVAS_RENDER_BLEND))
|
|
|
|
{
|
|
|
|
if (obj->func->is_visible)
|
2019-05-29 12:36:59 -07:00
|
|
|
return obj->func->is_visible(obj->object);
|
2013-07-28 04:24:46 -07:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
2012-11-04 03:51:42 -08:00
|
|
|
evas_object_is_in_output_rect(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, int x, int y, int w, int h)
|
2008-05-26 06:08:54 -07:00
|
|
|
{
|
|
|
|
/* assumes coords have been recalced */
|
|
|
|
if ((RECTS_INTERSECT(x, y, w, h,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->cur->cache.clip.x,
|
|
|
|
obj->cur->cache.clip.y,
|
|
|
|
obj->cur->cache.clip.w,
|
|
|
|
obj->cur->cache.clip.h)))
|
2008-05-26 06:08:54 -07:00
|
|
|
return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_is_active(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
2008-05-26 06:08:54 -07:00
|
|
|
{
|
2019-05-29 12:36:53 -07:00
|
|
|
if (evas_object_is_visible(obj) || evas_object_was_visible(obj))
|
2009-11-19 00:37:22 -08:00
|
|
|
{
|
2013-04-26 11:01:44 -07:00
|
|
|
Evas_Public_Data *e = obj->layer->evas;
|
|
|
|
int fx, fy;
|
|
|
|
fx = e->framespace.x;
|
|
|
|
fy = e->framespace.y;
|
2017-11-28 18:48:21 -08:00
|
|
|
if (obj->is_smart && !(obj->map->cur.map && obj->map->cur.usemap))
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
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;
|
2009-11-19 00:37:22 -08:00
|
|
|
}
|
2012-07-26 01:44:54 -07:00
|
|
|
/* FIXME: forcing object with proxies to stay active,
|
|
|
|
need to be smarter and only do that when really needed. */
|
2013-01-16 23:21:06 -08:00
|
|
|
if (obj->proxy->proxies && obj->changed)
|
2012-07-26 01:44:54 -07:00
|
|
|
return 1;
|
2016-12-15 19:16:01 -08:00
|
|
|
if (obj->mask->is_mask && obj->clip.clipees)
|
|
|
|
return 1;
|
2008-05-26 06:08:54 -07:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_coords_recalc(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
2008-05-26 06:08:54 -07:00
|
|
|
{
|
2013-03-12 05:58:19 -07:00
|
|
|
//// if (obj->cur->cache.geometry.validity == obj->layer->evas->output_validity)
|
2008-05-26 06:08:54 -07:00
|
|
|
//// return;
|
2013-03-12 05:58:19 -07:00
|
|
|
//// obj->cur->cache.geometry.x =
|
|
|
|
//// evas_coord_world_x_to_screen(obj->layer->evas, obj->cur->geometry.x);
|
|
|
|
//// obj->cur->cache.geometry.y =
|
|
|
|
//// evas_coord_world_y_to_screen(obj->layer->evas, obj->cur->geometry.y);
|
|
|
|
//// obj->cur->cache.geometry.w =
|
|
|
|
//// evas_coord_world_x_to_screen(obj->layer->evas, obj->cur->geometry.w) -
|
2008-05-26 06:08:54 -07:00
|
|
|
//// evas_coord_world_x_to_screen(obj->layer->evas, 0);
|
2013-03-12 05:58:19 -07:00
|
|
|
//// obj->cur->cache.geometry.h =
|
|
|
|
//// evas_coord_world_y_to_screen(obj->layer->evas, obj->cur->geometry.h) -
|
2008-05-26 06:08:54 -07:00
|
|
|
//// evas_coord_world_y_to_screen(obj->layer->evas, 0);
|
2013-07-08 17:46:15 -07:00
|
|
|
if (obj->func->coords_recalc) obj->func->coords_recalc(eo_obj, obj, obj->private_data);
|
2013-03-12 05:58:19 -07:00
|
|
|
//// obj->cur->cache.geometry.validity = obj->layer->evas->output_validity;
|
2008-05-26 06:08:54 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
2017-02-20 03:24:21 -08:00
|
|
|
evas_object_clip_recalc(Evas_Object_Protected_Data *obj)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *clipper = NULL;
|
|
|
|
|
|
|
|
EVAS_OBJECT_DATA_ALIVE_CHECK(obj);
|
|
|
|
|
|
|
|
clipper = obj->cur->clipper;
|
|
|
|
|
|
|
|
if (EINA_LIKELY(((!obj->cur->cache.clip.dirty) &&
|
|
|
|
!(!clipper || clipper->cur->cache.clip.dirty)))) return;
|
|
|
|
|
|
|
|
if (EINA_UNLIKELY(obj->layer->evas->is_frozen)) return;
|
|
|
|
|
|
|
|
evas_object_clip_recalc_do(obj, clipper);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
2017-02-20 06:14:38 -08:00
|
|
|
evas_object_clip_dirty(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
|
|
|
{
|
|
|
|
if (obj->cur->cache.clip.dirty) return;
|
|
|
|
evas_object_clip_dirty_do(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
2015-02-10 03:44:38 -08:00
|
|
|
evas_object_async_block(Evas_Object_Protected_Data *obj)
|
|
|
|
{
|
2016-11-02 03:51:20 -07:00
|
|
|
if (EVAS_OBJECT_DATA_VALID(obj))
|
2015-02-10 03:44:38 -08:00
|
|
|
{
|
|
|
|
eina_lock_take(&(obj->layer->evas->lock_objects));
|
|
|
|
eina_lock_release(&(obj->layer->evas->lock_objects));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
evas_canvas_async_block(Evas_Public_Data *e)
|
|
|
|
{
|
|
|
|
if (e)
|
|
|
|
{
|
|
|
|
eina_lock_take(&(e->lock_objects));
|
|
|
|
eina_lock_release(&(e->lock_objects));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-16 16:05:56 -08:00
|
|
|
static inline void
|
|
|
|
evas_common_draw_context_cache_update(RGBA_Draw_Context *dc)
|
|
|
|
{
|
|
|
|
dc->cache.used++;
|
|
|
|
if (dc->cache.used >= 4096)
|
|
|
|
{
|
|
|
|
evas_common_draw_context_cutouts_real_free(dc->cache.rects);
|
|
|
|
dc->cache.rects = NULL;
|
|
|
|
dc->cache.used = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-22 23:55:41 -07:00
|
|
|
static inline Eina_Bool
|
|
|
|
_evas_eina_rectangle_inside(const Eina_Rectangle *big, const Eina_Rectangle *small)
|
|
|
|
{
|
|
|
|
Eina_Rectangle inter = *big;
|
|
|
|
|
|
|
|
if (!eina_rectangle_intersection(&inter, small))
|
|
|
|
return EINA_FALSE;
|
|
|
|
if ((inter.w == small->w) && (inter.h == small->h))
|
|
|
|
return EINA_TRUE;
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2017-04-24 15:09:25 -07:00
|
|
|
// Temporary until we have multi output support
|
|
|
|
static inline void *
|
|
|
|
_evas_default_output_get(Evas_Public_Data *e)
|
|
|
|
{
|
|
|
|
Efl_Canvas_Output *output;
|
|
|
|
|
|
|
|
output = eina_list_data_get(e->outputs);
|
2017-06-02 15:23:44 -07:00
|
|
|
return output ? output->output : NULL;
|
2017-04-24 15:09:25 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline void *
|
|
|
|
_evas_engine_context(Evas_Public_Data *e)
|
|
|
|
{
|
2017-08-25 10:49:53 -07:00
|
|
|
return e->backend;
|
2017-04-24 15:09:25 -07:00
|
|
|
}
|
|
|
|
|
2018-05-09 20:01:17 -07:00
|
|
|
static inline void
|
|
|
|
_evas_wrap_del(Evas_Object **eo, Evas_Object_Protected_Data *pd)
|
|
|
|
{
|
|
|
|
if (!*eo) return ;
|
2018-06-12 07:19:12 -07:00
|
|
|
if (pd && pd->legacy.ctor) evas_object_del(*eo);
|
2018-05-09 20:01:17 -07:00
|
|
|
else efl_del(*eo);
|
|
|
|
}
|
|
|
|
|
2016-09-06 05:03:11 -07:00
|
|
|
#define _EVAS_COLOR_CLAMP(x, y) do { \
|
|
|
|
if (x > y) { x = y; bad = 1; } \
|
|
|
|
if (x < 0) { x = 0; bad = 1; } } while (0)
|
|
|
|
|
|
|
|
#define EVAS_COLOR_SANITIZE(r, g, b, a) \
|
|
|
|
({ int bad = 0; \
|
|
|
|
_EVAS_COLOR_CLAMP(a, 255); \
|
|
|
|
_EVAS_COLOR_CLAMP(r, a); \
|
|
|
|
_EVAS_COLOR_CLAMP(g, a); \
|
|
|
|
_EVAS_COLOR_CLAMP(b, a); \
|
|
|
|
bad; })
|
|
|
|
|
2008-05-26 06:08:54 -07:00
|
|
|
#endif
|