[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[E-devel] The big evas premul move.

	Well long overdue, and could use much more testing.. but
I may as well send this for others to check and test if they wish :)

	We've mentioned what this 'evas premul' move means before,
so I won't repeat it here, but anyone with any questions please feel
free to ask.

	There are new utility api functs for helping one to convert
to/fro premul colors and data - should you need to do so:

   EAPI void evas_color_argb_premul(int a, int *r, int *g, int *b);
   EAPI void evas_color_argb_unpremul(int a, int *r, int *g, int *b);

   EAPI void evas_data_argb_premul(unsigned int *data,
                                   unsigned int len);
   EAPI void evas_data_argb_unpremul(unsigned int *data,
                                     unsigned int len);

	The main api changes (besides the semantic change in color,
and image data) involve gradients, since they are most directly
affected.. and also since I've made further grad changes in order
to better address the issues that rephorm encountered with grads in
edje. In fact, since we're breaking things and grads are only now
starting to really be used, I thought an overhaul of the grad api
might be in order.. and here is the full grad api (only the 'set'
funcs here) that I'd suggest:

   EAPI Evas_Object *evas_object_gradient_add(Evas *e);

   EAPI void evas_object_gradient_color_stop_add(Evas_Object *obj,
int r, int g, int b, int a, int delta);

   EAPI void evas_object_gradient_alpha_stop_add(Evas_Object *obj,
int a, int delta);

   EAPI void evas_object_gradient_color_data_set(Evas_Object *obj,
void *color_data, int len, Evas_Bool has_alpha);

   EAPI void evas_object_gradient_alpha_data_set(Evas_Object *obj,
void *alpha_data, int len);

   EAPI void evas_object_gradient_clear(Evas_Object *obj);

   EAPI void evas_object_gradient_type_set(Evas_Object *obj,
const char *type, const char *instance_params);

   EAPI void evas_object_gradient_fill_set(Evas_Object *obj,
Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);

   EAPI void evas_object_gradient_fill_angle_set(Evas_Object *obj,
Evas_Angle angle);

   EAPI void evas_object_gradient_fill_spread_set(Evas_Object *obj,
int tile_mode);

   EAPI void evas_object_gradient_angle_set(Evas_Object *obj,
Evas_Angle angle);

   EAPI void evas_object_gradient_direction_set(Evas_Object *obj,
int direction);

   EAPI void evas_object_gradient_offset_set(Evas_Object *obj,
float offset);

	I've also added two new linear grad types, "linear.diag"
and "linear.codiag", in order to make working with linear grads
more flexible.

	I've attached the evas-premul diff (rather largish but so
it was) with the new grad api. It won't work with edje of course,
and edje and others need to make sure to 'move' to premul data and
colors as well. The grad api changes are ony a suggestion.. it's
easy enough to chamge to whatever people feel would be best.. but
at this point it would seem like a good idea to get it as logical
and useful as possible.

	Feel free to take your time and experiment with this evas-
premul if you wish, and let me know of any issues, comments, problems,
etc... that you may find.