Unverified Commit af47958e authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Update the golden image comparator to handle read-only image ByteData views (#61406)

parent 1c964797
...@@ -210,7 +210,9 @@ Future<ComparisonResult> compareLists(List<int> test, List<int> master) async { ...@@ -210,7 +210,9 @@ Future<ComparisonResult> compareLists(List<int> test, List<int> master) async {
final ByteData invertedMasterRgba = _invert(masterImageRgba); final ByteData invertedMasterRgba = _invert(masterImageRgba);
final ByteData invertedTestRgba = _invert(testImageRgba); final ByteData invertedTestRgba = _invert(testImageRgba);
final ByteData maskedDiffRgba = await testImage.toByteData(); final Uint8List testImageBytes = (await testImage.toByteData()).buffer.asUint8List();
final ByteData maskedDiffRgba = ByteData(testImageBytes.length);
maskedDiffRgba.buffer.asUint8List().setRange(0, testImageBytes.length, testImageBytes);
final ByteData isolatedDiffRgba = ByteData(width * height * 4); final ByteData isolatedDiffRgba = ByteData(width * height * 4);
for (int x = 0; x < width; x++) { for (int x = 0; x < width; x++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment