diff --git a/src/Makefile_Ector.am b/src/Makefile_Ector.am index 11ed70cdf3..fd0810f29f 100644 --- a/src/Makefile_Ector.am +++ b/src/Makefile_Ector.am @@ -40,6 +40,7 @@ lib_LTLIBRARIES += lib/ector/libector.la installed_ectormainheadersdir = $(includedir)/ector-@VMAJ@ dist_installed_ectormainheaders_DATA = \ lib/ector/Ector.h \ +lib/ector/ector_util.h \ lib/ector/cairo/Ector_Cairo.h \ lib/ector/software/Ector_Software.h diff --git a/src/lib/ector/Ector.h b/src/lib/ector/Ector.h index fe8d13c62e..0a53facc20 100644 --- a/src/lib/ector/Ector.h +++ b/src/lib/ector/Ector.h @@ -174,6 +174,7 @@ EAPI int ector_shutdown(void); #include "ector_surface.h" #include "ector_renderer.h" +#include "ector_util.h" #endif diff --git a/src/lib/ector/ector_util.h b/src/lib/ector/ector_util.h new file mode 100644 index 0000000000..664fdb2b6d --- /dev/null +++ b/src/lib/ector/ector_util.h @@ -0,0 +1,13 @@ +#ifndef ECTOR_UTIL_H +# define ECTOR_UTIL_H + +static inline unsigned int +ector_color_multiply(unsigned int c1, unsigned int c2) +{ + return ( ((((((c1) >> 16) & 0xff00) * (((c2) >> 16) & 0xff00)) + 0xff0000) & 0xff000000) + + ((((((c1) >> 8) & 0xff00) * (((c2) >> 16) & 0xff)) + 0xff00) & 0xff0000) + + ((((((c1) & 0xff00) * ((c2) & 0xff00)) + 0xff00) >> 16) & 0xff00) + + (((((c1) & 0xff) * ((c2) & 0xff)) + 0xff) >> 8) ); +} + +#endif