{
Evas_VG_Node_Data *nd = eo_data_scope_get(n, EVAS_VG_NODE_CLASS);
- obj->layer->evas->engine.func->ector_draw(output, context, surface, nd->renderer, clips, x, y, do_async);
+ obj->layer->evas->engine.func->ector_renderer_draw(output, context, surface, nd->renderer, clips, x, y, do_async);
}
}
context);
obj->layer->evas->engine.func->context_render_op_set(output, context,
obj->cur->render_op);
+ obj->layer->evas->engine.func->ector_begin(output, context, surface, do_async);
_evas_vg_render(obj, output, context, surface, vd->root, NULL,
obj->cur->geometry.x + x, obj->cur->geometry.y + y,
do_async);
+ obj->layer->evas->engine.func->ector_end(output, context, surface, do_async);
}
static void
void (*texture_image_set) (void *data, void *texture, void *image);
Ector_Surface *(*ector_get) (void *data);
- void (*ector_draw) (void *data, void *context, void *surface, Ector_Renderer *r, Eina_Array *clips, int x, int y, Eina_Bool do_async);
+ void (*ector_begin) (void *data, void *context, void *surface, Eina_Bool do_async);
+ void (*ector_renderer_draw) (void *data, void *context, void *surface, Ector_Renderer *r, Eina_Array *clips, int x, int y, Eina_Bool do_async);
+ void (*ector_end) (void *data, void *context, void *surface, Eina_Bool do_async);
};
struct _Evas_Image_Save_Func
typedef struct _Evas_Thread_Command_Map Evas_Thread_Command_Map;
typedef struct _Evas_Thread_Command_Multi_Font Evas_Thread_Command_Multi_Font;
typedef struct _Evas_Thread_Command_Ector Evas_Thread_Command_Ector;
+typedef struct _Evas_Thread_Command_Ector_Surface Evas_Thread_Command_Ector_Surface;
struct _Evas_Thread_Command_Rect
{
struct _Evas_Thread_Command_Ector
{
- void *surface;
Ector_Renderer *r;
Eina_Array *clips;
Eina_Bool free_it;
};
+struct _Evas_Thread_Command_Ector_Surface
+{
+ void *surface;
+};
+
Eina_Mempool *_mp_command_rect = NULL;
Eina_Mempool *_mp_command_line = NULL;
Eina_Mempool *_mp_command_polygon = NULL;
Eina_Mempool *_mp_command_map = NULL;
Eina_Mempool *_mp_command_multi_font = NULL;
Eina_Mempool *_mp_command_ector = NULL;
+Eina_Mempool *_mp_command_ector_surface = NULL;
/*
*****
**
_draw_thread_ector_draw(void *data)
{
Evas_Thread_Command_Ector *ector = data;
- RGBA_Image *surface = ector->surface;
- void *pixels = evas_cache_image_pixels(&surface->cache_entry);
- unsigned int w, h;
-
- w = surface->cache_entry.w;
- h = surface->cache_entry.h;
-
- // FIXME: do not reset cairo context if not necessary
- eo_do(_software_ector,
- ector_cairo_software_surface_set(pixels, w, h));
eo_do(ector->r,
ector_renderer_draw(ector->render_op,
if (eina_array_count(c) == 0)
eina_array_push(c, eina_rectangle_new(clip.x, clip.y, clip.w, clip.h));
- ector.surface = surface;
ector.r = eo_ref(renderer);
ector.clips = c;
ector.render_op = _evas_render_op_to_ector_rop(dc->render_op);
}
}
+static void
+_draw_thread_ector_surface_set(void *data)
+{
+ Evas_Thread_Command_Ector_Surface *ector_surface = data;
+ RGBA_Image *surface = ector_surface->surface;
+ void *pixels = NULL;
+ unsigned int w = 0;
+ unsigned int h = 0;
+
+ if (surface)
+ {
+ pixels = evas_cache_image_pixels(&surface->cache_entry);
+ w = surface->cache_entry.w;
+ h = surface->cache_entry.h;
+ }
+
+ eo_do(_software_ector,
+ ector_cairo_software_surface_set(pixels, w, h));
+
+ eina_mempool_free(_mp_command_ector_surface, ector_surface);
+}
+
+static void
+eng_ector_begin(void *data EINA_UNUSED, void *context EINA_UNUSED, void *surface, Eina_Bool do_async)
+{
+ if (do_async)
+ {
+ Evas_Thread_Command_Ector_Surface *nes;
+
+ nes = eina_mempool_malloc(_mp_command_ector_surface, sizeof (Evas_Thread_Command_Ector_Surface));
+ if (!nes) return ;
+
+ nes->surface = surface;
+
+ evas_thread_cmd_enqueue(_draw_thread_ector_surface_set, nes);
+ }
+ else
+ {
+ RGBA_Image *sf = surface;
+ void *pixels = NULL;
+ unsigned int w = 0;
+ unsigned int h = 0;
+
+ pixels = evas_cache_image_pixels(&sf->cache_entry);
+ w = sf->cache_entry.w;
+ h = sf->cache_entry.h;
+
+ eo_do(_software_ector,
+ ector_cairo_software_surface_set(pixels, w, h));
+ }
+}
+
+static void
+eng_ector_end(void *data EINA_UNUSED, void *context EINA_UNUSED, void *surface EINA_UNUSED, Eina_Bool do_async)
+{
+ if (do_async)
+ {
+ Evas_Thread_Command_Ector_Surface *nes;
+
+ nes = eina_mempool_malloc(_mp_command_ector_surface, sizeof (Evas_Thread_Command_Ector_Surface));
+ if (!nes) return ;
+
+ nes->surface = NULL;
+
+ evas_thread_cmd_enqueue(_draw_thread_ector_surface_set, nes);
+ }
+ else
+ {
+ eo_do(_software_ector, ector_cairo_software_surface_set(NULL, 0, 0));
+ }
+}
+
//------------------------------------------------//
/*
NULL, // eng_texture_filter_get
NULL, // eng_texture_image_set
eng_ector_get,
- eng_ector_renderer_draw
+ eng_ector_begin,
+ eng_ector_renderer_draw,
+ eng_ector_end
/* FUTURE software generic calls go here */
};
_mp_command_ector =
eina_mempool_add("chained_mempool", "Evas_Thread_Command_Ector",
NULL, sizeof(Evas_Thread_Command_Ector), 128);
+ _mp_command_ector_surface =
+ eina_mempool_add("chained_mempool", "Evas_Thread_Command_Ector_Surface",
+ NULL, sizeof(Evas_Thread_Command_Ector_Surface), 128);
init_gl();
evas_common_pipe_init();