I am trying to draw a static CIImage using the CIContext drawImage in drawRect from GLKView, however I get about 4 frames per second. Suggestions for improvement?
// init code self.backgroundColor = UIColor.black; self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB(); self.ciContext = [CIContext contextWithEAGLContext:self.context options:@{ kCIContextOutputColorSpace: (__bridge id)cs, kCIContextWorkingColorSpace: (__bridge id)cs }]; self.drawableColorFormat = GLKViewDrawableColorFormatRGBA8888; self.drawableDepthFormat = GLKViewDrawableDepthFormatNone; self.drawableMultisample = GLKViewDrawableMultisampleNone; self.drawableStencilFormat = GLKViewDrawableStencilFormatNone; // draw code - (void) drawRect:(CGRect)r { // Clears the screen to a black color glClearColor(0.0, 0.0, 0.0, 1.0); glClear(GL_COLOR_BUFFER_BIT); glEnable(GL_BLEND); glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); [self.ciContext drawImage:self.ciImage inRect:self.bounds fromRect:self.bounds]; }
No one has answered this question yet.
See related questions:
Source: https://habr.com/ru/post/1496675/More articles:Can I rename an iOS application in only one language? - iosAuthenticating domain users in Windows Store apps? - authenticationRun a post-build script with brunch - brunchConvert simple Python code to Java method - javaContentPresenter.Content Memory Leak - .netCheck for installed applications - androidList of all routes from the application using Zend Framework 2 - zend-framework2ServiceStack returns JSV instead of JSON - servicestackBootstrap 3.0.0 breaks datepicker icon - jqueryWhat will be faster - plugin, html or shortcode? - performanceAll Articles