From: Søren Sandmann Pedersen Date: Mon, 22 Jun 2009 01:32:23 +0000 (-0400) Subject: Move some macros into pixman-access.c X-Git-Tag: 1.0_branch~1016 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=76bf3073d45e184973cfc992d8f366a4a5ed0127;p=profile%2Fivi%2Fpixman.git Move some macros into pixman-access.c --- diff --git a/pixman/pixman-access.c b/pixman/pixman-access.c index b5ce6a2..9506ae7 100644 --- a/pixman/pixman-access.c +++ b/pixman/pixman-access.c @@ -34,6 +34,18 @@ #include "pixman-private.h" +#define CvtR8G8B8toY15(s) (((((s) >> 16) & 0xff) * 153 + \ + (((s) >> 8) & 0xff) * 301 + \ + (((s) ) & 0xff) * 58) >> 2) +#define miCvtR8G8B8to15(s) ((((s) >> 3) & 0x001f) | \ + (((s) >> 6) & 0x03e0) | \ + (((s) >> 9) & 0x7c00)) +#define miIndexToEnt15(mif,rgb15) ((mif)->ent[rgb15]) +#define miIndexToEnt24(mif,rgb24) miIndexToEnt15(mif,miCvtR8G8B8to15(rgb24)) + +#define miIndexToEntY24(mif,rgb24) ((mif)->ent[CvtR8G8B8toY15(rgb24)]) + + #define Red(x) (((x) >> 16) & 0xff) #define Green(x) (((x) >> 8) & 0xff) #define Blue(x) ((x) & 0xff) diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h index 07921b9..6f24c5e 100644 --- a/pixman/pixman-private.h +++ b/pixman/pixman-private.h @@ -373,18 +373,6 @@ _pixman_gradient_walker_pixel (pixman_gradient_walker_t *walker, WRITE(img, (a)+2, (uint8_t) ((v) >> 16)))) #endif -#define CvtR8G8B8toY15(s) (((((s) >> 16) & 0xff) * 153 + \ - (((s) >> 8) & 0xff) * 301 + \ - (((s) ) & 0xff) * 58) >> 2) -#define miCvtR8G8B8to15(s) ((((s) >> 3) & 0x001f) | \ - (((s) >> 6) & 0x03e0) | \ - (((s) >> 9) & 0x7c00)) -#define miIndexToEnt15(mif,rgb15) ((mif)->ent[rgb15]) -#define miIndexToEnt24(mif,rgb24) miIndexToEnt15(mif,miCvtR8G8B8to15(rgb24)) - -#define miIndexToEntY24(mif,rgb24) ((mif)->ent[CvtR8G8B8toY15(rgb24)]) - - #define FbIntMult(a,b,t) ( (t) = (a) * (b) + 0x80, ( ( ( (t)>>8 ) + (t) )>>8 ) ) #define FbIntDiv(a,b) (((uint16_t) (a) * 255) / (b))