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

[read-fonts] capture full range of image data in cblc #863

Merged
merged 3 commits into from
Mar 30, 2024
Merged

Conversation

dfrg
Copy link
Member

@dfrg dfrg commented Mar 28, 2024

These can be sparse which requires reading offset and offset +1 to compute the full range.

ref https://skia-review.googlesource.com/c/skia/+/809056

dfrg added 2 commits March 28, 2024 18:10
These can be sparse which requires reading offset and offset +1 to compute the full range.

ref https://skia-review.googlesource.com/c/skia/+/809056
all formats can compute a data size
if gid == 1 {
assert!(cbdt.data(&location).is_err());
} else {
cbdt.data(&location).unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: if this ever fails you won't know which gid. Suggest unwrap_or_else panic with a helpful message.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call. Changed both to asserts with messages describing the failure.

@dfrg dfrg merged commit bb468ed into main Mar 30, 2024
9 checks passed
@dfrg dfrg deleted the sparse-cblc-fix branch March 30, 2024 01:56
@drott
Copy link
Contributor

drott commented Apr 2, 2024

👍 thanks for the fix! I guess it's time for me to roll some versions, into Chromium as well, with bytemuck and all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants