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:
fredkiefer 2012-02-18 21:10:07 +00:00
parent 48b00f0cab
commit a6d81f4df2
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> 2012-02-09 Richard Frith-Macdonald <rfm@gnu.org>
* Tools/gbps.m: Add lots of debug information (have objects describe * 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 NSCompositeDestinationOver:
case NSCompositeDestinationOut: case NSCompositeDestinationOut:
case NSCompositeXOR: case NSCompositeXOR:
case NSCompositeHighlight:
case NSCompositePlusLighter: case NSCompositePlusLighter:
return -1; /* noop */ return -1; /* noop */
} }
@ -79,6 +80,7 @@ if necessary. Returns new operation, or -1 it it's a noop. */
case NSCompositeSourceOver: case NSCompositeSourceOver:
case NSCompositeSourceIn: case NSCompositeSourceIn:
case NSCompositeSourceAtop: case NSCompositeSourceAtop:
case NSCompositeHighlight:
return NSCompositeCopy; return NSCompositeCopy;
case NSCompositeSourceOut: case NSCompositeSourceOut:
@ -104,6 +106,7 @@ if necessary. Returns new operation, or -1 it it's a noop. */
switch (op) switch (op)
{ {
case NSCompositeSourceOver: case NSCompositeSourceOver:
case NSCompositeHighlight:
return NSCompositeCopy; return NSCompositeCopy;
case NSCompositeSourceIn: case NSCompositeSourceIn:
@ -145,6 +148,7 @@ if necessary. Returns new operation, or -1 it it's a noop. */
case NSCompositeSourceOver: case NSCompositeSourceOver:
case NSCompositeSourceAtop: case NSCompositeSourceAtop:
case NSCompositeHighlight:
blit_func = DI.composite_sover_ao; blit_func = DI.composite_sover_ao;
break; break;
@ -178,6 +182,7 @@ if necessary. Returns new operation, or -1 it it's a noop. */
switch (op) switch (op)
{ {
case NSCompositeSourceOver: case NSCompositeSourceOver:
case NSCompositeHighlight:
blit_func = DI.composite_sover_aa; blit_func = DI.composite_sover_aa;
break; break;
case NSCompositeSourceIn: 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 /* these ignore the source window, so we send them off to
compositerect: op: */ compositerect: op: */
if (op == NSCompositeClear || op == NSCompositeHighlight) if (op == NSCompositeClear || op == GSCompositeHighlight)
{ {
[self compositerect: NSMakeRect(aPoint.x, aPoint.y, [self compositerect: NSMakeRect(aPoint.x, aPoint.y,
aRect.size.width, aRect.size.height) 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); memset(dst_alpha, 0, n);
) )
} }
else if (op == NSCompositeHighlight) else if (op == GSCompositeHighlight)
{ {
DO_STUFF( DO_STUFF(
{ {

View file

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

View file

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

View file

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

View file

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