< Summary

Class:GPUSkinning.GPUSkinningThrottler
Assembly:RenderUtils
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Rendering/Utils/GPUSkinning/GPUSkinningThrottler.cs
Covered lines:9
Uncovered lines:1
Coverable lines:10
Total lines:27
Line coverage:90% (9 of 10)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
GPUSkinningThrottler(...)0%110100%
SetThrottling(...)0%2100%
TryUpdate()0%220100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Rendering/Utils/GPUSkinning/GPUSkinningThrottler.cs

#LineLine coverage
 1namespace GPUSkinning
 2{
 3    public class GPUSkinningThrottler
 4    {
 5        internal static int startingFrame = 0;
 6
 7        internal readonly IGPUSkinning gpuSkinning;
 8        internal int framesBetweenUpdates;
 9        internal int currentFrame;
 10
 311        public GPUSkinningThrottler(IGPUSkinning gpuSkinning)
 12        {
 313            this.gpuSkinning = gpuSkinning;
 314            framesBetweenUpdates = 1;
 315            currentFrame = startingFrame++;
 316        }
 17
 018        public void SetThrottling(int newFramesBetweenUpdates) { framesBetweenUpdates = newFramesBetweenUpdates; }
 19
 20        public void TryUpdate()
 21        {
 3022            currentFrame++;
 3023            if (currentFrame % framesBetweenUpdates == 0)
 1724                gpuSkinning.Update();
 3025        }
 26    }
 27}