Skip to content
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

[Impeller] make sampler use string_view instead of std::string. #56821

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

jonahwilliams
Copy link
Member

I believe these are always const strings anyway, so remove the copy associated with using std::string.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@flutter-dashboard
Copy link

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.

Changes reported for pull request #56821 at sha 3df1079

@jonahwilliams
Copy link
Member Author

Note: this change caused the clangd server to highlight a lurking bug - we forgot to pass the sampler descriptor to the vertices w/ texture path.

@@ -786,6 +786,7 @@ void Canvas::DrawVertices(const std::shared_ptr<VerticesGeometry>& vertices,
contents->SetEffectTransform(effect_transform);
contents->SetTexture(texture);
contents->SetTileMode(x_tile_mode, y_tile_mode);
contents->SetSamplerDescriptor(sampler_descriptor);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for whatever reason, with this change clangd highlighted that sampler_descriptor was unused, revealing this bug.

Copy link
Member

@gaaclarke gaaclarke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked through the codebase to make sure that we aren't creating a SamplerDescriptor with a dynamically allocated string. I didn't see one, lgtm!

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 27, 2024
@auto-submit auto-submit bot merged commit 10ba734 into flutter:main Nov 27, 2024
34 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 27, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 27, 2024
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Nov 27, 2024
…159527)

flutter/engine@da71729...b9474a9

2024-11-27 chris@bracken.jp Reland: iOS: Migrate PlatformViewsController
to Objective-C (flutter/engine#56828)
2024-11-27 jonahwilliams@google.com [Impeller] make sampler use
string_view instead of std::string. (flutter/engine#56821)

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 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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
nick9822 pushed a commit to nick9822/flutter that referenced this pull request Dec 18, 2024
…ter/engine#56821)

I believe these are always const strings anyway, so remove the copy associated with using std::string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App e: impeller will affect goldens
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants