mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Update the golden image comparator to handle read-only image ByteData views (#61406)
This commit is contained in:
parent
1c96479760
commit
af47958eff
@ -210,7 +210,9 @@ Future<ComparisonResult> compareLists(List<int> test, List<int> master) async {
|
||||
final ByteData invertedMasterRgba = _invert(masterImageRgba);
|
||||
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);
|
||||
|
||||
for (int x = 0; x < width; x++) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user