mirror of
https://github.com/gnustep/libs-back.git
synced 2025-02-23 20:01:22 +00:00
My final GNUstep commit.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@39237 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
cc7fa76c5e
commit
24be840e39
4 changed files with 29 additions and 16 deletions
|
@ -1,3 +1,12 @@
|
|||
2015-12-13 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/opal/OpalFontInfo.m
|
||||
Prevent a compiler warning.
|
||||
* Source/opal/OpalGState.m
|
||||
* Source/opal/OpalSurface.m
|
||||
Correct the bitmap flags used.
|
||||
Add a few missing function calls.
|
||||
|
||||
2015-11-25 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* configure
|
||||
|
|
|
@ -245,7 +245,8 @@ BOOL _cairo_extents_for_NSGlyph(cairo_scaled_font_t *scaled_font, NSGlyph glyph,
|
|||
{
|
||||
CGFontRef face = [_faceInfo fontFace];
|
||||
int advance = 0;
|
||||
CGFontGetGlyphAdvances(face, &glyph, 1, &advance);
|
||||
CGGlyph cgglyph = glyph;
|
||||
CGFontGetGlyphAdvances(face, &cgglyph, 1, &advance);
|
||||
|
||||
CGFloat advanceUserSpace = [self _fontUnitToUserSpace: advance];
|
||||
|
||||
|
|
|
@ -66,18 +66,6 @@ static inline NSPoint _NSPointFromCGPoint(CGPoint cgpoint)
|
|||
{
|
||||
theCopy->_opGState = OPContextCopyGState(cgctx);
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME: perhaps Opal could provide an API for getting the default
|
||||
// gstate?
|
||||
CGColorSpaceRef colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
|
||||
CGContextRef ctx = CGBitmapContextCreate(NULL, 1, 1, 8, 32, colorSpace, kCGImageAlphaPremultipliedFirst);
|
||||
CGColorSpaceRelease(colorSpace);
|
||||
theCopy->_opGState = OPContextCopyGState(ctx);
|
||||
CGContextRelease(ctx);
|
||||
NSDebugLLog(@"OpalGState", @"Included default gstate %p", theCopy->_opGState);
|
||||
}
|
||||
|
||||
return theCopy;
|
||||
}
|
||||
|
||||
|
@ -118,6 +106,7 @@ static inline NSPoint _NSPointFromCGPoint(CGPoint cgpoint)
|
|||
const CGFloat alpha = 1.0; // TODO: is this correct?
|
||||
if (cgctx)
|
||||
{
|
||||
CGContextSetGrayStrokeColor(cgctx, gray, alpha);
|
||||
CGContextSetGrayFillColor(cgctx, gray, alpha);
|
||||
}
|
||||
[super DPSsetgray: gray];
|
||||
|
@ -132,11 +121,25 @@ static inline NSPoint _NSPointFromCGPoint(CGPoint cgpoint)
|
|||
if (cgctx)
|
||||
{
|
||||
CGContextSetRGBStrokeColor(cgctx, r, g, b, alpha);
|
||||
CGContextSetRGBFillColor(CGCTX, r, g, b, alpha);
|
||||
CGContextSetRGBFillColor(cgctx, r, g, b, alpha);
|
||||
}
|
||||
[super DPSsetrgbcolor: r : g : b];
|
||||
}
|
||||
|
||||
- (void) DPSsetcmykcolor: (CGFloat)c : (CGFloat)m : (CGFloat)y : (CGFloat)k
|
||||
{
|
||||
NSDebugLLog(@"OpalGState", @"%p (%@): %s", self, [self class], __PRETTY_FUNCTION__);
|
||||
CGContextRef cgctx = CGCTX;
|
||||
|
||||
const CGFloat alpha = 1.0; // TODO: is this correct?
|
||||
if (cgctx)
|
||||
{
|
||||
CGContextSetCMYKFillColor(cgctx, c, m, y, k, alpha);
|
||||
CGContextSetCMYKStrokeColor(cgctx, c, m, y, k, alpha);
|
||||
}
|
||||
[super DPSsetcmykcolor: c : m : y : k];
|
||||
}
|
||||
|
||||
|
||||
- (void) DPSshow: (const char *)s
|
||||
{
|
||||
|
@ -795,7 +798,7 @@ static inline NSPoint _NSPointFromCGPoint(CGPoint cgpoint)
|
|||
CGDataProviderRef dataProvider = CGDataProviderCreateWithCFData(nsData);
|
||||
CGImageRef img = CGImageCreate(pixelsWide, pixelsHigh, bitsPerSample,
|
||||
bitsPerPixel, bytesPerRow, colorSpace,
|
||||
hasAlpha ? kCGImageAlphaPremultipliedLast : 0 /* correct? */,
|
||||
kCGBitmapByteOrder32Big | (hasAlpha ? kCGImageAlphaPremultipliedLast : 0),
|
||||
dataProvider,
|
||||
NULL, /* const CGFloat decode[] is what? */
|
||||
false, /* shouldInterpolate? */
|
||||
|
|
|
@ -52,7 +52,7 @@ static CGContextRef createCGBitmapContext(int pixelsWide,
|
|||
8, // bits per component
|
||||
bitmapBytesPerRow,
|
||||
colorSpace,
|
||||
kCGImageAlphaPremultipliedLast);
|
||||
kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst);
|
||||
|
||||
// Note: our use of premultiplied alpha means that we need to
|
||||
// do alpha blending using:
|
||||
|
|
Loading…
Reference in a new issue