mirror of
https://github.com/gnustep/libs-back.git
synced 2025-04-22 15:31:14 +00:00
Finish rework of composite operators started four years ago.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@28313 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
38a23e2da3
commit
77aaf931f4
7 changed files with 61 additions and 117 deletions
16
ChangeLog
16
ChangeLog
|
@ -1,3 +1,19 @@
|
|||
2009-05-31 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/gsc/GSContext.m (-DPScomposite:...:, -DPSdissolve:...:) Map
|
||||
onto GScomposite:toPoint:fromRect:operation:fraction:.
|
||||
* Source/gsc/GSGState.m (-compositeGState:fromRect:toPoint:op:,
|
||||
-dissolveGState:fromRect:toPoint:delta:) Map onto
|
||||
compositeGState:fromRect:toPoint:op:fraction:.
|
||||
* Source/winlib/WIN32GState.m (-compositeGState:fromRect:toPoint:op:,
|
||||
-dissolveGState:fromRect:toPoint:delta:),
|
||||
* Source/xlib/XGGState.m (-compositeGState:fromRect:toPoint:op:,
|
||||
-dissolveGState:fromRect:toPoint:delta:),
|
||||
* Source/cairo/CairoGState.m (-compositeGState:fromRect:toPoint:op:,
|
||||
-dissolveGState:fromRect:toPoint:delta:): Remove these methods.
|
||||
* Source/art/composite.m
|
||||
(-compositeGState:fromRect:toPoint:op:fraction:): Added.
|
||||
|
||||
2009-05-10 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* Version 0.17.0
|
||||
|
|
|
@ -1200,6 +1200,27 @@ static BOOL _rect_advance(rect_trace_t *t, int *x0, int *x1)
|
|||
UPDATE_UNBUFFERED
|
||||
}
|
||||
|
||||
- (void) compositeGState: (GSGState *)source
|
||||
fromRect: (NSRect)aRect
|
||||
toPoint: (NSPoint)aPoint
|
||||
op: (NSCompositingOperation)op
|
||||
fraction: (float)delta
|
||||
{
|
||||
if (op == NSCompositeSourceOver)
|
||||
{
|
||||
[self dissolveGState: source
|
||||
fromRect: aRect
|
||||
toPoint: aPoint
|
||||
delta: delta];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self compositeGState: source
|
||||
fromRect: aRect
|
||||
toPoint: aPoint
|
||||
op: op];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) compositerect: (NSRect)aRect
|
||||
op: (NSCompositingOperation)op
|
||||
|
|
|
@ -1331,28 +1331,4 @@ _set_op(cairo_t *ct, NSCompositingOperation op)
|
|||
cairo_restore(_ct);
|
||||
}
|
||||
|
||||
- (void) compositeGState: (CairoGState *)source
|
||||
fromRect: (NSRect)aRect
|
||||
toPoint: (NSPoint)aPoint
|
||||
op: (NSCompositingOperation)op
|
||||
{
|
||||
[self compositeGState: source
|
||||
fromRect: aRect
|
||||
toPoint: aPoint
|
||||
op: op
|
||||
fraction: 1.0];
|
||||
}
|
||||
|
||||
- (void) dissolveGState: (CairoGState *)source
|
||||
fromRect: (NSRect)aRect
|
||||
toPoint: (NSPoint)aPoint
|
||||
delta: (float)delta
|
||||
{
|
||||
[self compositeGState: source
|
||||
fromRect: aRect
|
||||
toPoint: aPoint
|
||||
op: NSCompositeSourceOver
|
||||
fraction: delta];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -778,20 +778,11 @@ static NSMapTable *gtable;
|
|||
- (void) DPScomposite: (float)x : (float)y : (float)w : (float)h
|
||||
: (int)gstateNum : (float)dx : (float)dy : (int)op
|
||||
{
|
||||
NSRect rect;
|
||||
NSPoint p;
|
||||
GSGState *g = gstate;
|
||||
|
||||
if (gstateNum)
|
||||
{
|
||||
[self DPSexecuserobject: gstateNum];
|
||||
ctxt_pop(g, opstack, GSGState);
|
||||
}
|
||||
|
||||
rect = NSMakeRect(x, y, w, h);
|
||||
p = NSMakePoint(dx, dy);
|
||||
|
||||
[gstate compositeGState: g fromRect: rect toPoint: p op: op];
|
||||
[self GScomposite: gstateNum
|
||||
toPoint: NSMakePoint(dx, dy)
|
||||
fromRect: NSMakeRect(x, y, w, h)
|
||||
operation: op
|
||||
fraction: 1.0];
|
||||
}
|
||||
|
||||
- (void) DPScompositerect: (float)x : (float)y : (float)w : (float)h : (int)op
|
||||
|
@ -802,20 +793,11 @@ static NSMapTable *gtable;
|
|||
- (void) DPSdissolve: (float)x : (float)y : (float)w : (float)h
|
||||
: (int)gstateNum : (float)dx : (float)dy : (float)delta
|
||||
{
|
||||
NSRect rect;
|
||||
NSPoint p;
|
||||
GSGState *g = gstate;
|
||||
|
||||
if (gstateNum)
|
||||
{
|
||||
[self DPSexecuserobject: gstateNum];
|
||||
ctxt_pop(g, opstack, GSGState);
|
||||
}
|
||||
|
||||
rect = NSMakeRect(x, y, w, h);
|
||||
p = NSMakePoint(dx, dy);
|
||||
|
||||
[gstate dissolveGState: g fromRect: rect toPoint: p delta: delta];
|
||||
[self GScomposite: gstateNum
|
||||
toPoint: NSMakePoint(dx, dy)
|
||||
fromRect: NSMakeRect(x, y, w, h)
|
||||
operation: NSCompositeSourceOver
|
||||
fraction: delta];
|
||||
}
|
||||
|
||||
- (void) GScomposite: (int)gstateNum
|
||||
|
|
|
@ -138,20 +138,31 @@
|
|||
ASSIGN(pattern, image);
|
||||
}
|
||||
|
||||
// This is only a fall back, the method should not be called any more.
|
||||
- (void) compositeGState: (GSGState *)source
|
||||
fromRect: (NSRect)aRect
|
||||
toPoint: (NSPoint)aPoint
|
||||
op: (NSCompositingOperation)op
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
[self compositeGState: source
|
||||
fromRect: aRect
|
||||
toPoint: aPoint
|
||||
op: op
|
||||
fraction: 1.0];
|
||||
|
||||
}
|
||||
|
||||
// This is only a fall back, the method should not be called any more.
|
||||
- (void) dissolveGState: (GSGState *)source
|
||||
fromRect: (NSRect)aRect
|
||||
toPoint: (NSPoint)aPoint
|
||||
delta: (float)delta
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
[self compositeGState: source
|
||||
fromRect: aRect
|
||||
toPoint: aPoint
|
||||
op: NSCompositeSourceOver
|
||||
fraction: delta];
|
||||
}
|
||||
|
||||
- (void) compositeGState: (GSGState *)source
|
||||
|
@ -160,21 +171,7 @@
|
|||
op: (NSCompositingOperation)op
|
||||
fraction: (float)delta
|
||||
{
|
||||
if (op == NSCompositeSourceOver)
|
||||
{
|
||||
[self dissolveGState: source
|
||||
fromRect: aRect
|
||||
toPoint: aPoint
|
||||
delta: delta];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self compositeGState: source
|
||||
fromRect: aRect
|
||||
toPoint: aPoint
|
||||
op: op];
|
||||
}
|
||||
|
||||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
- (void) compositerect: (NSRect)aRect
|
||||
|
|
|
@ -282,30 +282,6 @@ RECT GSViewRectToWin(WIN32GState *s, NSRect r)
|
|||
[source releaseHDC: sourceDC];
|
||||
}
|
||||
|
||||
- (void) compositeGState: (GSGState *)source
|
||||
fromRect: (NSRect)aRect
|
||||
toPoint: (NSPoint)aPoint
|
||||
op: (NSCompositingOperation)op
|
||||
{
|
||||
[self compositeGState: (WIN32GState *) source
|
||||
fromRect: aRect
|
||||
toPoint: aPoint
|
||||
op: op
|
||||
fraction: 1.0];
|
||||
}
|
||||
|
||||
- (void) dissolveGState: (GSGState *)source
|
||||
fromRect: (NSRect)aRect
|
||||
toPoint: (NSPoint)aPoint
|
||||
delta: (float)delta
|
||||
{
|
||||
[self compositeGState: (WIN32GState *) source
|
||||
fromRect: aRect
|
||||
toPoint: aPoint
|
||||
op: NSCompositeSourceOver
|
||||
fraction: delta];
|
||||
}
|
||||
|
||||
- (void) compositerect: (NSRect)aRect
|
||||
op: (NSCompositingOperation)op
|
||||
{
|
||||
|
|
|
@ -771,30 +771,6 @@ static Region emptyRegion;
|
|||
}
|
||||
}
|
||||
|
||||
- (void) compositeGState: (GSGState *)source
|
||||
fromRect: (NSRect)aRect
|
||||
toPoint: (NSPoint)aPoint
|
||||
op: (NSCompositingOperation)op
|
||||
{
|
||||
[self compositeGState: source
|
||||
fromRect: aRect
|
||||
toPoint: aPoint
|
||||
op: op
|
||||
fraction: 1.0];
|
||||
}
|
||||
|
||||
- (void) dissolveGState: (GSGState *)source
|
||||
fromRect: (NSRect)aRect
|
||||
toPoint: (NSPoint)aPoint
|
||||
delta: (float)delta
|
||||
{
|
||||
[self compositeGState: source
|
||||
fromRect: aRect
|
||||
toPoint: aPoint
|
||||
op: NSCompositeSourceOver
|
||||
fraction: delta];
|
||||
}
|
||||
|
||||
- (void) compositerect: (NSRect)aRect
|
||||
op: (NSCompositingOperation)op
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue