瀏覽代碼

Fix missed changes in IRenderTimer.

Jeremy Koritzinsky 7 年之前
父節點
當前提交
0aa5866ea8

+ 2 - 2
src/OSX/Avalonia.MonoMac/RenderTimer.cs

@@ -12,7 +12,7 @@ namespace Avalonia.MonoMac
         {
         }
 
-        protected override IDisposable StartCore(Action<long> tick)
+        protected override IDisposable StartCore(Action<TimeSpan> tick)
         {
             return AvaloniaLocator.Current.GetService<IRuntimePlatform>().StartSystemTimer(
                 TimeSpan.FromSeconds(1.0 / FramesPerSecond),
@@ -20,7 +20,7 @@ namespace Avalonia.MonoMac
                 {
                     using (new NSAutoreleasePool())
                     {
-                        tick?.Invoke(Environment.TickCount);
+                        tick?.Invoke(TimeSpan.FromMilliseconds(Environment.TickCount));
                     }
                 });
         }

+ 2 - 2
src/Windows/Avalonia.Win32/RenderTimer.cs

@@ -29,12 +29,12 @@ namespace Avalonia.Win32
         {
         }
 
-        protected override IDisposable StartCore(Action<long> tick)
+        protected override IDisposable StartCore(Action<TimeSpan> tick)
         {
             EnsureTimerQueueCreated();
             var msPerFrame = 1000 / FramesPerSecond;
 
-            timerDelegate = (_, __) => tick(Environment.TickCount);
+            timerDelegate = (_, __) => tick(TimeSpan.FromMilliseconds(Environment.TickCount));
 
             UnmanagedMethods.CreateTimerQueueTimer(
                 out var timer,

+ 2 - 2
src/iOS/Avalonia.iOS/DisplayLinkRenderTimer.cs

@@ -7,7 +7,7 @@ namespace Avalonia.iOS
 {
     class DisplayLinkRenderTimer : IRenderTimer
     {
-        public event Action<long> Tick;
+        public event Action<TimeSpan> Tick;
         private CADisplayLink _link;
 
         public DisplayLinkRenderTimer()
@@ -21,7 +21,7 @@ namespace Avalonia.iOS
         {
             try
             {
-                Tick?.Invoke(Environment.TickCount);
+                Tick?.Invoke(TimeSpan.FromMilliseconds(Environment.TickCount));
             }
             catch (Exception)
             {

+ 1 - 1
tests/Avalonia.Visuals.UnitTests/Rendering/DeferredRendererTests.cs

@@ -357,7 +357,7 @@ namespace Avalonia.Visuals.UnitTests.Rendering
 
         private void RunFrame(IRenderLoopTask task)
         {
-            task.Update(0);
+            task.Update(TimeSpan.Zero);
             task.Render();
         }