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

Conversation

@dnfield
Copy link
Contributor

@dnfield dnfield commented Jul 27, 2023

Fixes flutter/flutter#130613

Before this patch, the test would fail to render anything because the culling would decide it fell outside the cull rect when the transform has perspective sometimes. We should fix our Rect::TransformBounds implementation, but I can't quite seem to get it happy enough here so I'm just bailing out on culling if there is perspective instead, which is safe. This also makes the patch a bit easier/safer to cherry pick since it's a simple de-optimization when perspective is involved for the sake of fidelity, instead of a larger change that may have other side effects.

Filed flutter/flutter#131445 to track the perspective issue.

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.

LGTM

}

if (display_list->has_rtree()) {
if (display_list->has_rtree() && !initial_matrix_.HasPerspective()) {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Add todo comment nearby linking to the new bug?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@flar flar left a comment

Choose a reason for hiding this comment

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

LGTM, would like to see a comment pointing to a filed issue as well...

}

constexpr bool HasPerspective() const {
return m[3] != 0 || m[7] != 0 || m[11] != 0 || m[15] != 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

That should be safe. We may not care about 11 for the case at hand since it is the Z component of W and Z=0, but it can't hurt to bail on that for simplicity/robustness sake.

@chinmaygarde chinmaygarde changed the title [Impeller] Avoid culling when the current matrix has perspective [Impeller] Avoid culling when the current matrix has perspective. Jul 28, 2023
@dnfield dnfield added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 28, 2023
@auto-submit auto-submit bot merged commit 182e118 into flutter:main Jul 28, 2023
@dnfield dnfield deleted the persp branch July 28, 2023 15:59
dnfield added a commit to dnfield/engine that referenced this pull request Jul 28, 2023
…utter#44089)

Fixes flutter/flutter#130613

Before this patch, the test would fail to render anything because the culling would decide it fell outside the cull rect when the transform has perspective sometimes. We should fix our Rect::TransformBounds implementation, but I can't quite seem to get it happy enough here so I'm just bailing out on culling if there is perspective instead, which is safe. This also makes the patch a bit easier/safer to cherry pick since it's a simple de-optimization when perspective is involved for the sake of fidelity, instead of a larger change that may have other side effects.

Filed flutter/flutter#131445 to track the perspective issue.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 28, 2023
XilaiZhang pushed a commit that referenced this pull request Aug 2, 2023
…#44106)

Cherry pick of #44089

Before this patch, the test would fail to render anything because the
culling would decide it fell outside the cull rect when the transform
has perspective sometimes. We should fix our Rect::TransformBounds
implementation, but I can't quite seem to get it happy enough here so
I'm just bailing out on culling if there is perspective instead, which
is safe. This also makes the patch a bit easier/safer to cherry pick
since it's a simple de-optimization when perspective is involved for the
sake of fidelity, instead of a larger change that may have other side
effects.
gaaclarke pushed a commit to gaaclarke/engine that referenced this pull request Aug 30, 2023
…utter#44089)

Fixes flutter/flutter#130613

Before this patch, the test would fail to render anything because the culling would decide it fell outside the cull rect when the transform has perspective sometimes. We should fix our Rect::TransformBounds implementation, but I can't quite seem to get it happy enough here so I'm just bailing out on culling if there is perspective instead, which is safe. This also makes the patch a bit easier/safer to cherry pick since it's a simple de-optimization when perspective is involved for the sake of fidelity, instead of a larger change that may have other side effects.

Filed flutter/flutter#131445 to track the perspective issue.
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.

[latest master][Impeller] widgets disappear too early during perspective animation

3 participants