Skip to content

Commit 0a86ac3

Browse files
committed
Raw pixels depend on the CPU endianness
1 parent ff8ca2e commit 0a86ac3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/Tests/SKPixmapTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ public void GetPixelSpanReadsValuesCorrectly(uint color)
225225
// no need for swizzle
226226
Assert.Equal(rgb888, pixmap.GetPixelColor(0, 0));
227227

228-
// swizzle for some CPU endian-ness
229-
if (SKImageInfo.PlatformColorType == SKColorType.Bgra8888)
228+
// swizzle for some CPU endianness
229+
if (BitConverter.IsLittleEndian)
230230
rgb888 = new SKColor(rgb888.Blue, rgb888.Green, rgb888.Red, rgb888.Alpha);
231231

232232
Assert.Equal(rgb888, pixmap.GetPixelSpan<SKColor>()[0]);

0 commit comments

Comments
 (0)