浏览代码

Fix issue in test framework image compare

/main
Tim Cooper 6 年前
当前提交
b0754411
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 8
      com.unity.testframework.graphics/Runtime/ImageAssert.cs

8
com.unity.testframework.graphics/Runtime/ImageAssert.cs


"The expected image had format {0} but the actual image had format {1}.", expected.format,
actual.format);
using (var expectedPixels = new NativeArray<Color32>(expected.GetPixels32(0), Allocator.Temp))
using (var actualPixels = new NativeArray<Color32>(actual.GetPixels32(0), Allocator.Temp))
using (var diffPixels = new NativeArray<Color32>(expectedPixels.Length, Allocator.Temp))
using (var sumOverThreshold = new NativeArray<float>(Mathf.CeilToInt(expectedPixels.Length / (float)k_BatchSize), Allocator.Temp))
using (var expectedPixels = new NativeArray<Color32>(expected.GetPixels32(0), Allocator.TempJob))
using (var actualPixels = new NativeArray<Color32>(actual.GetPixels32(0), Allocator.TempJob))
using (var diffPixels = new NativeArray<Color32>(expectedPixels.Length, Allocator.TempJob))
using (var sumOverThreshold = new NativeArray<float>(Mathf.CeilToInt(expectedPixels.Length / (float)k_BatchSize), Allocator.TempJob))
{
if (settings == null)
settings = new ImageComparisonSettings();

正在加载...
取消
保存