当 UIView 低于 EAGLView 时,我的性能是否会受到很大影响?
我有一个 EAGLView,它有一个 EAGLLayer 作为支持层。我的应用程序基于 UIKit,但我想全屏显示基于 OpenGL 的图表。删除底层视图会很痛苦,我只想将 EAGLView 显示在其他任何内容之上(通过将其作为子视图添加到窗口)。
当然,我的 EAGLView 是不透明的。没有什么东西能透出来。我认为这很好,但也许有人可以根据经验判断这是否是一件坏事?系统是否足够聪明,能够检测到最上面的是 OpenGL 层,屏幕上没有其他东西,而忽略 OpenGL 层下面的内容?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
就 CPU 而言,如果 EAGLView 是 %100 不透明,我认为根本不会有任何损失。另一方面,如果您不从视图堆栈中删除视图,它将无缘无故地使用内存。
所以,我想答案取决于视图占用了多少空间以及 EAGLView 中的内存使用和计算的强度。如果由于某种原因,后面的视图是一个包含 1000 个单元格的
uitableview
,并且不使用dequeueReusableCellWithIdentifier
,那么您可能会受到很大的性能损失,但如果你有一个简单的uiview
我对此的诚实看法是,只有你真正尝试过才能知道。
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 auitableview
with 1000 cells that don't usedequeueReusableCellWithIdentifier
, but will get no penalty at all if you have a simpleuiview
My honest opinion about this is that you can only find out if you actually try it.