Browse Source

Merge pull request #10352 from MrJul/d2d1-tests-debug

Fix Direct2D1 test runner hanging
pull/10362/head
Max Katz 3 years ago
committed by GitHub
parent
commit
f55ac6b4b5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      src/Windows/Avalonia.Direct2D1/Direct2D1Platform.cs

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

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

Loading…
Cancel
Save