mirror of
https://github.com/gnustep/libs-back.git
synced 2025-05-31 01:11:00 +00:00
* Headers/gsc/GSGState.h
* Source/gsc/GSContext.m * Source/gsc/GSGState.m * Source/cairo/CairoGState.m Implement per gstate methods for antialias, patternPhase and compositingOperation. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@39026 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2b19c384ca
commit
6f2916e9e5
5 changed files with 81 additions and 3 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2015-10-03 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Headers/gsc/GSGState.h
|
||||||
|
* Source/gsc/GSContext.m
|
||||||
|
* Source/gsc/GSGState.m
|
||||||
|
* Source/cairo/CairoGState.m
|
||||||
|
Implement per gstate methods for antialias, patternPhase and
|
||||||
|
compositingOperation.
|
||||||
|
|
||||||
2015-09-20 Fred Kiefer <FredKiefer@gmx.de>
|
2015-09-20 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Source/cairo/CairoGState.m: Preliminary support for anti alias
|
* Source/cairo/CairoGState.m: Preliminary support for anti alias
|
||||||
|
|
|
@ -69,6 +69,9 @@ typedef enum {
|
||||||
NSAffineTransform *textCtm; /* Text transform - concat with ctm */
|
NSAffineTransform *textCtm; /* Text transform - concat with ctm */
|
||||||
GSTextDrawingMode textMode;
|
GSTextDrawingMode textMode;
|
||||||
BOOL viewIsFlipped;
|
BOOL viewIsFlipped;
|
||||||
|
BOOL _antialias;
|
||||||
|
NSPoint _patternPhase;
|
||||||
|
NSCompositingOperation _compositingOperation;
|
||||||
}
|
}
|
||||||
|
|
||||||
- initWithDrawContext: (GSContext *)context;
|
- initWithDrawContext: (GSContext *)context;
|
||||||
|
@ -80,6 +83,13 @@ typedef enum {
|
||||||
- (void) setColor: (device_color_t *)color state: (color_state_t)cState;
|
- (void) setColor: (device_color_t *)color state: (color_state_t)cState;
|
||||||
- (void) GSSetPatterColor: (NSImage*)image;
|
- (void) GSSetPatterColor: (NSImage*)image;
|
||||||
|
|
||||||
|
- (void) setShouldAntialias: (BOOL)antialias;
|
||||||
|
- (BOOL) shouldAntialias;
|
||||||
|
- (NSPoint) patternPhase;
|
||||||
|
- (void) setPatternPhase: (NSPoint)phase;
|
||||||
|
- (NSCompositingOperation) compositingOperation;
|
||||||
|
- (void) setCompositingOperation:(NSCompositingOperation) operation;
|
||||||
|
|
||||||
- (void) compositeGState: (GSGState *)source
|
- (void) compositeGState: (GSGState *)source
|
||||||
fromRect: (NSRect)aRect
|
fromRect: (NSRect)aRect
|
||||||
toPoint: (NSPoint)aPoint
|
toPoint: (NSPoint)aPoint
|
||||||
|
|
|
@ -723,8 +723,7 @@ static inline cairo_filter_t cairoFilterFromNSImageInterpolation(NSImageInterpol
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// FIXME: Should be part of the state
|
cairo_set_antialias(_ct, [self shouldAntialias] ? CAIRO_ANTIALIAS_DEFAULT : CAIRO_ANTIALIAS_NONE);
|
||||||
cairo_set_antialias(_ct, [drawcontext shouldAntialias] ? CAIRO_ANTIALIAS_DEFAULT : CAIRO_ANTIALIAS_NONE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) DPSclip
|
- (void) DPSclip
|
||||||
|
|
|
@ -254,6 +254,36 @@ static NSMapTable *gtable;
|
||||||
return gstate;
|
return gstate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) setShouldAntialias: (BOOL)antialias
|
||||||
|
{
|
||||||
|
[gstate setShouldAntialias: antialias];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL) shouldAntialias
|
||||||
|
{
|
||||||
|
return [gstate shouldAntialias];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSPoint) patternPhase
|
||||||
|
{
|
||||||
|
return [gstate patternPhase];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setPatternPhase: (NSPoint)phase
|
||||||
|
{
|
||||||
|
[gstate setPatternPhase: phase];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSCompositingOperation) compositingOperation
|
||||||
|
{
|
||||||
|
return [gstate compositingOperation];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setCompositingOperation: (NSCompositingOperation)operation
|
||||||
|
{
|
||||||
|
[gstate setCompositingOperation: operation];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation GSContext (Ops)
|
@implementation GSContext (Ops)
|
||||||
|
|
|
@ -143,6 +143,36 @@
|
||||||
ASSIGN(pattern, image);
|
ASSIGN(pattern, image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) setShouldAntialias: (BOOL)antialias
|
||||||
|
{
|
||||||
|
_antialias = antialias;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL) shouldAntialias
|
||||||
|
{
|
||||||
|
return _antialias;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSPoint) patternPhase
|
||||||
|
{
|
||||||
|
return _patternPhase;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setPatternPhase: (NSPoint)phase
|
||||||
|
{
|
||||||
|
_patternPhase = phase;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSCompositingOperation) compositingOperation
|
||||||
|
{
|
||||||
|
return _compositingOperation;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setCompositingOperation: (NSCompositingOperation)operation
|
||||||
|
{
|
||||||
|
_compositingOperation = operation;
|
||||||
|
}
|
||||||
|
|
||||||
// This is only a fall back, the method should not be called any more.
|
// This is only a fall back, the method should not be called any more.
|
||||||
- (void) compositeGState: (GSGState *)source
|
- (void) compositeGState: (GSGState *)source
|
||||||
fromRect: (NSRect)aRect
|
fromRect: (NSRect)aRect
|
||||||
|
@ -1285,7 +1315,7 @@ typedef enum {
|
||||||
[ictm invert];
|
[ictm invert];
|
||||||
|
|
||||||
size = [color_pattern size];
|
size = [color_pattern size];
|
||||||
patternPhase = [drawcontext patternPhase];
|
patternPhase = [self patternPhase];
|
||||||
|
|
||||||
if (!NSEqualPoints(patternPhase, NSZeroPoint))
|
if (!NSEqualPoints(patternPhase, NSZeroPoint))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue