ios - CIContext drawImage is very slow -
i trying draw static ciimage using cicontext drawimage in drawrect of glkview, getting 4 frames per second. suggestions 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 screen 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]; }
Comments
Post a Comment