Browse Source

Scene.Id -> Scene.Generation.

pull/827/head
Steven Kirk 9 years ago
parent
commit
aefc5c5a77
  1. 6
      src/Avalonia.Visuals/Rendering/DeferredRenderer.cs
  2. 10
      src/Avalonia.Visuals/Rendering/SceneGraph/Scene.cs

6
src/Avalonia.Visuals/Rendering/DeferredRenderer.cs

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

10
src/Avalonia.Visuals/Rendering/SceneGraph/Scene.cs

@ -28,7 +28,7 @@ namespace Avalonia.Rendering.SceneGraph
_index.Add(rootVisual, Root); _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); Contract.Requires<ArgumentNullException>(root != null);
@ -37,14 +37,14 @@ namespace Avalonia.Rendering.SceneGraph
_index = index; _index = index;
Root = root; Root = root;
Layers = layers; Layers = layers;
Id = id; Generation = generation;
root.LayerRoot = root.Visual; root.LayerRoot = root.Visual;
} }
/// <summary> /// <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> /// </summary>
public int Id { get; } public int Generation { get; }
/// <summary> /// <summary>
/// Gets the layers for the scene. /// Gets the layers for the scene.
@ -86,7 +86,7 @@ namespace Avalonia.Rendering.SceneGraph
var index = new Dictionary<IVisual, IVisualNode>(); var index = new Dictionary<IVisual, IVisualNode>();
var root = Clone((VisualNode)Root, null, index); 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, Size = Size,
Scaling = Scaling, Scaling = Scaling,

Loading…
Cancel
Save