CoreAnimation性能分析-使用CAShapeLayer的CAReplicatorLayer [英] CoreAnimation performance profiling - CAReplicatorLayer with CAShapeLayer
问题描述
我正在制作一个依赖CoreAnimation的应用程序。它具有一个CAReplicatorLayer和一个CAShapeLayer作为子层。
当具有12个复制然后动画化路径(在touchMoved上更改路径)时,一旦图形在屏幕上变大(约12-20 fps),FPS就会大大降低。
I'm making an app that relies on CoreAnimation. It has got a CAReplicatorLayer and as a sublayer a CAShapeLayer. When having 12 replications and then animating the path (changing it on touchMoved) there's a significant reduction in FPS once the graphics get bigger on screen (about 12-20 fps).
时间分析器显示大约10%的CPU使用率,Open GL ES驱动程序分析器报告大约90-97%的渲染使用率和40-50%的 Tiler使用率。
The time profiler shows about 10 % CPU Utilization, the Open GL ES Driver profiler reports about 90-97% "Render Utilization" and 40-50 % "Tiler Utilization".
本指南解释了这两个词,但没有详细介绍。谁能解释这两个到底是什么?
Apple Docs
This guide explains these two words but not to a great detail. Can anybody explain what these two are exactly? Apple Docs
显然是较高的渲染利用率是问题,所以我该怎么做才能提高性能?
Apparently the high Render Utilization is the problem, so what can I do to improve the performance?
推荐答案
解决方案是从屏幕上删除所有具有透明性的UI元素(或将它们设置为不透明)。
The solution to this was to remove all UI elements with transparency from the screen (or setting them to opaque).
填充率严重受损在具有透明度的UI元素下方或上方渲染动画CAShapeLayer时。
The fillrate suffers highly when rendering an animated CAShapeLayer under or above UI elements with transparency.
优化此设置后,渲染利用率降至30-40%。
After optimizing this, the render utilization went down to 30-40 percent.
这篇关于CoreAnimation性能分析-使用CAShapeLayer的CAReplicatorLayer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!