You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #1816 - lsalzman:font-instance-options, r=glennw
add more per-platform font options to FontInstancePlatformOptions
This fleshes out FontInstancePlatformOptions in the ways previously discussed with Glenn:
Mainly that now FontInstancePlatformOptions actually has varying sets of options per-platform.
Revised FontInstanceOptions to rather implement Default trait instead of using Option all over the place to make Gecko integration simpler and saner.
Especially notable is that I heavily revised the set of FreeType options to be sufficient for Gecko to pass in all of its Fontconfig options.
As part of this, there was a lot of reworking of how bitmap fonts are managed with FreeType, and to allow them to be scaled in the shader from fixed-size strikes. To support bitmap fonts, I also needed to migrate us from using BlendMode::Alpha to using BlendMode::PremultipliedAlpha to avoid decode hell in FreeType (this also better agreeing with our image handling too). This required some heavy revision of the FreeType backend, and I optimized some decoding there while I was at it.
I cleaned up the FontInstance mechanics so that they are only really normalized once they are ready for lookup into the cache. This prevents us having to litter code everywhere to zero out the color, the subpixel direction, etc. This also slims down TextRunPrimitiveCpu by letting us remove some options that were only there because they were getting overwritten in FontInstance.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/1816)
<!-- Reviewable:end -->
0 commit comments