Skip to content

Move updateCPURenderAttributes calls to where they're actually needed #624

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

Merged

Conversation

adroitwhiz
Copy link
Contributor

This PR depends on #555

Resolves

Resolves #623

Proposed Changes

This PR moves updateCPURenderAttributes calls from the _touchingBounds function to isTouchingColor and isTouchingDrawable, and moves the updateCPURenderAttributes call in _getConvexHullPointsForDrawable to after the no-points-in-hull check.

Reason for Changes

_touchingBounds doesn't actually require the passed drawable's matrix or silhouette to be up-to-date. However, isTouchingColor and isTouchingDrawables relied on it updating those. For clarity (and to prevent things from breaking if a future coder decided to "optimize" _touchingBounds), these calls have been moved (in the form of calls to the new updateCPURenderAttributes function) to the places that actually require the drawable's matrix and silhouette to be updated.

_getConvexHullPointsForDrawable doesn't do anything that requires the drawable's CPU render stuff to be up-to-date until after the no-points-in-hull check, so it's safe to not update them until after it.

@adroitwhiz adroitwhiz force-pushed the update-silhouette-differently branch from da15dbc to ade45c0 Compare July 24, 2020 17:19
Copy link
Contributor

@fsih fsih left a comment

Choose a reason for hiding this comment

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

LG, thanks!

@fsih fsih merged commit 96f36ff into scratchfoundation:develop Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Current CPU render code relies on implicit behavior
2 participants