Fix handling of NSCompositeCopy.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@18330 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2004-01-07 14:05:11 +00:00
parent 4c86b44b9c
commit 27190e1de4
2 changed files with 28 additions and 13 deletions

View file

@ -1,3 +1,13 @@
2004-01-07 14:51 Alexander Malmberg <alexander@malmberg.org>
* Source/art/composite.m (-_composite_func::::::): If the source has
alpha, the destination is opaque, and the operator is NSCompositeCopy,
set dst_needs_alpha to YES.
(-compositerect:op:): If alpha is needed, make sure alpha is always
created _before_ setting up the alpha destination pointers. Only
write alpha for NSCompositeCopy if the current color isn't opaque.
2004-01-07 Fred Kiefer <FredKiefer@gmx.de>
Added missing .cvsignore files and extended the existing ones.

View file

@ -137,6 +137,10 @@ if necessary. Returns new operation, or -1 it it's a noop. */
{ /* source has alpha, destination is opaque */
switch (op)
{
case NSCompositeCopy:
*dst_needs_alpha = YES;
break;
case NSCompositeSourceOver:
case NSCompositeSourceAtop:
blit_func = DI.composite_sover_ao;
@ -1407,25 +1411,26 @@ static BOOL _rect_advance(rect_trace_t *t, int *x0, int *x1)
ri.r = (fill_color[0] * ri.a + 0xff) >> 8;
ri.g = (fill_color[1] * ri.a + 0xff) >> 8;
ri.b = (fill_color[2] * ri.a + 0xff) >> 8;
if (ri.a != 255)
[wi needsAlpha];
if (!wi->has_alpha)
if (ri.a != 255 && !wi->has_alpha)
return;
DO_STUFF(
ri.dst = dst;
DI.render_run_opaque(&ri, n);
if (DI.inline_alpha)
if (ri.a != 255)
{
/* TODO: needs to change to support inline
alpha for non-32-bit modes */
unsigned char *p;
for (p = dst; n; n--, p += 4)
p[DI.inline_alpha_ofs] = ri.a;
}
else
{
memset(dst_alpha, ri.a, n);
if (DI.inline_alpha)
{
/* TODO: needs to change to support inline
alpha for non-32-bit modes */
unsigned char *p;
for (p = dst; n; n--, p += 4)
p[DI.inline_alpha_ofs] = ri.a;
}
else
{
memset(dst_alpha, ri.a, n);
}
}
)
}