1
0
Fork 0

(svn r13721) -Codechange: one less multiplication for colour mixing in 32bpp blitters (GeekToo)

release/0.7
smatz 2008-07-17 23:43:47 +00:00
parent 6e1aaa2c69
commit 69cb2f088f
1 changed files with 4 additions and 11 deletions

View File

@ -54,9 +54,9 @@ public:
/* The 256 is wrong, it should be 255, but 256 is much faster... */ /* The 256 is wrong, it should be 255, but 256 is much faster... */
return ComposeColour(0xFF, return ComposeColour(0xFF,
(r * a + cr * (256 - a)) / 256, ((int)(r - cr) * a) / 256 + cr,
(g * a + cg * (256 - a)) / 256, ((int)(g - cg) * a) / 256 + cg,
(b * a + cb * (256 - a)) / 256); ((int)(b - cb) * a) / 256 + cb);
} }
/** /**
@ -79,15 +79,8 @@ public:
uint r = GB(colour, 16, 8); uint r = GB(colour, 16, 8);
uint g = GB(colour, 8, 8); uint g = GB(colour, 8, 8);
uint b = GB(colour, 0, 8); uint b = GB(colour, 0, 8);
uint cr = GB(current, 16, 8);
uint cg = GB(current, 8, 8);
uint cb = GB(current, 0, 8);
/* The 256 is wrong, it should be 255, but 256 is much faster... */ return ComposeColourRGBANoCheck(r, g, b, a, current);
return ComposeColour(0xFF,
(r * a + cr * (256 - a)) / 256,
(g * a + cg * (256 - a)) / 256,
(b * a + cb * (256 - a)) / 256);
} }
/** /**