-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Fixes merge conflict from high bitrate texture tests #179416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes merge conflict from high bitrate texture tests #179416
Conversation
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.
Code Review
This pull request corrects a test setup by changing the default test case and extending CpuSdfCanvas to support different pixel formats. A new method _loadR32FloatSdfImage is added to generate R32F textures, and the widget initialization logic is updated to select the appropriate image loading method based on the targetFormat. My review includes suggestions to improve the robustness of the new switch statement, fix a potential bug in the distance field calculation, and reduce code duplication.
| Future<ui.Image> _loadR32FloatSdfImage() async { | ||
| const width = 1024; | ||
| const height = 1024; | ||
| const double radius = width / 4.0; | ||
| final floats = List<double>.filled(width * height, 0.0); | ||
| for (var i = 0; i < height; ++i) { | ||
| for (var j = 0; j < width; ++j) { | ||
| double x = j.toDouble(); | ||
| double y = i.toDouble(); | ||
| x -= width / 2.0; | ||
| y -= height / 2.0; | ||
| final double length = sqrt(x * x + y * y) - radius; | ||
| final int idx = i * width + j; | ||
| floats[idx] = length - radius; | ||
| } | ||
| } | ||
| final floatList = Float32List.fromList(floats); | ||
| final intList = Uint8List.view(floatList.buffer); | ||
| final completer = Completer<ui.Image>(); | ||
| ui.decodeImageFromPixels( | ||
| intList, | ||
| width, | ||
| height, | ||
| ui.PixelFormat.rFloat32, | ||
| targetFormat: ui.TargetPixelFormat.rFloat32, | ||
| (ui.Image image) { | ||
| completer.complete(image); | ||
| }, | ||
| ); | ||
| return completer.future; | ||
| } |
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 function is very similar to _loadRGBA32FloatSdfImage. There's a lot of duplicated code for setting up dimensions, calculating the signed distance field, and decoding the image. To improve maintainability and reduce redundancy, consider refactoring these two methods into a single one that takes the pixel format as a parameter and handles the differences internally. This would also make it easier to fix the calculation bug mentioned in the other comment in one place.
walley892
left a comment
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.
LGTM
Roll Flutter from 69d8710 to 5b87203 (42 revisions) flutter/flutter@69d8710...5b87203 2025-12-05 engine-flutter-autoroll@skia.org Roll Packages from d39e481 to b17d3ff (3 revisions) (flutter/flutter#179505) 2025-12-05 bungeman@chromium.org Move target_cpu into use_rbe block in Fuchsia build (flutter/flutter#179458) 2025-12-05 engine-flutter-autoroll@skia.org Roll Skia from fe6bf18a3f6b to a31411879251 (3 revisions) (flutter/flutter#179499) 2025-12-05 sokolovskyi.konstantin@gmail.com Force WASM single threading in Chrome extensions. (flutter/flutter#179400) 2025-12-05 engine-flutter-autoroll@skia.org Roll Skia from aea282ea0bcd to fe6bf18a3f6b (7 revisions) (flutter/flutter#179489) 2025-12-05 dolt@guide.inc fix: check both pointer count and action before reusing MotionEvent (flutter/flutter#178528) 2025-12-05 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from VtDPX2k1kosHxjKUE... to vDeTl_KBeLJY8nCAx... (flutter/flutter#179478) 2025-12-05 bkonyi@google.com [ Widget Preview ] Add embedded Widget Inspector support (flutter/flutter#178116) 2025-12-05 30870216+gaaclarke@users.noreply.github.com bubble up fragment shader errors (flutter/flutter#179363) 2025-12-05 engine-flutter-autoroll@skia.org Roll Dart SDK from eda82318e193 to 42fe3327abca (1 revision) (flutter/flutter#179472) 2025-12-05 jesswon@google.com [Android 16] Use AVD With New Android Renderer (flutter/flutter#179306) 2025-12-05 bkonyi@google.com Unpin `package:dwds` dependency (flutter/flutter#179462) 2025-12-05 flar@google.com [Impeller] include uniform info in impellerc json reflections (flutter/flutter#179317) 2025-12-05 engine-flutter-autoroll@skia.org Roll Skia from 1591b066f49b to aea282ea0bcd (1 revision) (flutter/flutter#179468) 2025-12-04 engine-flutter-autoroll@skia.org Roll Skia from e1923478562b to 1591b066f49b (3 revisions) (flutter/flutter#179460) 2025-12-04 jacksongardner@google.com Cherry-pick flutter 3.38.4 changelog back to master. (flutter/flutter#179463) 2025-12-04 1961493+harryterkelsen@users.noreply.github.com [web] Add clone method to LayerPicture and dispose pictures in PictureLayer (flutter/flutter#179162) 2025-12-04 30870216+gaaclarke@users.noreply.github.com Fixes merge conflict from high bitrate texture tests (flutter/flutter#179416) 2025-12-04 116356835+AbdeMohlbi@users.noreply.github.com Fix typos in `VirtualDisplayController.java` (flutter/flutter#179411) 2025-12-04 engine-flutter-autoroll@skia.org Roll Dart SDK from 2de44cc08970 to eda82318e193 (1 revision) (flutter/flutter#179453) 2025-12-04 engine-flutter-autoroll@skia.org Roll Skia from 55d94a54f453 to e1923478562b (1 revision) (flutter/flutter#179449) 2025-12-04 engine-flutter-autoroll@skia.org Roll Packages from 8cb4903 to d39e481 (8 revisions) (flutter/flutter#179451) 2025-12-04 bruno.leroux@gmail.com Add DropdownMenu.selectOnly (flutter/flutter#179189) 2025-12-04 engine-flutter-autoroll@skia.org Roll Dart SDK from 7e6bfc6af55c to 2de44cc08970 (6 revisions) (flutter/flutter#179443) 2025-12-04 engine-flutter-autoroll@skia.org Roll Skia from b8f79d7316c0 to 55d94a54f453 (1 revision) (flutter/flutter#179439) 2025-12-04 6655696+guidezpl@users.noreply.github.com Revise README for link updates and terminology changes (flutter/flutter#179357) 2025-12-04 engine-flutter-autoroll@skia.org Roll Skia from ce19122e3982 to b8f79d7316c0 (3 revisions) (flutter/flutter#179436) 2025-12-04 bruno.leroux@gmail.com Update some BottomNavigationBar comments to reflect theme normalization (flutter/flutter#179404) 2025-12-04 robert.ancell@canonical.com Replace use of eglCreateImage with eglCreateImageKHR to reduce EGL requirement (flutter/flutter#179310) 2025-12-04 engine-flutter-autoroll@skia.org Roll Skia from 81a9a0751f00 to ce19122e3982 (5 revisions) (flutter/flutter#179430) 2025-12-04 30870216+gaaclarke@users.noreply.github.com [impellerc] adds entry prefix flag to avoid shader collisions (flutter/flutter#179160) 2025-12-04 jon.i@hotmail.fr [Windows] Allow apps to prefer high power GPUs (flutter/flutter#177653) 2025-12-04 bkonyi@google.com [ Infra ] Shard `Windows tool_tests_commands` (flutter/flutter#179409) 2025-12-04 nshahan@google.com [flutter_tools] Fix filename typo (flutter/flutter#179427) 2025-12-04 fluttergithubbot@gmail.com Marks Linux_pixel_7pro draw_arcs_all_stroke_styles_perf__timeline_summary to be unflaky (flutter/flutter#179392) 2025-12-03 fluttergithubbot@gmail.com Marks Mac_ios draw_arcs_all_fill_styles_perf_ios__timeline_summary to be unflaky (flutter/flutter#179391) 2025-12-03 fluttergithubbot@gmail.com Marks Linux_pixel_7pro draw_arcs_all_fill_styles_perf__timeline_summary to be unflaky (flutter/flutter#179390) 2025-12-03 jason-simmons@users.noreply.github.com Roll Abseil to 564023aa5376 (flutter/flutter#179421) 2025-12-03 30870216+gaaclarke@users.noreply.github.com Made wide gamut tests give more information in their failure (flutter/flutter#179415) 2025-12-03 engine-flutter-autoroll@skia.org Roll Skia from c20f797ab6f9 to 81a9a0751f00 (5 revisions) (flutter/flutter#179417) 2025-12-03 737941+loic-sharma@users.noreply.github.com Migrate samples and docs to RadioGroup (flutter/flutter#179158) 2025-12-03 iinozemtsev@google.com Roll Dart SDK to 3.11.0-200.1.beta (flutter/flutter#179399) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages ...
flutter@d57f6f8 had a merge conflict that I resolved incorrectly. The test I was trusting to verify it was actually set to bringup, this fixes that test. ## 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], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
d57f6f8 had a merge conflict that I resolved incorrectly. The test I was trusting to verify it was actually set to bringup, this fixes that test.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.