简体   繁体   中英

Do I get a big performance penalty when a UIView is below a EAGLView?

I have a EAGLView which has a EAGLLayer as backing-layer. My app is UIKit-based but I want to display a OpenGL-based chart fullscreen. It would be a pain to remove the underlying view, and I just want to display that EAGLView on top of anything else (by adding it as subview to window).

Of course, my EAGLView is opaque. Nothing shines through. I think it would be fine but maybe someone can tell from experience if this is a bad thing to do? Is the system clever enough to detect that the topmost thing is a OpenGL layer and nothing else is on the screen, just ignoring what is below that OpenGL layer?

In terms of CPU I don't think there is a penalty at all IF the EAGLView is %100 opaque. On the other hand, if you don't remove your view from the view stack it will use memory for no good reason.

So, I guess the answer depends on how much space does the view occupy and how intensive is the memory usage and calculations in the EAGLView . You would probably get a big performance penalty if for some reason the view behind is a uitableview with 1000 cells that don't use dequeueReusableCellWithIdentifier , but will get no penalty at all if you have a simple uiview

My honest opinion about this is that you can only find out if you actually try it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM