summaryrefslogtreecommitdiff
path: root/src/lib/evas/include/evas_common_private.h
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-01-31 14:50:52 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-01-31 23:01:50 +0900
commita909ca1f68e178f54c5cc047ddff79d25b2c34c6 (patch)
treeb4f604ded3a6d03f115b42aa62640a261f045401 /src/lib/evas/include/evas_common_private.h
parentb38c610c7e60cbdcb45fd6d27450e39e3a9c9dd1 (diff)
evas draw context - reduce size and allocations and frees
so a little perf fun shows malloc/free/realloc/etc. are, combined a reasonable overhead. this reduced malloc overhead for draw contexts so whne we duplicate them or create new ones, we re-use a small cache of 8 of them to avoid re-allocation. just take the first one from the list as it really is that simple. mempool would not have helped more here and cost more overhead. @optimize
Diffstat (limited to 'src/lib/evas/include/evas_common_private.h')
-rw-r--r--src/lib/evas/include/evas_common_private.h55
1 files changed, 26 insertions, 29 deletions
diff --git a/src/lib/evas/include/evas_common_private.h b/src/lib/evas/include/evas_common_private.h
index d52dec5fb3..b256318dbd 100644
--- a/src/lib/evas/include/evas_common_private.h
+++ b/src/lib/evas/include/evas_common_private.h
@@ -744,50 +744,47 @@ struct _Evas_Common_Transform
744struct _RGBA_Draw_Context 744struct _RGBA_Draw_Context
745{ 745{
746 struct { 746 struct {
747 Eina_Bool use : 1; 747 struct {
748 DATA32 col; 748 void *(*gl_new) (void *data, RGBA_Font_Glyph *fg);
749 } mul; 749 void (*gl_free) (void *ext_dat);
750 void (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y);
751 void *(*gl_image_new_from_data) (void *gc, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, Evas_Colorspace cspace);
752 void (*gl_image_free) (void *image);
753 void (*gl_image_draw) (void *gc, void *im, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int smooth);
754 } func;
755 void *data;
756 } font_ext;
750 struct { 757 struct {
751#ifdef HAVE_PIXMAN 758 int x, y, w, h;
752 pixman_image_t *pixman_color_image; 759 } cutout_target;
753#endif
754 DATA32 col;
755 } col;
756 struct RGBA_Draw_Context_clip { 760 struct RGBA_Draw_Context_clip {
757 int x, y, w, h;
758 Evas_Public_Data *evas; // for async unref 761 Evas_Public_Data *evas; // for async unref
759 void *mask; // RGBA_Image (SW) or Evas_GL_Image (GL) 762 void *mask; // RGBA_Image (SW) or Evas_GL_Image (GL)
763 int x, y, w, h;
760 int mask_x, mask_y; 764 int mask_x, mask_y;
761 Eina_Bool use : 1; 765 Eina_Bool use : 1;
762 Eina_Bool async : 1; 766 Eina_Bool async : 1;
763 } clip; 767 } clip;
768 struct {
769#ifdef HAVE_PIXMAN
770 pixman_image_t *pixman_color_image;
771#endif
772 DATA32 col;
773 } col;
764 Cutout_Rects cutout; 774 Cutout_Rects cutout;
765 struct { 775 struct {
766 int x, y, w, h; 776 DATA32 col;
767 } cutout_target; 777 Eina_Bool use : 1;
778 } mul;
768 struct { 779 struct {
769 Cutout_Rects *rects; 780 Cutout_Rects *rects;
770 int used; 781 unsigned int used;
771 } cache; 782 } cache;
772 struct { 783 struct {
773 struct { 784 unsigned char color_space;
774 void *(*gl_new) (void *data, RGBA_Font_Glyph *fg);
775 void (*gl_free) (void *ext_dat);
776 void (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y);
777 void *(*gl_image_new_from_data) (void *gc, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, Evas_Colorspace cspace);
778 void (*gl_image_free) (void *image);
779 void (*gl_image_draw) (void *gc, void *im, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int smooth);
780 } func;
781 void *data;
782 } font_ext;
783 struct {
784 int color_space;
785 } interpolation; 785 } interpolation;
786 struct { 786 unsigned char render_op;
787 int y, h; 787 unsigned char anti_alias : 1;
788 } sli;
789 int render_op;
790 Eina_Bool anti_alias : 1;
791}; 788};
792 789
793#ifdef BUILD_PIPE_RENDER 790#ifdef BUILD_PIPE_RENDER