コード例 #1
0
ファイル: Drawable.cs プロジェクト: jorolf/osu-framework
        /// <summary>
        /// Generates the DrawNode for ourselves.
        /// </summary>
        /// <returns>A complete and updated DrawNode, or null if the DrawNode would be invisible.</returns>
        protected internal virtual DrawNode GenerateDrawNodeSubtree(int treeIndex, RectangleF bounds)
        {
            // If we are proxied somewhere, then we want to be drawn at the proxy's location
            // in the scene graph, rather than at our own location, thus no draw nodes for us.
            if (proxy != null)
            {
                return(null);
            }

            DrawNode node = drawNodes[treeIndex];

            if (node == null)
            {
                drawNodes[treeIndex] = node = CreateDrawNode();
                FrameStatistics.Increment(StatisticsCounterType.DrawNodeCtor);
            }

            if (invalidationID != node.InvalidationID)
            {
                ApplyDrawNode(node);
                FrameStatistics.Increment(StatisticsCounterType.DrawNodeAppl);
            }

            return(node);
        }
コード例 #2
0
        public BufferedDrawNode(IBufferedDrawable source, DrawNode child, BufferedDrawNodeSharedData sharedData, RenderbufferInternalFormat[] formats = null, bool pixelSnapping = false)
            : base(source)
        {
            this.formats = formats;

            Child      = child;
            SharedData = sharedData;

            filteringMode = pixelSnapping ? All.Nearest : All.Linear;
        }
コード例 #3
0
        internal DrawNode GenerateDrawNodeSubtree()
        {
            DrawNode node = BaseDrawNode;

            foreach (Drawable child in children.Current)
            {
                if (child.IsVisible)
                {
                    node.Children.Add(child.GenerateDrawNodeSubtree());
                }
            }

            return(node);
        }
コード例 #4
0
        /// <summary>
        /// Generates the DrawNode for ourselves.
        /// </summary>
        /// <returns>A complete and updated DrawNode, or null if the DrawNode would be invisible.</returns>
        protected internal virtual DrawNode GenerateDrawNodeSubtree(int treeIndex, RectangleF bounds)
        {
            DrawNode node = drawNodes[treeIndex];

            if (node == null)
            {
                drawNodes[treeIndex] = node = CreateDrawNode();
                FrameStatistics.Increment(StatisticsCounterType.DrawNodeCtor);
            }

            if (invalidationID != node.InvalidationID)
            {
                ApplyDrawNode(node);
                FrameStatistics.Increment(StatisticsCounterType.DrawNodeAppl);
            }

            return(node);
        }
コード例 #5
0
ファイル: Drawable.cs プロジェクト: TPGPL/osu-framework
        /// <summary>
        /// Generates the DrawNode for ourselves.
        /// </summary>
        /// <param name="node">An existing DrawNode which may need to be updated, or null if a node needs to be created.</param>
        /// <returns>A complete and updated DrawNode.</returns>
        internal virtual DrawNode GenerateDrawNodeSubtree(DrawNode node = null)
        {
            if (node == null)
            {
                //we don't have a previous node, so we need to initialise fresh.
                node          = CreateDrawNode();
                node.Drawable = this;
            }

            if (!node.IsValid)
            {
                //we need to update the node if it has been invalidated.
                ApplyDrawNode(node);
                node.IsValid = true;
                validDrawNodes.Add(node);
            }

            return(node);
        }
コード例 #6
0
 protected virtual void ApplyDrawNode(DrawNode node)
 {
     node.DrawInfo       = DrawInfo;
     node.InvalidationID = invalidationID;
 }
コード例 #7
0
 public BufferedDrawNode(IBufferedDrawable source, DrawNode child, BufferedDrawNodeSharedData sharedData)
     : base(source)
 {
     Child      = child;
     SharedData = sharedData;
 }
コード例 #8
0
ファイル: Drawable.cs プロジェクト: TPGPL/osu-framework
 protected virtual void ApplyDrawNode(DrawNode node)
 {
     node.DrawInfo = DrawInfo;
     node.Drawable = this;
 }