Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@gaaclarke
Copy link
Member

@gaaclarke gaaclarke commented Mar 10, 2023

fixes: flutter/flutter#113110

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

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

Looks good to go. Is something missing in the draft?

@chinmaygarde chinmaygarde changed the title Implemented skia's conical gradient. [Impeller] Implement two-point conical gradient. Mar 13, 2023
@gaaclarke
Copy link
Member Author

Looks good to go. Is something missing in the draft?

Yea, the math isn't quite right. I got it working this weekend but for performance reasons I might split it out to its own shader.

@jonahwilliams
Copy link
Contributor

I would strongly recommend making the radial and conical gradients separate shaders. These are already fairly expensive

@chinmaygarde chinmaygarde requested review from chinmaygarde and removed request for chinmaygarde March 13, 2023 17:17
@gaaclarke gaaclarke marked this pull request as ready for review March 13, 2023 20:36
@gaaclarke
Copy link
Member Author

@chinmaygarde The main work is done on this and is ready to review. Let me know what tests you'd like to see added.

@gaaclarke
Copy link
Member Author

There is a graphical glitch where there is banding if c0 is close to c1. I can remove that by adding a minimum samperate. Let me think if there is something smarter we can do.

float result = 0.0;
vec2 ab = c1 - c0;
float dr = r1 - r0;
// Set sample rate to a minimum for the case where c0 and c1 are close.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we handle this with a kEhCloseEnough check in the conical contents? if C0 close to C1, then its just a radial gradient right?

Copy link
Member Author

Choose a reason for hiding this comment

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

in order for it to be the same it has to be c0==c1 and r1 == 0. If c0==c1 we can do the math easily without the loop but it didn't seem worth the extra complexity.

Copy link
Contributor

Choose a reason for hiding this comment

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

ahh got it.

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

@gaaclarke
Copy link
Member Author

@chinmaygarde @jonahwilliams is there a special kind of golden image test we are doing for these shaders?

@gaaclarke
Copy link
Member Author

There isn't the testing infrastructure to write the kind of tests I'd like. I'm going to try to come up with ideas in an issue and we can revisit this. There are a lot of opinions about how to best test on the team so this may take some time to sort out what we want to do here.

@gaaclarke gaaclarke added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 14, 2023
@auto-submit auto-submit bot merged commit e80266b into flutter:main Mar 14, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 14, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Mar 14, 2023
…ngine#40236) (#122623)

Roll Flutter Engine from 22be417acc86 to e80266b78e74 (1 revision)
sourcegraph-bot pushed a commit to sgtest/megarepo that referenced this pull request Mar 14, 2023
…lutter/engine#40236) (#122623)

Commit: fcf11343ae9e291189ba59dc27c3d3e7def17ff9
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App e: impeller

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

[Impeller] Implement two-point conical gradient

3 participants