2013-06-20 03:53:29 -07:00
|
|
|
#include "evas_common_private.h"
|
2002-11-08 00:02:15 -08:00
|
|
|
#include "evas_private.h"
|
2011-10-10 23:06:11 -07:00
|
|
|
#include <math.h>
|
2013-09-02 21:48:08 -07:00
|
|
|
#include <assert.h>
|
2012-05-07 10:22:06 -07:00
|
|
|
#ifdef EVAS_CSERVE2
|
|
|
|
#include "evas_cs2_private.h"
|
|
|
|
#endif
|
2002-11-08 00:02:15 -08:00
|
|
|
|
2013-01-17 06:31:34 -08:00
|
|
|
#ifdef EVAS_RENDER_DEBUG_TIMING
|
|
|
|
#include <sys/time.h>
|
|
|
|
#endif
|
|
|
|
|
2013-12-20 02:45:17 -08:00
|
|
|
// symbols of funcs from evas_render2 which is a next-gen replacement of
|
|
|
|
// the current evas render code. see evas_render2.c for more.
|
|
|
|
Eina_Bool _evas_render2_begin(Eo *eo_e, Eina_Bool make_updates, Eina_Bool do_draw, Eina_Bool do_async);
|
|
|
|
void _evas_render2_idle_flush(Eo *eo_e);
|
|
|
|
void _evas_render2_dump(Eo *eo_e);
|
|
|
|
void _evas_render2_wait(Eo *eo_e);
|
2013-12-19 05:49:16 -08:00
|
|
|
|
|
|
|
|
2012-09-12 12:00:16 -07:00
|
|
|
/* debug rendering
|
2012-09-12 12:00:23 -07:00
|
|
|
* NOTE: Define REND_DBG 1 in evas_private.h to enable debugging. Don't define
|
2012-09-12 12:00:16 -07:00
|
|
|
* it here since the flag is used on other places too. */
|
|
|
|
|
2011-03-15 09:20:57 -07:00
|
|
|
/* #define STDOUT_DBG 1 */
|
2009-11-15 05:46:20 -08:00
|
|
|
|
2012-09-12 12:00:23 -07:00
|
|
|
#ifdef REND_DBG
|
2009-11-15 05:46:20 -08:00
|
|
|
static FILE *dbf = NULL;
|
|
|
|
|
|
|
|
static void
|
|
|
|
rend_dbg(const char *txt)
|
|
|
|
{
|
|
|
|
if (!dbf)
|
|
|
|
{
|
2010-09-03 01:23:38 -07:00
|
|
|
#ifdef STDOUT_DBG
|
|
|
|
dbf = stdout;
|
2011-05-20 23:23:33 -07:00
|
|
|
#else
|
2009-11-15 05:46:20 -08:00
|
|
|
dbf = fopen("EVAS-RENDER-DEBUG.log", "w");
|
2011-05-20 23:23:33 -07:00
|
|
|
#endif
|
2009-11-15 05:46:20 -08:00
|
|
|
if (!dbf) return;
|
|
|
|
}
|
|
|
|
fputs(txt, dbf);
|
|
|
|
fflush(dbf);
|
|
|
|
}
|
|
|
|
#define RD(args...) \
|
|
|
|
{ \
|
|
|
|
char __tmpbuf[4096]; \
|
|
|
|
\
|
|
|
|
snprintf(__tmpbuf, sizeof(__tmpbuf), ##args); \
|
|
|
|
rend_dbg(__tmpbuf); \
|
|
|
|
}
|
|
|
|
#define RDI(xxxx) \
|
|
|
|
{ \
|
|
|
|
char __tmpbuf[4096]; int __tmpi; \
|
|
|
|
for (__tmpi = 0; __tmpi < xxxx; __tmpi++) \
|
|
|
|
__tmpbuf[__tmpi] = ' '; \
|
|
|
|
__tmpbuf[__tmpi] = 0; \
|
|
|
|
rend_dbg(__tmpbuf); \
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#define RD(args...)
|
|
|
|
#define RDI(x)
|
|
|
|
#endif
|
|
|
|
|
2013-05-02 00:47:16 -07:00
|
|
|
#define OBJ_ARRAY_PUSH(array, obj) \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
eina_array_push(array, obj); \
|
|
|
|
eo_data_ref(obj->object, NULL); \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define OBJS_ARRAY_CLEAN(array) \
|
|
|
|
{ \
|
|
|
|
Evas_Object_Protected_Data *item; \
|
|
|
|
Eina_Array_Iterator iterator; \
|
|
|
|
unsigned int idx; \
|
|
|
|
EINA_ARRAY_ITER_NEXT(array, idx, item, iterator) \
|
|
|
|
eo_data_unref(item->object, item); \
|
|
|
|
eina_array_clean(array); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define OBJS_ARRAY_FLUSH(array) \
|
|
|
|
{ \
|
|
|
|
Evas_Object_Protected_Data *item; \
|
|
|
|
Eina_Array_Iterator iterator; \
|
|
|
|
unsigned int idx; \
|
|
|
|
EINA_ARRAY_ITER_NEXT(array, idx, item, iterator) \
|
|
|
|
eo_data_unref(item->object, item); \
|
|
|
|
eina_array_flush(array); \
|
|
|
|
}
|
|
|
|
|
2014-11-12 02:25:21 -08:00
|
|
|
/* save typing */
|
|
|
|
#define ENFN evas->engine.func
|
|
|
|
#define ENDT evas->engine.data.output
|
|
|
|
|
2012-12-18 08:28:55 -08:00
|
|
|
typedef struct _Render_Updates Render_Updates;
|
|
|
|
struct _Render_Updates
|
|
|
|
{
|
|
|
|
void *surface;
|
|
|
|
Eina_Rectangle *area;
|
|
|
|
};
|
|
|
|
|
|
|
|
static Eina_Bool
|
2013-03-25 19:48:23 -07:00
|
|
|
evas_render_updates_internal(Evas *eo_e, unsigned char make_updates, unsigned char do_draw, Evas_Render_Done_Cb done_func, void *done_data, Eina_Bool do_async);
|
2005-12-03 01:27:53 -08:00
|
|
|
|
2013-09-02 21:48:08 -07:00
|
|
|
static Eina_List *_rendering_evases = NULL;
|
|
|
|
|
2013-01-17 06:31:34 -08:00
|
|
|
#ifdef EVAS_RENDER_DEBUG_TIMING
|
|
|
|
static double
|
|
|
|
_time_get()
|
|
|
|
{
|
|
|
|
struct timeval tv;
|
|
|
|
|
|
|
|
gettimeofday(&tv, NULL);
|
|
|
|
|
|
|
|
return (tv.tv_sec + tv.tv_usec / 1000000.0) * 1000.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct accumulator {
|
|
|
|
double total, min, max;
|
|
|
|
int samples;
|
|
|
|
const char *what;
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct accumulator async_accumulator = {
|
|
|
|
.total = 0,
|
|
|
|
.min = 1000000,
|
|
|
|
.max = 0,
|
|
|
|
.samples = 0,
|
|
|
|
.what = "async render"
|
|
|
|
};
|
|
|
|
static struct accumulator sync_accumulator = {
|
|
|
|
.total = 0,
|
|
|
|
.min = 1000000,
|
|
|
|
.max = 0,
|
|
|
|
.samples = 0,
|
|
|
|
.what = "sync render"
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
_accumulate_time(double before, struct accumulator *acc)
|
|
|
|
{
|
|
|
|
double diff = _time_get() - before;
|
|
|
|
|
|
|
|
acc->total += diff;
|
|
|
|
if (diff > acc->max) acc->max = diff;
|
|
|
|
if (diff < acc->min) acc->min = diff;
|
|
|
|
|
|
|
|
acc->samples++;
|
|
|
|
if (acc->samples % 100 == 0)
|
|
|
|
{
|
|
|
|
fprintf(stderr, "*** %s: avg %fms min %fms max %fms\n",
|
|
|
|
acc->what, acc->total / 100.0, acc->min, acc->max);
|
|
|
|
acc->total = 0.0;
|
|
|
|
acc->max = 0.0;
|
|
|
|
acc->min = 1000000;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN void
|
2014-06-26 14:29:46 -07:00
|
|
|
_evas_canvas_damage_rectangle_add(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, int x, int y, int w, int h)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Eina_Rectangle *r;
|
|
|
|
|
2009-04-14 02:27:27 -07:00
|
|
|
NEW_RECT(r, x, y, w, h);
|
2002-11-08 00:02:15 -08:00
|
|
|
if (!r) return;
|
2008-10-21 09:31:05 -07:00
|
|
|
e->damages = eina_list_append(e->damages, r);
|
2012-05-16 06:21:37 -07:00
|
|
|
e->changed = EINA_TRUE;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN void
|
2014-06-26 14:29:46 -07:00
|
|
|
_evas_canvas_obscured_rectangle_add(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, int x, int y, int w, int h)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
|
|
|
Eina_Rectangle *r;
|
|
|
|
|
2009-04-14 02:27:27 -07:00
|
|
|
NEW_RECT(r, x, y, w, h);
|
2002-11-08 00:02:15 -08:00
|
|
|
if (!r) return;
|
2008-10-21 09:31:05 -07:00
|
|
|
e->obscures = eina_list_append(e->obscures, r);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN void
|
2014-06-26 14:29:46 -07:00
|
|
|
_evas_canvas_obscured_clear(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
|
|
|
Eina_Rectangle *r;
|
|
|
|
|
2009-04-14 02:27:27 -07:00
|
|
|
EINA_LIST_FREE(e->obscures, r)
|
2009-10-30 03:11:15 -07:00
|
|
|
{
|
|
|
|
eina_rectangle_free(r);
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2012-11-20 03:52:16 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_evas_clip_changes_free(const void *container EINA_UNUSED, void *data, void *fdata EINA_UNUSED)
|
|
|
|
{
|
|
|
|
eina_rectangle_free(data);
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2009-11-10 00:50:11 -08:00
|
|
|
static Eina_Bool
|
2012-10-10 00:23:00 -07:00
|
|
|
_evas_render_had_map(Evas_Object_Protected_Data *obj)
|
2009-11-10 00:50:11 -08:00
|
|
|
{
|
2013-01-21 19:56:00 -08:00
|
|
|
return ((obj->map->prev.map) && (obj->map->prev.usemap));
|
2013-03-12 05:58:19 -07:00
|
|
|
// return ((!obj->map->cur.map) && (obj->prev->usemap));
|
2009-11-10 00:50:11 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_render_is_relevant(Evas_Object *eo_obj)
|
2009-11-10 00:50:11 -08:00
|
|
|
{
|
2014-06-02 06:47:59 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
|
2013-03-12 05:58:19 -07:00
|
|
|
return ((evas_object_is_visible(eo_obj, obj) && (!obj->cur->have_clipees)) ||
|
|
|
|
(evas_object_was_visible(eo_obj, obj) && (!obj->prev->have_clipees)));
|
2009-11-10 00:50:11 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
2012-10-10 00:23:00 -07:00
|
|
|
_evas_render_can_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
2009-11-10 00:50:11 -08:00
|
|
|
{
|
2013-03-12 05:58:19 -07:00
|
|
|
return (evas_object_is_visible(eo_obj, obj) && (!obj->cur->have_clipees));
|
2009-11-10 00:50:11 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-10-10 00:23:00 -07:00
|
|
|
_evas_render_prev_cur_clip_cache_add(Evas_Public_Data *e, Evas_Object_Protected_Data *obj)
|
2009-11-10 00:50:11 -08:00
|
|
|
{
|
|
|
|
e->engine.func->output_redraws_rect_add(e->engine.data.output,
|
2013-04-26 11:01:44 -07:00
|
|
|
obj->prev->cache.clip.x + e->framespace.x,
|
|
|
|
obj->prev->cache.clip.y + e->framespace.y,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->prev->cache.clip.w,
|
|
|
|
obj->prev->cache.clip.h);
|
2009-11-10 00:50:11 -08:00
|
|
|
e->engine.func->output_redraws_rect_add(e->engine.data.output,
|
2013-04-26 11:01:44 -07:00
|
|
|
obj->cur->cache.clip.x + e->framespace.x,
|
|
|
|
obj->cur->cache.clip.y + e->framespace.y,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->cur->cache.clip.w,
|
|
|
|
obj->cur->cache.clip.h);
|
2009-11-10 00:50:11 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-10-10 00:23:00 -07:00
|
|
|
_evas_render_cur_clip_cache_del(Evas_Public_Data *e, Evas_Object_Protected_Data *obj)
|
2009-11-10 00:50:11 -08:00
|
|
|
{
|
2011-11-10 21:56:40 -08:00
|
|
|
Evas_Coord x, y, w, h;
|
2012-05-16 06:21:37 -07:00
|
|
|
|
2013-03-12 05:58:19 -07:00
|
|
|
x = obj->cur->cache.clip.x;
|
|
|
|
y = obj->cur->cache.clip.y;
|
|
|
|
w = obj->cur->cache.clip.w;
|
|
|
|
h = obj->cur->cache.clip.h;
|
|
|
|
if (obj->cur->clipper)
|
2011-11-10 21:56:40 -08:00
|
|
|
{
|
|
|
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->cur->clipper->cur->cache.clip.x,
|
|
|
|
obj->cur->clipper->cur->cache.clip.y,
|
|
|
|
obj->cur->clipper->cur->cache.clip.w,
|
|
|
|
obj->cur->clipper->cur->cache.clip.h);
|
2011-11-10 21:56:40 -08:00
|
|
|
}
|
2009-11-10 00:50:11 -08:00
|
|
|
e->engine.func->output_redraws_rect_del(e->engine.data.output,
|
2013-04-26 11:01:44 -07:00
|
|
|
x + e->framespace.x,
|
|
|
|
y + e->framespace.y, w, h);
|
2009-11-10 00:50:11 -08:00
|
|
|
}
|
|
|
|
|
2014-11-12 17:47:29 -08:00
|
|
|
/* sets the redraw flag for all the proxies depending on this obj as a source */
|
2013-11-24 17:09:34 -08:00
|
|
|
static void
|
|
|
|
_evas_proxy_redraw_set(Evas_Public_Data *e, Evas_Object_Protected_Data *obj,
|
|
|
|
Eina_Bool render)
|
|
|
|
{
|
|
|
|
Evas_Object *eo_proxy;
|
|
|
|
Evas_Object_Protected_Data *proxy;
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(obj->proxy->proxies, l, eo_proxy)
|
|
|
|
{
|
2014-06-02 06:47:59 -07:00
|
|
|
proxy = eo_data_scope_get(eo_proxy, EVAS_OBJECT_CLASS);
|
2013-11-24 17:09:34 -08:00
|
|
|
|
|
|
|
/* Flag need redraw on proxy too */
|
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, proxy->proxy,
|
|
|
|
Evas_Object_Proxy_Data, proxy_write)
|
|
|
|
proxy_write->redraw = EINA_TRUE;
|
|
|
|
EINA_COW_WRITE_END(evas_object_proxy_cow, proxy->proxy, proxy_write);
|
|
|
|
|
|
|
|
if (render)
|
|
|
|
{
|
|
|
|
proxy->func->render_pre(eo_proxy, proxy, proxy->private_data);
|
|
|
|
_evas_render_prev_cur_clip_cache_add(e, proxy);
|
|
|
|
}
|
|
|
|
|
|
|
|
//Update the proxies recursively.
|
|
|
|
_evas_proxy_redraw_set(e, proxy, render);
|
|
|
|
}
|
2014-01-07 00:39:23 -08:00
|
|
|
|
|
|
|
if (obj->proxy->proxy_textures)
|
|
|
|
{
|
|
|
|
/* Flag need redraw on proxy texture source */
|
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, obj->proxy,
|
|
|
|
Evas_Object_Proxy_Data, source)
|
|
|
|
source->redraw = EINA_TRUE;
|
|
|
|
EINA_COW_WRITE_END(evas_object_proxy_cow, obj->proxy, source);
|
|
|
|
}
|
2013-11-24 17:09:34 -08:00
|
|
|
}
|
|
|
|
|
2014-11-12 17:47:29 -08:00
|
|
|
/* sets the mask redraw flag for all the objects clipped by this mask */
|
|
|
|
static void
|
|
|
|
_evas_mask_redraw_set(Evas_Public_Data *e EINA_UNUSED,
|
|
|
|
Evas_Object_Protected_Data *obj)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *clippee;
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
if (!(obj->mask->redraw &&
|
|
|
|
obj->mask->x == obj->cur->geometry.x &&
|
|
|
|
obj->mask->y == obj->cur->geometry.y &&
|
|
|
|
obj->mask->w == obj->cur->geometry.w &&
|
|
|
|
obj->mask->h == obj->cur->geometry.h))
|
|
|
|
{
|
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_mask_cow, obj->mask,
|
|
|
|
Evas_Object_Mask_Data, mask)
|
|
|
|
mask->redraw = EINA_TRUE;
|
|
|
|
EINA_COW_WRITE_END(evas_object_mask_cow, obj->mask, mask);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!obj->cur->cache.clip.dirty)
|
|
|
|
{
|
|
|
|
EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
|
|
|
|
state_write->cache.clip.dirty = EINA_TRUE;
|
|
|
|
EINA_COW_STATE_WRITE_END(obj, state_write, cur);
|
|
|
|
}
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(obj->clip.clipees, l, clippee)
|
|
|
|
{
|
|
|
|
evas_object_clip_recalc(clippee);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline Eina_Bool
|
|
|
|
_evas_render_object_changed_get(Evas_Object_Protected_Data *obj)
|
|
|
|
{
|
|
|
|
if (obj->smart.smart)
|
|
|
|
return evas_object_smart_changed_get(obj->object);
|
|
|
|
else
|
|
|
|
return obj->changed;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline Eina_Bool
|
|
|
|
_evas_render_object_is_mask(Evas_Object_Protected_Data *obj)
|
|
|
|
{
|
|
|
|
if (!obj) return EINA_FALSE;
|
|
|
|
return (obj->mask->is_mask && obj->clip.clipees);
|
|
|
|
}
|
|
|
|
|
2009-11-06 21:01:43 -08:00
|
|
|
static void
|
2012-10-10 00:23:00 -07:00
|
|
|
_evas_render_phase1_direct(Evas_Public_Data *e,
|
2011-06-30 19:02:02 -07:00
|
|
|
Eina_Array *active_objects,
|
2012-10-08 18:58:41 -07:00
|
|
|
Eina_Array *restack_objects EINA_UNUSED,
|
|
|
|
Eina_Array *delete_objects EINA_UNUSED,
|
2009-11-10 00:50:11 -08:00
|
|
|
Eina_Array *render_objects)
|
2009-11-06 21:01:43 -08:00
|
|
|
{
|
|
|
|
unsigned int i;
|
2013-11-24 17:09:34 -08:00
|
|
|
Evas_Object *eo_obj;
|
2009-11-06 21:01:43 -08:00
|
|
|
|
2009-11-15 05:46:20 -08:00
|
|
|
RD(" [--- PHASE 1 DIRECT\n");
|
2011-05-19 06:01:44 -07:00
|
|
|
for (i = 0; i < active_objects->count; i++)
|
|
|
|
{
|
2013-10-31 01:01:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj =
|
|
|
|
eina_array_data_get(active_objects, i);
|
2013-04-06 22:00:10 -07:00
|
|
|
|
2013-10-31 01:01:41 -07:00
|
|
|
if (obj->changed) evas_object_clip_recalc(obj);
|
|
|
|
|
2014-11-12 17:47:29 -08:00
|
|
|
if (obj->proxy->proxies || obj->proxy->proxy_textures)
|
|
|
|
{
|
|
|
|
/* is proxy source */
|
|
|
|
if (_evas_render_object_changed_get(obj))
|
|
|
|
_evas_proxy_redraw_set(e, obj, EINA_FALSE);
|
|
|
|
}
|
|
|
|
if (_evas_render_object_is_mask(obj))
|
|
|
|
{
|
|
|
|
/* is image clipper */
|
|
|
|
if (_evas_render_object_changed_get(obj))
|
|
|
|
_evas_mask_redraw_set(e, obj);
|
|
|
|
}
|
2011-05-19 06:01:44 -07:00
|
|
|
}
|
2009-11-09 07:18:37 -08:00
|
|
|
for (i = 0; i < render_objects->count; i++)
|
2009-11-06 21:01:43 -08:00
|
|
|
{
|
2013-11-24 17:09:34 -08:00
|
|
|
Evas_Object_Protected_Data *obj =
|
|
|
|
eina_array_data_get(render_objects, i);
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_obj = obj->object;
|
2013-11-24 17:09:34 -08:00
|
|
|
|
2013-08-18 21:20:57 -07:00
|
|
|
RD(" OBJ [%p", obj);
|
|
|
|
if (obj->name)
|
2013-08-19 00:35:34 -07:00
|
|
|
{
|
|
|
|
RD(":%s", obj->name);
|
|
|
|
}
|
2013-08-18 21:20:57 -07:00
|
|
|
RD("] changed %i\n", obj->changed);
|
2013-11-24 17:09:34 -08:00
|
|
|
|
2011-05-20 23:23:33 -07:00
|
|
|
if (obj->changed)
|
2009-11-06 21:01:43 -08:00
|
|
|
{
|
2013-04-06 22:00:10 -07:00
|
|
|
evas_object_clip_recalc(obj);
|
2013-12-07 10:14:14 -08:00
|
|
|
obj->func->render_pre(eo_obj, obj, obj->private_data);
|
2014-11-12 17:47:29 -08:00
|
|
|
|
|
|
|
if (obj->proxy->redraw || obj->mask->redraw)
|
2013-12-07 10:14:14 -08:00
|
|
|
_evas_render_prev_cur_clip_cache_add(e, obj);
|
2014-11-12 17:47:29 -08:00
|
|
|
|
|
|
|
if (!obj->smart.smart || evas_object_smart_changed_get(eo_obj))
|
2011-02-06 15:51:48 -08:00
|
|
|
{
|
2014-11-12 17:47:29 -08:00
|
|
|
/* proxy sources */
|
|
|
|
if (obj->proxy->proxies || obj->proxy->proxy_textures)
|
2011-05-19 06:01:44 -07:00
|
|
|
{
|
2013-11-17 23:10:55 -08:00
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, obj->proxy,
|
|
|
|
Evas_Object_Proxy_Data, proxy_write)
|
|
|
|
proxy_write->redraw = EINA_TRUE;
|
|
|
|
EINA_COW_WRITE_END(evas_object_proxy_cow, obj->proxy,
|
|
|
|
proxy_write);
|
2013-11-24 17:09:34 -08:00
|
|
|
_evas_proxy_redraw_set(e, obj, EINA_TRUE);
|
2011-05-19 06:01:44 -07:00
|
|
|
}
|
2014-11-12 17:47:29 -08:00
|
|
|
|
|
|
|
/* clipper objects (image masks) */
|
|
|
|
if (_evas_render_object_is_mask(obj))
|
|
|
|
_evas_mask_redraw_set(e, obj);
|
2011-05-19 06:01:44 -07:00
|
|
|
}
|
2012-05-30 00:32:27 -07:00
|
|
|
|
|
|
|
RD(" pre-render-done smart:%p|%p [%p, %i] | [%p, %i] has_map:%i had_map:%i\n",
|
|
|
|
obj->smart.smart,
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_smart_members_get_direct(eo_obj),
|
2013-01-21 19:56:00 -08:00
|
|
|
obj->map->cur.map, obj->map->cur.usemap,
|
2013-08-05 23:45:07 -07:00
|
|
|
obj->map->prev.map, obj->map->prev.usemap,
|
2012-10-10 00:23:00 -07:00
|
|
|
_evas_render_has_map(eo_obj, obj),
|
|
|
|
_evas_render_had_map(obj));
|
2012-10-08 18:58:41 -07:00
|
|
|
if ((obj->is_smart) &&
|
2012-10-22 01:59:32 -07:00
|
|
|
((_evas_render_has_map(eo_obj, obj) ||
|
2012-10-25 08:24:27 -07:00
|
|
|
(obj->changed_src_visible))))
|
2011-05-19 06:01:44 -07:00
|
|
|
{
|
2012-05-30 00:32:27 -07:00
|
|
|
RD(" has map + smart\n");
|
2012-10-10 00:23:00 -07:00
|
|
|
_evas_render_prev_cur_clip_cache_add(e, obj);
|
2009-11-15 05:46:20 -08:00
|
|
|
}
|
2009-11-06 21:01:43 -08:00
|
|
|
}
|
2011-05-20 23:23:33 -07:00
|
|
|
else
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->is_smart)
|
2009-11-06 21:01:43 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
// obj->func->render_pre(eo_obj);
|
2009-11-06 21:01:43 -08:00
|
|
|
}
|
2013-09-24 03:32:24 -07:00
|
|
|
else if (evas_object_is_visible(eo_obj, obj) &&
|
|
|
|
((obj->rect_del) ||
|
2014-02-12 22:40:29 -08:00
|
|
|
(evas_object_is_opaque(eo_obj, obj))) &&
|
|
|
|
(!evas_object_is_source_invisible(eo_obj, obj)))
|
2009-11-15 05:46:20 -08:00
|
|
|
{
|
|
|
|
RD(" rect del\n");
|
2012-10-10 00:23:00 -07:00
|
|
|
_evas_render_cur_clip_cache_del(e, obj);
|
2009-11-15 05:46:20 -08:00
|
|
|
}
|
2011-05-20 23:23:33 -07:00
|
|
|
}
|
2009-11-06 21:01:43 -08:00
|
|
|
}
|
2009-11-15 05:46:20 -08:00
|
|
|
RD(" ---]\n");
|
2009-10-30 03:11:15 -07:00
|
|
|
}
|
|
|
|
|
2009-06-17 03:01:52 -07:00
|
|
|
static Eina_Bool
|
2012-10-10 00:23:00 -07:00
|
|
|
_evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
|
2010-04-27 06:43:10 -07:00
|
|
|
Eina_Array *active_objects,
|
|
|
|
Eina_Array *restack_objects,
|
|
|
|
Eina_Array *delete_objects,
|
|
|
|
Eina_Array *render_objects,
|
2012-05-15 04:29:28 -07:00
|
|
|
int restack,
|
2012-07-16 04:33:12 -07:00
|
|
|
int *redraw_all,
|
2014-03-26 23:47:00 -07:00
|
|
|
Eina_Bool mapped_parent,
|
2014-11-04 21:54:35 -08:00
|
|
|
Eina_Bool src_changed, int level)
|
2008-05-26 06:24:24 -07:00
|
|
|
{
|
2009-06-17 03:01:52 -07:00
|
|
|
Eina_Bool clean_them = EINA_FALSE;
|
2005-10-26 21:36:58 -07:00
|
|
|
int is_active;
|
2012-05-15 04:29:28 -07:00
|
|
|
Eina_Bool map, hmap;
|
2011-05-20 23:23:33 -07:00
|
|
|
|
2014-06-02 06:47:59 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
|
2012-07-16 04:33:12 -07:00
|
|
|
//Need pre render for the children of mapped object.
|
|
|
|
//But only when they have changed.
|
|
|
|
if (mapped_parent && (!obj->changed)) return EINA_FALSE;
|
|
|
|
|
2012-05-15 04:43:23 -07:00
|
|
|
obj->rect_del = EINA_FALSE;
|
|
|
|
obj->render_pre = EINA_FALSE;
|
2008-05-26 06:24:24 -07:00
|
|
|
|
2010-05-21 00:10:45 -07:00
|
|
|
if (obj->delete_me == 2)
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJ_ARRAY_PUSH(delete_objects, obj);
|
2012-04-26 02:53:03 -07:00
|
|
|
else if (obj->delete_me != 0) obj->delete_me++;
|
2008-05-26 06:24:24 -07:00
|
|
|
/* If the object will be removed, we should not cache anything during this run. */
|
2009-11-10 00:50:11 -08:00
|
|
|
if (obj->delete_me != 0) clean_them = EINA_TRUE;
|
2008-05-26 06:24:24 -07:00
|
|
|
|
2005-10-26 19:44:36 -07:00
|
|
|
/* build active object list */
|
2013-04-06 22:00:10 -07:00
|
|
|
evas_object_clip_recalc(obj);
|
2010-04-27 06:43:10 -07:00
|
|
|
|
2014-03-26 23:47:00 -07:00
|
|
|
if (src_changed) is_active = EINA_TRUE;
|
2014-03-27 00:16:49 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
is_active = evas_object_is_active(eo_obj, obj);
|
2014-09-01 03:45:19 -07:00
|
|
|
if (is_active && obj->proxy->proxies) src_changed = is_active;
|
2014-03-27 00:16:49 -07:00
|
|
|
}
|
|
|
|
obj->is_active = is_active;
|
|
|
|
|
2009-11-15 05:46:20 -08:00
|
|
|
RDI(level);
|
2013-08-18 21:20:57 -07:00
|
|
|
RD(" [--- PROCESS [%p", obj);
|
2014-03-26 23:47:00 -07:00
|
|
|
if (obj->name)
|
2013-08-19 00:35:34 -07:00
|
|
|
{
|
|
|
|
RD(":%s", obj->name);
|
|
|
|
}
|
2013-08-18 21:20:57 -07:00
|
|
|
RD("] '%s' active = %i, del = %i | %i %i %ix%i\n", obj->type, is_active, obj->delete_me, obj->cur->geometry.x, obj->cur->geometry.y, obj->cur->geometry.w, obj->cur->geometry.h);
|
2012-07-15 20:12:39 -07:00
|
|
|
|
2012-07-16 04:33:12 -07:00
|
|
|
if ((!mapped_parent) && ((is_active) || (obj->delete_me != 0)))
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJ_ARRAY_PUSH(active_objects, obj);
|
2009-11-19 00:37:22 -08:00
|
|
|
|
2012-09-12 12:00:23 -07:00
|
|
|
#ifdef REND_DBG
|
2009-11-19 00:37:22 -08:00
|
|
|
if (!is_active)
|
|
|
|
{
|
|
|
|
RDI(level);
|
2013-08-18 21:20:57 -07:00
|
|
|
RD(" [%p", obj);
|
|
|
|
if (obj->name) RD(":%s", obj->name);
|
|
|
|
RD("] vis: %i, cache.clip.vis: %i cache.clip.a: %i [%p]\n", obj->cur->visible, obj->cur->cache.clip.visible, obj->cur->cache.clip.a, obj->func->is_visible);
|
2009-11-19 00:37:22 -08:00
|
|
|
}
|
2010-04-27 06:43:10 -07:00
|
|
|
#endif
|
|
|
|
|
2012-10-10 00:23:00 -07:00
|
|
|
map = _evas_render_has_map(eo_obj, obj);
|
|
|
|
hmap = _evas_render_had_map(obj);
|
2010-04-27 06:43:10 -07:00
|
|
|
|
2009-11-10 00:50:11 -08:00
|
|
|
if ((restack) && (!map))
|
2005-10-26 23:40:28 -07:00
|
|
|
{
|
2011-05-20 23:23:33 -07:00
|
|
|
if (!obj->changed)
|
2009-11-09 07:18:37 -08:00
|
|
|
{
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJ_ARRAY_PUSH(&e->pending_objects, obj);
|
2012-05-15 04:43:23 -07:00
|
|
|
obj->changed = EINA_TRUE;
|
2009-11-09 07:18:37 -08:00
|
|
|
}
|
2012-05-15 04:43:23 -07:00
|
|
|
obj->restack = EINA_TRUE;
|
2011-05-20 23:23:33 -07:00
|
|
|
clean_them = EINA_TRUE;
|
2005-10-26 23:40:28 -07:00
|
|
|
}
|
2009-11-06 21:01:43 -08:00
|
|
|
|
2009-11-10 00:50:11 -08:00
|
|
|
if (map)
|
2009-10-28 01:59:01 -07:00
|
|
|
{
|
2009-11-15 05:46:20 -08:00
|
|
|
RDI(level);
|
|
|
|
RD(" obj mapped\n");
|
2009-10-28 01:59:01 -07:00
|
|
|
if (obj->changed)
|
|
|
|
{
|
2012-05-15 04:43:23 -07:00
|
|
|
if (map != hmap) *redraw_all = 1;
|
|
|
|
|
|
|
|
if ((is_active) && (!obj->clip.clipees) &&
|
2013-03-12 05:58:19 -07:00
|
|
|
((evas_object_is_visible(eo_obj, obj) && (!obj->cur->have_clipees)) ||
|
|
|
|
(evas_object_was_visible(eo_obj, obj) && (!obj->prev->have_clipees))))
|
2009-11-06 21:01:43 -08:00
|
|
|
{
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJ_ARRAY_PUSH(render_objects, obj);
|
2012-10-10 00:23:00 -07:00
|
|
|
_evas_render_prev_cur_clip_cache_add(e, obj);
|
2012-05-15 04:43:23 -07:00
|
|
|
obj->render_pre = EINA_TRUE;
|
2012-07-16 04:33:12 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->is_smart)
|
2012-07-16 04:33:12 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj2;
|
2013-04-04 23:18:23 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj), obj2)
|
2012-07-16 04:33:12 -07:00
|
|
|
{
|
2012-10-10 00:23:00 -07:00
|
|
|
_evas_render_phase1_object_process(e, obj2->object,
|
2012-07-16 04:33:12 -07:00
|
|
|
active_objects,
|
|
|
|
restack_objects,
|
|
|
|
delete_objects,
|
|
|
|
render_objects,
|
|
|
|
obj->restack,
|
|
|
|
redraw_all,
|
2014-03-26 23:47:00 -07:00
|
|
|
EINA_TRUE,
|
2014-11-04 21:54:35 -08:00
|
|
|
src_changed,
|
|
|
|
level + 1);
|
2012-07-16 04:33:12 -07:00
|
|
|
}
|
|
|
|
}
|
2009-10-28 01:59:01 -07:00
|
|
|
}
|
|
|
|
}
|
2009-11-06 02:26:54 -08:00
|
|
|
return clean_them;
|
2009-10-28 01:59:01 -07:00
|
|
|
}
|
2012-05-30 03:12:10 -07:00
|
|
|
else if (hmap)
|
2009-11-09 07:18:37 -08:00
|
|
|
{
|
2009-11-15 05:46:20 -08:00
|
|
|
RDI(level);
|
|
|
|
RD(" had map - restack objs\n");
|
2013-05-02 00:47:16 -07:00
|
|
|
// OBJ_ARRAY_PUSH(restack_objects, obj);
|
2012-10-10 00:23:00 -07:00
|
|
|
_evas_render_prev_cur_clip_cache_add(e, obj);
|
2010-08-23 23:58:07 -07:00
|
|
|
if (obj->changed)
|
2010-09-24 23:19:30 -07:00
|
|
|
{
|
2012-07-15 20:12:39 -07:00
|
|
|
if (!map)
|
2010-09-24 23:19:30 -07:00
|
|
|
{
|
2013-01-21 19:56:00 -08:00
|
|
|
if ((obj->map->cur.map) && (obj->map->cur.usemap)) map = EINA_TRUE;
|
2010-09-24 23:19:30 -07:00
|
|
|
}
|
|
|
|
if (map != hmap)
|
|
|
|
{
|
|
|
|
*redraw_all = 1;
|
|
|
|
}
|
2010-08-23 23:58:07 -07:00
|
|
|
}
|
2009-11-09 07:18:37 -08:00
|
|
|
}
|
2010-04-27 06:43:10 -07:00
|
|
|
|
2009-10-28 01:59:01 -07:00
|
|
|
/* handle normal rendering. this object knows how to handle maps */
|
2005-10-26 23:40:28 -07:00
|
|
|
if (obj->changed)
|
2005-10-26 19:44:36 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->is_smart)
|
2011-05-20 23:23:33 -07:00
|
|
|
{
|
2009-11-15 05:46:20 -08:00
|
|
|
RDI(level);
|
|
|
|
RD(" changed + smart - render ok\n");
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJ_ARRAY_PUSH(render_objects, obj);
|
2014-03-26 23:47:00 -07:00
|
|
|
|
|
|
|
if (!is_active && obj->proxy->proxies) src_changed = EINA_TRUE;
|
|
|
|
|
2012-05-15 04:43:23 -07:00
|
|
|
obj->render_pre = EINA_TRUE;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj2;
|
|
|
|
EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj),
|
2012-07-16 04:33:12 -07:00
|
|
|
obj2)
|
2011-05-20 23:23:33 -07:00
|
|
|
{
|
2012-10-10 00:23:00 -07:00
|
|
|
_evas_render_phase1_object_process(e, obj2->object,
|
2011-05-20 23:23:33 -07:00
|
|
|
active_objects,
|
|
|
|
restack_objects,
|
|
|
|
delete_objects,
|
|
|
|
render_objects,
|
|
|
|
obj->restack,
|
2012-07-16 04:33:12 -07:00
|
|
|
redraw_all,
|
2014-03-26 23:47:00 -07:00
|
|
|
mapped_parent,
|
2014-11-04 21:54:35 -08:00
|
|
|
src_changed,
|
|
|
|
level + 1);
|
2011-05-20 23:23:33 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-11-12 17:47:29 -08:00
|
|
|
/* non smart object */
|
2013-04-15 11:05:16 -07:00
|
|
|
if ((!obj->clip.clipees) && _evas_render_is_relevant(eo_obj))
|
2009-11-10 00:50:11 -08:00
|
|
|
{
|
2013-04-15 11:05:16 -07:00
|
|
|
if (is_active)
|
|
|
|
{
|
|
|
|
RDI(level);
|
|
|
|
RD(" relevant + active\n");
|
|
|
|
if (obj->restack)
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJ_ARRAY_PUSH(restack_objects, obj);
|
2013-04-15 11:05:16 -07:00
|
|
|
else
|
|
|
|
{
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJ_ARRAY_PUSH(render_objects, obj);
|
2013-04-15 11:05:16 -07:00
|
|
|
obj->render_pre = EINA_TRUE;
|
|
|
|
}
|
|
|
|
}
|
2009-11-10 00:50:11 -08:00
|
|
|
else
|
|
|
|
{
|
2013-04-15 11:05:16 -07:00
|
|
|
/* It goes to be hidden. Prev caching should be replaced
|
|
|
|
by the current (hidden) state. */
|
|
|
|
if (evas_object_is_visible(eo_obj, obj) !=
|
|
|
|
evas_object_was_visible(eo_obj, obj))
|
|
|
|
evas_object_cur_prev(eo_obj);
|
|
|
|
|
|
|
|
RDI(level);
|
|
|
|
RD(" skip - not smart, not active or clippees or not relevant\n");
|
2009-11-10 00:50:11 -08:00
|
|
|
}
|
|
|
|
}
|
2014-11-12 17:47:29 -08:00
|
|
|
else if (is_active && _evas_render_object_is_mask(obj) &&
|
|
|
|
(evas_object_is_visible(eo_obj, obj) || evas_object_was_visible(eo_obj, obj)))
|
|
|
|
{
|
|
|
|
if (obj->restack)
|
|
|
|
OBJ_ARRAY_PUSH(restack_objects, obj);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
OBJ_ARRAY_PUSH(render_objects, obj);
|
|
|
|
obj->render_pre = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
RDI(level);
|
|
|
|
RD(" relevant + active: clipper image\n");
|
|
|
|
}
|
2009-11-15 05:46:20 -08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
RDI(level);
|
|
|
|
RD(" skip - not smart, not active or clippees or not relevant\n");
|
|
|
|
}
|
2011-05-20 23:23:33 -07:00
|
|
|
}
|
2005-10-26 19:44:36 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-11-12 17:47:29 -08:00
|
|
|
/* not changed */
|
2010-04-27 06:43:10 -07:00
|
|
|
RD(" not changed... [%i] -> (%i %i %p %i) [%i]\n",
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_is_visible(eo_obj, obj),
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->cur->visible, obj->cur->cache.clip.visible, obj->smart.smart,
|
|
|
|
obj->cur->cache.clip.a, evas_object_was_visible(eo_obj, obj));
|
2012-07-16 04:33:12 -07:00
|
|
|
|
2011-05-20 23:23:33 -07:00
|
|
|
if ((!obj->clip.clipees) && (obj->delete_me == 0) &&
|
2012-10-10 00:23:00 -07:00
|
|
|
(_evas_render_can_render(eo_obj, obj) ||
|
2013-03-12 05:58:19 -07:00
|
|
|
(evas_object_was_visible(eo_obj, obj) && (!obj->prev->have_clipees))))
|
2011-05-20 23:23:33 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->is_smart)
|
2011-05-20 23:23:33 -07:00
|
|
|
{
|
2009-11-15 05:46:20 -08:00
|
|
|
RDI(level);
|
|
|
|
RD(" smart + visible/was visible + not clip\n");
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJ_ARRAY_PUSH(render_objects, obj);
|
2012-05-16 06:21:37 -07:00
|
|
|
obj->render_pre = EINA_TRUE;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj2;
|
2011-05-20 23:23:33 -07:00
|
|
|
EINA_INLIST_FOREACH
|
2012-10-08 18:58:41 -07:00
|
|
|
(evas_object_smart_members_get_direct(eo_obj), obj2)
|
2011-05-20 23:23:33 -07:00
|
|
|
{
|
2012-10-10 00:23:00 -07:00
|
|
|
_evas_render_phase1_object_process(e, obj2->object,
|
2011-05-20 23:23:33 -07:00
|
|
|
active_objects,
|
|
|
|
restack_objects,
|
|
|
|
delete_objects,
|
|
|
|
render_objects,
|
2012-05-15 04:29:28 -07:00
|
|
|
restack,
|
2012-07-16 04:33:12 -07:00
|
|
|
redraw_all,
|
2014-03-26 23:47:00 -07:00
|
|
|
mapped_parent,
|
2014-11-04 21:54:35 -08:00
|
|
|
src_changed,
|
|
|
|
level + 1);
|
2011-05-20 23:23:33 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-11-12 17:47:29 -08:00
|
|
|
/* not smart */
|
2012-10-08 18:58:41 -07:00
|
|
|
if (evas_object_is_opaque(eo_obj, obj) &&
|
|
|
|
evas_object_is_visible(eo_obj, obj))
|
2011-05-20 23:23:33 -07:00
|
|
|
{
|
2009-11-15 05:46:20 -08:00
|
|
|
RDI(level);
|
|
|
|
RD(" opaque + visible\n");
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJ_ARRAY_PUSH(render_objects, obj);
|
2012-05-15 04:43:23 -07:00
|
|
|
obj->rect_del = EINA_TRUE;
|
2011-05-20 23:23:33 -07:00
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
else if (evas_object_is_visible(eo_obj, obj))
|
2009-11-10 01:10:59 -08:00
|
|
|
{
|
2009-11-15 05:46:20 -08:00
|
|
|
RDI(level);
|
|
|
|
RD(" visible\n");
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJ_ARRAY_PUSH(render_objects, obj);
|
2012-05-15 04:43:23 -07:00
|
|
|
obj->render_pre = EINA_TRUE;
|
2009-11-10 01:10:59 -08:00
|
|
|
}
|
2009-11-15 05:46:20 -08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
RDI(level);
|
|
|
|
RD(" skip\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-11-12 17:47:29 -08:00
|
|
|
else if (is_active && _evas_render_object_is_mask(obj) &&
|
|
|
|
evas_object_is_visible(eo_obj, obj))
|
|
|
|
{
|
|
|
|
RDI(level);
|
|
|
|
RD(" visible clipper image\n");
|
|
|
|
OBJ_ARRAY_PUSH(render_objects, obj);
|
|
|
|
obj->render_pre = EINA_TRUE;
|
|
|
|
}
|
2012-07-16 04:33:12 -07:00
|
|
|
/* else if (obj->smart.smart)
|
2012-07-15 20:12:39 -07:00
|
|
|
{
|
|
|
|
RDI(level);
|
|
|
|
RD(" smart + mot visible/was visible\n");
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJ_ARRAY_PUSH(render_objects, obj);
|
2012-07-15 20:12:39 -07:00
|
|
|
obj->render_pre = 1;
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_INLIST_FOREACH (evas_object_smart_members_get_direct(eo_obj),
|
2012-07-16 04:33:12 -07:00
|
|
|
obj2)
|
2012-07-15 20:12:39 -07:00
|
|
|
{
|
2012-10-10 00:23:00 -07:00
|
|
|
_evas_render_phase1_object_process(e, obj2,
|
2012-07-15 20:12:39 -07:00
|
|
|
active_objects,
|
|
|
|
restack_objects,
|
|
|
|
delete_objects,
|
|
|
|
render_objects,
|
|
|
|
restack,
|
2014-11-04 21:54:35 -08:00
|
|
|
redraw_all,
|
|
|
|
level + 1);
|
2012-07-15 20:12:39 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
if (!is_active) obj->restack = EINA_FALSE;
|
|
|
|
RDI(level);
|
|
|
|
RD(" ---]\n");
|
|
|
|
return clean_them;
|
2005-10-26 19:44:36 -07:00
|
|
|
}
|
|
|
|
|
2009-06-17 03:01:52 -07:00
|
|
|
static Eina_Bool
|
2012-10-10 00:23:00 -07:00
|
|
|
_evas_render_phase1_process(Evas_Public_Data *e,
|
2010-04-27 06:43:10 -07:00
|
|
|
Eina_Array *active_objects,
|
|
|
|
Eina_Array *restack_objects,
|
|
|
|
Eina_Array *delete_objects,
|
2010-08-23 23:58:07 -07:00
|
|
|
Eina_Array *render_objects,
|
|
|
|
int *redraw_all)
|
2005-10-26 19:44:36 -07:00
|
|
|
{
|
2008-10-17 04:23:18 -07:00
|
|
|
Evas_Layer *lay;
|
2009-06-17 03:01:52 -07:00
|
|
|
Eina_Bool clean_them = EINA_FALSE;
|
2005-10-26 19:44:36 -07:00
|
|
|
|
2009-11-15 05:46:20 -08:00
|
|
|
RD(" [--- PHASE 1\n");
|
2008-10-21 05:19:57 -07:00
|
|
|
EINA_INLIST_FOREACH(e->layers, lay)
|
2005-10-26 19:44:36 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj;
|
2010-04-27 06:43:10 -07:00
|
|
|
|
2011-05-20 23:23:33 -07:00
|
|
|
EINA_INLIST_FOREACH(lay->objects, obj)
|
|
|
|
{
|
|
|
|
clean_them |= _evas_render_phase1_object_process
|
2012-10-10 00:23:00 -07:00
|
|
|
(e, obj->object, active_objects, restack_objects, delete_objects,
|
2014-11-04 21:54:35 -08:00
|
|
|
render_objects, 0, redraw_all, EINA_FALSE, EINA_FALSE, 1);
|
2011-05-20 23:23:33 -07:00
|
|
|
}
|
2008-05-26 06:24:24 -07:00
|
|
|
}
|
2009-11-15 05:46:20 -08:00
|
|
|
RD(" ---]\n");
|
2008-05-26 06:24:24 -07:00
|
|
|
return clean_them;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_render_check_pending_objects(Eina_Array *pending_objects, Evas *eo_e EINA_UNUSED, Evas_Public_Data *e)
|
2008-05-26 06:24:24 -07:00
|
|
|
{
|
2010-05-05 04:36:21 -07:00
|
|
|
unsigned int i;
|
2008-05-26 06:24:24 -07:00
|
|
|
|
|
|
|
for (i = 0; i < pending_objects->count; ++i)
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
2012-05-16 06:21:37 -07:00
|
|
|
int is_active;
|
|
|
|
Eina_Bool ok = EINA_FALSE;
|
2012-10-08 18:58:41 -07:00
|
|
|
|
|
|
|
Evas_Object_Protected_Data *obj = eina_array_data_get(pending_objects, i);
|
|
|
|
eo_obj = obj->object;
|
|
|
|
|
2011-05-20 23:23:33 -07:00
|
|
|
if (!obj->layer) goto clean_stuff;
|
2010-04-27 06:43:10 -07:00
|
|
|
|
2012-06-15 06:29:24 -07:00
|
|
|
//If the children are in active objects, They should be cleaned up.
|
2012-10-10 00:23:00 -07:00
|
|
|
if (obj->changed_map && _evas_render_has_map(eo_obj, obj))
|
2012-06-15 06:29:24 -07:00
|
|
|
goto clean_stuff;
|
2012-05-29 17:51:11 -07:00
|
|
|
|
2013-04-06 22:00:10 -07:00
|
|
|
evas_object_clip_recalc(obj);
|
2012-10-08 18:58:41 -07:00
|
|
|
is_active = evas_object_is_active(eo_obj, obj);
|
2010-04-27 06:43:10 -07:00
|
|
|
|
2011-05-20 23:23:33 -07:00
|
|
|
if ((!is_active) && (!obj->is_active) && (!obj->render_pre) &&
|
2009-10-30 03:11:15 -07:00
|
|
|
(!obj->rect_del))
|
2011-05-20 23:23:33 -07:00
|
|
|
{
|
2012-05-16 06:21:37 -07:00
|
|
|
ok = EINA_TRUE;
|
2011-05-20 23:23:33 -07:00
|
|
|
goto clean_stuff;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (obj->is_active == is_active)
|
|
|
|
{
|
|
|
|
if (obj->changed)
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->is_smart)
|
2011-05-20 23:23:33 -07:00
|
|
|
{
|
2012-05-16 06:21:37 -07:00
|
|
|
if (obj->render_pre || obj->rect_del) ok = EINA_TRUE;
|
2011-05-20 23:23:33 -07:00
|
|
|
}
|
2009-10-28 01:59:01 -07:00
|
|
|
else
|
2011-05-20 23:23:33 -07:00
|
|
|
if ((is_active) && (obj->restack) && (!obj->clip.clipees) &&
|
2012-10-10 00:23:00 -07:00
|
|
|
(_evas_render_can_render(eo_obj, obj) ||
|
2013-03-12 05:58:19 -07:00
|
|
|
(evas_object_was_visible(eo_obj, obj) && (!obj->prev->have_clipees))))
|
2009-10-28 01:59:01 -07:00
|
|
|
{
|
2012-05-16 06:21:37 -07:00
|
|
|
if (!(obj->render_pre || obj->rect_del))
|
|
|
|
ok = EINA_TRUE;
|
2009-10-28 01:59:01 -07:00
|
|
|
}
|
2011-05-20 23:23:33 -07:00
|
|
|
else
|
|
|
|
if (is_active && (!obj->clip.clipees) &&
|
2012-10-10 00:23:00 -07:00
|
|
|
(_evas_render_can_render(eo_obj, obj) ||
|
2013-03-12 05:58:19 -07:00
|
|
|
(evas_object_was_visible(eo_obj, obj) && (!obj->prev->have_clipees))))
|
2011-05-20 23:23:33 -07:00
|
|
|
{
|
2012-05-16 06:21:37 -07:00
|
|
|
if (obj->render_pre || obj->rect_del) ok = EINA_TRUE;
|
2011-05-20 23:23:33 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((!obj->clip.clipees) && (obj->delete_me == 0) &&
|
2013-03-12 05:58:19 -07:00
|
|
|
(!obj->cur->have_clipees || (evas_object_was_visible(eo_obj, obj) && (!obj->prev->have_clipees)))
|
2012-10-08 18:58:41 -07:00
|
|
|
&& evas_object_is_opaque(eo_obj, obj) && evas_object_is_visible(eo_obj, obj))
|
2009-10-30 03:11:15 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->rect_del || obj->is_smart) ok = EINA_TRUE;
|
2009-10-30 03:11:15 -07:00
|
|
|
}
|
2011-05-20 23:23:33 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
clean_stuff:
|
|
|
|
if (!ok)
|
|
|
|
{
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJS_ARRAY_CLEAN(&e->active_objects);
|
|
|
|
OBJS_ARRAY_CLEAN(&e->render_objects);
|
|
|
|
OBJS_ARRAY_CLEAN(&e->restack_objects);
|
|
|
|
OBJS_ARRAY_CLEAN(&e->delete_objects);
|
2012-05-16 06:21:37 -07:00
|
|
|
e->invalidate = EINA_TRUE;
|
2013-06-20 04:28:18 -07:00
|
|
|
return;
|
2011-05-20 23:23:33 -07:00
|
|
|
}
|
2005-10-26 19:44:36 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-09-03 22:13:19 -07:00
|
|
|
Eina_Bool
|
2012-10-08 18:58:41 -07:00
|
|
|
pending_change(void *data, void *gdata EINA_UNUSED)
|
2008-06-04 09:42:39 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
2008-06-04 09:42:39 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = data;
|
|
|
|
eo_obj = obj->object;
|
2008-10-16 05:27:07 -07:00
|
|
|
if (obj->delete_me) return EINA_FALSE;
|
2009-11-23 02:07:07 -08:00
|
|
|
if (obj->pre_render_done)
|
|
|
|
{
|
2013-08-18 21:20:57 -07:00
|
|
|
RD(" OBJ [%p", obj);
|
2013-08-19 00:35:34 -07:00
|
|
|
if (obj->name)
|
|
|
|
{
|
|
|
|
RD(":%s", obj->name);
|
|
|
|
}
|
2013-08-18 21:20:57 -07:00
|
|
|
RD("] pending change %i -> 0, pre %i\n", obj->changed, obj->pre_render_done);
|
2013-07-08 17:46:15 -07:00
|
|
|
obj->func->render_post(eo_obj, obj, obj->private_data);
|
2012-05-16 06:21:37 -07:00
|
|
|
obj->pre_render_done = EINA_FALSE;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_change_reset(eo_obj);
|
2009-11-23 02:07:07 -08:00
|
|
|
}
|
2013-12-19 00:34:05 -08:00
|
|
|
else if (!_evas_render_can_render(eo_obj, obj) &&
|
|
|
|
(!obj->is_active) && (!obj->render_pre) &&
|
|
|
|
(!obj->rect_del))
|
|
|
|
{
|
|
|
|
evas_object_change_reset(eo_obj);
|
|
|
|
}
|
2013-05-02 00:47:16 -07:00
|
|
|
if (!obj->changed) eo_data_unref(eo_obj, obj);
|
2008-10-16 05:27:07 -07:00
|
|
|
return obj->changed ? EINA_TRUE : EINA_FALSE;
|
2008-06-04 09:42:39 -07:00
|
|
|
}
|
2011-01-19 03:59:53 -08:00
|
|
|
|
2011-10-02 20:28:52 -07:00
|
|
|
static Eina_Bool
|
2012-10-10 00:23:00 -07:00
|
|
|
_evas_render_can_use_overlay(Evas_Public_Data *e, Evas_Object *eo_obj)
|
2011-10-02 20:28:52 -07:00
|
|
|
{
|
|
|
|
Eina_Rectangle *r;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_tmp;
|
2011-10-02 20:28:52 -07:00
|
|
|
Eina_List *alphas = NULL;
|
|
|
|
Eina_List *opaques = NULL;
|
|
|
|
Evas_Object *video_parent = NULL;
|
|
|
|
Eina_Rectangle zone;
|
|
|
|
Evas_Coord xc1, yc1, xc2, yc2;
|
|
|
|
unsigned int i;
|
|
|
|
Eina_Bool nooverlay;
|
2014-06-02 06:47:59 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
|
2012-10-10 00:23:00 -07:00
|
|
|
Evas_Object_Protected_Data *tmp = NULL;
|
evas/image: Add video surface caps.
Wayland subsurfaces can be used as video surfaces too, similarly to
Ecore_X windows. However, they support a different set of features. Some
of them, like subsurface clipping and scaling, might be added in the
future, but so far we must work with what we have.
This commit allows to set an enum bitfield to the Video_Surface, with
the default value being one that will keep the same behavior as before,
for Ecore_X window. Thus, backward compatibility should not be broken.
It's possible to inform Evas that the surface in question is not able to
resize or scale, or that it's above or below the original canvas
surface. This allows Evas to show the surface itself, or use a buffer of
pixels instead, when the capabilities are not available.
2013-09-26 09:49:18 -07:00
|
|
|
Evas_Coord imgw, imgh;
|
|
|
|
unsigned int caps;
|
|
|
|
Eina_Bool surface_below, stacking_check, object_above = EINA_FALSE;
|
|
|
|
Eina_Bool ignore_window;
|
2011-10-02 20:28:52 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
video_parent = _evas_object_image_video_parent_get(eo_obj);
|
2011-10-02 20:28:52 -07:00
|
|
|
|
|
|
|
/* Check if any one is the stack make this object mapped */
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_tmp = eo_obj;
|
2014-08-26 20:46:43 -07:00
|
|
|
tmp = eo_data_scope_get(eo_tmp, EVAS_OBJECT_CLASS);
|
2012-10-10 00:23:00 -07:00
|
|
|
while (tmp && !_evas_render_has_map(eo_tmp, tmp))
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2014-06-02 06:47:59 -07:00
|
|
|
tmp = eo_data_scope_get(eo_tmp, EVAS_OBJECT_CLASS);
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_tmp = tmp->smart.parent;
|
|
|
|
}
|
2011-10-02 20:28:52 -07:00
|
|
|
|
2012-10-10 00:23:00 -07:00
|
|
|
if (tmp && _evas_render_has_map(eo_tmp, tmp)) return EINA_FALSE; /* we are mapped, we can't be an overlay */
|
2011-10-02 20:28:52 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if (!evas_object_is_visible(eo_obj, obj)) return EINA_FALSE; /* no need to update the overlay if it's not visible */
|
2011-10-02 20:28:52 -07:00
|
|
|
|
|
|
|
/* If any recoloring of the surface is needed, n overlay to */
|
2013-03-12 05:58:19 -07:00
|
|
|
if ((obj->cur->cache.clip.r != 255) ||
|
|
|
|
(obj->cur->cache.clip.g != 255) ||
|
|
|
|
(obj->cur->cache.clip.b != 255) ||
|
|
|
|
(obj->cur->cache.clip.a != 255))
|
2011-10-02 20:28:52 -07:00
|
|
|
return EINA_FALSE;
|
|
|
|
|
evas/image: Add video surface caps.
Wayland subsurfaces can be used as video surfaces too, similarly to
Ecore_X windows. However, they support a different set of features. Some
of them, like subsurface clipping and scaling, might be added in the
future, but so far we must work with what we have.
This commit allows to set an enum bitfield to the Video_Surface, with
the default value being one that will keep the same behavior as before,
for Ecore_X window. Thus, backward compatibility should not be broken.
It's possible to inform Evas that the surface in question is not able to
resize or scale, or that it's above or below the original canvas
surface. This allows Evas to show the surface itself, or use a buffer of
pixels instead, when the capabilities are not available.
2013-09-26 09:49:18 -07:00
|
|
|
caps = evas_object_image_video_surface_caps_get(eo_obj);
|
|
|
|
|
|
|
|
/* check if surface is above the canvas */
|
|
|
|
surface_below = !!(caps & EVAS_VIDEO_SURFACE_BELOW);
|
|
|
|
if (!surface_below)
|
|
|
|
{
|
|
|
|
/* above canvas, must support resize and clipping */
|
|
|
|
|
|
|
|
/* check if video surface supports resize */
|
|
|
|
evas_object_image_size_get(eo_obj, &imgw, &imgh);
|
|
|
|
if ((obj->cur->geometry.w != imgw) ||
|
|
|
|
(obj->cur->geometry.h != imgh))
|
|
|
|
{
|
|
|
|
if (!(caps & EVAS_VIDEO_SURFACE_RESIZE))
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
/* check if video surface supports clipping */
|
|
|
|
evas_object_image_size_get(eo_obj, &imgw, &imgh);
|
|
|
|
if ((obj->cur->cache.clip.x != obj->cur->geometry.x) ||
|
|
|
|
(obj->cur->cache.clip.y != obj->cur->geometry.y) ||
|
|
|
|
(obj->cur->cache.clip.w != obj->cur->geometry.w) ||
|
|
|
|
(obj->cur->cache.clip.h != obj->cur->geometry.h))
|
|
|
|
{
|
|
|
|
if (!(caps & EVAS_VIDEO_SURFACE_CLIP))
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* check for window/surface/canvas limits */
|
|
|
|
ignore_window = !!(caps & EVAS_VIDEO_SURFACE_IGNORE_WINDOW);
|
|
|
|
if (!ignore_window)
|
|
|
|
{
|
|
|
|
Evas_Coord x1, x2, y1, y2;
|
|
|
|
Evas_Coord fx, fy, fw, fh;
|
|
|
|
|
|
|
|
fx = e->framespace.x;
|
|
|
|
fy = e->framespace.y;
|
|
|
|
fw = e->framespace.w;
|
|
|
|
fh = e->framespace.h;
|
|
|
|
|
|
|
|
x1 = obj->cur->geometry.x + fx;
|
|
|
|
y1 = obj->cur->geometry.y + fy;
|
|
|
|
x2 = obj->cur->geometry.x + obj->cur->geometry.w + fx;
|
|
|
|
y2 = obj->cur->geometry.y + obj->cur->geometry.h + fy;
|
|
|
|
|
|
|
|
if ((x1 < fx) || (y1 < fy) ||
|
|
|
|
(x2 > e->output.w - (fw - fx)) ||
|
|
|
|
(y2 > e->output.h - (fh - fy)))
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* check if there are other objects above the video object? */
|
|
|
|
stacking_check = !!(caps & EVAS_VIDEO_SURFACE_STACKING_CHECK);
|
|
|
|
if (!stacking_check)
|
|
|
|
return EINA_TRUE;
|
|
|
|
|
2011-10-02 20:28:52 -07:00
|
|
|
/* Check presence of transparent object on top of the video object */
|
|
|
|
EINA_RECTANGLE_SET(&zone,
|
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);
|
2011-10-02 20:28:52 -07:00
|
|
|
|
|
|
|
for (i = e->active_objects.count - 1; i > 0; i--)
|
|
|
|
{
|
|
|
|
Eina_Rectangle self;
|
|
|
|
Eina_Rectangle *match;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_current;
|
2011-10-02 20:28:52 -07:00
|
|
|
Eina_List *l;
|
|
|
|
int xm1, ym1, xm2, ym2;
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *current = eina_array_data_get(&e->active_objects, i);
|
|
|
|
eo_current = current->object;
|
2011-10-02 20:28:52 -07:00
|
|
|
|
|
|
|
/* Did we find the video object in the stack ? */
|
2012-10-08 18:58:41 -07:00
|
|
|
if (eo_current == video_parent || eo_current == eo_obj)
|
2011-10-02 20:28:52 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
EINA_RECTANGLE_SET(&self,
|
2013-03-12 05:58:19 -07:00
|
|
|
current->cur->cache.clip.x,
|
|
|
|
current->cur->cache.clip.y,
|
|
|
|
current->cur->cache.clip.w,
|
|
|
|
current->cur->cache.clip.h);
|
2011-10-02 20:28:52 -07:00
|
|
|
|
|
|
|
/* This doesn't cover the area of the video object, so don't bother with that object */
|
|
|
|
if (!eina_rectangles_intersect(&zone, &self))
|
2012-05-25 05:55:45 -07:00
|
|
|
continue;
|
2011-10-02 20:28:52 -07:00
|
|
|
|
2013-03-12 05:58:19 -07:00
|
|
|
xc1 = current->cur->cache.clip.x;
|
|
|
|
yc1 = current->cur->cache.clip.y;
|
|
|
|
xc2 = current->cur->cache.clip.x + current->cur->cache.clip.w;
|
|
|
|
yc2 = current->cur->cache.clip.y + current->cur->cache.clip.h;
|
2011-10-02 20:28:52 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if (evas_object_is_visible(eo_current, current) &&
|
2011-10-02 20:28:52 -07:00
|
|
|
(!current->clip.clipees) &&
|
2013-03-12 05:58:19 -07:00
|
|
|
(current->cur->visible) &&
|
2011-10-02 20:28:52 -07:00
|
|
|
(!current->delete_me) &&
|
2013-03-12 05:58:19 -07:00
|
|
|
(current->cur->cache.clip.visible) &&
|
2014-06-02 06:47:59 -07:00
|
|
|
(!eo_isa(eo_current, EVAS_OBJECT_SMART_CLASS)))
|
2011-10-02 20:28:52 -07:00
|
|
|
{
|
|
|
|
Eina_Bool included = EINA_FALSE;
|
|
|
|
|
evas/image: Add video surface caps.
Wayland subsurfaces can be used as video surfaces too, similarly to
Ecore_X windows. However, they support a different set of features. Some
of them, like subsurface clipping and scaling, might be added in the
future, but so far we must work with what we have.
This commit allows to set an enum bitfield to the Video_Surface, with
the default value being one that will keep the same behavior as before,
for Ecore_X window. Thus, backward compatibility should not be broken.
It's possible to inform Evas that the surface in question is not able to
resize or scale, or that it's above or below the original canvas
surface. This allows Evas to show the surface itself, or use a buffer of
pixels instead, when the capabilities are not available.
2013-09-26 09:49:18 -07:00
|
|
|
if (!surface_below)
|
|
|
|
{
|
|
|
|
object_above = EINA_TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if (evas_object_is_opaque(eo_current, current) ||
|
2011-10-02 20:28:52 -07:00
|
|
|
((current->func->has_opaque_rect) &&
|
2013-07-08 17:46:15 -07:00
|
|
|
(current->func->has_opaque_rect(eo_current, current, current->private_data))))
|
2011-10-02 20:28:52 -07:00
|
|
|
{
|
|
|
|
/* The object is opaque */
|
|
|
|
|
|
|
|
/* Check if the opaque object is inside another opaque object */
|
|
|
|
EINA_LIST_FOREACH(opaques, l, match)
|
|
|
|
{
|
|
|
|
xm1 = match->x;
|
|
|
|
ym1 = match->y;
|
|
|
|
xm2 = match->x + match->w;
|
|
|
|
ym2 = match->y + match->h;
|
|
|
|
|
|
|
|
/* Both object are included */
|
|
|
|
if (xc1 >= xm1 && yc1 >= ym1 && xc2 <= xm2 && yc2 <= ym2)
|
|
|
|
{
|
|
|
|
included = EINA_TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Not included yet */
|
|
|
|
if (!included)
|
|
|
|
{
|
|
|
|
Eina_List *ln;
|
|
|
|
Evas_Coord xn2, yn2;
|
|
|
|
|
2013-03-12 05:58:19 -07:00
|
|
|
r = eina_rectangle_new(current->cur->cache.clip.x, current->cur->cache.clip.y,
|
|
|
|
current->cur->cache.clip.w, current->cur->cache.clip.h);
|
2011-10-02 20:28:52 -07:00
|
|
|
|
|
|
|
opaques = eina_list_append(opaques, r);
|
|
|
|
|
|
|
|
xn2 = r->x + r->w;
|
|
|
|
yn2 = r->y + r->h;
|
|
|
|
|
|
|
|
/* Remove all the transparent object that are covered by the new opaque object */
|
|
|
|
EINA_LIST_FOREACH_SAFE(alphas, l, ln, match)
|
|
|
|
{
|
|
|
|
xm1 = match->x;
|
|
|
|
ym1 = match->y;
|
|
|
|
xm2 = match->x + match->w;
|
|
|
|
ym2 = match->y + match->h;
|
|
|
|
|
|
|
|
if (xm1 >= r->x && ym1 >= r->y && xm2 <= xn2 && ym2 <= yn2)
|
|
|
|
{
|
|
|
|
/* The new rectangle is over some transparent object,
|
|
|
|
so remove the transparent object */
|
|
|
|
alphas = eina_list_remove_list(alphas, l);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* The object has some transparency */
|
|
|
|
|
|
|
|
/* Check if the transparent object is inside any other transparent object */
|
|
|
|
EINA_LIST_FOREACH(alphas, l, match)
|
|
|
|
{
|
|
|
|
xm1 = match->x;
|
|
|
|
ym1 = match->y;
|
|
|
|
xm2 = match->x + match->w;
|
|
|
|
ym2 = match->y + match->h;
|
|
|
|
|
|
|
|
/* Both object are included */
|
|
|
|
if (xc1 >= xm1 && yc1 >= ym1 && xc2 <= xm2 && yc2 <= ym2)
|
|
|
|
{
|
|
|
|
included = EINA_TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If not check if it is inside any opaque one */
|
|
|
|
if (!included)
|
|
|
|
{
|
|
|
|
EINA_LIST_FOREACH(opaques, l, match)
|
|
|
|
{
|
|
|
|
xm1 = match->x;
|
|
|
|
ym1 = match->y;
|
|
|
|
xm2 = match->x + match->w;
|
|
|
|
ym2 = match->y + match->h;
|
|
|
|
|
|
|
|
/* Both object are included */
|
|
|
|
if (xc1 >= xm1 && yc1 >= ym1 && xc2 <= xm2 && yc2 <= ym2)
|
|
|
|
{
|
|
|
|
included = EINA_TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* No inclusion at all, so add it */
|
|
|
|
if (!included)
|
|
|
|
{
|
2013-03-12 05:58:19 -07:00
|
|
|
r = eina_rectangle_new(current->cur->cache.clip.x, current->cur->cache.clip.y,
|
|
|
|
current->cur->cache.clip.w, current->cur->cache.clip.h);
|
2011-10-02 20:28:52 -07:00
|
|
|
|
|
|
|
alphas = eina_list_append(alphas, r);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If there is any pending transparent object, then no overlay */
|
|
|
|
nooverlay = !!eina_list_count(alphas);
|
|
|
|
|
|
|
|
EINA_LIST_FREE(alphas, r)
|
|
|
|
eina_rectangle_free(r);
|
|
|
|
EINA_LIST_FREE(opaques, r)
|
|
|
|
eina_rectangle_free(r);
|
|
|
|
|
evas/image: Add video surface caps.
Wayland subsurfaces can be used as video surfaces too, similarly to
Ecore_X windows. However, they support a different set of features. Some
of them, like subsurface clipping and scaling, might be added in the
future, but so far we must work with what we have.
This commit allows to set an enum bitfield to the Video_Surface, with
the default value being one that will keep the same behavior as before,
for Ecore_X window. Thus, backward compatibility should not be broken.
It's possible to inform Evas that the surface in question is not able to
resize or scale, or that it's above or below the original canvas
surface. This allows Evas to show the surface itself, or use a buffer of
pixels instead, when the capabilities are not available.
2013-09-26 09:49:18 -07:00
|
|
|
if (nooverlay || object_above)
|
2011-10-02 20:28:52 -07:00
|
|
|
return EINA_FALSE;
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
2008-06-04 09:42:39 -07:00
|
|
|
|
2013-07-04 19:09:03 -07:00
|
|
|
static void
|
|
|
|
_evas_render_mapped_context_clip_set(Evas_Public_Data *e, Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *ctx, Evas_Proxy_Render_Data *proxy_render_data, int off_x, int off_y)
|
|
|
|
{
|
|
|
|
int x, y, w, h;
|
|
|
|
Eina_Bool proxy_src_clip = EINA_TRUE;
|
|
|
|
|
|
|
|
if (proxy_render_data) proxy_src_clip = proxy_render_data->source_clip;
|
|
|
|
|
|
|
|
if (proxy_src_clip)
|
|
|
|
{
|
|
|
|
x = obj->cur->cache.clip.x;
|
|
|
|
y = obj->cur->cache.clip.y;
|
|
|
|
w = obj->cur->cache.clip.w;
|
|
|
|
h = obj->cur->cache.clip.h;
|
|
|
|
|
|
|
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
|
|
|
obj->cur->clipper->cur->cache.clip.x,
|
|
|
|
obj->cur->clipper->cur->cache.clip.y,
|
|
|
|
obj->cur->clipper->cur->cache.clip.w,
|
|
|
|
obj->cur->clipper->cur->cache.clip.h);
|
|
|
|
|
|
|
|
e->engine.func->context_clip_set(e->engine.data.output,
|
|
|
|
ctx, x + off_x, y + off_y, w, h);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
//FIXME: Consider to clip by the proxy clipper.
|
|
|
|
if (proxy_render_data->eo_src != eo_obj)
|
|
|
|
{
|
|
|
|
x = obj->cur->clipper->cur->geometry.x + off_x;
|
|
|
|
y = obj->cur->clipper->cur->geometry.y + off_y;
|
|
|
|
w = obj->cur->clipper->cur->geometry.w;
|
|
|
|
h = obj->cur->clipper->cur->geometry.h;
|
|
|
|
e->engine.func->context_clip_set(e->engine.data.output, ctx, x, y,
|
|
|
|
w, h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-20 07:40:28 -07:00
|
|
|
Eina_Bool
|
2012-10-18 04:30:04 -07:00
|
|
|
evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
|
|
|
|
Evas_Object_Protected_Data *obj, void *context,
|
|
|
|
void *surface, int off_x, int off_y, int mapped, int ecx,
|
2013-05-31 04:28:12 -07:00
|
|
|
int ecy, int ecw, int ech,
|
2014-11-04 21:54:35 -08:00
|
|
|
Evas_Proxy_Render_Data *proxy_render_data, int level,
|
2014-11-12 02:18:09 -08:00
|
|
|
Eina_Bool use_mapped_ctx, Eina_Bool do_async)
|
2009-10-30 03:11:15 -07:00
|
|
|
{
|
2009-11-06 21:01:43 -08:00
|
|
|
void *ctx;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj2;
|
2010-05-05 04:36:21 -07:00
|
|
|
Eina_Bool clean_them = EINA_FALSE;
|
2013-05-06 06:18:08 -07:00
|
|
|
Eina_Bool proxy_src_clip = EINA_TRUE;
|
2009-11-15 05:46:20 -08:00
|
|
|
|
2013-07-01 23:28:56 -07:00
|
|
|
//Don't Render if the source is invisible.
|
2013-05-31 04:28:12 -07:00
|
|
|
if (!proxy_render_data)
|
2013-04-29 05:05:33 -07:00
|
|
|
{
|
|
|
|
if ((evas_object_is_source_invisible(eo_obj, obj)))
|
|
|
|
return clean_them;
|
|
|
|
}
|
|
|
|
else
|
2013-05-31 04:28:12 -07:00
|
|
|
proxy_src_clip = proxy_render_data->source_clip;
|
2013-04-28 23:30:37 -07:00
|
|
|
|
2013-04-06 22:00:10 -07:00
|
|
|
evas_object_clip_recalc(obj);
|
2012-08-16 23:02:49 -07:00
|
|
|
|
2010-04-27 06:43:10 -07:00
|
|
|
RDI(level);
|
2013-08-18 21:20:57 -07:00
|
|
|
RD(" { evas_render_mapped(%p, %p", e, obj);
|
2013-08-19 00:35:34 -07:00
|
|
|
if (obj->name)
|
|
|
|
{
|
|
|
|
RD(":%s", obj->name);
|
|
|
|
}
|
2013-08-18 21:20:57 -07:00
|
|
|
RD(", %p, %p, %i, %i, %i, %i)\n", context, surface, off_x, off_y, mapped, level);
|
2013-04-26 04:05:46 -07:00
|
|
|
|
2009-11-09 07:18:37 -08:00
|
|
|
if (mapped)
|
|
|
|
{
|
2014-11-12 17:47:29 -08:00
|
|
|
if (_evas_render_object_is_mask(obj))
|
|
|
|
{
|
|
|
|
// don't return;
|
|
|
|
}
|
|
|
|
else if (proxy_src_clip)
|
2009-11-15 05:46:20 -08:00
|
|
|
{
|
2013-04-26 04:05:46 -07:00
|
|
|
if ((!evas_object_is_visible(eo_obj, obj)) || (obj->clip.clipees)
|
|
|
|
|| (obj->cur->have_clipees))
|
2013-04-25 22:45:41 -07:00
|
|
|
{
|
2013-04-26 04:05:46 -07:00
|
|
|
RDI(level);
|
|
|
|
RD(" }\n");
|
|
|
|
return clean_them;
|
2013-04-25 22:45:41 -07:00
|
|
|
}
|
2013-04-26 04:05:46 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-07-28 04:24:46 -07:00
|
|
|
if (!evas_object_is_proxy_visible(eo_obj, obj) ||
|
|
|
|
(obj->clip.clipees) || (obj->cur->have_clipees))
|
2013-04-25 22:45:41 -07:00
|
|
|
{
|
|
|
|
RDI(level);
|
|
|
|
RD(" }\n");
|
|
|
|
return clean_them;
|
|
|
|
}
|
2009-11-15 05:46:20 -08:00
|
|
|
}
|
2009-11-09 07:18:37 -08:00
|
|
|
}
|
2013-04-26 04:05:46 -07:00
|
|
|
else if (!(((evas_object_is_active(eo_obj, obj) && (!obj->clip.clipees) &&
|
|
|
|
(_evas_render_can_render(eo_obj, obj))))
|
|
|
|
))
|
2009-11-15 05:46:20 -08:00
|
|
|
{
|
2010-04-27 06:43:10 -07:00
|
|
|
RDI(level);
|
2009-11-15 05:46:20 -08:00
|
|
|
RD(" }\n");
|
2010-05-05 04:36:21 -07:00
|
|
|
return clean_them;
|
2009-11-15 05:46:20 -08:00
|
|
|
}
|
2010-04-27 06:43:10 -07:00
|
|
|
|
2009-11-23 02:07:07 -08:00
|
|
|
// set render_pre - for child objs that may not have gotten it.
|
2013-09-02 20:39:49 -07:00
|
|
|
obj->pre_render_done = EINA_TRUE;
|
2011-02-06 15:52:17 -08:00
|
|
|
RD(" Hasmap: %p (%d) %p %d -> %d\n",obj->func->can_map,
|
2012-10-08 18:58:41 -07:00
|
|
|
obj->func->can_map ? obj->func->can_map(eo_obj): -1,
|
2013-01-21 19:56:00 -08:00
|
|
|
obj->map->cur.map, obj->map->cur.usemap,
|
2012-10-10 00:23:00 -07:00
|
|
|
_evas_render_has_map(eo_obj, obj));
|
|
|
|
if (_evas_render_has_map(eo_obj, obj))
|
2009-10-30 03:11:15 -07:00
|
|
|
{
|
2009-10-31 02:08:01 -07:00
|
|
|
int sw, sh;
|
2012-05-16 06:21:37 -07:00
|
|
|
Eina_Bool changed = EINA_FALSE, rendered = EINA_FALSE;
|
2010-04-27 06:43:10 -07:00
|
|
|
|
2011-05-20 23:23:33 -07:00
|
|
|
clean_them = EINA_TRUE;
|
2010-05-05 04:36:21 -07:00
|
|
|
|
2013-03-12 05:58:19 -07:00
|
|
|
sw = obj->cur->geometry.w;
|
|
|
|
sh = obj->cur->geometry.h;
|
2010-04-27 06:43:10 -07:00
|
|
|
RDI(level);
|
2009-11-15 05:46:20 -08:00
|
|
|
RD(" mapped obj: %ix%i\n", sw, sh);
|
|
|
|
if ((sw <= 0) || (sh <= 0))
|
|
|
|
{
|
2010-04-27 06:43:10 -07:00
|
|
|
RDI(level);
|
2009-11-15 05:46:20 -08:00
|
|
|
RD(" }\n");
|
2010-05-05 04:36:21 -07:00
|
|
|
return clean_them;
|
2009-11-15 05:46:20 -08:00
|
|
|
}
|
2014-01-05 20:54:58 -08:00
|
|
|
|
|
|
|
changed = evas_object_map_update(eo_obj, off_x, off_y, sw, sh, sw, sh);
|
2010-04-27 06:43:10 -07:00
|
|
|
|
2013-01-21 19:56:00 -08:00
|
|
|
if (obj->map->surface)
|
2009-10-31 02:08:01 -07:00
|
|
|
{
|
2013-01-21 19:56:00 -08:00
|
|
|
if ((obj->map->surface_w != sw) ||
|
|
|
|
(obj->map->surface_h != sh))
|
2009-10-31 02:08:01 -07:00
|
|
|
{
|
2010-04-27 06:43:10 -07:00
|
|
|
RDI(level);
|
2009-11-15 05:46:20 -08:00
|
|
|
RD(" new surf: %ix%i\n", sw, sh);
|
2013-01-21 19:56:00 -08:00
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
|
|
|
|
{
|
|
|
|
obj->layer->evas->engine.func->image_map_surface_free
|
|
|
|
(e->engine.data.output, map_write->surface);
|
|
|
|
map_write->surface = NULL;
|
|
|
|
}
|
|
|
|
EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write);
|
2009-10-31 02:08:01 -07:00
|
|
|
}
|
|
|
|
}
|
2013-01-21 19:56:00 -08:00
|
|
|
if (!obj->map->surface)
|
2009-10-31 02:08:01 -07:00
|
|
|
{
|
2013-01-21 19:56:00 -08:00
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
|
|
|
|
{
|
|
|
|
map_write->surface_w = sw;
|
|
|
|
map_write->surface_h = sh;
|
|
|
|
|
|
|
|
map_write->surface =
|
|
|
|
obj->layer->evas->engine.func->image_map_surface_new
|
|
|
|
(e->engine.data.output, map_write->surface_w,
|
|
|
|
map_write->surface_h,
|
|
|
|
map_write->cur.map->alpha);
|
|
|
|
}
|
|
|
|
EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write);
|
|
|
|
|
2010-04-27 06:43:10 -07:00
|
|
|
RDI(level);
|
2009-11-15 05:46:20 -08:00
|
|
|
RD(" fisrt surf: %ix%i\n", sw, sh);
|
2012-05-16 06:21:37 -07:00
|
|
|
changed = EINA_TRUE;
|
2009-10-31 02:08:01 -07:00
|
|
|
}
|
2013-05-05 19:03:11 -07:00
|
|
|
|
2013-11-24 23:05:12 -08:00
|
|
|
if (!changed) changed = evas_object_smart_changed_get(eo_obj);
|
2010-04-27 06:43:10 -07:00
|
|
|
|
2012-08-23 12:58:02 -07:00
|
|
|
/* mark the old map as invalid, so later we don't reuse it as a
|
|
|
|
* cache. */
|
2013-01-21 19:56:00 -08:00
|
|
|
if (changed && obj->map->prev.map)
|
|
|
|
{
|
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
|
|
|
|
map_write->prev.valid_map = EINA_FALSE;
|
|
|
|
EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write);
|
|
|
|
}
|
2012-08-23 12:58:02 -07:00
|
|
|
|
2009-10-31 02:08:01 -07:00
|
|
|
// clear surface before re-render
|
2013-01-21 19:56:00 -08:00
|
|
|
if ((changed) && (obj->map->surface))
|
2009-10-30 03:11:15 -07:00
|
|
|
{
|
2010-09-01 15:45:30 -07:00
|
|
|
int off_x2, off_y2;
|
2011-05-20 23:23:33 -07:00
|
|
|
|
2010-04-27 06:43:10 -07:00
|
|
|
RDI(level);
|
2009-11-15 05:46:20 -08:00
|
|
|
RD(" children redraw\n");
|
2009-11-09 07:18:37 -08:00
|
|
|
// FIXME: calculate "changes" within map surface and only clear
|
|
|
|
// and re-render those
|
2013-01-21 19:56:00 -08:00
|
|
|
if (obj->map->cur.map->alpha)
|
2009-10-31 18:32:23 -07:00
|
|
|
{
|
|
|
|
ctx = e->engine.func->context_new(e->engine.data.output);
|
|
|
|
e->engine.func->context_color_set
|
2011-05-20 23:23:33 -07:00
|
|
|
(e->engine.data.output, ctx, 0, 0, 0, 0);
|
2009-10-31 18:32:23 -07:00
|
|
|
e->engine.func->context_render_op_set
|
2011-05-20 23:23:33 -07:00
|
|
|
(e->engine.data.output, ctx, EVAS_RENDER_COPY);
|
2009-10-31 18:32:23 -07:00
|
|
|
e->engine.func->rectangle_draw(e->engine.data.output,
|
|
|
|
ctx,
|
2013-01-21 19:56:00 -08:00
|
|
|
obj->map->surface,
|
2010-04-27 06:43:10 -07:00
|
|
|
0, 0,
|
2013-01-21 19:56:00 -08:00
|
|
|
obj->map->surface_w,
|
|
|
|
obj->map->surface_h,
|
2012-12-18 08:28:55 -08:00
|
|
|
EINA_FALSE);
|
2009-10-31 18:32:23 -07:00
|
|
|
e->engine.func->context_free(e->engine.data.output, ctx);
|
|
|
|
}
|
2009-10-31 02:08:01 -07:00
|
|
|
ctx = e->engine.func->context_new(e->engine.data.output);
|
2013-03-12 05:58:19 -07:00
|
|
|
off_x2 = -obj->cur->geometry.x;
|
|
|
|
off_y2 = -obj->cur->geometry.y;
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->is_smart)
|
2009-10-31 02:08:01 -07:00
|
|
|
{
|
|
|
|
EINA_INLIST_FOREACH
|
2012-10-08 18:58:41 -07:00
|
|
|
(evas_object_smart_members_get_direct(eo_obj), obj2)
|
2011-05-20 23:23:33 -07:00
|
|
|
{
|
2012-10-18 04:30:04 -07:00
|
|
|
clean_them |= evas_render_mapped(e, obj2->object,
|
|
|
|
obj2, ctx,
|
2013-01-21 19:56:00 -08:00
|
|
|
obj->map->surface,
|
2011-05-20 23:23:33 -07:00
|
|
|
off_x2, off_y2, 1,
|
2012-10-18 04:30:04 -07:00
|
|
|
ecx, ecy, ecw, ech,
|
2014-11-04 21:54:35 -08:00
|
|
|
proxy_render_data,
|
|
|
|
level + 1,
|
2014-11-12 02:18:09 -08:00
|
|
|
EINA_FALSE,
|
2014-11-04 21:54:35 -08:00
|
|
|
do_async);
|
2014-03-31 22:08:14 -07:00
|
|
|
/* We aren't sure this object will be rendered by
|
|
|
|
normal(not proxy) drawing after, we reset this
|
|
|
|
only in case of normal drawing. For optmizing,
|
|
|
|
push this object in an array then reset them
|
|
|
|
in the end of the rendering.*/
|
|
|
|
if (!proxy_render_data)
|
|
|
|
evas_object_change_reset(obj2->object);
|
2011-05-20 23:23:33 -07:00
|
|
|
}
|
2009-10-31 02:08:01 -07:00
|
|
|
}
|
|
|
|
else
|
2010-04-28 07:38:46 -07:00
|
|
|
{
|
|
|
|
int x = 0, y = 0, w = 0, h = 0;
|
2010-05-01 06:27:05 -07:00
|
|
|
|
2013-01-21 19:56:00 -08:00
|
|
|
w = obj->map->surface_w;
|
|
|
|
h = obj->map->surface_h;
|
2010-04-28 07:38:46 -07:00
|
|
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->cur->geometry.x + off_x2,
|
|
|
|
obj->cur->geometry.y + off_y2,
|
|
|
|
obj->cur->geometry.w,
|
|
|
|
obj->cur->geometry.h);
|
2011-03-15 09:20:57 -07:00
|
|
|
|
2010-04-28 07:38:46 -07:00
|
|
|
e->engine.func->context_clip_set(e->engine.data.output,
|
|
|
|
ctx, x, y, w, h);
|
2013-07-08 17:46:15 -07:00
|
|
|
obj->func->render(eo_obj, obj, obj->private_data,
|
|
|
|
e->engine.data.output, ctx,
|
2013-01-21 19:56:00 -08:00
|
|
|
obj->map->surface, off_x2, off_y2,
|
2012-12-18 08:28:55 -08:00
|
|
|
EINA_FALSE);
|
2010-04-28 07:38:46 -07:00
|
|
|
}
|
2009-10-31 02:08:01 -07:00
|
|
|
e->engine.func->context_free(e->engine.data.output, ctx);
|
2012-05-16 06:21:37 -07:00
|
|
|
rendered = EINA_TRUE;
|
2009-10-31 02:08:01 -07:00
|
|
|
}
|
|
|
|
|
2010-01-26 00:16:36 -08:00
|
|
|
RDI(level);
|
2011-02-09 22:52:53 -08:00
|
|
|
RD(" draw map\n");
|
2010-04-27 06:43:10 -07:00
|
|
|
|
2010-04-30 01:24:55 -07:00
|
|
|
if (rendered)
|
|
|
|
{
|
2013-01-21 19:56:00 -08:00
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
|
|
|
|
{
|
|
|
|
map_write->surface = e->engine.func->image_dirty_region
|
|
|
|
(e->engine.data.output, map_write->surface,
|
|
|
|
0, 0, map_write->surface_w, map_write->surface_h);
|
|
|
|
|
|
|
|
map_write->cur.valid_map = EINA_TRUE;
|
|
|
|
}
|
|
|
|
EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write);
|
2010-04-30 01:24:55 -07:00
|
|
|
}
|
2010-09-18 19:28:09 -07:00
|
|
|
e->engine.func->context_clip_unset(e->engine.data.output,
|
2012-07-23 21:27:17 -07:00
|
|
|
context);
|
2013-01-21 19:56:00 -08:00
|
|
|
if (obj->map->surface)
|
2010-09-01 15:45:30 -07:00
|
|
|
{
|
2013-03-12 05:58:19 -07:00
|
|
|
if (obj->cur->clipper)
|
2010-09-01 15:45:30 -07:00
|
|
|
{
|
2013-04-06 22:00:10 -07:00
|
|
|
evas_object_clip_recalc(obj);
|
2012-08-16 23:16:04 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->is_smart)
|
2010-10-11 02:53:52 -07:00
|
|
|
{
|
|
|
|
Evas_Object *tobj;
|
2011-05-20 23:23:33 -07:00
|
|
|
|
2013-07-04 19:14:47 -07:00
|
|
|
EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
|
|
|
|
{
|
|
|
|
state_write->cache.clip.dirty = EINA_TRUE;
|
|
|
|
}
|
|
|
|
EINA_COW_STATE_WRITE_END(obj, state_write, cur);
|
2013-01-21 19:56:00 -08:00
|
|
|
|
2013-07-04 19:14:47 -07:00
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map,
|
|
|
|
Evas_Object_Map_Data, map_write)
|
2013-01-21 19:56:00 -08:00
|
|
|
{
|
|
|
|
tobj = map_write->cur.map_parent;
|
2013-07-04 19:14:47 -07:00
|
|
|
map_write->cur.map_parent =
|
|
|
|
obj->cur->clipper->map->cur.map_parent;
|
2013-01-21 19:56:00 -08:00
|
|
|
map_write->cur.map_parent = tobj;
|
|
|
|
}
|
2013-07-04 19:14:47 -07:00
|
|
|
EINA_COW_WRITE_END(evas_object_map_cow, obj->map,
|
|
|
|
map_write);
|
2010-10-11 02:53:52 -07:00
|
|
|
}
|
2013-07-04 19:14:47 -07:00
|
|
|
_evas_render_mapped_context_clip_set(e, eo_obj, obj, context,
|
|
|
|
proxy_render_data, off_x,
|
|
|
|
off_y);
|
2010-09-01 15:45:30 -07:00
|
|
|
}
|
|
|
|
}
|
2011-12-15 23:04:00 -08:00
|
|
|
// if (surface == e->engine.data.output)
|
2011-05-20 23:23:33 -07:00
|
|
|
e->engine.func->context_clip_clip(e->engine.data.output,
|
2012-07-23 21:27:17 -07:00
|
|
|
context,
|
2011-05-20 23:23:33 -07:00
|
|
|
ecx, ecy, ecw, ech);
|
2013-07-04 20:53:09 -07:00
|
|
|
if (obj->cur->cache.clip.visible || !proxy_src_clip)
|
2012-03-20 21:04:03 -07:00
|
|
|
{
|
2012-04-14 20:55:36 -07:00
|
|
|
obj->layer->evas->engine.func->context_multiplier_unset
|
2012-07-23 21:27:17 -07:00
|
|
|
(e->engine.data.output, context);
|
2013-09-05 04:30:51 -07:00
|
|
|
obj->layer->evas->engine.func->context_render_op_set
|
|
|
|
(e->engine.data.output, context, obj->cur->render_op);
|
2013-01-11 11:56:17 -08:00
|
|
|
evas_draw_image_map_async_check
|
|
|
|
(obj, e->engine.data.output, context, surface,
|
2013-01-21 19:56:00 -08:00
|
|
|
obj->map->surface, obj->map->spans,
|
|
|
|
obj->map->cur.map->smooth, 0, do_async);
|
2012-03-20 21:04:03 -07:00
|
|
|
}
|
2009-10-30 03:11:15 -07:00
|
|
|
// FIXME: needs to cache these maps and
|
|
|
|
// keep them only rendering updates
|
2011-05-20 23:23:33 -07:00
|
|
|
// obj->layer->evas->engine.func->image_map_surface_free
|
2013-01-21 19:56:00 -08:00
|
|
|
// (e->engine.data.output, obj->map->surface);
|
|
|
|
// obj->map->surface = NULL;
|
2009-10-30 03:11:15 -07:00
|
|
|
}
|
|
|
|
else
|
2009-11-06 21:01:43 -08:00
|
|
|
{
|
2013-04-06 23:11:56 -07:00
|
|
|
#if 0
|
2013-03-12 05:58:19 -07:00
|
|
|
if (0 && obj->cur->cached_surface)
|
2012-06-14 02:58:16 -07:00
|
|
|
fprintf(stderr, "We should cache '%s' [%i, %i, %i, %i]\n",
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_type_get(eo_obj),
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->cur->bounding_box.x, obj->cur->bounding_box.x,
|
|
|
|
obj->cur->bounding_box.w, obj->cur->bounding_box.h);
|
2013-04-06 23:11:56 -07:00
|
|
|
#endif
|
2014-11-12 17:47:29 -08:00
|
|
|
|
2009-11-06 21:01:43 -08:00
|
|
|
if (mapped)
|
|
|
|
{
|
2010-04-27 06:43:10 -07:00
|
|
|
RDI(level);
|
2009-11-15 05:46:20 -08:00
|
|
|
RD(" draw child of mapped obj\n");
|
2014-11-12 02:18:09 -08:00
|
|
|
if (use_mapped_ctx)
|
|
|
|
ctx = context;
|
|
|
|
else
|
|
|
|
ctx = e->engine.func->context_new(e->engine.data.output);
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->is_smart)
|
2009-11-06 21:01:43 -08:00
|
|
|
{
|
|
|
|
EINA_INLIST_FOREACH
|
2012-10-08 18:58:41 -07:00
|
|
|
(evas_object_smart_members_get_direct(eo_obj), obj2)
|
2011-05-20 23:23:33 -07:00
|
|
|
{
|
2012-10-18 04:30:04 -07:00
|
|
|
clean_them |= evas_render_mapped(e, obj2->object,
|
|
|
|
obj2, ctx, surface,
|
2011-05-20 23:23:33 -07:00
|
|
|
off_x, off_y, 1,
|
2012-10-18 04:30:04 -07:00
|
|
|
ecx, ecy, ecw, ech,
|
2014-11-04 21:54:35 -08:00
|
|
|
proxy_render_data,
|
|
|
|
level + 1,
|
2014-11-12 02:18:09 -08:00
|
|
|
EINA_FALSE,
|
2014-11-04 21:54:35 -08:00
|
|
|
do_async);
|
2014-03-31 22:08:14 -07:00
|
|
|
/* We aren't sure this object will be rendered by
|
|
|
|
normal(not proxy) drawing after, we reset this
|
|
|
|
only in case of normal drawing. For optmizing,
|
|
|
|
push this object in an array then reset them
|
|
|
|
in the end of the rendering.*/
|
|
|
|
if (!proxy_render_data)
|
|
|
|
evas_object_change_reset(obj2->object);
|
2011-05-20 23:23:33 -07:00
|
|
|
}
|
2009-11-06 21:01:43 -08:00
|
|
|
}
|
|
|
|
else
|
2010-08-24 01:14:46 -07:00
|
|
|
{
|
2012-08-16 23:02:49 -07:00
|
|
|
RDI(level);
|
2011-03-15 09:20:57 -07:00
|
|
|
|
2013-05-07 09:16:49 -07:00
|
|
|
if (obj->cur->clipper)
|
2012-08-16 23:02:49 -07:00
|
|
|
{
|
2014-11-12 17:47:29 -08:00
|
|
|
if (_evas_render_has_map(eo_obj, obj) ||
|
|
|
|
_evas_render_object_is_mask(obj->cur->clipper))
|
2013-06-25 05:56:28 -07:00
|
|
|
evas_object_clip_recalc(obj);
|
2013-07-04 19:09:03 -07:00
|
|
|
_evas_render_mapped_context_clip_set(e, eo_obj, obj, ctx,
|
|
|
|
proxy_render_data,
|
2014-11-12 17:47:29 -08:00
|
|
|
off_x, off_y);
|
|
|
|
|
|
|
|
/* Clipper masks */
|
|
|
|
if (_evas_render_object_is_mask(obj->cur->clipper))
|
|
|
|
{
|
|
|
|
// This path can be hit when we're multiplying masks on top of each other...
|
2015-01-20 22:14:50 -08:00
|
|
|
Evas_Object_Protected_Data *mask = obj->cur->clipper;
|
2014-11-12 17:47:29 -08:00
|
|
|
if (mask->mask->redraw || !mask->mask->surface)
|
|
|
|
evas_render_mask_subrender(obj->layer->evas, mask, NULL);
|
|
|
|
|
|
|
|
if (mask->mask->surface)
|
|
|
|
{
|
|
|
|
e->engine.func->context_clip_image_set
|
|
|
|
(e->engine.data.output, ctx,
|
|
|
|
mask->mask->surface,
|
|
|
|
mask->mask->x + off_x,
|
|
|
|
mask->mask->y + off_y);
|
|
|
|
}
|
|
|
|
}
|
2010-09-25 07:30:02 -07:00
|
|
|
}
|
2013-07-08 17:46:15 -07:00
|
|
|
obj->func->render(eo_obj, obj, obj->private_data,
|
|
|
|
e->engine.data.output, ctx,
|
2012-12-18 08:28:55 -08:00
|
|
|
surface, off_x, off_y, EINA_FALSE);
|
2010-08-24 01:14:46 -07:00
|
|
|
}
|
2014-11-12 02:18:09 -08:00
|
|
|
if (!use_mapped_ctx)
|
|
|
|
e->engine.func->context_free(e->engine.data.output, ctx);
|
2009-11-06 21:01:43 -08:00
|
|
|
}
|
|
|
|
else
|
2009-11-09 07:18:37 -08:00
|
|
|
{
|
2013-05-07 09:16:49 -07:00
|
|
|
if (obj->cur->clipper)
|
2011-03-15 09:20:57 -07:00
|
|
|
{
|
2014-11-12 17:47:29 -08:00
|
|
|
Evas_Object_Protected_Data *clipper = obj->cur->clipper;
|
2011-03-15 09:20:57 -07:00
|
|
|
int x, y, w, h;
|
|
|
|
|
2014-11-12 17:47:29 -08:00
|
|
|
if (_evas_render_has_map(eo_obj, obj) ||
|
|
|
|
_evas_render_object_is_mask(obj->cur->clipper))
|
2013-04-06 22:00:10 -07:00
|
|
|
evas_object_clip_recalc(obj);
|
2013-03-12 05:58:19 -07:00
|
|
|
x = obj->cur->cache.clip.x;
|
|
|
|
y = obj->cur->cache.clip.y;
|
|
|
|
w = obj->cur->cache.clip.w;
|
|
|
|
h = obj->cur->cache.clip.h;
|
2011-03-15 09:20:57 -07:00
|
|
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
2014-11-12 17:47:29 -08:00
|
|
|
clipper->cur->cache.clip.x,
|
|
|
|
clipper->cur->cache.clip.y,
|
|
|
|
clipper->cur->cache.clip.w,
|
|
|
|
clipper->cur->cache.clip.h);
|
2011-03-15 09:20:57 -07:00
|
|
|
e->engine.func->context_clip_set(e->engine.data.output,
|
2012-07-23 21:27:17 -07:00
|
|
|
context,
|
2011-03-15 09:20:57 -07:00
|
|
|
x + off_x, y + off_y, w, h);
|
2011-03-31 03:26:42 -07:00
|
|
|
e->engine.func->context_clip_clip(e->engine.data.output,
|
2012-07-23 21:27:17 -07:00
|
|
|
context,
|
2011-03-31 03:26:42 -07:00
|
|
|
ecx, ecy, ecw, ech);
|
2011-03-15 09:20:57 -07:00
|
|
|
}
|
|
|
|
|
2010-04-27 06:43:10 -07:00
|
|
|
RDI(level);
|
2009-11-15 05:46:20 -08:00
|
|
|
RD(" draw normal obj\n");
|
2013-07-08 17:46:15 -07:00
|
|
|
obj->func->render(eo_obj, obj, obj->private_data,
|
|
|
|
e->engine.data.output, context, surface,
|
2012-12-18 08:28:55 -08:00
|
|
|
off_x, off_y, do_async);
|
2009-11-09 07:18:37 -08:00
|
|
|
}
|
2012-05-28 22:13:03 -07:00
|
|
|
if (obj->changed_map) clean_them = EINA_TRUE;
|
2009-11-06 21:01:43 -08:00
|
|
|
}
|
2010-04-27 06:43:10 -07:00
|
|
|
RDI(level);
|
2009-11-15 05:46:20 -08:00
|
|
|
RD(" }\n");
|
2010-05-05 04:36:21 -07:00
|
|
|
|
|
|
|
return clean_them;
|
2009-10-30 03:11:15 -07:00
|
|
|
}
|
|
|
|
|
2014-10-22 23:27:40 -07:00
|
|
|
/*
|
|
|
|
* Render the source object when a proxy is set.
|
|
|
|
* Used to force a draw if necessary, else just makes sure it's available.
|
|
|
|
* Called from: image objects and text with filters.
|
|
|
|
* TODO: 3d objects subrender should probably be merged here as well.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
evas_render_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_proxy,
|
|
|
|
Evas_Object_Protected_Data *proxy_obj, Eina_Bool do_async)
|
|
|
|
{
|
2014-11-12 02:25:21 -08:00
|
|
|
Evas_Public_Data *evas = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2014-10-22 23:27:40 -07:00
|
|
|
Evas_Object_Protected_Data *source;
|
|
|
|
Eina_Bool source_clip = EINA_FALSE;
|
|
|
|
void *ctx;
|
|
|
|
int w, h;
|
|
|
|
|
|
|
|
if (!eo_source) return;
|
|
|
|
source = eo_data_scope_get(eo_source, EVAS_OBJECT_CLASS);
|
|
|
|
|
|
|
|
w = source->cur->geometry.w;
|
|
|
|
h = source->cur->geometry.h;
|
|
|
|
|
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, source->proxy,
|
|
|
|
Evas_Object_Proxy_Data, proxy_write)
|
|
|
|
{
|
|
|
|
proxy_write->redraw = EINA_FALSE;
|
|
|
|
|
|
|
|
/* We need to redraw surface then */
|
|
|
|
if ((proxy_write->surface) &&
|
|
|
|
((proxy_write->w != w) || (proxy_write->h != h)))
|
|
|
|
{
|
2014-11-12 02:25:21 -08:00
|
|
|
ENFN->image_map_surface_free(ENDT, proxy_write->surface);
|
2014-10-22 23:27:40 -07:00
|
|
|
proxy_write->surface = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FIXME: Hardcoded alpha 'on' */
|
|
|
|
/* FIXME (cont): Should see if the object has alpha */
|
|
|
|
if (!proxy_write->surface)
|
|
|
|
{
|
2014-11-12 02:25:21 -08:00
|
|
|
proxy_write->surface = ENFN->image_map_surface_new(ENDT, w, h, 1);
|
2014-10-22 23:27:40 -07:00
|
|
|
if (!proxy_write->surface) goto end;
|
|
|
|
proxy_write->w = w;
|
|
|
|
proxy_write->h = h;
|
|
|
|
}
|
|
|
|
|
2014-11-12 02:25:21 -08:00
|
|
|
ctx = ENFN->context_new(ENDT);
|
|
|
|
ENFN->context_color_set(ENDT, ctx, 0, 0,0, 0);
|
|
|
|
ENFN->context_render_op_set(ENDT, ctx,EVAS_RENDER_COPY);
|
|
|
|
ENFN->rectangle_draw(ENDT, ctx, proxy_write->surface, 0, 0, w, h, do_async);
|
|
|
|
ENFN->context_free(ENDT, ctx);
|
2014-10-22 23:27:40 -07:00
|
|
|
|
2014-11-12 02:25:21 -08:00
|
|
|
ctx = ENFN->context_new(ENDT);
|
2014-10-22 23:27:40 -07:00
|
|
|
|
|
|
|
if (eo_isa(eo_proxy, EVAS_IMAGE_CLASS))
|
|
|
|
eo_do(eo_proxy, source_clip = evas_obj_image_source_clip_get());
|
|
|
|
|
|
|
|
Evas_Proxy_Render_Data proxy_render_data = {
|
|
|
|
.eo_proxy = eo_proxy,
|
|
|
|
.proxy_obj = proxy_obj,
|
|
|
|
.eo_src = eo_source,
|
|
|
|
.source_clip = source_clip
|
|
|
|
};
|
2014-11-12 02:25:21 -08:00
|
|
|
evas_render_mapped(evas, eo_source, source, ctx, proxy_write->surface,
|
2014-10-22 23:27:40 -07:00
|
|
|
-source->cur->geometry.x,
|
|
|
|
-source->cur->geometry.y,
|
2014-11-12 02:25:21 -08:00
|
|
|
1, 0, 0, evas->output.w, evas->output.h,
|
2014-11-12 02:18:09 -08:00
|
|
|
&proxy_render_data, 1, EINA_TRUE, do_async);
|
2014-10-22 23:27:40 -07:00
|
|
|
|
2014-11-12 02:25:21 -08:00
|
|
|
ENFN->context_free(ENDT, ctx);
|
|
|
|
proxy_write->surface = ENFN->image_dirty_region(ENDT, proxy_write->surface, 0, 0, w, h);
|
2014-10-22 23:27:40 -07:00
|
|
|
}
|
|
|
|
end:
|
|
|
|
EINA_COW_WRITE_END(evas_object_proxy_cow, source->proxy, proxy_write);
|
|
|
|
}
|
|
|
|
|
2014-11-12 17:47:29 -08:00
|
|
|
/* @internal
|
|
|
|
* Synchronously render a mask image (or smart object) into a surface.
|
|
|
|
* In SW the target surface will be ALPHA only (GRY8), after conversion.
|
|
|
|
* In GL the target surface will be RGBA for now. TODO: Find out how to
|
|
|
|
* render GL to alpha, if that's possible.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
evas_render_mask_subrender(Evas_Public_Data *evas,
|
|
|
|
Evas_Object_Protected_Data *mask,
|
|
|
|
Evas_Object_Protected_Data *prev_mask)
|
|
|
|
{
|
|
|
|
int x, y, w, h, r, g, b, a;
|
|
|
|
void *ctx;
|
|
|
|
|
|
|
|
if (!mask) return;
|
|
|
|
if (!mask->mask->redraw && mask->mask->surface)
|
|
|
|
{
|
|
|
|
DBG("Requested mask redraw but the redraw flag is off.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
x = mask->cur->geometry.x;
|
|
|
|
y = mask->cur->geometry.y;
|
|
|
|
w = mask->cur->geometry.w;
|
|
|
|
h = mask->cur->geometry.h;
|
|
|
|
|
|
|
|
r = mask->cur->color.r;
|
|
|
|
g = mask->cur->color.g;
|
|
|
|
b = mask->cur->color.b;
|
|
|
|
a = mask->cur->color.a;
|
|
|
|
if ((r != 255) || (g != 255) || (b != 255) || (a != 255))
|
|
|
|
{
|
|
|
|
EINA_COW_STATE_WRITE_BEGIN(mask, state_write, cur)
|
|
|
|
{
|
|
|
|
state_write->color.r = 255;
|
|
|
|
state_write->color.g = 255;
|
|
|
|
state_write->color.b = 255;
|
|
|
|
state_write->color.a = 255;
|
|
|
|
}
|
|
|
|
EINA_COW_STATE_WRITE_END(mask, state_write, cur);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (prev_mask == mask)
|
|
|
|
prev_mask = NULL;
|
|
|
|
|
|
|
|
if (prev_mask)
|
|
|
|
{
|
|
|
|
if (!prev_mask->mask->is_mask)
|
|
|
|
{
|
|
|
|
ERR("Passed invalid mask that is not a mask");
|
|
|
|
prev_mask = NULL;
|
|
|
|
}
|
|
|
|
else if (!prev_mask->mask->surface)
|
|
|
|
{
|
|
|
|
// FIXME?
|
|
|
|
WRN("Mask render order may be invalid");
|
|
|
|
evas_render_mask_subrender(evas, prev_mask, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_mask_cow, mask->mask, Evas_Object_Mask_Data, mdata)
|
|
|
|
mdata->redraw = EINA_FALSE;
|
|
|
|
|
|
|
|
/* delete render surface if changed or if already alpha
|
|
|
|
* (we don't know how to render objects to alpha) */
|
|
|
|
if (mdata->surface && ((w != mdata->w) || (h != mdata->h) || mdata->is_alpha))
|
|
|
|
{
|
|
|
|
ENFN->image_map_surface_free(ENDT, mdata->surface);
|
|
|
|
mdata->surface = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* create new RGBA render surface if needed */
|
|
|
|
if (!mdata->surface)
|
|
|
|
{
|
|
|
|
mdata->surface = ENFN->image_map_surface_new(ENDT, w, h, EINA_TRUE);
|
|
|
|
if (!mdata->surface) goto end;
|
|
|
|
mdata->w = w;
|
|
|
|
mdata->h = h;
|
|
|
|
}
|
|
|
|
|
|
|
|
mdata->x = x;
|
|
|
|
mdata->y = y;
|
|
|
|
mdata->is_alpha = EINA_FALSE;
|
|
|
|
|
|
|
|
/* Clear surface with transparency */
|
|
|
|
ctx = ENFN->context_new(ENDT);
|
|
|
|
ENFN->context_color_set(ENDT, ctx, 0, 0, 0, 0);
|
|
|
|
ENFN->context_render_op_set(ENDT, ctx, EVAS_RENDER_COPY);
|
|
|
|
ENFN->rectangle_draw(ENDT, ctx, mdata->surface, 0, 0, w, h, EINA_FALSE);
|
|
|
|
ENFN->context_free(ENDT, ctx);
|
|
|
|
|
|
|
|
/* Render mask to RGBA surface */
|
|
|
|
ctx = ENFN->context_new(ENDT);
|
|
|
|
if (prev_mask)
|
|
|
|
{
|
|
|
|
ENFN->context_clip_image_set(ENDT, ctx,
|
|
|
|
prev_mask->mask->surface,
|
|
|
|
prev_mask->mask->x - x,
|
|
|
|
prev_mask->mask->y - y);
|
|
|
|
}
|
|
|
|
evas_render_mapped(evas, mask->object, mask, ctx, mdata->surface,
|
|
|
|
-x, -y, 1, 0, 0, evas->output.w, evas->output.h,
|
|
|
|
NULL, 1, EINA_TRUE, EINA_FALSE);
|
|
|
|
ENFN->context_free(ENDT, ctx);
|
|
|
|
|
|
|
|
/* BEGIN HACK */
|
|
|
|
|
|
|
|
/* Now we want to convert this RGBA surface to Alpha.
|
|
|
|
* NOTE: So, this is not going to work with the GL engine but only with
|
|
|
|
* the SW engine. Here's the detection hack:
|
|
|
|
* FIXME: If you know of a way to support rendering to GL_ALPHA in GL,
|
|
|
|
* then we should render directly to an ALPHA surface. A priori,
|
|
|
|
* GLES FBO does not support this.
|
|
|
|
*/
|
|
|
|
if (!ENFN->gl_surface_read_pixels)
|
|
|
|
{
|
|
|
|
RGBA_Image *alpha_surface;
|
|
|
|
DATA32 *rgba;
|
|
|
|
DATA8* alpha;
|
|
|
|
|
|
|
|
alpha_surface = ENFN->image_new_from_copied_data
|
|
|
|
(ENDT, w, h, NULL, EINA_TRUE, EVAS_COLORSPACE_GRY8);
|
|
|
|
if (!alpha_surface) goto end;
|
|
|
|
|
|
|
|
/* Copy alpha channel */
|
|
|
|
rgba = ((RGBA_Image *) mdata->surface)->image.data;
|
|
|
|
alpha = alpha_surface->image.data8;
|
|
|
|
for (y = h; y; --y)
|
|
|
|
for (x = w; x; --x, alpha++, rgba++)
|
|
|
|
*alpha = (DATA8) A_VAL(rgba);
|
|
|
|
|
|
|
|
/* Now we can drop the original surface */
|
|
|
|
ENFN->image_map_surface_free(ENDT, mdata->surface);
|
|
|
|
mdata->surface = alpha_surface;
|
|
|
|
mdata->is_alpha = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* END OF HACK */
|
|
|
|
|
|
|
|
end:
|
|
|
|
EINA_COW_WRITE_END(evas_object_mask_cow, mask->mask, mdata);
|
|
|
|
|
|
|
|
if ((r != 255) || (g != 255) || (b != 255) || (a != 255))
|
|
|
|
{
|
|
|
|
EINA_COW_STATE_WRITE_BEGIN(mask, state_write, cur)
|
|
|
|
{
|
|
|
|
state_write->color.r = r;
|
|
|
|
state_write->color.g = g;
|
|
|
|
state_write->color.b = b;
|
|
|
|
state_write->color.a = a;
|
|
|
|
}
|
|
|
|
EINA_COW_STATE_WRITE_END(mask, state_write, cur);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-10-27 02:39:18 -07:00
|
|
|
static void
|
2013-04-11 00:25:36 -07:00
|
|
|
_evas_render_cutout_add(Evas_Public_Data *e, Evas_Object_Protected_Data *obj, int off_x, int off_y)
|
2011-10-27 02:39:18 -07:00
|
|
|
{
|
2013-04-11 00:25:36 -07:00
|
|
|
if (evas_object_is_source_invisible(obj->object, obj)) return;
|
|
|
|
if (evas_object_is_opaque(obj->object, obj))
|
2011-10-27 02:39:18 -07:00
|
|
|
{
|
|
|
|
Evas_Coord cox, coy, cow, coh;
|
2013-04-11 00:25:36 -07:00
|
|
|
|
2013-03-12 05:58:19 -07:00
|
|
|
cox = obj->cur->cache.clip.x;
|
|
|
|
coy = obj->cur->cache.clip.y;
|
|
|
|
cow = obj->cur->cache.clip.w;
|
|
|
|
coh = obj->cur->cache.clip.h;
|
2013-01-21 19:56:00 -08:00
|
|
|
if ((obj->map->cur.map) && (obj->map->cur.usemap))
|
2011-10-27 02:39:18 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_oo;
|
2012-10-16 05:41:48 -07:00
|
|
|
Evas_Object_Protected_Data *oo;
|
2012-05-16 06:21:37 -07:00
|
|
|
|
2013-04-11 00:25:36 -07:00
|
|
|
eo_oo = obj->object;
|
2014-06-02 06:47:59 -07:00
|
|
|
oo = eo_data_scope_get(eo_oo, EVAS_OBJECT_CLASS);
|
2013-03-12 05:58:19 -07:00
|
|
|
while (oo->cur->clipper)
|
2011-10-27 02:39:18 -07:00
|
|
|
{
|
2013-03-12 05:58:19 -07:00
|
|
|
if ((oo->cur->clipper->map->cur.map_parent
|
2013-01-21 19:56:00 -08:00
|
|
|
!= oo->map->cur.map_parent) &&
|
|
|
|
(!((oo->map->cur.map) && (oo->map->cur.usemap))))
|
2011-10-27 02:39:18 -07:00
|
|
|
break;
|
|
|
|
RECTS_CLIP_TO_RECT(cox, coy, cow, coh,
|
2013-03-12 05:58:19 -07:00
|
|
|
oo->cur->geometry.x,
|
|
|
|
oo->cur->geometry.y,
|
|
|
|
oo->cur->geometry.w,
|
|
|
|
oo->cur->geometry.h);
|
2013-04-06 22:00:10 -07:00
|
|
|
eo_oo = oo->cur->clipper->object;
|
2013-03-12 05:58:19 -07:00
|
|
|
oo = oo->cur->clipper;
|
2011-10-27 02:39:18 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
e->engine.func->context_cutout_add
|
|
|
|
(e->engine.data.output, e->engine.data.context,
|
|
|
|
cox + off_x, coy + off_y, cow, coh);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (obj->func->get_opaque_rect)
|
|
|
|
{
|
|
|
|
Evas_Coord obx, oby, obw, obh;
|
2012-05-16 06:21:37 -07:00
|
|
|
|
2013-07-08 17:46:15 -07:00
|
|
|
obj->func->get_opaque_rect(obj->object, obj, obj->private_data, &obx, &oby, &obw, &obh);
|
2011-10-27 02:39:18 -07:00
|
|
|
if ((obw > 0) && (obh > 0))
|
|
|
|
{
|
|
|
|
obx += off_x;
|
|
|
|
oby += off_y;
|
|
|
|
RECTS_CLIP_TO_RECT(obx, oby, obw, obh,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->cur->cache.clip.x + off_x,
|
|
|
|
obj->cur->cache.clip.y + off_y,
|
|
|
|
obj->cur->cache.clip.w,
|
|
|
|
obj->cur->cache.clip.h);
|
2011-10-27 02:39:18 -07:00
|
|
|
e->engine.func->context_cutout_add
|
|
|
|
(e->engine.data.output, e->engine.data.context,
|
|
|
|
obx, oby, obw, obh);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-12-18 08:26:44 -08:00
|
|
|
void
|
|
|
|
evas_render_rendering_wait(Evas_Public_Data *evas)
|
|
|
|
{
|
|
|
|
while (evas->rendering) evas_async_events_process_blocking();
|
|
|
|
}
|
|
|
|
|
2013-09-02 21:48:08 -07:00
|
|
|
/*
|
|
|
|
* Syncs ALL async rendering canvases. Must be called in the main thread.
|
|
|
|
*/
|
2013-09-02 15:38:52 -07:00
|
|
|
void
|
2013-10-17 12:13:24 -07:00
|
|
|
evas_all_sync(void)
|
2013-09-02 15:38:52 -07:00
|
|
|
{
|
2013-09-02 21:48:08 -07:00
|
|
|
Evas_Public_Data *evas;
|
2013-09-02 15:38:52 -07:00
|
|
|
|
2013-09-02 21:48:08 -07:00
|
|
|
if (!_rendering_evases) return;
|
|
|
|
|
|
|
|
evas = eina_list_data_get(eina_list_last(_rendering_evases));
|
|
|
|
evas_render_rendering_wait(evas);
|
|
|
|
|
|
|
|
assert(_rendering_evases == NULL);
|
2013-09-02 15:38:52 -07:00
|
|
|
}
|
|
|
|
|
2013-01-11 11:54:12 -08:00
|
|
|
static Eina_Bool
|
2013-01-17 14:14:05 -08:00
|
|
|
_drop_scie_ref(const void *container EINA_UNUSED, void *data, void *fdata EINA_UNUSED)
|
2013-01-11 11:54:12 -08:00
|
|
|
{
|
2013-01-17 14:14:05 -08:00
|
|
|
evas_common_rgba_image_scalecache_item_unref(data);
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
2013-01-16 14:32:39 -08:00
|
|
|
|
2013-01-17 14:14:05 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_drop_image_cache_ref(const void *container EINA_UNUSED, void *data, void *fdata EINA_UNUSED)
|
|
|
|
{
|
2013-01-11 11:54:12 -08:00
|
|
|
#ifdef EVAS_CSERVE2
|
2013-09-02 02:53:18 -07:00
|
|
|
if (evas_cserve2_use_get() && evas_cache2_image_cached(data))
|
2013-01-11 11:54:12 -08:00
|
|
|
evas_cache2_image_close((Image_Entry *)data);
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
evas_cache_image_drop((Image_Entry *)data);
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2013-11-30 20:26:04 -08:00
|
|
|
static void
|
|
|
|
_cb_always_call(Evas *eo_e, Evas_Callback_Type type, void *event_info)
|
|
|
|
{
|
|
|
|
int freeze_num = 0, i;
|
|
|
|
|
2014-06-02 04:49:46 -07:00
|
|
|
eo_do(eo_e, freeze_num = eo_event_freeze_count_get());
|
2013-11-30 20:26:04 -08:00
|
|
|
for (i = 0; i < freeze_num; i++) eo_do(eo_e, eo_event_thaw());
|
|
|
|
evas_event_callback_call(eo_e, type, event_info);
|
|
|
|
for (i = 0; i < freeze_num; i++) eo_do(eo_e, eo_event_freeze());
|
|
|
|
}
|
|
|
|
|
2012-12-18 08:26:44 -08:00
|
|
|
static Eina_Bool
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_render_updates_internal(Evas *eo_e,
|
2009-10-28 01:59:01 -07:00
|
|
|
unsigned char make_updates,
|
2012-12-18 08:26:44 -08:00
|
|
|
unsigned char do_draw,
|
|
|
|
Evas_Render_Done_Cb done_func,
|
|
|
|
void *done_data,
|
|
|
|
Eina_Bool do_async)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
|
|
|
Evas_Object_Protected_Data *obj;
|
2012-10-10 00:23:00 -07:00
|
|
|
Evas_Public_Data *e;
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *ll;
|
2002-11-08 00:02:15 -08:00
|
|
|
void *surface;
|
2009-06-17 03:01:52 -07:00
|
|
|
Eina_Bool clean_them = EINA_FALSE;
|
2009-06-26 06:26:52 -07:00
|
|
|
Eina_Bool alpha;
|
2009-06-23 06:57:27 -07:00
|
|
|
Eina_Rectangle *r;
|
2002-11-08 00:02:15 -08:00
|
|
|
int ux, uy, uw, uh;
|
|
|
|
int cx, cy, cw, ch;
|
2008-06-04 09:42:39 -07:00
|
|
|
unsigned int i, j;
|
2010-08-23 23:58:07 -07:00
|
|
|
int redraw_all = 0;
|
2012-05-16 06:21:37 -07:00
|
|
|
Eina_Bool haveup = 0;
|
2012-12-19 08:15:58 -08:00
|
|
|
Evas_Render_Mode render_mode = EVAS_RENDER_MODE_UNDEF;
|
2013-01-17 06:31:34 -08:00
|
|
|
#ifdef EVAS_RENDER_DEBUG_TIMING
|
|
|
|
double start_time = _time_get();
|
|
|
|
#endif
|
2013-09-11 05:00:23 -07:00
|
|
|
Eina_Rectangle clip_rect;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
2012-12-18 08:26:44 -08:00
|
|
|
return EINA_FALSE;
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK_END();
|
2012-10-10 00:23:00 -07:00
|
|
|
|
2014-06-26 14:29:46 -07:00
|
|
|
e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2012-12-18 08:26:44 -08:00
|
|
|
if (!e->changed) return EINA_FALSE;
|
|
|
|
|
2013-01-11 10:20:11 -08:00
|
|
|
if (e->rendering)
|
|
|
|
{
|
2013-01-14 12:02:43 -08:00
|
|
|
if (do_async)
|
|
|
|
return EINA_FALSE;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WRN("Mixing render sync as already doing async "
|
|
|
|
"render! Syncing! e=%p [%s]", e,
|
|
|
|
e->engine.module->definition->name);
|
|
|
|
evas_render_rendering_wait(e);
|
|
|
|
}
|
2013-01-11 10:20:11 -08:00
|
|
|
}
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2012-05-03 14:01:31 -07:00
|
|
|
#ifdef EVAS_CSERVE2
|
|
|
|
if (evas_cserve2_use_get())
|
|
|
|
evas_cserve2_dispatch();
|
|
|
|
#endif
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_call_smarts_calculate(eo_e);
|
2010-04-27 06:43:10 -07:00
|
|
|
|
2009-11-15 05:46:20 -08:00
|
|
|
RD("[--- RENDER EVAS (size: %ix%i)\n", e->viewport.w, e->viewport.h);
|
2010-04-27 06:43:10 -07:00
|
|
|
|
2013-11-30 20:26:04 -08:00
|
|
|
_cb_always_call(eo_e, EVAS_CALLBACK_RENDER_PRE, NULL);
|
2012-05-16 06:21:37 -07:00
|
|
|
|
2008-05-26 06:24:24 -07:00
|
|
|
/* Check if the modified object mean recalculating every thing */
|
2008-06-04 09:42:39 -07:00
|
|
|
if (!e->invalidate)
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_render_check_pending_objects(&e->pending_objects, eo_e, e);
|
2008-05-26 06:24:24 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
/* phase 1. add extra updates for changed objects */
|
2011-10-21 03:25:35 -07:00
|
|
|
if (e->invalidate || e->render_objects.count <= 0)
|
2012-10-10 00:23:00 -07:00
|
|
|
clean_them = _evas_render_phase1_process(e,
|
2011-03-21 08:18:26 -07:00
|
|
|
&e->active_objects,
|
|
|
|
&e->restack_objects,
|
|
|
|
&e->delete_objects,
|
2010-08-23 23:58:07 -07:00
|
|
|
&e->render_objects,
|
|
|
|
&redraw_all);
|
2010-04-27 06:43:10 -07:00
|
|
|
|
2013-09-11 05:00:23 -07:00
|
|
|
if (!strncmp(e->engine.module->definition->name, "wayland", 7))
|
|
|
|
{
|
2013-11-01 21:50:13 -07:00
|
|
|
evas_event_freeze(eo_e);
|
2013-09-11 05:00:23 -07:00
|
|
|
/* check for master clip */
|
|
|
|
if (!e->framespace.clip)
|
|
|
|
{
|
|
|
|
e->framespace.clip = evas_object_rectangle_add(eo_e);
|
|
|
|
evas_object_color_set(e->framespace.clip, 255, 255, 255, 255);
|
|
|
|
evas_object_move(e->framespace.clip, 0, 0);
|
|
|
|
evas_object_resize(e->framespace.clip,
|
|
|
|
e->viewport.w - e->framespace.w,
|
|
|
|
e->viewport.h - e->framespace.h);
|
2013-11-01 21:50:13 -07:00
|
|
|
evas_object_pass_events_set(e->framespace.clip, EINA_TRUE);
|
|
|
|
evas_object_layer_set(e->framespace.clip, EVAS_LAYER_MIN);
|
2013-09-11 05:00:23 -07:00
|
|
|
evas_object_show(e->framespace.clip);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* setup master clip rectangle for comparison to objects */
|
|
|
|
EINA_RECTANGLE_SET(&clip_rect, e->framespace.x, e->framespace.y,
|
|
|
|
e->viewport.w - e->framespace.w,
|
|
|
|
e->viewport.h - e->framespace.h);
|
|
|
|
|
|
|
|
for (i = 0; i < e->render_objects.count; ++i)
|
|
|
|
{
|
|
|
|
Eina_Rectangle obj_rect;
|
|
|
|
|
|
|
|
obj = eina_array_data_get(&e->render_objects, i);
|
|
|
|
if (obj->delete_me) continue;
|
|
|
|
if (obj->is_frame) continue;
|
|
|
|
if (obj->object == e->framespace.clip) continue;
|
|
|
|
|
|
|
|
/* setup object rectangle for comparison to clip rectangle */
|
|
|
|
EINA_RECTANGLE_SET(&obj_rect,
|
|
|
|
obj->cur->geometry.x, obj->cur->geometry.y,
|
|
|
|
obj->cur->geometry.w, obj->cur->geometry.h);
|
|
|
|
|
|
|
|
/* check if this object intersects with the master clip */
|
|
|
|
if (!eina_rectangles_intersect(&clip_rect, &obj_rect))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (!evas_object_clip_get(obj->object))
|
|
|
|
{
|
|
|
|
/* clip this object to the master clip */
|
|
|
|
evas_object_clip_set(obj->object, e->framespace.clip);
|
|
|
|
}
|
|
|
|
}
|
2013-11-01 21:50:13 -07:00
|
|
|
if (!evas_object_clipees_get(e->framespace.clip))
|
|
|
|
evas_object_hide(e->framespace.clip);
|
|
|
|
evas_event_thaw(eo_e);
|
2013-09-11 05:00:23 -07:00
|
|
|
}
|
|
|
|
|
2011-10-02 20:28:52 -07:00
|
|
|
/* phase 1.5. check if the video should be inlined or stay in their overlay */
|
|
|
|
alpha = e->engine.func->canvas_alpha_get(e->engine.data.output,
|
2012-10-16 05:41:48 -07:00
|
|
|
e->engine.data.context);
|
2011-10-02 20:28:52 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(e->video_objects, ll, eo_obj)
|
2011-10-02 20:28:52 -07:00
|
|
|
{
|
|
|
|
/* we need the surface to be transparent to display the underlying overlay */
|
2012-10-10 00:23:00 -07:00
|
|
|
if (alpha && _evas_render_can_use_overlay(e, eo_obj))
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_object_image_video_overlay_show(eo_obj);
|
2011-10-02 20:28:52 -07:00
|
|
|
else
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_object_image_video_overlay_hide(eo_obj);
|
2011-10-02 20:28:52 -07:00
|
|
|
}
|
2011-10-13 02:23:42 -07:00
|
|
|
/* phase 1.8. pre render for proxy */
|
2012-10-10 00:23:00 -07:00
|
|
|
_evas_render_phase1_direct(e, &e->active_objects, &e->restack_objects,
|
2011-10-13 02:23:42 -07:00
|
|
|
&e->delete_objects, &e->render_objects);
|
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
/* phase 2. force updates for restacks */
|
2008-05-26 06:24:24 -07:00
|
|
|
for (i = 0; i < e->restack_objects.count; ++i)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2011-05-20 23:23:33 -07:00
|
|
|
obj = eina_array_data_get(&e->restack_objects, i);
|
2014-01-27 08:54:25 -08:00
|
|
|
obj->func->render_pre(obj->object, obj, obj->private_data);
|
2012-10-10 00:23:00 -07:00
|
|
|
_evas_render_prev_cur_clip_cache_add(e, obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJS_ARRAY_CLEAN(&e->restack_objects);
|
2011-12-26 15:10:27 -08:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
/* phase 3. add exposes */
|
2009-04-14 02:27:27 -07:00
|
|
|
EINA_LIST_FREE(e->damages, r)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2010-09-24 23:19:30 -07:00
|
|
|
e->engine.func->output_redraws_rect_add(e->engine.data.output,
|
|
|
|
r->x, r->y, r->w, r->h);
|
|
|
|
eina_rectangle_free(r);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2011-12-26 15:10:27 -08:00
|
|
|
|
2011-12-17 10:45:09 -08:00
|
|
|
/* phase 4. framespace, output & viewport changes */
|
2003-04-17 05:05:00 -07:00
|
|
|
if (e->viewport.changed)
|
|
|
|
{
|
2010-09-24 23:19:30 -07:00
|
|
|
e->engine.func->output_redraws_rect_add(e->engine.data.output,
|
|
|
|
0, 0,
|
|
|
|
e->output.w, e->output.h);
|
2003-04-17 05:05:00 -07:00
|
|
|
}
|
|
|
|
if (e->output.changed)
|
|
|
|
{
|
2010-09-24 23:19:30 -07:00
|
|
|
e->engine.func->output_resize(e->engine.data.output,
|
|
|
|
e->output.w, e->output.h);
|
|
|
|
e->engine.func->output_redraws_rect_add(e->engine.data.output,
|
|
|
|
0, 0,
|
|
|
|
e->output.w, e->output.h);
|
2003-04-17 05:05:00 -07:00
|
|
|
}
|
2006-11-15 19:20:24 -08:00
|
|
|
if ((e->output.w != e->viewport.w) || (e->output.h != e->viewport.h))
|
|
|
|
{
|
2011-05-20 23:23:33 -07:00
|
|
|
ERR("viewport size != output size!");
|
2006-11-15 19:20:24 -08:00
|
|
|
}
|
2012-05-25 05:55:45 -07:00
|
|
|
|
|
|
|
if (e->framespace.changed)
|
2010-08-23 23:58:07 -07:00
|
|
|
{
|
2013-08-23 00:34:22 -07:00
|
|
|
/* NB: If the framespace changes, we need to add a redraw rectangle
|
|
|
|
* which covers the Whole viewport. This is because 'framespace' is
|
|
|
|
* defined as "the space IN the viewport which is Occupied by the
|
|
|
|
* window frame" */
|
2010-08-23 23:58:07 -07:00
|
|
|
e->engine.func->output_redraws_rect_add(e->engine.data.output,
|
2013-08-23 00:34:22 -07:00
|
|
|
e->viewport.x, e->viewport.y,
|
|
|
|
e->viewport.w, e->viewport.h);
|
2012-05-25 05:55:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
if (redraw_all)
|
|
|
|
{
|
|
|
|
e->engine.func->output_redraws_rect_add(e->engine.data.output, 0, 0,
|
2010-08-23 23:58:07 -07:00
|
|
|
e->output.w, e->output.h);
|
|
|
|
}
|
2011-12-26 15:10:27 -08:00
|
|
|
|
2003-04-17 05:05:00 -07:00
|
|
|
/* phase 5. add obscures */
|
2008-10-21 09:31:05 -07:00
|
|
|
EINA_LIST_FOREACH(e->obscures, ll, r)
|
2009-11-06 21:01:43 -08:00
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
e->engine.func->output_redraws_rect_del(e->engine.data.output,
|
2011-05-20 23:23:33 -07:00
|
|
|
r->x, r->y, r->w, r->h);
|
2009-11-06 21:01:43 -08:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
/* build obscure objects list of active objects that obscure */
|
2008-05-26 06:24:24 -07:00
|
|
|
for (i = 0; i < e->active_objects.count; ++i)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2011-05-20 23:23:33 -07:00
|
|
|
obj = eina_array_data_get(&e->active_objects, i);
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_obj = obj->object;
|
|
|
|
if (UNLIKELY((evas_object_is_opaque(eo_obj, obj) ||
|
2009-02-16 20:53:03 -08:00
|
|
|
((obj->func->has_opaque_rect) &&
|
2013-07-08 17:46:15 -07:00
|
|
|
(obj->func->has_opaque_rect(eo_obj, obj, obj->private_data)))) &&
|
2014-11-12 17:47:29 -08:00
|
|
|
(!obj->mask->is_mask) &&
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_is_visible(eo_obj, obj) &&
|
2007-06-04 11:31:30 -07:00
|
|
|
(!obj->clip.clipees) &&
|
2013-03-12 05:58:19 -07:00
|
|
|
(obj->cur->visible) &&
|
2007-06-04 11:31:30 -07:00
|
|
|
(!obj->delete_me) &&
|
2013-03-12 05:58:19 -07:00
|
|
|
(obj->cur->cache.clip.visible) &&
|
2012-10-08 18:58:41 -07:00
|
|
|
(!obj->is_smart)))
|
2011-05-20 23:23:33 -07:00
|
|
|
/* obscuring_objects = eina_list_append(obscuring_objects, obj); */
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJ_ARRAY_PUSH(&e->obscuring_objects, obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2011-10-02 20:28:52 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
/* save this list */
|
2011-05-20 23:23:33 -07:00
|
|
|
/* obscuring_objects_orig = obscuring_objects; */
|
|
|
|
/* obscuring_objects = NULL; */
|
2004-02-16 11:22:48 -08:00
|
|
|
/* phase 6. go thru each update rect and render objects in it*/
|
2007-01-22 04:44:57 -08:00
|
|
|
if (do_draw)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2011-05-20 23:23:33 -07:00
|
|
|
unsigned int offset = 0;
|
2013-04-26 11:01:44 -07:00
|
|
|
int fx = e->framespace.x;
|
|
|
|
int fy = e->framespace.y;
|
2008-06-04 09:42:39 -07:00
|
|
|
|
2011-05-20 23:23:33 -07:00
|
|
|
while ((surface =
|
|
|
|
e->engine.func->output_redraws_next_update_get
|
2010-09-24 23:19:30 -07:00
|
|
|
(e->engine.data.output,
|
2011-05-20 23:23:33 -07:00
|
|
|
&ux, &uy, &uw, &uh,
|
|
|
|
&cx, &cy, &cw, &ch)))
|
|
|
|
{
|
|
|
|
int off_x, off_y;
|
2012-12-18 08:26:44 -08:00
|
|
|
Render_Updates *ru;
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2009-11-15 05:46:20 -08:00
|
|
|
RD(" [--- UPDATE %i %i %ix%i\n", ux, uy, uw, uh);
|
2012-12-18 08:26:44 -08:00
|
|
|
if (do_async)
|
|
|
|
{
|
|
|
|
ru = malloc(sizeof(*ru));
|
|
|
|
ru->surface = surface;
|
|
|
|
NEW_RECT(ru->area, ux, uy, uw, uh);
|
|
|
|
e->render.updates = eina_list_append(e->render.updates, ru);
|
|
|
|
evas_cache_image_ref(surface);
|
|
|
|
}
|
|
|
|
else if (make_updates)
|
2011-05-20 23:23:33 -07:00
|
|
|
{
|
|
|
|
Eina_Rectangle *rect;
|
|
|
|
|
|
|
|
NEW_RECT(rect, ux, uy, uw, uh);
|
|
|
|
if (rect)
|
2012-12-18 08:26:44 -08:00
|
|
|
e->render.updates = eina_list_append(e->render.updates,
|
|
|
|
rect);
|
2011-05-20 23:23:33 -07:00
|
|
|
}
|
2012-05-16 06:21:37 -07:00
|
|
|
haveup = EINA_TRUE;
|
2011-05-20 23:23:33 -07:00
|
|
|
off_x = cx - ux;
|
|
|
|
off_y = cy - uy;
|
|
|
|
/* build obscuring objects list (in order from bottom to top) */
|
2012-02-20 23:01:39 -08:00
|
|
|
if (alpha)
|
|
|
|
{
|
|
|
|
e->engine.func->context_clip_set(e->engine.data.output,
|
|
|
|
e->engine.data.context,
|
|
|
|
ux + off_x, uy + off_y, uw, uh);
|
|
|
|
}
|
2011-05-20 23:23:33 -07:00
|
|
|
for (i = 0; i < e->obscuring_objects.count; ++i)
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
obj = (Evas_Object_Protected_Data *)eina_array_data_get
|
2010-09-24 23:19:30 -07:00
|
|
|
(&e->obscuring_objects, i);
|
2014-01-27 08:54:25 -08:00
|
|
|
if (evas_object_is_in_output_rect(obj->object, obj, ux - fx, uy - fy, uw, uh))
|
2011-05-20 23:23:33 -07:00
|
|
|
{
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJ_ARRAY_PUSH(&e->temporary_objects, obj);
|
2011-05-20 23:23:33 -07:00
|
|
|
|
|
|
|
/* reset the background of the area if needed (using cutout and engine alpha flag to help) */
|
2010-09-24 23:19:30 -07:00
|
|
|
if (alpha)
|
2013-04-26 11:01:44 -07:00
|
|
|
_evas_render_cutout_add(e, obj, off_x + fx, off_y + fy);
|
2011-05-20 23:23:33 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (alpha)
|
|
|
|
{
|
|
|
|
e->engine.func->context_color_set(e->engine.data.output,
|
|
|
|
e->engine.data.context,
|
2010-09-24 23:19:30 -07:00
|
|
|
0, 0, 0, 0);
|
2011-05-20 23:23:33 -07:00
|
|
|
e->engine.func->context_multiplier_unset
|
2010-09-24 23:19:30 -07:00
|
|
|
(e->engine.data.output, e->engine.data.context);
|
2011-05-20 23:23:33 -07:00
|
|
|
e->engine.func->context_render_op_set(e->engine.data.output,
|
2010-09-24 23:19:30 -07:00
|
|
|
e->engine.data.context,
|
|
|
|
EVAS_RENDER_COPY);
|
2011-05-20 23:23:33 -07:00
|
|
|
e->engine.func->rectangle_draw(e->engine.data.output,
|
|
|
|
e->engine.data.context,
|
|
|
|
surface,
|
2012-12-18 08:28:55 -08:00
|
|
|
cx, cy, cw, ch, do_async);
|
2011-05-20 23:23:33 -07:00
|
|
|
e->engine.func->context_cutout_clear(e->engine.data.output,
|
|
|
|
e->engine.data.context);
|
|
|
|
e->engine.func->context_clip_unset(e->engine.data.output,
|
2009-12-30 03:35:40 -08:00
|
|
|
e->engine.data.context);
|
2011-05-20 23:23:33 -07:00
|
|
|
}
|
2012-07-16 04:33:12 -07:00
|
|
|
|
2011-05-20 23:23:33 -07:00
|
|
|
/* render all object that intersect with rect */
|
2008-05-26 06:24:24 -07:00
|
|
|
for (i = 0; i < e->active_objects.count; ++i)
|
2011-05-20 23:23:33 -07:00
|
|
|
{
|
|
|
|
obj = eina_array_data_get(&e->active_objects, i);
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_obj = obj->object;
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2011-05-20 23:23:33 -07:00
|
|
|
/* if it's in our outpout rect and it doesn't clip anything */
|
2013-08-18 21:20:57 -07:00
|
|
|
RD(" OBJ: [%p", obj);
|
2013-08-19 00:35:34 -07:00
|
|
|
if (obj->name)
|
|
|
|
{
|
|
|
|
RD(":%s", obj->name);
|
|
|
|
}
|
2013-08-18 21:20:57 -07:00
|
|
|
RD("] '%s' %i %i %ix%i\n", obj->type, obj->cur->geometry.x, obj->cur->geometry.y, obj->cur->geometry.w, obj->cur->geometry.h);
|
2013-04-26 11:01:44 -07:00
|
|
|
if ((evas_object_is_in_output_rect(eo_obj, obj, ux - fx, uy - fy, uw, uh) ||
|
2012-10-08 18:58:41 -07:00
|
|
|
(obj->is_smart)) &&
|
2011-05-20 23:23:33 -07:00
|
|
|
(!obj->clip.clipees) &&
|
2013-03-12 05:58:19 -07:00
|
|
|
(obj->cur->visible) &&
|
2011-05-20 23:23:33 -07:00
|
|
|
(!obj->delete_me) &&
|
2013-03-12 05:58:19 -07:00
|
|
|
(obj->cur->cache.clip.visible) &&
|
2012-10-08 18:58:41 -07:00
|
|
|
// (!obj->is_smart) &&
|
2013-03-12 05:58:19 -07:00
|
|
|
((obj->cur->color.a > 0 || obj->cur->render_op != EVAS_RENDER_BLEND)))
|
2011-05-20 23:23:33 -07:00
|
|
|
{
|
|
|
|
int x, y, w, h;
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2013-03-12 05:58:19 -07:00
|
|
|
RD(" DRAW (vis: %i, a: %i, clipees: %p\n", obj->cur->visible, obj->cur->color.a, obj->clip.clipees);
|
2011-05-20 23:23:33 -07:00
|
|
|
if ((e->temporary_objects.count > offset) &&
|
|
|
|
(eina_array_data_get(&e->temporary_objects, offset) == obj))
|
|
|
|
offset++;
|
|
|
|
x = cx; y = cy; w = cw; h = ch;
|
2012-10-08 18:58:41 -07:00
|
|
|
if (((w > 0) && (h > 0)) || (obj->is_smart))
|
2011-05-20 23:23:33 -07:00
|
|
|
{
|
2014-11-12 17:47:29 -08:00
|
|
|
Evas_Object_Protected_Data *prev_mask = NULL;
|
|
|
|
Evas_Object_Protected_Data *mask = NULL;
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if (!obj->is_smart)
|
2010-04-28 07:38:46 -07:00
|
|
|
{
|
|
|
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
2013-04-26 11:01:44 -07:00
|
|
|
obj->cur->cache.clip.x + off_x + fx,
|
|
|
|
obj->cur->cache.clip.y + off_y + fy,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->cur->cache.clip.w,
|
|
|
|
obj->cur->cache.clip.h);
|
2010-04-28 07:38:46 -07:00
|
|
|
}
|
2012-12-05 05:52:59 -08:00
|
|
|
|
2012-02-20 23:01:39 -08:00
|
|
|
e->engine.func->context_clip_set(e->engine.data.output,
|
|
|
|
e->engine.data.context,
|
|
|
|
x, y, w, h);
|
2014-11-12 17:47:29 -08:00
|
|
|
|
|
|
|
/* Clipper masks */
|
|
|
|
if (_evas_render_object_is_mask(obj->cur->clipper))
|
2015-01-20 22:14:50 -08:00
|
|
|
mask = obj->cur->clipper; // main object clipped by this mask
|
|
|
|
else if (obj->clip.mask)
|
|
|
|
mask = obj->clip.mask; // propagated clip
|
|
|
|
prev_mask = obj->clip.prev_mask;
|
2014-11-12 17:47:29 -08:00
|
|
|
|
|
|
|
if (mask)
|
|
|
|
{
|
|
|
|
if (mask->mask->redraw || !mask->mask->surface)
|
|
|
|
evas_render_mask_subrender(obj->layer->evas, mask, prev_mask);
|
|
|
|
|
|
|
|
if (mask->mask->surface)
|
|
|
|
{
|
|
|
|
e->engine.func->context_clip_image_set
|
|
|
|
(e->engine.data.output,
|
|
|
|
e->engine.data.context,
|
|
|
|
mask->mask->surface,
|
|
|
|
mask->mask->x + off_x,
|
|
|
|
mask->mask->y + off_y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-01-22 04:44:57 -08:00
|
|
|
#if 1 /* FIXME: this can slow things down... figure out optimum... coverage */
|
2011-05-20 23:23:33 -07:00
|
|
|
for (j = offset; j < e->temporary_objects.count; ++j)
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj2;
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
obj2 = (Evas_Object_Protected_Data *)eina_array_data_get
|
2011-10-27 02:39:18 -07:00
|
|
|
(&e->temporary_objects, j);
|
2013-04-26 11:01:44 -07:00
|
|
|
_evas_render_cutout_add(e, obj2, off_x + fx, off_y + fy);
|
2011-05-20 23:23:33 -07:00
|
|
|
}
|
2005-05-21 19:49:50 -07:00
|
|
|
#endif
|
2012-10-10 00:23:00 -07:00
|
|
|
clean_them |= evas_render_mapped(e, eo_obj, obj, e->engine.data.context,
|
2013-04-26 11:01:44 -07:00
|
|
|
surface, off_x + fx,
|
|
|
|
off_y + fy, 0,
|
2012-10-18 04:30:04 -07:00
|
|
|
cx, cy, cw, ch,
|
2014-11-12 02:18:09 -08:00
|
|
|
NULL, 1,
|
|
|
|
EINA_FALSE,
|
|
|
|
do_async);
|
2011-05-20 23:23:33 -07:00
|
|
|
e->engine.func->context_cutout_clear(e->engine.data.output,
|
|
|
|
e->engine.data.context);
|
2014-11-12 17:47:29 -08:00
|
|
|
|
|
|
|
if (mask)
|
|
|
|
{
|
|
|
|
e->engine.func->context_clip_image_unset
|
|
|
|
(e->engine.data.output, e->engine.data.context);
|
|
|
|
}
|
2011-05-20 23:23:33 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-12-18 08:26:44 -08:00
|
|
|
|
2012-12-19 08:15:58 -08:00
|
|
|
if (!do_async) render_mode = EVAS_RENDER_MODE_SYNC;
|
|
|
|
else render_mode = EVAS_RENDER_MODE_ASYNC_INIT;
|
|
|
|
|
|
|
|
e->engine.func->output_redraws_next_update_push(e->engine.data.output,
|
|
|
|
surface,
|
|
|
|
ux, uy, uw, uh,
|
|
|
|
render_mode);
|
2012-12-18 08:26:44 -08:00
|
|
|
|
2011-05-20 23:23:33 -07:00
|
|
|
/* free obscuring objects list */
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJS_ARRAY_CLEAN(&e->temporary_objects);
|
2009-11-15 05:46:20 -08:00
|
|
|
RD(" ---]\n");
|
2011-05-20 23:23:33 -07:00
|
|
|
}
|
2012-12-18 08:26:44 -08:00
|
|
|
|
|
|
|
if (do_async)
|
|
|
|
{
|
2012-12-28 05:00:37 -08:00
|
|
|
eo_ref(eo_e);
|
|
|
|
e->rendering = EINA_TRUE;
|
2013-09-02 21:48:08 -07:00
|
|
|
_rendering_evases = eina_list_append(_rendering_evases, e);
|
2012-12-28 05:00:37 -08:00
|
|
|
|
2012-12-30 15:39:11 -08:00
|
|
|
evas_thread_queue_flush((Evas_Thread_Command_Cb)done_func, done_data);
|
2012-12-18 08:26:44 -08:00
|
|
|
}
|
|
|
|
else if (haveup)
|
2010-03-16 05:30:55 -07:00
|
|
|
{
|
2013-10-01 11:35:09 -07:00
|
|
|
EINA_LIST_FOREACH(e->video_objects, ll, eo_obj)
|
|
|
|
{
|
|
|
|
_evas_object_image_video_overlay_do(eo_obj);
|
|
|
|
}
|
2013-11-30 20:26:04 -08:00
|
|
|
_cb_always_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_PRE, NULL);
|
2012-12-19 08:15:58 -08:00
|
|
|
e->engine.func->output_flush(e->engine.data.output,
|
|
|
|
EVAS_RENDER_MODE_SYNC);
|
2013-11-30 20:26:04 -08:00
|
|
|
_cb_always_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_POST, NULL);
|
2010-03-16 05:30:55 -07:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2012-12-18 08:26:44 -08:00
|
|
|
|
|
|
|
if (!do_async)
|
|
|
|
{
|
|
|
|
/* clear redraws */
|
|
|
|
e->engine.func->output_redraws_clear(e->engine.data.output);
|
|
|
|
}
|
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
/* and do a post render pass */
|
2008-05-26 06:24:24 -07:00
|
|
|
for (i = 0; i < e->active_objects.count; ++i)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2011-05-20 23:23:33 -07:00
|
|
|
obj = eina_array_data_get(&e->active_objects, i);
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_obj = obj->object;
|
2012-05-16 06:21:37 -07:00
|
|
|
obj->pre_render_done = EINA_FALSE;
|
2013-08-18 21:20:57 -07:00
|
|
|
RD(" OBJ [%p", obj);
|
2013-08-19 00:35:34 -07:00
|
|
|
if (obj->name)
|
|
|
|
{
|
|
|
|
RD(":%s", obj->name);
|
|
|
|
}
|
2013-08-18 21:20:57 -07:00
|
|
|
RD("] post... %i %i\n", obj->changed, do_draw);
|
2012-10-19 05:00:57 -07:00
|
|
|
if ((clean_them) || (obj->changed && do_draw))
|
2009-11-06 00:44:49 -08:00
|
|
|
{
|
2013-08-18 21:20:57 -07:00
|
|
|
RD(" OBJ [%p", obj);
|
2013-08-19 00:35:34 -07:00
|
|
|
if (obj->name)
|
|
|
|
{
|
|
|
|
RD(":%s", obj->name);
|
|
|
|
}
|
2013-08-18 21:20:57 -07:00
|
|
|
RD("] post... func\n");
|
2013-07-08 17:46:15 -07:00
|
|
|
obj->func->render_post(eo_obj, obj, obj->private_data);
|
2012-05-16 06:21:37 -07:00
|
|
|
obj->restack = EINA_FALSE;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_change_reset(eo_obj);
|
2009-11-06 00:44:49 -08:00
|
|
|
}
|
2011-05-20 23:23:33 -07:00
|
|
|
/* moved to other pre-process phase 1
|
|
|
|
if (obj->delete_me == 2)
|
|
|
|
{
|
|
|
|
delete_objects = eina_list_append(delete_objects, obj);
|
|
|
|
}
|
|
|
|
else if (obj->delete_me != 0) obj->delete_me++;
|
|
|
|
*/
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2005-10-26 21:25:30 -07:00
|
|
|
/* free our obscuring object list */
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJS_ARRAY_CLEAN(&e->obscuring_objects);
|
2008-06-04 09:42:39 -07:00
|
|
|
|
|
|
|
/* If some object are still marked as changed, do not remove
|
|
|
|
them from the pending list. */
|
2008-10-16 05:27:07 -07:00
|
|
|
eina_array_remove(&e->pending_objects, pending_change, NULL);
|
2008-06-04 09:42:39 -07:00
|
|
|
|
2013-12-02 23:23:05 -08:00
|
|
|
/* Reinsert parent of changed object in the pending changed state */
|
|
|
|
for (i = 0; i < e->pending_objects.count; ++i)
|
|
|
|
{
|
|
|
|
obj = eina_array_data_get(&e->pending_objects, i);
|
|
|
|
eo_obj = obj->object;
|
|
|
|
if (obj->smart.parent)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *smart_parent;
|
|
|
|
|
|
|
|
smart_parent = eo_data_scope_get(obj->smart.parent,
|
2014-06-02 06:47:59 -07:00
|
|
|
EVAS_OBJECT_CLASS);
|
2013-12-02 23:23:05 -08:00
|
|
|
evas_object_change(obj->smart.parent, smart_parent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-06-13 00:34:44 -07:00
|
|
|
for (i = 0; i < e->render_objects.count; ++i)
|
|
|
|
{
|
|
|
|
obj = eina_array_data_get(&e->render_objects, i);
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_obj = obj->object;
|
2012-05-16 06:21:37 -07:00
|
|
|
obj->pre_render_done = EINA_FALSE;
|
2012-09-12 11:36:08 -07:00
|
|
|
if ((obj->changed) && (do_draw))
|
|
|
|
{
|
2013-12-02 23:23:05 -08:00
|
|
|
obj->func->render_post(eo_obj, obj, obj->private_data);
|
2012-09-12 11:36:08 -07:00
|
|
|
obj->restack = EINA_FALSE;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_change_reset(eo_obj);
|
2012-09-12 11:36:08 -07:00
|
|
|
}
|
2011-06-13 00:34:44 -07:00
|
|
|
}
|
|
|
|
|
2013-09-11 05:00:23 -07:00
|
|
|
if (!strncmp(e->engine.module->definition->name, "wayland", 7))
|
|
|
|
{
|
|
|
|
/* unclip objects from master clip */
|
|
|
|
for (i = 0; i < e->render_objects.count; ++i)
|
|
|
|
{
|
|
|
|
obj = eina_array_data_get(&e->render_objects, i);
|
|
|
|
if (obj->is_frame) continue;
|
|
|
|
if (obj->object == e->framespace.clip) continue;
|
|
|
|
|
|
|
|
if (evas_object_clip_get(obj->object) == e->framespace.clip)
|
|
|
|
{
|
|
|
|
/* unclip this object from the master clip */
|
|
|
|
evas_object_clip_unset(obj->object);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* delete master clip */
|
|
|
|
evas_object_del(e->framespace.clip);
|
|
|
|
e->framespace.clip = NULL;
|
|
|
|
}
|
|
|
|
|
2012-05-16 06:21:37 -07:00
|
|
|
e->changed = EINA_FALSE;
|
|
|
|
e->viewport.changed = EINA_FALSE;
|
|
|
|
e->output.changed = EINA_FALSE;
|
|
|
|
e->framespace.changed = EINA_FALSE;
|
|
|
|
e->invalidate = EINA_FALSE;
|
2008-06-04 09:42:39 -07:00
|
|
|
|
2012-03-20 01:08:42 -07:00
|
|
|
// always clean... lots of mem waste!
|
2010-04-27 06:43:10 -07:00
|
|
|
/* If their are some object to restack or some object to delete,
|
2009-11-09 07:18:37 -08:00
|
|
|
* it's useless to keep the render object list around. */
|
2010-05-05 04:36:21 -07:00
|
|
|
if (clean_them)
|
2008-06-04 09:42:39 -07:00
|
|
|
{
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJS_ARRAY_CLEAN(&e->active_objects);
|
|
|
|
OBJS_ARRAY_CLEAN(&e->render_objects);
|
|
|
|
OBJS_ARRAY_CLEAN(&e->restack_objects);
|
|
|
|
OBJS_ARRAY_CLEAN(&e->temporary_objects);
|
2012-11-20 03:52:16 -08:00
|
|
|
eina_array_foreach(&e->clip_changes, _evas_clip_changes_free, NULL);
|
2012-03-20 01:08:42 -07:00
|
|
|
eina_array_clean(&e->clip_changes);
|
|
|
|
/* we should flush here and have a mempool system for this
|
|
|
|
eina_array_flush(&e->active_objects);
|
|
|
|
eina_array_flush(&e->render_objects);
|
|
|
|
eina_array_flush(&e->restack_objects);
|
|
|
|
eina_array_flush(&e->delete_objects);
|
|
|
|
eina_array_flush(&e->obscuring_objects);
|
|
|
|
eina_array_flush(&e->temporary_objects);
|
|
|
|
eina_array_flush(&e->clip_changes);
|
|
|
|
*/
|
2012-05-16 06:21:37 -07:00
|
|
|
e->invalidate = EINA_TRUE;
|
2008-06-04 09:42:39 -07:00
|
|
|
}
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2013-05-02 00:48:43 -07:00
|
|
|
/* delete all objects flagged for deletion now */
|
|
|
|
for (i = 0; i < e->delete_objects.count; ++i)
|
|
|
|
{
|
|
|
|
obj = eina_array_data_get(&e->delete_objects, i);
|
2014-01-27 08:54:25 -08:00
|
|
|
evas_object_free(obj->object, 1);
|
2013-05-02 00:48:43 -07:00
|
|
|
}
|
|
|
|
eina_array_clean(&e->delete_objects);
|
|
|
|
/* if we deleted no objects this frame or we deleted a lot (> 1024) then
|
|
|
|
* try and reset the deleted objects array to empty (no mem used) for
|
|
|
|
* efficiency */
|
|
|
|
if ((e->delete_objects.count == 0) || (e->delete_objects.count > 1024))
|
|
|
|
eina_array_flush(&e->delete_objects);
|
|
|
|
|
2006-09-18 02:40:29 -07:00
|
|
|
evas_module_clean();
|
2012-05-16 06:21:37 -07:00
|
|
|
|
2012-12-18 08:26:44 -08:00
|
|
|
if (!do_async)
|
2013-03-20 02:53:26 -07:00
|
|
|
{
|
|
|
|
Evas_Event_Render_Post post;
|
|
|
|
|
|
|
|
post.updated_area = e->render.updates;
|
2013-11-30 20:26:04 -08:00
|
|
|
_cb_always_call(eo_e, EVAS_CALLBACK_RENDER_POST, e->render.updates ? &post : NULL);
|
2013-03-20 02:53:26 -07:00
|
|
|
}
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2009-11-15 05:46:20 -08:00
|
|
|
RD("---]\n");
|
2010-04-27 06:43:10 -07:00
|
|
|
|
2013-01-17 06:31:34 -08:00
|
|
|
#ifdef EVAS_RENDER_DEBUG_TIMING
|
|
|
|
_accumulate_time(start_time, do_async ? &async_accumulator : &sync_accumulator);
|
|
|
|
#endif
|
|
|
|
|
2012-12-18 08:26:44 -08:00
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2013-01-11 11:55:40 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_drop_glyph_ref(const void *container EINA_UNUSED, void *data, void *fdata EINA_UNUSED)
|
|
|
|
{
|
|
|
|
evas_common_font_glyphs_unref(data);
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2013-01-15 09:35:11 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_drop_texts_ref(const void *container EINA_UNUSED, void *data, void *fdata EINA_UNUSED)
|
|
|
|
{
|
|
|
|
evas_common_font_fonts_unref(data);
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2012-12-18 08:26:44 -08:00
|
|
|
static void
|
|
|
|
evas_render_wakeup(Evas *eo_e)
|
|
|
|
{
|
2013-03-20 02:53:26 -07:00
|
|
|
Evas_Event_Render_Post post;
|
2012-12-18 08:26:44 -08:00
|
|
|
Render_Updates *ru;
|
|
|
|
Eina_Bool haveup = EINA_FALSE;
|
|
|
|
Eina_List *ret_updates = NULL;
|
2014-06-26 14:29:46 -07:00
|
|
|
Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2012-12-18 08:26:44 -08:00
|
|
|
|
|
|
|
EINA_LIST_FREE(e->render.updates, ru)
|
|
|
|
{
|
|
|
|
/* punch rect out */
|
2012-12-19 08:15:58 -08:00
|
|
|
e->engine.func->output_redraws_next_update_push
|
|
|
|
(e->engine.data.output, ru->surface,
|
|
|
|
ru->area->x, ru->area->y, ru->area->w, ru->area->h,
|
|
|
|
EVAS_RENDER_MODE_ASYNC_END);
|
|
|
|
|
2013-03-20 02:53:26 -07:00
|
|
|
ret_updates = eina_list_append(ret_updates, ru->area);
|
2012-12-18 08:26:44 -08:00
|
|
|
evas_cache_image_drop(ru->surface);
|
|
|
|
free(ru);
|
|
|
|
haveup = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* flush redraws */
|
|
|
|
if (haveup)
|
|
|
|
{
|
2013-10-01 11:35:09 -07:00
|
|
|
Eina_List *ll;
|
|
|
|
Evas_Object *eo_obj;
|
|
|
|
EINA_LIST_FOREACH(e->video_objects, ll, eo_obj)
|
|
|
|
{
|
|
|
|
_evas_object_image_video_overlay_do(eo_obj);
|
|
|
|
}
|
2013-11-30 20:26:04 -08:00
|
|
|
_cb_always_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_PRE, NULL);
|
2012-12-19 08:15:58 -08:00
|
|
|
e->engine.func->output_flush(e->engine.data.output,
|
|
|
|
EVAS_RENDER_MODE_ASYNC_END);
|
2013-11-30 20:26:04 -08:00
|
|
|
_cb_always_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_POST, NULL);
|
2012-12-18 08:26:44 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* clear redraws */
|
|
|
|
e->engine.func->output_redraws_clear(e->engine.data.output);
|
|
|
|
|
2013-01-11 11:55:40 -08:00
|
|
|
/* unref queues */
|
2013-01-17 14:14:05 -08:00
|
|
|
eina_array_foreach(&e->scie_unref_queue, _drop_scie_ref, NULL);
|
|
|
|
eina_array_clean(&e->scie_unref_queue);
|
|
|
|
evas_common_rgba_image_scalecache_prune();
|
|
|
|
|
2013-01-11 11:54:12 -08:00
|
|
|
eina_array_foreach(&e->image_unref_queue, _drop_image_cache_ref, NULL);
|
|
|
|
eina_array_clean(&e->image_unref_queue);
|
2013-01-16 14:32:39 -08:00
|
|
|
|
2013-01-11 11:55:40 -08:00
|
|
|
eina_array_foreach(&e->glyph_unref_queue, _drop_glyph_ref, NULL);
|
|
|
|
eina_array_clean(&e->glyph_unref_queue);
|
2013-01-16 14:32:39 -08:00
|
|
|
|
2013-01-15 09:35:11 -08:00
|
|
|
eina_array_foreach(&e->texts_unref_queue, _drop_texts_ref, NULL);
|
|
|
|
eina_array_clean(&e->texts_unref_queue);
|
2013-01-11 11:54:12 -08:00
|
|
|
|
2013-01-17 14:14:05 -08:00
|
|
|
/* post rendering */
|
2013-09-02 21:48:08 -07:00
|
|
|
_rendering_evases = eina_list_remove(_rendering_evases, e);
|
2013-01-14 12:02:43 -08:00
|
|
|
e->rendering = EINA_FALSE;
|
|
|
|
|
2013-03-20 02:53:26 -07:00
|
|
|
post.updated_area = ret_updates;
|
2013-11-30 20:26:04 -08:00
|
|
|
_cb_always_call(eo_e, EVAS_CALLBACK_RENDER_POST, &post);
|
2013-01-14 12:02:43 -08:00
|
|
|
|
2013-03-25 19:48:23 -07:00
|
|
|
evas_render_updates_free(ret_updates);
|
2012-12-18 08:26:44 -08:00
|
|
|
|
|
|
|
eo_unref(eo_e);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
evas_render_async_wakeup(void *target, Evas_Callback_Type type EINA_UNUSED, void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Evas_Public_Data *e = target;
|
|
|
|
evas_render_wakeup(e->evas);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
evas_render_pipe_wakeup(void *data)
|
|
|
|
{
|
|
|
|
evas_async_events_put(data, 0, NULL, evas_render_async_wakeup);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2008-10-21 09:31:05 -07:00
|
|
|
evas_render_updates_free(Eina_List *updates)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2009-06-23 06:57:27 -07:00
|
|
|
Eina_Rectangle *r;
|
2009-04-14 05:15:07 -07:00
|
|
|
|
|
|
|
EINA_LIST_FREE(updates, r)
|
2011-05-20 23:23:33 -07:00
|
|
|
eina_rectangle_free(r);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN Eina_Bool
|
2014-06-26 14:29:46 -07:00
|
|
|
_evas_canvas_render_async(Eo *eo_e, Evas_Public_Data *e)
|
2012-12-18 08:26:44 -08:00
|
|
|
{
|
2013-12-19 05:49:16 -08:00
|
|
|
static int render_2 = -1;
|
2012-12-18 08:26:44 -08:00
|
|
|
|
2013-12-19 05:49:16 -08:00
|
|
|
if (render_2 == -1)
|
|
|
|
{
|
|
|
|
if (getenv("EVAS_RENDER2")) render_2 = 1;
|
|
|
|
else render_2 = 0;
|
|
|
|
}
|
|
|
|
if (render_2)
|
2014-03-11 23:53:00 -07:00
|
|
|
return _evas_render2_begin(eo_e, EINA_TRUE, EINA_TRUE, EINA_TRUE);
|
2013-12-19 05:49:16 -08:00
|
|
|
else
|
2014-03-11 23:53:00 -07:00
|
|
|
return evas_render_updates_internal(eo_e, 1, 1, evas_render_pipe_wakeup,
|
2013-12-19 05:49:16 -08:00
|
|
|
e, EINA_TRUE);
|
2012-12-18 08:26:44 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_List *
|
|
|
|
evas_render_updates_internal_wait(Evas *eo_e,
|
|
|
|
unsigned char make_updates,
|
|
|
|
unsigned char do_draw)
|
|
|
|
{
|
|
|
|
Eina_List *ret = NULL;
|
2014-06-26 14:29:46 -07:00
|
|
|
Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2013-12-19 05:49:16 -08:00
|
|
|
static int render_2 = -1;
|
2012-12-18 08:26:44 -08:00
|
|
|
|
2013-12-19 05:49:16 -08:00
|
|
|
if (render_2 == -1)
|
|
|
|
{
|
|
|
|
if (getenv("EVAS_RENDER2")) render_2 = 1;
|
|
|
|
else render_2 = 0;
|
|
|
|
}
|
|
|
|
if (render_2)
|
|
|
|
{
|
|
|
|
if (!_evas_render2_begin(eo_e, make_updates, do_draw, EINA_FALSE))
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!evas_render_updates_internal(eo_e, make_updates, do_draw, NULL,
|
|
|
|
NULL, EINA_FALSE))
|
|
|
|
return NULL;
|
|
|
|
}
|
2012-12-18 08:26:44 -08:00
|
|
|
|
|
|
|
ret = e->render.updates;
|
|
|
|
e->render.updates = NULL;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN Eina_List*
|
2014-06-26 14:29:46 -07:00
|
|
|
_evas_canvas_render_updates(Eo *eo_e, Evas_Public_Data *e)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2014-03-11 23:53:00 -07:00
|
|
|
if (!e->changed) return NULL;
|
|
|
|
return evas_render_updates_internal_wait(eo_e, 1, 1);
|
2005-12-03 01:27:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN void
|
2014-06-26 14:29:46 -07:00
|
|
|
_evas_canvas_render(Eo *eo_e, Evas_Public_Data *e)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2006-09-18 02:40:29 -07:00
|
|
|
if (!e->changed) return;
|
2012-12-18 08:26:44 -08:00
|
|
|
evas_render_updates_internal_wait(eo_e, 0, 1);
|
2007-01-16 02:17:10 -08:00
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN void
|
2014-06-26 14:29:46 -07:00
|
|
|
_evas_canvas_norender(Eo *eo_e, Evas_Public_Data *_pd EINA_UNUSED)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2011-05-20 23:23:33 -07:00
|
|
|
// if (!e->changed) return;
|
2012-12-18 08:26:44 -08:00
|
|
|
evas_render_updates_internal_wait(eo_e, 0, 0);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2007-01-16 02:17:10 -08:00
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN void
|
2014-06-26 14:29:46 -07:00
|
|
|
_evas_canvas_render_idle_flush(Eo *eo_e, Evas_Public_Data *e)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2013-12-19 05:49:16 -08:00
|
|
|
static int render_2 = -1;
|
2008-06-04 09:42:39 -07:00
|
|
|
|
2013-12-19 05:49:16 -08:00
|
|
|
if (render_2 == -1)
|
|
|
|
{
|
|
|
|
if (getenv("EVAS_RENDER2")) render_2 = 1;
|
|
|
|
else render_2 = 0;
|
|
|
|
}
|
|
|
|
if (render_2)
|
|
|
|
{
|
|
|
|
_evas_render2_idle_flush(eo_e);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
|
|
|
|
evas_render_rendering_wait(e);
|
|
|
|
|
|
|
|
evas_fonts_zero_pressure(eo_e);
|
|
|
|
|
|
|
|
if ((e->engine.func) && (e->engine.func->output_idle_flush) &&
|
|
|
|
(e->engine.data.output))
|
|
|
|
e->engine.func->output_idle_flush(e->engine.data.output);
|
|
|
|
|
|
|
|
OBJS_ARRAY_FLUSH(&e->active_objects);
|
|
|
|
OBJS_ARRAY_FLUSH(&e->render_objects);
|
|
|
|
OBJS_ARRAY_FLUSH(&e->restack_objects);
|
|
|
|
OBJS_ARRAY_FLUSH(&e->delete_objects);
|
|
|
|
OBJS_ARRAY_FLUSH(&e->obscuring_objects);
|
|
|
|
OBJS_ARRAY_FLUSH(&e->temporary_objects);
|
|
|
|
eina_array_foreach(&e->clip_changes, _evas_clip_changes_free, NULL);
|
|
|
|
eina_array_clean(&e->clip_changes);
|
|
|
|
|
|
|
|
e->invalidate = EINA_TRUE;
|
|
|
|
}
|
2007-06-16 19:56:59 -07:00
|
|
|
}
|
2008-05-26 06:24:24 -07:00
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN void
|
2014-06-26 14:29:46 -07:00
|
|
|
_evas_canvas_sync(Eo *eo_e, Evas_Public_Data *e)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2013-12-19 05:49:16 -08:00
|
|
|
static int render_2 = -1;
|
|
|
|
|
|
|
|
if (render_2 == -1)
|
|
|
|
{
|
|
|
|
if (getenv("EVAS_RENDER2")) render_2 = 1;
|
|
|
|
else render_2 = 0;
|
|
|
|
}
|
|
|
|
if (render_2)
|
|
|
|
_evas_render2_wait(eo_e);
|
|
|
|
else
|
|
|
|
evas_render_rendering_wait(e);
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_evas_render_dump_map_surfaces(Evas_Object *eo_obj)
|
2010-04-12 01:23:53 -07:00
|
|
|
{
|
2014-06-02 06:47:59 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
|
2013-01-21 19:56:00 -08:00
|
|
|
if ((obj->map->cur.map) && obj->map->surface)
|
2010-04-12 01:23:53 -07:00
|
|
|
{
|
|
|
|
obj->layer->evas->engine.func->image_map_surface_free
|
2013-01-21 19:56:00 -08:00
|
|
|
(obj->layer->evas->engine.data.output, obj->map->surface);
|
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
|
|
|
|
map_write->surface = NULL;
|
|
|
|
EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write);
|
2010-04-12 01:23:53 -07:00
|
|
|
}
|
2010-04-27 06:43:10 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->is_smart)
|
2010-04-12 01:23:53 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj2;
|
2010-04-27 06:43:10 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj), obj2)
|
|
|
|
_evas_render_dump_map_surfaces(obj2->object);
|
2010-04-12 01:23:53 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN void
|
2014-06-26 14:29:46 -07:00
|
|
|
_evas_canvas_render_dump(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2013-12-19 05:49:16 -08:00
|
|
|
static int render_2 = -1;
|
2010-04-12 01:23:53 -07:00
|
|
|
|
2013-12-19 05:49:16 -08:00
|
|
|
if (render_2 == -1)
|
2010-04-12 01:23:53 -07:00
|
|
|
{
|
2013-12-19 05:49:16 -08:00
|
|
|
if (getenv("EVAS_RENDER2")) render_2 = 1;
|
|
|
|
else render_2 = 0;
|
|
|
|
}
|
|
|
|
if (render_2)
|
|
|
|
{
|
|
|
|
_evas_render2_dump(eo_e);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Evas_Layer *lay;
|
|
|
|
|
|
|
|
evas_all_sync();
|
|
|
|
evas_cache_async_freeze();
|
|
|
|
|
|
|
|
EINA_INLIST_FOREACH(e->layers, lay)
|
2010-12-24 08:04:27 -08:00
|
|
|
{
|
2013-12-19 05:49:16 -08:00
|
|
|
Evas_Object_Protected_Data *obj;
|
|
|
|
|
|
|
|
EINA_INLIST_FOREACH(lay->objects, obj)
|
2013-09-02 05:07:37 -07:00
|
|
|
{
|
2013-12-19 05:49:16 -08:00
|
|
|
if (obj->proxy)
|
2013-09-02 05:07:37 -07:00
|
|
|
{
|
2013-12-19 05:49:16 -08:00
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, obj->proxy, Evas_Object_Proxy_Data, proxy_write)
|
2013-09-02 05:07:37 -07:00
|
|
|
{
|
2013-12-19 05:49:16 -08:00
|
|
|
if (proxy_write->surface)
|
|
|
|
{
|
|
|
|
e->engine.func->image_map_surface_free(e->engine.data.output,
|
|
|
|
proxy_write->surface);
|
|
|
|
proxy_write->surface = NULL;
|
|
|
|
}
|
2013-09-02 05:07:37 -07:00
|
|
|
}
|
2013-12-19 05:49:16 -08:00
|
|
|
EINA_COW_WRITE_END(evas_object_proxy_cow, obj->proxy, proxy_write);
|
2013-09-02 05:07:37 -07:00
|
|
|
}
|
2013-12-19 05:49:16 -08:00
|
|
|
if ((obj->type) && (!strcmp(obj->type, "image")))
|
|
|
|
evas_object_inform_call_image_unloaded(obj->object);
|
|
|
|
_evas_render_dump_map_surfaces(obj->object);
|
2013-09-02 05:07:37 -07:00
|
|
|
}
|
2010-12-24 08:04:27 -08:00
|
|
|
}
|
2013-12-19 05:49:16 -08:00
|
|
|
if ((e->engine.func) && (e->engine.func->output_dump) &&
|
|
|
|
(e->engine.data.output))
|
|
|
|
e->engine.func->output_dump(e->engine.data.output);
|
2013-04-01 02:39:50 -07:00
|
|
|
|
2013-12-19 05:49:16 -08:00
|
|
|
#define GC_ALL(Cow) \
|
2014-05-19 06:42:36 -07:00
|
|
|
if (Cow) while (eina_cow_gc(Cow))
|
2013-12-19 05:49:16 -08:00
|
|
|
GC_ALL(evas_object_proxy_cow);
|
|
|
|
GC_ALL(evas_object_map_cow);
|
|
|
|
GC_ALL(evas_object_image_pixels_cow);
|
|
|
|
GC_ALL(evas_object_image_load_opts_cow);
|
|
|
|
GC_ALL(evas_object_image_state_cow);
|
|
|
|
|
|
|
|
evas_fonts_zero_pressure(eo_e);
|
2013-09-02 05:07:37 -07:00
|
|
|
|
2013-12-19 05:49:16 -08:00
|
|
|
if ((e->engine.func) && (e->engine.func->output_idle_flush) &&
|
|
|
|
(e->engine.data.output))
|
|
|
|
e->engine.func->output_idle_flush(e->engine.data.output);
|
2013-09-02 05:07:37 -07:00
|
|
|
|
2013-12-19 05:49:16 -08:00
|
|
|
OBJS_ARRAY_FLUSH(&e->active_objects);
|
|
|
|
OBJS_ARRAY_FLUSH(&e->render_objects);
|
|
|
|
OBJS_ARRAY_FLUSH(&e->restack_objects);
|
|
|
|
OBJS_ARRAY_FLUSH(&e->delete_objects);
|
|
|
|
OBJS_ARRAY_FLUSH(&e->obscuring_objects);
|
|
|
|
OBJS_ARRAY_FLUSH(&e->temporary_objects);
|
|
|
|
eina_array_foreach(&e->clip_changes, _evas_clip_changes_free, NULL);
|
|
|
|
eina_array_clean(&e->clip_changes);
|
|
|
|
|
|
|
|
e->invalidate = EINA_TRUE;
|
|
|
|
|
|
|
|
evas_cache_async_thaw();
|
|
|
|
}
|
2010-04-12 01:23:53 -07:00
|
|
|
}
|
|
|
|
|
2008-05-26 06:24:24 -07:00
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_render_invalidate(Evas *eo_e)
|
2008-05-26 06:24:24 -07:00
|
|
|
{
|
2012-10-10 00:23:00 -07:00
|
|
|
Evas_Public_Data *e;
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
2008-05-26 06:24:24 -07:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2014-06-26 14:29:46 -07:00
|
|
|
e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2008-05-26 06:24:24 -07:00
|
|
|
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJS_ARRAY_CLEAN(&e->active_objects);
|
|
|
|
OBJS_ARRAY_CLEAN(&e->render_objects);
|
2008-06-04 09:42:39 -07:00
|
|
|
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJS_ARRAY_FLUSH(&e->restack_objects);
|
|
|
|
OBJS_ARRAY_FLUSH(&e->delete_objects);
|
2008-06-04 09:42:39 -07:00
|
|
|
|
2012-05-16 06:21:37 -07:00
|
|
|
e->invalidate = EINA_TRUE;
|
2008-05-26 06:24:24 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_render_object_recalc(Evas_Object *eo_obj)
|
2008-05-26 06:24:24 -07:00
|
|
|
{
|
2012-10-10 00:23:00 -07:00
|
|
|
Evas_Object_Protected_Data *obj;
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2008-05-26 06:24:24 -07:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-10 00:23:00 -07:00
|
|
|
|
2014-06-02 06:47:59 -07:00
|
|
|
obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
|
2008-06-12 06:22:26 -07:00
|
|
|
if ((!obj->changed) && (obj->delete_me < 2))
|
2012-04-26 02:53:03 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Public_Data *e;
|
2012-05-16 06:21:37 -07:00
|
|
|
|
2012-04-26 02:53:03 -07:00
|
|
|
e = obj->layer->evas;
|
|
|
|
if ((!e) || (e->cleanup)) return;
|
2013-05-02 00:47:16 -07:00
|
|
|
OBJ_ARRAY_PUSH(&e->pending_objects, obj);
|
2012-05-16 06:21:37 -07:00
|
|
|
obj->changed = EINA_TRUE;
|
2012-04-26 02:53:03 -07:00
|
|
|
}
|
2008-05-26 06:24:24 -07:00
|
|
|
}
|
2011-02-06 15:50:19 -08:00
|
|
|
|
2013-01-11 11:54:12 -08:00
|
|
|
void
|
|
|
|
evas_unref_queue_image_put(Evas_Public_Data *pd, void *image)
|
|
|
|
{
|
|
|
|
eina_array_push(&pd->image_unref_queue, image);
|
2013-01-17 14:14:05 -08:00
|
|
|
evas_common_rgba_image_scalecache_items_ref(image, &pd->scie_unref_queue);
|
2013-01-11 11:54:12 -08:00
|
|
|
}
|
|
|
|
|
2013-01-11 11:55:40 -08:00
|
|
|
void
|
|
|
|
evas_unref_queue_glyph_put(Evas_Public_Data *pd, void *glyph)
|
|
|
|
{
|
|
|
|
eina_array_push(&pd->glyph_unref_queue, glyph);
|
|
|
|
}
|
|
|
|
|
2013-01-15 09:35:11 -08:00
|
|
|
void
|
|
|
|
evas_unref_queue_texts_put(Evas_Public_Data *pd, void *texts)
|
|
|
|
{
|
|
|
|
eina_array_push(&pd->texts_unref_queue, texts);
|
|
|
|
}
|
|
|
|
|
2011-02-06 15:50:19 -08:00
|
|
|
/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
|
2014-03-11 23:53:00 -07:00
|
|
|
|