Browse Source

Scene.Id -> Scene.Generation.

Steven Kirk 8 years ago
parent
commit
aefc5c5a77

+ 3 - 3
src/Avalonia.Visuals/Rendering/DeferredRenderer.cs

@@ -182,17 +182,17 @@ namespace Avalonia.Rendering
 
             if (scene.Size != Size.Empty)
             {
-                if (scene.Id != _lastSceneId)
+                if (scene.Generation != _lastSceneId)
                 {
                     _layers.Update(scene);
                     RenderToLayers(scene);
 
                     if (DebugFramesPath != null)
                     {
-                        SaveDebugFrames(scene.Id);
+                        SaveDebugFrames(scene.Generation);
                     }
 
-                    _lastSceneId = scene.Id;
+                    _lastSceneId = scene.Generation;
                 }
 
                 RenderOverlay(scene);

+ 5 - 5
src/Avalonia.Visuals/Rendering/SceneGraph/Scene.cs

@@ -28,7 +28,7 @@ namespace Avalonia.Rendering.SceneGraph
             _index.Add(rootVisual, Root);
         }
 
-        private Scene(VisualNode root, Dictionary<IVisual, IVisualNode> index, SceneLayers layers, int id)
+        private Scene(VisualNode root, Dictionary<IVisual, IVisualNode> index, SceneLayers layers, int generation)
         {
             Contract.Requires<ArgumentNullException>(root != null);
 
@@ -37,14 +37,14 @@ namespace Avalonia.Rendering.SceneGraph
             _index = index;
             Root = root;
             Layers = layers;
-            Id = id;
+            Generation = generation;
             root.LayerRoot = root.Visual;
         }
 
         /// <summary>
-        /// Gets an ID identifying the scene. This is incremented each time the scene is cloned.
+        /// Gets a value identifying the scene's generation. This is incremented each time the scene is cloned.
         /// </summary>
-        public int Id { get; }
+        public int Generation { get; }
 
         /// <summary>
         /// Gets the layers for the scene.
@@ -86,7 +86,7 @@ namespace Avalonia.Rendering.SceneGraph
             var index = new Dictionary<IVisual, IVisualNode>();
             var root = Clone((VisualNode)Root, null, index);
 
-            var result = new Scene(root, index, Layers.Clone(), Id + 1)
+            var result = new Scene(root, index, Layers.Clone(), Generation + 1)
             {
                 Size = Size,
                 Scaling = Scaling,