-
Notifications
You must be signed in to change notification settings - Fork 293
Add API on stacking contexts to configure glyph raster mode. #2673
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
r? @gankro @staktrace heads up that this adds a new parameter to If you pass |
NOTE: The scale parameter for local space glyph rasterization is currently ignored. I plan to support using that as a follow up. |
ae1e47c
to
dd5a1e5
Compare
@glennw Noted, thanks! |
Reviewed 22 of 22 files at r1. webrender/src/display_list_flattener.rs, line 337 at r1 (raw file):
Why should the root be rendered in local space? (why isn't this forcing everything to be greyscale?) webrender_api/src/display_item.rs, line 476 at r1 (raw file):
This needs to be marked #[repr(u8)] to be used in a public API (forces a well-defined and stable layout that cbindgen knows about). Comments from Reviewable |
overall looks good, just one question and an easy fix to the type decl. r=me with those addressed. |
dd5a1e5
to
cb6f329
Compare
Review status: 20 of 22 files reviewed at latest revision, 2 unresolved discussions. webrender/src/display_list_flattener.rs, line 337 at r1 (raw file): Previously, Gankro (Alexis Beingessner) wrote…
The root stacking context here never actually contains any elements - it contains the user supplied stacking contexts. I changed it to screen for consistency though. webrender_api/src/display_item.rs, line 476 at r1 (raw file): Previously, Gankro (Alexis Beingessner) wrote…
Done. Comments from Reviewable |
What happens if you have a stacking context with GlyphRasterSpace::Local, and then inside of that, you have a stacking context with GlyphRasterSpace::Screen? Does GlyphRasterSpace::Screen take effect? Or does the inner stacking context rasterize glyphs in the local space of the closest ancestor stacking context with GlyphRasterSpace::Local? In Gecko, we'll want to use GlyphRasterSpace::Local for animated transforms. However, if there's a non-animated transform inside an animated transform, we don't want to rasterize that inner transform's glyphs in screen space. |
@mstange It only references the direct parent stacking context. It sounds like this will match the behaviour you want? |
Oh, I misread - you want the opposite to what it does now. |
@mstange So the options are either that Gecko needs to know about the hierarchy and specify Local in that case for the inner stacking context, or WR can implicitly match that. WR does have access to the complete stacking context stack at the flatten step, so it's easy to do that as a follow up, if that's easiest for Gecko? |
Hmm, I think it would be very easy to do this on the Gecko side. The WebRenderCommandsBuilder can just have a boolean field that says "am I inside an animated transform at the moment". |
The I added a commit that removes the The previous commit can be used as a test case for this compiler bug - I have not managed to reduce it to a smaller case yet. |
re-r? @gankro based on the above comment. |
fb30cb0
to
fd7d2e3
Compare
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.
r=me with nit
(stacking_context.allow_subpixel_aa, stacking_context.glyph_raster_space) | ||
} | ||
None => { | ||
(true, GlyphRasterSpace::Local(1.0)) |
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.
Can this be ScreenSpace too?
This allows configuring per-stacking context whether glyphs are rasterized in screen space or local space. Also add a reftest for the raster modes. In the future, we may want to change this to be a more general raster mode for all primitives and/or allow an individual scale value for x/y in local space mode.
fd7d2e3
to
2646fa2
Compare
@bors-servo r+ |
📌 Commit 2646fa2 has been approved by |
Add API on stacking contexts to configure glyph raster mode. This allows configuring per-stacking context whether glyphs are rasterized in screen space or local space. Also add a reftest for the raster modes. In the future, we may want to change this to be a more general raster mode for all primitives and/or allow an individual scale value for x/y in local space mode. <!-- 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/2673) <!-- Reviewable:end -->
☀️ Test successful - status-appveyor, status-taskcluster |
This allows configuring per-stacking context whether glyphs are
rasterized in screen space or local space.
Also add a reftest for the raster modes.
In the future, we may want to change this to be a more general
raster mode for all primitives and/or allow an individual scale
value for x/y in local space mode.
This change is