/// <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); }
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; }
internal DrawNode GenerateDrawNodeSubtree() { DrawNode node = BaseDrawNode; foreach (Drawable child in children.Current) { if (child.IsVisible) { node.Children.Add(child.GenerateDrawNodeSubtree()); } } return(node); }
/// <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); }
/// <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); }
protected virtual void ApplyDrawNode(DrawNode node) { node.DrawInfo = DrawInfo; node.InvalidationID = invalidationID; }
public BufferedDrawNode(IBufferedDrawable source, DrawNode child, BufferedDrawNodeSharedData sharedData) : base(source) { Child = child; SharedData = sharedData; }
protected virtual void ApplyDrawNode(DrawNode node) { node.DrawInfo = DrawInfo; node.Drawable = this; }