コード例 #1
0
        internal void AfterRenderDeviceRelease()
        {
            if (disposed)
            {
                DisposeHelper.NotifyDisposedUsed(this);
            }

            Debug.Assert(device == null);
            device = new UIRenderDevice(Implementation.RenderEvents.ResolveShader((panel as BaseVisualElementPanel)?.standardShader));

            Debug.Assert(painter == null);
            painter = new Implementation.UIRStylePainter(this);

            ConstructShaderInfoAllocator();

            var ve = GetFirstElementInPanel(m_FirstCommand?.owner);

            while (ve != null)
            {
                Implementation.RenderEvents.OnRestoreTransformIDs(ve, device);
                ve.renderChainData.shaderInfoAlloc = m_FullOpacityShaderInfo; // Reset shader info allocs
                UIEOnVisualsChanged(ve, false);                               // Marking dirty will repaint and have the data regenerated
                ve = ve.renderChainData.next;
            }
            UIEOnOpacityChanged(panel.visualTree);
        }
コード例 #2
0
        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();

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

            this.panel              = panelObj;
            this.device             = deviceObj;
            this.atlasManager       = atlasMan;
            this.vectorImageManager = vectorImageMan;
            this.shaderInfoAllocator.Construct();

            painter              = new Implementation.UIRStylePainter(this);
            Font.textureRebuilt += OnFontReset;
        }
コード例 #3
0
        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;
        }
コード例 #4
0
        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;
        }
コード例 #5
0
        protected RenderChain(IPanel panel, UIRenderDevice device, UIRAtlasManager atlasManager)
        {
            if (disposed)
            {
                DisposeHelper.NotifyDisposedUsed(this);
            }

            this.panel        = panel;
            this.device       = device;
            this.atlasManager = atlasManager;
            if (atlasManager != null)
            {
                atlasManager.ResetPerformed += OnAtlasReset;
            }
            painter              = new Implementation.UIRStylePainter(this);
            Font.textureRebuilt += OnFontReset;
        }
コード例 #6
0
        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);
            }
        }
コード例 #7
0
        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.Reset();

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