屏幕外的图形操作会产生处理开销吗?
我正在尝试优化应用程序的一些图形例程,并且我想知道是否是离屏动画(例如,[object startAnimating])或只是通过设置其矩形(离屏)来简单移动 UIImageView,有任何处理器开销,或者它们在屏幕外时是否被忽略?
非常感谢您的帮助。
I'm trying to optimise some graphical routines for an app, and I'd like to know if off-screen animations (eg, [object startAnimating]) or just plain moving of a UIImageView by setting its rect (off-screen), have any processor overhead, or are they somehow ignored when off-screen?
Many thanks for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
(1) 如果涉及改变屏幕上的像素,则存在开销。
(2) 如果涉及到在屏幕外做一些最终会出现在屏幕上的事情,就会产生开销。
(3) 如果涉及到做一些永远不会出现在屏幕上的事情,你为什么要这么做?
不过,最后一个有点尖酸刻薄。有时,您确实需要以某种方式维护相对可视的状态,然后您可以从中检索信息,即使它不是可视的。不过,数量很少且相距甚远。在不了解您的情况的情况下,很难说。
(1) If it involves changing pixels on the screen, there is overhead.
(2) If it involves doing something off screen that'll eventually be on screen, there is overhead.
(3) If it involves doing something that'll never be on screen, why are you doing it in the first place?
That last one, though, is very slightly snarky. Sometimes, you do need to maintain relatively visual state in a fashion that you can then retrieve information from, even though it isn't visual. Pretty few and far between, though. Without knowing more about your situation, hard to say.