-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Adds test to verify wide gamut indexed png decompression fix for Skia. #45399
Conversation
d3635b0 to
b2c89dc
Compare
e9cc968 to
f3b5330
Compare
65e4f13 to
89900ac
Compare
| namespace flutter { | ||
| namespace testing { | ||
|
|
||
| // Tests are disabled for fuchsia. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of these tests just got moved over here, so it wasn't running for fuchsia anyway.
| return (x * slope) + intercept; | ||
| } | ||
|
|
||
| TEST(ImageDecoderNoGLTest, ImpellerWideGamutDisplayP3) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was moved to its own file because it wasn't running on macos because other tests in image_decoder_unittests.cc need opengl, not this one.
89900ac to
7d8fbae
Compare
| return false; | ||
| } | ||
|
|
||
| if (memcmp(bytes, "\x89PNG\x0d\x0a\x1a\x0a", 8) != 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use constexpr std::string_view to represent the PNG format string constants and their lengths
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| } | ||
|
|
||
| const uint8_t* end = bytes + size; | ||
| const uint8_t* loc = bytes + 8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define a constant for the length of the PNG chunk header.
Or a packed struct for the header (like https://github.com/flutter/engine/blob/main/lib/ui/painting/image_generator_apng.h#L69)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| const uint8_t* end = bytes + size; | ||
| const uint8_t* loc = bytes + 8; | ||
| while (loc + 8 <= end) { | ||
| uint32_t chunk_length = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use fml::BigEndianToArch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| return false; | ||
| } | ||
|
|
||
| sk_sp<SkData> OpenFixtureAsSkData(const char* name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are several copies of OpenFixtureAsSkData in various tests.
Can they be consolidated into someplace like https://github.com/flutter/engine/blob/main/testing/testing.cc?
(I'd be fine with doing this in a separate PR if it's nontrivial)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't mean to add one more, removed the duplication I introduced.
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. |
|
|
||
| const uint8_t* end = bytes + size; | ||
| const uint8_t* loc = bytes + kPngMagic.size(); | ||
| while (loc + 8 <= end) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace 8 with kLengthBytes + kTypeBytes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
…pression fix for Skia. (flutter/engine#45399)
…pression fix for Skia. (flutter/engine#45399)
…134676) flutter/engine@5e671d5...b71b366 2023-09-13 matanlurey@users.noreply.github.com Do not run real processes in `clang_tidy_test.dart` (flutter/engine#45748) 2023-09-13 30870216+gaaclarke@users.noreply.github.com [Impeller] Adds test to verify wide gamut indexed png decompression fix for Skia. (flutter/engine#45399) 2023-09-13 skia-flutter-autoroll@skia.org Roll Skia from 284c333d7eb2 to 78d18d509475 (2 revisions) (flutter/engine#45769) 2023-09-13 skia-flutter-autoroll@skia.org Roll Skia from 3ff43577d04b to 284c333d7eb2 (1 revision) (flutter/engine#45768) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC bdero@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…ix for Skia. (flutter#45399) fixes flutter/flutter#133013 depends on skia fix: https://skia-review.googlesource.com/c/skia/+/751696 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I added new tests to check the change I am making or feature I am adding, or the PR is [test-exempt]. See [testing the engine] for instructions on writing and running engine tests. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I signed the [CLA]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style [testing the engine]: https://github.com/flutter/flutter/wiki/Testing-the-engine [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat
…lutter#134676) flutter/engine@5e671d5...b71b366 2023-09-13 matanlurey@users.noreply.github.com Do not run real processes in `clang_tidy_test.dart` (flutter/engine#45748) 2023-09-13 30870216+gaaclarke@users.noreply.github.com [Impeller] Adds test to verify wide gamut indexed png decompression fix for Skia. (flutter/engine#45399) 2023-09-13 skia-flutter-autoroll@skia.org Roll Skia from 284c333d7eb2 to 78d18d509475 (2 revisions) (flutter/engine#45769) 2023-09-13 skia-flutter-autoroll@skia.org Roll Skia from 3ff43577d04b to 284c333d7eb2 (1 revision) (flutter/engine#45768) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC bdero@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
fixes flutter/flutter#133013
depends on skia fix: https://skia-review.googlesource.com/c/skia/+/751696
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.