Replace NSCompositeHighlight with GSCompositeHighlight and map NSCompositeHighlight onto

NSCompositeSourceOver.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@34773 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2012-02-18 21:10:07 +00:00
parent 1f64ded0ca
commit 234ac0932b
6 changed files with 43 additions and 11 deletions

View file

@ -1,3 +1,14 @@
2012-02-18 Fred Kiefer <FredKiefer@gmx.de>
* Source/winlib/WIN32GState.m
* Source/art/composite.m
* Source/xlib/XGGState.m
* Source/xdps/NSDPSContextOps.m: Replace NSCompositeHighlight with
GSCompositeHighlight and map NSCompositeHighlight onto
NSCompositeSourceOver.
* Source/cairo/CairoGState.m (-compositerect:op:): Implement
GSCompositeHighlight with the difference operator.
2012-02-09 Richard Frith-Macdonald <rfm@gnu.org>
* Tools/gbps.m: Add lots of debug information (have objects describe

View file

@ -67,6 +67,7 @@ if necessary. Returns new operation, or -1 it it's a noop. */
case NSCompositeDestinationOver:
case NSCompositeDestinationOut:
case NSCompositeXOR:
case NSCompositeHighlight:
case NSCompositePlusLighter:
return -1; /* noop */
}
@ -79,6 +80,7 @@ if necessary. Returns new operation, or -1 it it's a noop. */
case NSCompositeSourceOver:
case NSCompositeSourceIn:
case NSCompositeSourceAtop:
case NSCompositeHighlight:
return NSCompositeCopy;
case NSCompositeSourceOut:
@ -104,6 +106,7 @@ if necessary. Returns new operation, or -1 it it's a noop. */
switch (op)
{
case NSCompositeSourceOver:
case NSCompositeHighlight:
return NSCompositeCopy;
case NSCompositeSourceIn:
@ -145,6 +148,7 @@ if necessary. Returns new operation, or -1 it it's a noop. */
case NSCompositeSourceOver:
case NSCompositeSourceAtop:
case NSCompositeHighlight:
blit_func = DI.composite_sover_ao;
break;
@ -178,6 +182,7 @@ if necessary. Returns new operation, or -1 it it's a noop. */
switch (op)
{
case NSCompositeSourceOver:
case NSCompositeHighlight:
blit_func = DI.composite_sover_aa;
break;
case NSCompositeSourceIn:
@ -475,7 +480,7 @@ static BOOL _rect_advance(rect_trace_t *t, int *x0, int *x1)
/* these ignore the source window, so we send them off to
compositerect: op: */
if (op == NSCompositeClear || op == NSCompositeHighlight)
if (op == NSCompositeClear || op == GSCompositeHighlight)
{
[self compositerect: NSMakeRect(aPoint.x, aPoint.y,
aRect.size.width, aRect.size.height)
@ -1406,7 +1411,7 @@ static BOOL _rect_advance(rect_trace_t *t, int *x0, int *x1)
memset(dst_alpha, 0, n);
)
}
else if (op == NSCompositeHighlight)
else if (op == GSCompositeHighlight)
{
DO_STUFF(
{

View file

@ -1188,12 +1188,22 @@ _set_op(cairo_t *ct, NSCompositingOperation op)
device_color_t c;
cairo_save(_ct);
_set_op(_ct, op);
c = fillColor;
gsColorToRGB(&c);
// The underlying concept does not allow to determine if alpha is set or not.
cairo_set_source_rgba(_ct, c.field[0], c.field[1], c.field[2], c.field[AINDEX]);
if (GSCompositeHighlight == op)
{
cairo_set_operator(_ct, CAIRO_OPERATOR_DIFFERENCE);
cairo_set_source_rgb(_ct, 1, 1, 1);
}
else
{
_set_op(_ct, op);
c = fillColor;
gsColorToRGB(&c);
// The underlying concept does not allow to determine if alpha is set or not.
cairo_set_source_rgba(_ct, c.field[0], c.field[1], c.field[2], c.field[AINDEX]);
}
// This is almost a rectclip::::, but the path stays unchanged.
path = [NSBezierPath bezierPathWithRect: aRect];
[path transformUsingAffineTransform: ctm];

View file

@ -363,6 +363,7 @@ BOOL alpha_blend_source_over(HDC destDC,
switch (op)
{
case NSCompositeSourceOver:
case NSCompositeHighlight:
{
success = alpha_blend_source_over(hDC,
sourceDC,
@ -420,7 +421,7 @@ BOOL alpha_blend_source_over(HDC destDC,
{
case NSCompositeClear:
break;
case NSCompositeHighlight:
case GSCompositeHighlight:
{
HDC hDC;
RECT rect = GSViewRectToWin(self, aRect);
@ -438,6 +439,7 @@ BOOL alpha_blend_source_over(HDC destDC,
case NSCompositeCopy:
// FIXME
case NSCompositeSourceOver:
case NSCompositeHighlight:
case NSCompositeSourceIn:
case NSCompositeSourceOut:
case NSCompositeSourceAtop:
@ -525,6 +527,7 @@ BOOL alpha_blend_source_over(HDC destDC,
switch (op)
{
case NSCompositeSourceOver:
case NSCompositeHighlight:
{
success = alpha_blend_source_over(hDC,
sourceDC,

View file

@ -1144,6 +1144,7 @@
gcv.function = GXcopy;
break;
case NSCompositeSourceOver:
case NSCompositeHighlight:
gcv.function = GXcopy;
break;
case NSCompositeSourceIn:
@ -1173,7 +1174,7 @@
case NSCompositePlusDarker:
gcv.function = GXcopy;
break;
case NSCompositeHighlight:
case GSCompositeHighlight:
gcv.function = GXxor;
break;
case NSCompositePlusLighter:

View file

@ -674,6 +674,7 @@ static Region emptyRegion;
comp_gcv.function = GXcopy;
break;
case NSCompositeSourceOver:
case NSCompositeHighlight:
CHECK_ALPHA;
if (source_alpha == NO)
do_copy = YES;
@ -737,7 +738,7 @@ static Region emptyRegion;
do_copy = NO;
comp_gcv.function = GXcopy;
break;
case NSCompositeHighlight:
case GSCompositeHighlight:
do_copy = NO;
comp_gcv.function = GXxor;
break;
@ -798,6 +799,7 @@ static Region emptyRegion;
gcv.function = GXcopy;
break;
case NSCompositeSourceOver:
case NSCompositeHighlight:
gcv.function = GXcopy;
break;
case NSCompositeSourceIn:
@ -827,7 +829,7 @@ static Region emptyRegion;
case NSCompositePlusDarker:
gcv.function = GXcopy;
break;
case NSCompositeHighlight:
case GSCompositeHighlight:
gcv.function = GXxor;
break;
case NSCompositePlusLighter: