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

[fuchsia] Ensure we do not initialize nan RoundedRectangles #13971

Merged
merged 1 commit into from Nov 22, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions flow/scene_update_context.cc
Expand Up @@ -71,6 +71,13 @@ void SceneUpdateContext::CreateFrame(scenic::EntityNode entity_node,
if (rrect.isEmpty())
return;

// isEmpty should account for this, but we are adding these experimental
// checks to validate if this is the root cause for b/144933519.
if (std::isnan(rrect.width()) || std::isnan(rrect.height())) {
Copy link
Member

Choose a reason for hiding this comment

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

rrect.rect().isFinite() ought to do the same thing. Also, shouldn't this check happen before setting the clip planes? Might be a worthwhile check either way as this input comes from the framework and there doesn't seem to be any validation on the results of the rrect as it is constructed from a canvas path. Maybe the path wasn't closed or was reset before being given to the engine. Not sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

rrect.isEmpty should already account for this. Our suspicion is that is might not be the working as intended on some devices. I added some additional logs to be 100% sure that this is not the case. I am continuing to investigate the above issue.

FML_LOG(ERROR) << "Invalid RoundedRectangle";
return;
}

// Add a part which represents the frame's geometry for clipping purposes
// and possibly for its texture.
// TODO(SCN-137): Need to be able to express the radii as vectors.
Expand Down