< Summary

Class:DCL.Asset_Gif
Assembly:AssetPromiseKeeper
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/AssetManager/Gif/Asset_Gif.cs
Covered lines:10
Uncovered lines:3
Coverable lines:13
Total lines:38
Line coverage:76.9% (10 of 13)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Dispose()0%2100%
Cleanup()0%550100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/AssetManager/Gif/Asset_Gif.cs

#LineLine coverage
 1using UnityEngine;
 2
 3namespace DCL
 4{
 5    public class Asset_Gif : Asset, ITexture
 6    {
 7        public event System.Action OnCleanup;
 8
 49        public Texture2D texture => frames?[0].texture;
 010        public int width => texture?.width ?? 0;
 011        public int height => texture?.height ?? 0;
 57612        public GifFrameData[] frames { get; internal set; }
 13
 14        internal IGifProcessor processor;
 15
 016        public void Dispose() { Cleanup(); }
 17
 18        public override void Cleanup()
 19        {
 1420            OnCleanup?.Invoke();
 21
 1422            processor?.DisposeGif();
 23
 1424            if (frames is null)
 25            {
 826                return;
 27            }
 28
 55229            for (int i = 0; i < frames.Length; i++)
 30            {
 27031                Object.Destroy(frames[i].texture);
 32            }
 33
 634            frames = null;
 635        }
 36    }
 37
 38}