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

Upgrade to TinySDF v2 with a fix to CJK performance #11047

Merged
merged 2 commits into from Sep 24, 2021
Merged

Upgrade to TinySDF v2 with a fix to CJK performance #11047

merged 2 commits into from Sep 24, 2021

Conversation

mourner
Copy link
Member

@mourner mourner commented Sep 22, 2021

Upgrades TinySDF to v2. In particular, the new version:

  • Fixes a severe performance issue with CJK glyphs on certain GPU/Chrome combinations (including my MBP 2017 with Chrome 94 beta).
  • Slightly improves CJK rasterization performance.
  • Fixes a bug where some CJK glyphs were clipped by 1 pixel at the bottom.

@ChrisLoer please review to make sure this doesn't cause any regressions on our CJK-heavy styles.

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • manually test the debug page
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
  • add an entry inside this element for inclusion in the mapbox-gl-js changelog: <changelog>Fixed an issue with slow tile loading performance on maps with CJK glyphs on certain Chrome/GPU combinations.</changelog>

Copy link
Contributor

@ryanhamley ryanhamley left a comment

Choose a reason for hiding this comment

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

Looks good!

Comment on lines +219 to +220
tinySDF = entry.tinySDF = new GlyphManager.TinySDF({fontFamily, fontWeight, fontSize, buffer, radius});
tinySDF.fontWeight = fontWeight;
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious, why do we need to set tinySDF.fontWeight when fontWeight is passed into the constructor?

Copy link
Member Author

Choose a reason for hiding this comment

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

@ryanhamley it was never a part of public TinySDF API, it just happened to be exposed there but is no longer the case with v2.

@mourner mourner merged commit f68aa81 into main Sep 24, 2021
@mourner mourner deleted the tiny-sdf-v2 branch September 24, 2021 13:00
mourner added a commit that referenced this pull request Sep 29, 2021
* upgrade to TinySDF v2

* update tiny-sdf to v2.0.2 to address a perf issue
mourner added a commit that referenced this pull request Sep 29, 2021
* upgrade to TinySDF v2

* update tiny-sdf to v2.0.2 to address a perf issue
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.

None yet

2 participants