-
Notifications
You must be signed in to change notification settings - Fork 306
Pipe dwrite rendering options to rasterize_glyphs #770
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
Conversation
|
☔ The latest upstream changes (presumably #748) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Do these options need to be stored per text run dynamically? For instance, can they be set once per frame / font or at init time perhaps? How often do they change? |
|
They can't be stored once per frame, it depends on the text run :(. Layout determines whether or not to enable these options for each text run. Even for the same font, depending on the font size, the options can change. |
|
OK, in that case, how about we rename the struct to just be GlyphOptions, and then we can specify which platforms each field applies to. This will allow us to use the same struct for other platform-specific options in the future if we need to. |
|
How do you specify how each field applies to which platform? I couldn't find something like that. I thought about going the GlyphOptions route but we don't use that for CG/Unix and I'd rather keep it very explicit what it's for. That's also why I passed it in as an Option rather than the full struct. |
|
You can use cfg() on each field to make it only available on that platform - but I was actually just suggesting a comment above each field specifying that this applies to Windows only. So I think if we just rename DWriteGlyphOptions -> GlyphOptions and add a comment for each of the two fields saying they only apply to Windows, that would be fine for now. |
kvark
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that DWriteGlyphOptions needs to be renamed, otherwise looks good.
|
Thanks for the review! Renamed and a comment added saying that GlyphOptions are only used on windows for now. |
|
@bors-servo r+ |
|
📌 Commit c5d6838 has been approved by |
Pipe dwrite rendering options to rasterize_glyphs Essentially replicating this from gecko - http://searchfox.org/mozilla-central/source/gfx/2d/DrawTargetSkia.cpp#1390 I contemplated various ways to pass glyph rendering options to rasterize_glyphs either through traits or some struct, but we don't do anything special for linux or mac, so using a option seemed like the best thing, even though it exposes "dwrite" and forces the other platforms to use it. Nor could I find a clean way to pass derived types with data only as traits seemed to only pass down method interfaces. <!-- 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/770) <!-- Reviewable:end -->
|
☀️ Test successful - status-travis |
Essentially replicating this from gecko - http://searchfox.org/mozilla-central/source/gfx/2d/DrawTargetSkia.cpp#1390
I contemplated various ways to pass glyph rendering options to rasterize_glyphs either through traits or some struct, but we don't do anything special for linux or mac, so using a option seemed like the best thing, even though it exposes "dwrite" and forces the other platforms to use it. Nor could I find a clean way to pass derived types with data only as traits seemed to only pass down method interfaces.
This change is