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

Conversation

@ColdPaleLight
Copy link
Member

@ColdPaleLight ColdPaleLight commented Sep 16, 2022

fix flutter/flutter#111737

without patch

dtV4mRtY9J

with patch

2qcLgw2TDv

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.

@ColdPaleLight ColdPaleLight marked this pull request as draft September 16, 2022 03:58
Copy link
Member

@bdero bdero left a comment

Choose a reason for hiding this comment

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

Thanks! Just minor comments. I think this solves all of the lingering problems -- including the fact the matrix is only supposed to apply to the geometry after the filter is rendered rather than before.

return std::nullopt;
}

auto transform = GetTransform(entity.GetTransformation()).Invert();
Copy link
Member

Choose a reason for hiding this comment

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

FilterContents already uses GetTransform to apply the local matrix before passing the entity into RenderFilter and GetFilterCoverage, so the entity transform should be used directly rather than passing them through GetTransform in these methods.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahh, I see. Done.

auto transform = GetTransform(entity.GetTransformation()).Invert();
transform = matrix_ * transform;
transform = GetTransform(entity.GetTransformation()) * transform;
snapshot->transform = transform * snapshot->transform;
Copy link
Member

Choose a reason for hiding this comment

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

Here and below: Can we throw this arithmetic on one line to make the multiplication order easier to read?

snapshot->transform = entity.GetTransformation() * matrix_ * entity.GetTransformation().Invert() * snapshot->transform;

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

const Matrix& effect_transform,
const Rect& coverage) const {
return inputs[0]->GetSnapshot(renderer, entity);
auto snapshot = inputs[0]->GetSnapshot(renderer, entity);
Copy link
Member

Choose a reason for hiding this comment

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

The prior implementation rendered out the child filter at the final on-screen bounds resolution. This implementation no longer does so -- which I believe is correct: https://fiddle.skia.org/c/6cbb551ab36d06f163db8693972be954. I'm not sure if you intended to fix this particular issue, but thought I'd mention that you incidentally fixed it. :)

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] Matrix image filter is not working as expected on master channel

2 participants