CIContext and performance differences
CIContext and performance differences
- Subject: CIContext and performance differences
- From: Allan Hsu <email@hidden>
- Date: Mon, 23 May 2005 15:29:02 -0700
I've written a custom view that draws CIImage objects. At the moment,
this is how I grab my CIContext:
NSGraphicsContext *currentContext = [NSGraphicsContext currentContext];
CIContext *coreContext = [currentContext CIContext];
I tried creating my CIContext using this alternate method:
CGContextRef cgContext = [[NSGraphicsContext currentContext]
graphicsPort];
CIContext *coreContext = [CIContext contextWithCGContext:cgContext
options:nil];
as well as this:
CGContextRef cgContext = [[NSGraphicsContext currentContext]
graphicsPort];
NSDictionary *contextOptions = [NSDictionary
dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO],
@"kCIContextUseSoftwareRenderer", nil];
CIContext *coreContext = [CIContext contextWithCGContext:cgContext
options:contextOptions];
(and one more time, passing YES in for the
kCIContextUseSoftwareRenderer option)
In every case that I've used the contextWithCGContext method to
obtain my CIContext, I've noticed a significant drop in CIImage
drawing speed and an increase in CPU usage. Passing YES or NO in for
kCIContextUseSoftwareRenderer doesn't seem to change this. I can't
seem to find any in the documentation regarding the difference
between these two different methods for creating a CIContext from the
current NSGraphicsContext. Does anybody know if this is intended
behaviour?
-Allan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden