Browse Source

Fix Direct2D1 test runner hanging

pull/10352/head
Julien Lebosquain 4 years ago
parent
commit
822f5d04aa
No known key found for this signature in database GPG Key ID: 1833CAD10ACC46FD
  1. 19
      src/Windows/Avalonia.Direct2D1/Direct2D1Platform.cs

19
src/Windows/Avalonia.Direct2D1/Direct2D1Platform.cs

@ -1,7 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.IO; using System.IO;
using Avalonia.Controls;
using Avalonia.Controls.Platform.Surfaces; using Avalonia.Controls.Platform.Surfaces;
using Avalonia.Direct2D1.Media; using Avalonia.Direct2D1.Media;
using Avalonia.Direct2D1.Media.Imaging; using Avalonia.Direct2D1.Media.Imaging;
@ -55,15 +55,18 @@ namespace Avalonia.Direct2D1
return; return;
} }
#if DEBUG #if DEBUG
try if (Debugger.IsAttached)
{ {
Direct2D1Factory = new SharpDX.Direct2D1.Factory1( try
SharpDX.Direct2D1.FactoryType.MultiThreaded, {
Direct2D1Factory = new SharpDX.Direct2D1.Factory1(
SharpDX.Direct2D1.FactoryType.MultiThreaded,
SharpDX.Direct2D1.DebugLevel.Error); SharpDX.Direct2D1.DebugLevel.Error);
} }
catch catch
{ {
// // ignore, retry below without the debug layer
}
} }
#endif #endif
if (Direct2D1Factory == null) if (Direct2D1Factory == null)

Loading…
Cancel
Save