Oapl: Add OPContextGetAlpha

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/opal/trunk@37181 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
ericwa 2013-10-01 23:31:53 +00:00
parent b5b4afdc87
commit 8269adcc02
3 changed files with 27 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2013-10-01 Eric Wasylishen <ewasylishen@gmail.com>
* Headers/CoreGraphics/CGContext.h:
* Source/OpalGraphics/CGContext.m: Add OPContextGetAlpha
2013-09-29 Fred Kiefer <FredKiefer@gmx.de>
* Source/OpalGraphics/CGBitmapContext.m:

View File

@ -555,6 +555,8 @@ CGRect CGContextConvertRectToUserSpace(CGContextRef ctx, CGRect rect);
// FIXME: Move extensions to a separate header?
CGFloat OPContextGetAlpha(CGContextRef ctx);
void OPContextSetScaleFactor(CGContextRef ctx, CGFloat scale);
void OPContextSetSize(CGContextRef ctx, CGSize size);

View File

@ -1055,6 +1055,26 @@ void CGContextClipToMask(CGContextRef ctx, CGRect rect, CGImageRef mask)
OPRESTORELOGGING()
}
CGFloat OPContextGetAlpha(CGContextRef ctx)
{
OPLOGCALL("ctx /*%p*/", ctx)
if(!ctx || !ctx->add)
{
NSLog(@"null %s%s%s in %s",
!ctx ? "ctx" : "",
(!ctx && !ctx->add) ? " and " : "",
!ctx->add ? "ctx->add" : "",
__PRETTY_FUNCTION__);
return 0;
}
CGFloat result = ctx->add->alpha;
OPRESTORELOGGING()
return result;
}
void OPContextResetClip(CGContextRef ctx)
{
OPLOGCALL("ctx /*%p*/", ctx)