Skip to content

Conversation

@NickGerleman
Copy link
Contributor

Summary:
TextPaint.reset() is buggy, and doesn't always reset all the state. D64535719 fixed this for resetting typeface, but a bug showed up, where we seem to sometimes leak fakeBoldText as well.

Let's remove the reset(), and explicitly set every field, every time.

Changelog:
[Android][Fixed] - Manually set all fields on scratch TextPaint

Differential Revision: D75987605

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 4, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D75987605

Summary:

TextLayoutManager has an optimization today, where it reuses a scratch TextPaint throughout layouts.

This is not safe in Facsimile, since we may mutate the paint on a Layout, after it is created, but before it is drawn.

This change makes it so that we only ever use a scratch paint, when the layout it is set on does not escape TextLayoutManager.

Changelog: [Internal]

Differential Revision: D75987605
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D75987605

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jun 5, 2025
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 0581e88.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants