public RenderChain(IPanel panel, Shader standardShader)
        {
            var atlasMan       = new UIRAtlasManager();
            var vectorImageMan = new VectorImageManager(atlasMan);

            Constructor(panel, new UIRenderDevice(Implementation.RenderEvents.ResolveShader(standardShader)), atlasMan, vectorImageMan);
        }
Exemple #2
0
        public RenderChain(IPanel panel)
        {
            var atlasMan       = new UIRAtlasManager();
            var vectorImageMan = new VectorImageManager(atlasMan);

            Constructor(panel, new UIRenderDevice(), atlasMan, vectorImageMan);
        }
        public RenderChain(IPanel panel, Shader standardShader)
        {
            if (disposed)
            {
                DisposeHelper.NotifyDisposedUsed(this);
            }

            this.panel = panel;
            device     = new UIRenderDevice(Implementation.RenderEvents.ResolveShader(standardShader));

            atlasManager       = new UIRAtlasManager();
            vectorImageManager = new VectorImageManager(atlasManager);
            painter            = new Implementation.UIRStylePainter(this);

            Font.textureRebuilt += OnFontReset;
        }
        void Constructor(IPanel panelObj, UIRenderDevice deviceObj, UIRAtlasManager atlasMan, VectorImageManager vectorImageMan)
        {
            if (disposed)
            {
                DisposeHelper.NotifyDisposedUsed(this);
            }

            // A reasonable starting depth level suggested here
            m_DirtyTracker.heads     = new List <VisualElement>(8);
            m_DirtyTracker.tails     = new List <VisualElement>(8);
            m_DirtyTracker.minDepths = new int[(int)RenderDataDirtyTypeClasses.Count];
            m_DirtyTracker.maxDepths = new int[(int)RenderDataDirtyTypeClasses.Count];
            m_DirtyTracker.Reset();

            this.panel              = panelObj;
            this.device             = deviceObj;
            this.atlasManager       = atlasMan;
            this.vectorImageManager = vectorImageMan;

            ConstructShaderInfoAllocator();

            painter              = new Implementation.UIRStylePainter(this);
            Font.textureRebuilt += OnFontReset;
        }
 protected RenderChain(IPanel panel, UIRenderDevice device, UIRAtlasManager atlasManager, VectorImageManager vectorImageManager)
 {
     Constructor(panel, device, atlasManager, vectorImageManager);
 }
        void Constructor(BaseVisualElementPanel panelObj, UIRenderDevice deviceObj, AtlasBase atlas, VectorImageManager vectorImageMan)
        {
            if (disposed)
            {
                DisposeHelper.NotifyDisposedUsed(this);
            }

            // A reasonable starting depth level suggested here
            m_DirtyTracker.heads     = new List <VisualElement>(8);
            m_DirtyTracker.tails     = new List <VisualElement>(8);
            m_DirtyTracker.minDepths = new int[(int)RenderDataDirtyTypeClasses.Count];
            m_DirtyTracker.maxDepths = new int[(int)RenderDataDirtyTypeClasses.Count];
            m_DirtyTracker.Reset();

            if (m_RenderNodesData.Count < 1)
            {
                m_RenderNodesData.Add(new RenderNodeData()
                {
                    matPropBlock = new MaterialPropertyBlock()
                });
            }

            this.panel              = panelObj;
            this.device             = deviceObj;
            this.atlas              = atlas;
            this.vectorImageManager = vectorImageMan;

            // TODO: Share these across all panels
            vertsPool   = new TempAllocator <Vertex>(8192, 2048, 64 * 1024);
            indicesPool = new TempAllocator <UInt16>(8192 << 1, 2048 << 1, (64 * 1024) << 1);
            jobManager  = new JobManager();

            this.shaderInfoAllocator.Construct();
            this.opacityIdAccelerator = new OpacityIdAccelerator();

            painter = new Implementation.UIRStylePainter(this);

            var rp = panel as BaseRuntimePanel;

            if (rp != null && rp.drawToCameras)
            {
                drawInCameras = true;
                m_StaticIndex = RenderChainStaticIndexAllocator.AllocateIndex(this);
            }
        }
 protected RenderChain(BaseVisualElementPanel panel, UIRenderDevice device, AtlasBase atlas, VectorImageManager vectorImageManager)
 {
     Constructor(panel, device, atlas, vectorImageManager);
 }
        protected RenderChain(IPanel panel, UIRenderDevice device, UIRAtlasManager atlasManager, VectorImageManager vectorImageManager)
        {
            if (disposed)
            {
                DisposeHelper.NotifyDisposedUsed(this);
            }

            this.panel              = panel;
            this.device             = device;
            this.atlasManager       = atlasManager;
            this.vectorImageManager = vectorImageManager;
            painter              = new Implementation.UIRStylePainter(this);
            Font.textureRebuilt += OnFontReset;
        }