1 #include "evas_common.h"
2 #include "evas_private.h"
11 static int cpunum = 0;
12 static int _evas_soft_gen_log_dom = -1;
15 eng_output_dump(void *data __UNUSED__)
17 evas_common_image_image_all_unload();
18 evas_common_font_font_all_unload();
22 eng_context_new(void *data __UNUSED__)
24 return evas_common_draw_context_new();
28 eng_context_free(void *data __UNUSED__, void *context)
30 evas_common_draw_context_free(context);
34 eng_context_clip_set(void *data __UNUSED__, void *context, int x, int y, int w, int h)
36 evas_common_draw_context_set_clip(context, x, y, w, h);
40 eng_context_clip_clip(void *data __UNUSED__, void *context, int x, int y, int w, int h)
42 evas_common_draw_context_clip_clip(context, x, y, w, h);
46 eng_context_clip_unset(void *data __UNUSED__, void *context)
48 evas_common_draw_context_unset_clip(context);
52 eng_context_clip_get(void *data __UNUSED__, void *context, int *x, int *y, int *w, int *h)
54 *x = ((RGBA_Draw_Context *)context)->clip.x;
55 *y = ((RGBA_Draw_Context *)context)->clip.y;
56 *w = ((RGBA_Draw_Context *)context)->clip.w;
57 *h = ((RGBA_Draw_Context *)context)->clip.h;
58 return ((RGBA_Draw_Context *)context)->clip.use;
62 eng_context_color_set(void *data __UNUSED__, void *context, int r, int g, int b, int a)
64 evas_common_draw_context_set_color(context, r, g, b, a);
68 eng_context_color_get(void *data __UNUSED__, void *context, int *r, int *g, int *b, int *a)
70 *r = (int)(R_VAL(&((RGBA_Draw_Context *)context)->col.col));
71 *g = (int)(G_VAL(&((RGBA_Draw_Context *)context)->col.col));
72 *b = (int)(B_VAL(&((RGBA_Draw_Context *)context)->col.col));
73 *a = (int)(A_VAL(&((RGBA_Draw_Context *)context)->col.col));
78 eng_context_multiplier_set(void *data __UNUSED__, void *context, int r, int g, int b, int a)
80 evas_common_draw_context_set_multiplier(context, r, g, b, a);
84 eng_context_multiplier_unset(void *data __UNUSED__, void *context)
86 evas_common_draw_context_unset_multiplier(context);
90 eng_context_multiplier_get(void *data __UNUSED__, void *context, int *r, int *g, int *b, int *a)
92 *r = (int)(R_VAL(&((RGBA_Draw_Context *)context)->mul.col));
93 *g = (int)(G_VAL(&((RGBA_Draw_Context *)context)->mul.col));
94 *b = (int)(B_VAL(&((RGBA_Draw_Context *)context)->mul.col));
95 *a = (int)(A_VAL(&((RGBA_Draw_Context *)context)->mul.col));
96 return ((RGBA_Draw_Context *)context)->mul.use;
100 eng_context_cutout_add(void *data __UNUSED__, void *context, int x, int y, int w, int h)
102 evas_common_draw_context_add_cutout(context, x, y, w, h);
106 eng_context_cutout_clear(void *data __UNUSED__, void *context)
108 evas_common_draw_context_clear_cutouts(context);
112 eng_context_anti_alias_set(void *data __UNUSED__, void *context, unsigned char aa)
114 evas_common_draw_context_set_anti_alias(context, aa);
118 eng_context_anti_alias_get(void *data __UNUSED__, void *context)
120 return ((RGBA_Draw_Context *)context)->anti_alias;
124 eng_context_color_interpolation_set(void *data __UNUSED__, void *context, int color_space)
126 evas_common_draw_context_set_color_interpolation(context, color_space);
130 eng_context_color_interpolation_get(void *data __UNUSED__, void *context)
132 return ((RGBA_Draw_Context *)context)->interpolation.color_space;
136 eng_context_render_op_set(void *data __UNUSED__, void *context, int op)
138 evas_common_draw_context_set_render_op(context, op);
142 eng_context_render_op_get(void *data __UNUSED__, void *context)
144 return ((RGBA_Draw_Context *)context)->render_op;
150 eng_rectangle_draw(void *data __UNUSED__, void *context, void *surface, int x, int y, int w, int h)
152 #ifdef BUILD_PIPE_RENDER
154 #ifdef EVAS_FRAME_QUEUING
155 && evas_common_frameq_enabled()
158 evas_common_pipe_rectangle_draw(surface, context, x, y, w, h);
162 evas_common_rectangle_draw(surface, context, x, y, w, h);
163 evas_common_cpu_end_opt();
168 eng_line_draw(void *data __UNUSED__, void *context, void *surface, int x1, int y1, int x2, int y2)
170 #ifdef BUILD_PIPE_RENDER
172 #ifdef EVAS_FRAME_QUEUING
173 && evas_common_frameq_enabled()
176 evas_common_pipe_line_draw(surface, context, x1, y1, x2, y2);
180 evas_common_line_draw(surface, context, x1, y1, x2, y2);
181 evas_common_cpu_end_opt();
186 eng_polygon_point_add(void *data __UNUSED__, void *context __UNUSED__, void *polygon, int x, int y)
188 return evas_common_polygon_point_add(polygon, x, y);
192 eng_polygon_points_clear(void *data __UNUSED__, void *context __UNUSED__, void *polygon)
194 return evas_common_polygon_points_clear(polygon);
198 eng_polygon_draw(void *data __UNUSED__, void *context, void *surface, void *polygon, int x, int y)
200 #ifdef BUILD_PIPE_RENDER
202 #ifdef EVAS_FRAME_QUEUING
203 && evas_common_frameq_enabled()
206 evas_common_pipe_poly_draw(surface, context, polygon, x, y);
210 evas_common_polygon_draw(surface, context, polygon, x, y);
211 evas_common_cpu_end_opt();
216 eng_gradient2_color_np_stop_insert(void *data __UNUSED__, void *gradient, int r, int g, int b, int a, float pos)
218 evas_common_gradient2_color_np_stop_insert(gradient, r, g, b, a, pos);
222 eng_gradient2_clear(void *data __UNUSED__, void *gradient)
224 evas_common_gradient2_clear(gradient);
228 eng_gradient2_fill_transform_set(void *data __UNUSED__, void *gradient, void *transform)
230 evas_common_gradient2_fill_transform_set(gradient, transform);
234 eng_gradient2_fill_spread_set(void *data __UNUSED__, void *gradient, int spread)
236 evas_common_gradient2_fill_spread_set(gradient, spread);
240 eng_gradient2_linear_new(void *data __UNUSED__)
242 return evas_common_gradient2_linear_new();
246 eng_gradient2_linear_free(void *data __UNUSED__, void *linear_gradient)
248 evas_common_gradient2_free(linear_gradient);
252 eng_gradient2_linear_fill_set(void *data __UNUSED__, void *linear_gradient, float x0, float y0, float x1, float y1)
254 evas_common_gradient2_linear_fill_set(linear_gradient, x0, y0, x1, y1);
258 eng_gradient2_linear_is_opaque(void *data __UNUSED__, void *context, void *linear_gradient, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
260 RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
261 RGBA_Gradient2 *gr = (RGBA_Gradient2 *)linear_gradient;
263 if (!dc || !gr || !gr->type.geometer) return 0;
264 return !(gr->type.geometer->has_alpha(gr, dc->render_op) |
265 gr->type.geometer->has_mask(gr, dc->render_op));
269 eng_gradient2_linear_is_visible(void *data __UNUSED__, void *context, void *linear_gradient, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
271 RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
273 if (!dc || !linear_gradient) return 0;
278 eng_gradient2_linear_render_pre(void *data __UNUSED__, void *context, void *linear_gradient)
280 RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
281 RGBA_Gradient2 *gr = (RGBA_Gradient2 *)linear_gradient;
284 if (!dc || !gr || !gr->type.geometer) return;
285 gr->type.geometer->geom_update(gr);
286 len = gr->type.geometer->get_map_len(gr);
287 evas_common_gradient2_map(dc, gr, len);
291 eng_gradient2_linear_render_post(void *data __UNUSED__, void *linear_gradient __UNUSED__)
296 eng_gradient2_linear_draw(void *data __UNUSED__, void *context, void *surface, void *linear_gradient, int x, int y, int w, int h)
298 #ifdef BUILD_PIPE_RENDER
300 #ifdef EVAS_FRAME_QUEUING
301 && evas_common_frameq_enabled()
304 evas_common_pipe_grad2_draw(surface, context, x, y, w, h, linear_gradient);
307 evas_common_gradient2_draw(surface, context, x, y, w, h, linear_gradient);
311 eng_gradient2_radial_new(void *data __UNUSED__)
313 return evas_common_gradient2_radial_new();
317 eng_gradient2_radial_free(void *data __UNUSED__, void *radial_gradient)
319 evas_common_gradient2_free(radial_gradient);
323 eng_gradient2_radial_fill_set(void *data __UNUSED__, void *radial_gradient, float cx, float cy, float rx, float ry)
325 evas_common_gradient2_radial_fill_set(radial_gradient, cx, cy, rx, ry);
329 eng_gradient2_radial_is_opaque(void *data __UNUSED__, void *context, void *radial_gradient, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
331 RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
332 RGBA_Gradient2 *gr = (RGBA_Gradient2 *)radial_gradient;
334 if (!dc || !gr || !gr->type.geometer) return 0;
335 return !(gr->type.geometer->has_alpha(gr, dc->render_op) |
336 gr->type.geometer->has_mask(gr, dc->render_op));
340 eng_gradient2_radial_is_visible(void *data __UNUSED__, void *context, void *radial_gradient, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
342 RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
344 if (!dc || !radial_gradient) return 0;
349 eng_gradient2_radial_render_pre(void *data __UNUSED__, void *context, void *radial_gradient)
351 RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
352 RGBA_Gradient2 *gr = (RGBA_Gradient2 *)radial_gradient;
355 if (!dc || !gr || !gr->type.geometer) return;
356 gr->type.geometer->geom_update(gr);
357 len = gr->type.geometer->get_map_len(gr);
358 evas_common_gradient2_map(dc, gr, len);
362 eng_gradient2_radial_render_post(void *data __UNUSED__, void *radial_gradient __UNUSED__)
367 eng_gradient2_radial_draw(void *data __UNUSED__, void *context, void *surface, void *radial_gradient, int x, int y, int w, int h)
369 #ifdef BUILD_PIPE_RENDER
371 #ifdef EVAS_FRAME_QUEUING
372 && evas_common_frameq_enabled()
375 evas_common_pipe_grad2_draw(surface, context, x, y, w, h, radial_gradient);
378 evas_common_gradient2_draw(surface, context, x, y, w, h, radial_gradient);
382 eng_gradient_new(void *data __UNUSED__)
384 return evas_common_gradient_new();
388 eng_gradient_free(void *data __UNUSED__, void *gradient)
390 evas_common_gradient_free(gradient);
394 eng_gradient_color_stop_add(void *data __UNUSED__, void *gradient, int r, int g, int b, int a, int delta)
396 evas_common_gradient_color_stop_add(gradient, r, g, b, a, delta);
400 eng_gradient_alpha_stop_add(void *data __UNUSED__, void *gradient, int a, int delta)
402 evas_common_gradient_alpha_stop_add(gradient, a, delta);
406 eng_gradient_color_data_set(void *data __UNUSED__, void *gradient, void *map, int len, int has_alpha)
408 evas_common_gradient_color_data_set(gradient, map, len, has_alpha);
412 eng_gradient_alpha_data_set(void *data __UNUSED__, void *gradient, void *alpha_map, int len)
414 evas_common_gradient_alpha_data_set(gradient, alpha_map, len);
418 eng_gradient_clear(void *data __UNUSED__, void *gradient)
420 evas_common_gradient_clear(gradient);
424 eng_gradient_fill_set(void *data __UNUSED__, void *gradient, int x, int y, int w, int h)
426 evas_common_gradient_fill_set(gradient, x, y, w, h);
430 eng_gradient_fill_angle_set(void *data __UNUSED__, void *gradient, double angle)
432 evas_common_gradient_fill_angle_set(gradient, angle);
436 eng_gradient_fill_spread_set(void *data __UNUSED__, void *gradient, int spread)
438 evas_common_gradient_fill_spread_set(gradient, spread);
442 eng_gradient_angle_set(void *data __UNUSED__, void *gradient, double angle)
444 evas_common_gradient_map_angle_set(gradient, angle);
448 eng_gradient_offset_set(void *data __UNUSED__, void *gradient, float offset)
450 evas_common_gradient_map_offset_set(gradient, offset);
454 eng_gradient_direction_set(void *data __UNUSED__, void *gradient, int direction)
456 evas_common_gradient_map_direction_set(gradient, direction);
460 eng_gradient_type_set(void *data __UNUSED__, void *gradient, char *name, char *params)
462 evas_common_gradient_type_set(gradient, name, params);
466 eng_gradient_is_opaque(void *data __UNUSED__, void *context, void *gradient, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
468 RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
469 RGBA_Gradient *gr = (RGBA_Gradient *)gradient;
471 if (!dc || !gr || !gr->type.geometer) return 0;
472 return !(gr->type.geometer->has_alpha(gr, dc->render_op) |
473 gr->type.geometer->has_mask(gr, dc->render_op));
477 eng_gradient_is_visible(void *data __UNUSED__, void *context, void *gradient, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
479 RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
481 if (!dc || !gradient) return 0;
486 eng_gradient_render_pre(void *data __UNUSED__, void *context, void *gradient)
488 RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
489 RGBA_Gradient *gr = (RGBA_Gradient *)gradient;
492 if (!dc || !gr || !gr->type.geometer) return;
493 gr->type.geometer->geom_set(gr);
494 len = gr->type.geometer->get_map_len(gr);
495 evas_common_gradient_map(dc, gr, len);
499 eng_gradient_render_post(void *data __UNUSED__, void *gradient __UNUSED__)
504 eng_gradient_draw(void *data __UNUSED__, void *context, void *surface, void *gradient, int x, int y, int w, int h)
506 #ifdef BUILD_PIPE_RENDER
508 #ifdef EVAS_FRAME_QUEUING
509 && evas_common_frameq_enabled()
512 evas_common_pipe_grad_draw(surface, context, x, y, w, h, gradient);
516 evas_common_gradient_draw(surface, context, x, y, w, h, gradient);
517 evas_common_cpu_end_opt();
522 eng_image_alpha_get(void *data __UNUSED__, void *image)
526 if (!image) return 1;
530 case EVAS_COLORSPACE_ARGB8888:
531 if (im->flags.alpha) return 1;
539 eng_image_colorspace_get(void *data __UNUSED__, void *image)
543 if (!image) return EVAS_COLORSPACE_ARGB8888;
549 eng_image_alpha_set(void *data __UNUSED__, void *image, int has_alpha)
553 if (!image) return NULL;
555 if (im->cache_entry.space != EVAS_COLORSPACE_ARGB8888)
557 im->cache_entry.flags.alpha = 0;
560 im = (RGBA_Image *) evas_cache_image_alone(&im->cache_entry);
561 evas_common_image_colorspace_dirty(im);
563 im->cache_entry.flags.alpha = has_alpha ? 1 : 0;
568 eng_image_border_set(void *data __UNUSED__, void *image, int l __UNUSED__, int r __UNUSED__, int t __UNUSED__, int b __UNUSED__)
577 eng_image_border_get(void *data __UNUSED__, void *image, int *l __UNUSED__, int *r __UNUSED__, int *t __UNUSED__, int *b __UNUSED__)
585 eng_image_comment_get(void *data __UNUSED__, void *image, char *key __UNUSED__)
589 if (!image) return NULL;
591 return im->info.comment;
595 eng_image_format_get(void *data __UNUSED__, void *image __UNUSED__)
601 eng_image_colorspace_set(void *data __UNUSED__, void *image, int cspace)
607 evas_cache_image_colorspace(im, cspace);
611 eng_image_native_set(void *data __UNUSED__, void *image __UNUSED__, void *native __UNUSED__)
616 eng_image_native_get(void *data __UNUSED__, void *image __UNUSED__)
622 eng_image_load(void *data __UNUSED__, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo)
624 *error = EVAS_LOAD_ERROR_NONE;
625 return evas_common_load_image_from_file(file, key, lo, error);
629 eng_image_new_from_data(void *data __UNUSED__, int w, int h, DATA32 *image_data, int alpha, int cspace)
631 return evas_cache_image_data(evas_common_image_cache_get(), w, h, image_data, alpha, cspace);
635 eng_image_new_from_copied_data(void *data __UNUSED__, int w, int h, DATA32 *image_data, int alpha, int cspace)
637 return evas_cache_image_copied_data(evas_common_image_cache_get(), w, h, image_data, alpha, cspace);
641 eng_image_free(void *data __UNUSED__, void *image)
643 evas_cache_image_drop(image);
647 eng_image_size_get(void *data __UNUSED__, void *image, int *w, int *h)
657 eng_image_size_set(void *data __UNUSED__, void *image, int w, int h)
662 return evas_cache_image_size_set(image, w, h);
666 eng_image_dirty_region(void *data __UNUSED__, void *image, int x, int y, int w, int h)
668 Image_Entry *im = image;
670 if (!image) return NULL;
671 return evas_cache_image_dirty(im, x, y, w, h);
675 eng_image_data_get(void *data __UNUSED__, void *image, int to_write, DATA32 **image_data)
685 evas_cache_image_load_data(&im->cache_entry);
686 switch (im->cache_entry.space)
688 case EVAS_COLORSPACE_ARGB8888:
690 im = (RGBA_Image *) evas_cache_image_alone(&im->cache_entry);
691 *image_data = im->image.data;
693 case EVAS_COLORSPACE_YCBCR422P601_PL:
694 case EVAS_COLORSPACE_YCBCR422P709_PL:
695 *image_data = im->cs.data;
705 eng_image_data_put(void *data, void *image, DATA32 *image_data)
707 RGBA_Image *im, *im2;
709 if (!image) return NULL;
711 switch (im->cache_entry.space)
713 case EVAS_COLORSPACE_ARGB8888:
714 if (image_data != im->image.data)
718 w = im->cache_entry.w;
719 h = im->cache_entry.h;
720 im2 = eng_image_new_from_data(data, w, h, image_data,
721 eng_image_alpha_get(data, image),
722 eng_image_colorspace_get(data, image));
723 evas_cache_image_drop(&im->cache_entry);
727 case EVAS_COLORSPACE_YCBCR422P601_PL:
728 case EVAS_COLORSPACE_YCBCR422P709_PL:
729 if (image_data != im->cs.data)
733 if (!im->cs.no_free) free(im->cs.data);
735 im->cs.data = image_data;
736 evas_common_image_colorspace_dirty(im);
747 eng_image_data_preload_request(void *data __UNUSED__, void *image, const void *target)
749 RGBA_Image *im = image;
752 evas_cache_image_preload_data(&im->cache_entry, target);
756 eng_image_data_preload_cancel(void *data __UNUSED__, void *image, const void *target)
758 RGBA_Image *im = image;
761 evas_cache_image_preload_cancel(&im->cache_entry, target);
765 eng_image_draw(void *data __UNUSED__, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth)
771 #ifdef BUILD_PIPE_RENDER
773 #ifdef EVAS_FRAME_QUEUING
774 && evas_common_frameq_enabled()
778 evas_common_rgba_image_scalecache_prepare(im, surface, context, smooth,
779 src_x, src_y, src_w, src_h,
780 dst_x, dst_y, dst_w, dst_h);
782 evas_common_pipe_image_draw(im, surface, context, smooth,
783 src_x, src_y, src_w, src_h,
784 dst_x, dst_y, dst_w, dst_h);
789 // if (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
790 // evas_cache_image_load_data(&im->cache_entry);
791 // evas_common_image_colorspace_normalize(im);
792 evas_common_rgba_image_scalecache_prepare(&im->cache_entry, surface, context, smooth,
793 src_x, src_y, src_w, src_h,
794 dst_x, dst_y, dst_w, dst_h);
795 evas_common_rgba_image_scalecache_do(&im->cache_entry, surface, context, smooth,
796 src_x, src_y, src_w, src_h,
797 dst_x, dst_y, dst_w, dst_h);
800 evas_common_scale_rgba_in_to_out_clip_smooth(im, surface, context,
801 src_x, src_y, src_w, src_h,
802 dst_x, dst_y, dst_w, dst_h);
804 evas_common_scale_rgba_in_to_out_clip_sample(im, surface, context,
805 src_x, src_y, src_w, src_h,
806 dst_x, dst_y, dst_w, dst_h);
808 evas_common_cpu_end_opt();
813 eng_image_map4_draw(void *data __UNUSED__, void *context, void *surface, void *image, RGBA_Map_Point *p, int smooth, int level)
815 RGBA_Image *im, *srf;
816 RGBA_Map_Point *pt = p;
821 if ((p[0].x == p[3].x) &&
822 (p[1].x == p[2].x) &&
823 (p[0].y == p[1].y) &&
824 (p[3].y == p[2].y) &&
825 (p[0].x <= p[1].x) &&
826 (p[0].y <= p[2].y) &&
829 (p[1].u == (im->cache_entry.w << FP)) &&
831 (p[2].u == (im->cache_entry.w << FP)) &&
832 (p[2].v == (im->cache_entry.h << FP)) &&
834 (p[3].v == (im->cache_entry.h << FP)) &&
835 (p[0].col == 0xffffffff) &&
836 (p[1].col == 0xffffffff) &&
837 (p[2].col == 0xffffffff) &&
838 (p[3].col == 0xffffffff))
844 dw = (p[2].x >> FP) - dx;
845 dh = (p[2].y >> FP) - dy;
847 (data, context, surface, image,
848 0, 0, im->cache_entry.w, im->cache_entry.h,
849 dx, dy, dw, dh, smooth);
853 #ifdef BUILD_PIPE_RENDER
855 # ifdef EVAS_FRAME_QUEUING
856 && evas_common_frameq_enabled()
859 evas_common_pipe_map4_draw(im, surface, context, p, smooth, level);
862 evas_common_map4_rgba(im, surface, context, p, smooth, level);
864 evas_common_cpu_end_opt();
869 eng_image_map_surface_new(void *data __UNUSED__, int w, int h, int alpha)
873 surface = evas_cache_image_copied_data(evas_common_image_cache_get(),
875 EVAS_COLORSPACE_ARGB8888);
876 pixels = evas_cache_image_pixels(surface);
881 eng_image_map_surface_free(void *data __UNUSED__, void *surface)
883 evas_cache_image_drop(surface);
887 eng_image_scale_hint_set(void *data __UNUSED__, void *image, int hint)
893 im->scale_hint = hint;
897 eng_image_scale_hint_get(void *data __UNUSED__, void *image)
901 if (!image) return EVAS_IMAGE_SCALE_HINT_NONE;
903 return im->scale_hint;
907 eng_image_cache_flush(void *data __UNUSED__)
911 tmp_size = evas_common_image_get_cache();
912 evas_common_image_set_cache(0);
913 evas_common_rgba_image_scalecache_flush();
914 evas_common_image_set_cache(tmp_size);
918 eng_image_cache_set(void *data __UNUSED__, int bytes)
920 evas_common_image_set_cache(bytes);
921 evas_common_rgba_image_scalecache_size_set(bytes);
925 eng_image_cache_get(void *data __UNUSED__)
927 return evas_common_image_get_cache();
931 eng_font_load(void *data __UNUSED__, const char *name, int size)
933 return evas_common_font_load(name, size);
937 eng_font_memory_load(void *data __UNUSED__, char *name, int size, const void *fdata, int fdata_size)
939 return evas_common_font_memory_load(name, size, fdata, fdata_size);
943 eng_font_add(void *data __UNUSED__, void *font, const char *name, int size)
945 return evas_common_font_add(font, name, size);
949 eng_font_memory_add(void *data __UNUSED__, void *font, char *name, int size, const void *fdata, int fdata_size)
951 return evas_common_font_memory_add(font, name, size, fdata, fdata_size);
955 eng_font_free(void *data __UNUSED__, void *font)
957 evas_common_font_free(font);
961 eng_font_ascent_get(void *data __UNUSED__, void *font)
963 return evas_common_font_ascent_get(font);
967 eng_font_descent_get(void *data __UNUSED__, void *font)
969 return evas_common_font_descent_get(font);
973 eng_font_max_ascent_get(void *data __UNUSED__, void *font)
975 return evas_common_font_max_ascent_get(font);
979 eng_font_max_descent_get(void *data __UNUSED__, void *font)
981 return evas_common_font_max_descent_get(font);
985 eng_font_string_size_get(void *data __UNUSED__, void *font, const char *text, int *w, int *h)
987 evas_common_font_query_size(font, text, w, h);
991 eng_font_inset_get(void *data __UNUSED__, void *font, const char *text)
993 return evas_common_font_query_inset(font, text);
997 eng_font_h_advance_get(void *data __UNUSED__, void *font, const char *text)
1001 evas_common_font_query_advance(font, text, &h, &v);
1006 eng_font_v_advance_get(void *data __UNUSED__, void *font, const char *text)
1010 evas_common_font_query_advance(font, text, &h, &v);
1015 eng_font_char_coords_get(void *data __UNUSED__, void *font, const char *text, int pos, int *cx, int *cy, int *cw, int *ch)
1017 return evas_common_font_query_char_coords(font, text, pos, cx, cy, cw, ch);
1021 eng_font_char_at_coords_get(void *data __UNUSED__, void *font, const char *text, int x, int y, int *cx, int *cy, int *cw, int *ch)
1023 return evas_common_font_query_text_at_pos(font, text, x, y, cx, cy, cw, ch);
1027 eng_font_last_up_to_pos(void *data __UNUSED__, void *font, const char *text, int x, int y)
1029 return evas_common_font_query_last_up_to_pos(font, text, x, y);
1033 eng_font_draw(void *data __UNUSED__, void *context, void *surface, void *font, int x, int y, int w __UNUSED__, int h __UNUSED__, int ow __UNUSED__, int oh __UNUSED__, const char *text)
1035 #ifdef BUILD_PIPE_RENDER
1037 #ifdef EVAS_FRAME_QUEUING
1038 && evas_common_frameq_enabled()
1041 evas_common_pipe_text_draw(surface, context, font, x, y, text);
1045 evas_common_font_draw(surface, context, font, x, y, text);
1046 evas_common_cpu_end_opt();
1051 eng_font_cache_flush(void *data __UNUSED__)
1053 evas_common_font_flush();
1057 eng_font_cache_set(void *data __UNUSED__, int bytes)
1059 evas_common_font_cache_set(bytes);
1063 eng_font_cache_get(void *data __UNUSED__)
1065 return evas_common_font_cache_get();
1069 eng_font_hinting_set(void *data __UNUSED__, void *font, int hinting)
1071 evas_common_font_hinting_set(font, hinting);
1075 eng_font_hinting_can_hint(void *data __UNUSED__, int hinting)
1077 return evas_common_hinting_available(hinting);
1081 eng_canvas_alpha_get(void *data __UNUSED__, void *info __UNUSED__)
1094 static Evas_Func func =
1110 /* draw context virtual methods */
1112 eng_canvas_alpha_get,
1114 eng_context_clip_set,
1115 eng_context_clip_clip,
1116 eng_context_clip_unset,
1117 eng_context_clip_get,
1118 eng_context_color_set,
1119 eng_context_color_get,
1120 eng_context_multiplier_set,
1121 eng_context_multiplier_unset,
1122 eng_context_multiplier_get,
1123 eng_context_cutout_add,
1124 eng_context_cutout_clear,
1125 eng_context_anti_alias_set,
1126 eng_context_anti_alias_get,
1127 eng_context_color_interpolation_set,
1128 eng_context_color_interpolation_get,
1129 eng_context_render_op_set,
1130 eng_context_render_op_get,
1131 /* rect draw funcs */
1133 /* line draw funcs */
1135 /* polygon draw funcs */
1136 eng_polygon_point_add,
1137 eng_polygon_points_clear,
1139 /* gradient draw funcs */
1140 eng_gradient2_color_np_stop_insert,
1141 eng_gradient2_clear,
1142 eng_gradient2_fill_transform_set,
1143 eng_gradient2_fill_spread_set,
1145 eng_gradient2_linear_new,
1146 eng_gradient2_linear_free,
1147 eng_gradient2_linear_fill_set,
1148 eng_gradient2_linear_is_opaque,
1149 eng_gradient2_linear_is_visible,
1150 eng_gradient2_linear_render_pre,
1151 eng_gradient2_linear_render_post,
1152 eng_gradient2_linear_draw,
1154 eng_gradient2_radial_new,
1155 eng_gradient2_radial_free,
1156 eng_gradient2_radial_fill_set,
1157 eng_gradient2_radial_is_opaque,
1158 eng_gradient2_radial_is_visible,
1159 eng_gradient2_radial_render_pre,
1160 eng_gradient2_radial_render_post,
1161 eng_gradient2_radial_draw,
1165 eng_gradient_color_stop_add,
1166 eng_gradient_alpha_stop_add,
1167 eng_gradient_color_data_set,
1168 eng_gradient_alpha_data_set,
1170 eng_gradient_fill_set,
1171 eng_gradient_fill_angle_set,
1172 eng_gradient_fill_spread_set,
1173 eng_gradient_angle_set,
1174 eng_gradient_offset_set,
1175 eng_gradient_direction_set,
1176 eng_gradient_type_set,
1177 eng_gradient_is_opaque,
1178 eng_gradient_is_visible,
1179 eng_gradient_render_pre,
1180 eng_gradient_render_post,
1182 /* image draw funcs */
1184 eng_image_new_from_data,
1185 eng_image_new_from_copied_data,
1190 eng_image_dirty_region,
1193 eng_image_data_preload_request,
1194 eng_image_data_preload_cancel,
1195 eng_image_alpha_set,
1196 eng_image_alpha_get,
1197 eng_image_border_set,
1198 eng_image_border_get,
1200 eng_image_comment_get,
1201 eng_image_format_get,
1202 eng_image_colorspace_set,
1203 eng_image_colorspace_get,
1204 eng_image_native_set,
1205 eng_image_native_get,
1206 /* image cache funcs */
1207 eng_image_cache_flush,
1208 eng_image_cache_set,
1209 eng_image_cache_get,
1210 /* font draw functions */
1212 eng_font_memory_load,
1214 eng_font_memory_add,
1216 eng_font_ascent_get,
1217 eng_font_descent_get,
1218 eng_font_max_ascent_get,
1219 eng_font_max_descent_get,
1220 eng_font_string_size_get,
1222 eng_font_h_advance_get,
1223 eng_font_v_advance_get,
1224 eng_font_char_coords_get,
1225 eng_font_char_at_coords_get,
1227 /* font cache functions */
1228 eng_font_cache_flush,
1231 /* font hinting functions */
1232 eng_font_hinting_set,
1233 eng_font_hinting_can_hint,
1234 eng_image_scale_hint_set,
1235 eng_image_scale_hint_get,
1236 /* more font draw functions */
1237 eng_font_last_up_to_pos,
1238 /* FUTURE software generic calls go here (done) */
1239 eng_image_map4_draw,
1240 eng_image_map_surface_new,
1241 eng_image_map_surface_free
1242 /* FUTURE software generic calls go here */
1248 ** MODULE ACCESSIBLE API API
1254 module_open(Evas_Module *em)
1257 _evas_soft_gen_log_dom = eina_log_domain_register("EvasSoftGeneric", EVAS_DEFAULT_LOG_COLOR);
1258 if(_evas_soft_gen_log_dom<0)
1260 EINA_LOG_ERR("Evas SoftGen : Impossible to create a log domain for the software generic engine.\n");
1263 em->functions = (void *)(&func);
1264 cpunum = eina_cpu_count();
1269 module_close(Evas_Module *em)
1271 eina_log_domain_unregister(_evas_soft_gen_log_dom);
1274 static Evas_Module_Api evas_modapi =
1276 EVAS_MODULE_API_VERSION,
1285 EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_ENGINE, engine, software_generic);
1287 #ifndef EVAS_STATIC_BUILD_SOFTWARE_GENERIC
1288 EVAS_EINA_MODULE_DEFINE(engine, software_generic);