Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upBasic preserve-3d support #1169
Conversation
|
|
|
Reviewed 17 of 22 files at r1. wrench/reftests/split/simple.yaml, line 7 at r1 (raw file):
CSS uses Comments from Reviewable |
|
Partial review only so far - I'll be working through the remaining files today. |
|
Reviewed 5 of 22 files at r1. webrender/res/ps_split_composite.vs.glsl, line 26 at r1 (raw file):
Extracting this into a webrender/src/frame.rs, line 440 at r1 (raw file):
I think this type might be webrender/src/frame_builder.rs, line 85 at r1 (raw file):
Could you explain how the anchor parameter works? webrender/src/frame_builder.rs, line 254 at r1 (raw file):
What could cause this - I guess if we have mix-blend-mode on a preserve-3d? webrender/src/frame_builder.rs, line 1145 at r1 (raw file):
This doesn't seem right - the local bounds won't take the zoom / transform etc into effect. Shouldn't this be based on the screen bounding rect? webrender/src/frame_builder.rs, line 1155 at r1 (raw file):
It might be clearer to combine this if and the one above into a match statement? webrender/src/frame_builder.rs, line 1284 at r1 (raw file):
I'm not sure I fully understand this part - does this imply that any primitives in a preserve-3d context get rendered without any transform to the intermediate surface? Comments from Reviewable |
|
@kvark In general this looks great! It's far fewer lines of code than I expected (although I guess it helps having the plane splitting crate separate). I have a few questions about the PR above that I don't fully understand - it might be easier to discuss on IRC / Vidyo? |
|
@kvark Ah, I think I understand a bit better now. So the current implementation renders those intermediate sources untransformed into a target. Then it splits them and composites them, applying the transform when compositing the split planes - is that right? I think that if we do it this way, we may have quality issues when the transformed planes have an interesting transform on them - since, I think, we'll end up drawing things like text and borders at the un-zoomed quality level into the intermediate target. If that's right - I wonder if we could do it the inverse way - draw the intermediate surfaces transformed at full zoom / scale, and then composite them in screen space? I'm not sure how easy / feasible that is, or if I'm completely mis-understanding something - does that make any sense? :) |
|
@kvark Also, even if the above is correct - it might still make sense to merge this now, as a step towards that? |
|
Reviewed 1 of 5 files at r2. webrender/res/ps_split_composite.vs.glsl, line 26 at r1 (raw file): Previously, glennw (Glenn Watson) wrote…
thanks, fixed! webrender/src/frame.rs, line 440 at r1 (raw file): Previously, glennw (Glenn Watson) wrote…
fixed webrender/src/frame_builder.rs, line 85 at r1 (raw file): Previously, glennw (Glenn Watson) wrote…
added a comment webrender/src/frame_builder.rs, line 254 at r1 (raw file): Previously, glennw (Glenn Watson) wrote…
yes. These interactions are not supported nicely yet webrender/src/frame_builder.rs, line 1145 at r1 (raw file): Previously, glennw (Glenn Watson) wrote…
I believe you answered this yourself later on: I draw primitives without transforms, then transform the layer when compositing. webrender/src/frame_builder.rs, line 1155 at r1 (raw file): Previously, glennw (Glenn Watson) wrote…
good idea! fixed webrender/src/frame_builder.rs, line 1284 at r1 (raw file): Previously, glennw (Glenn Watson) wrote…
yes wrench/reftests/split/simple.yaml, line 7 at r1 (raw file): Previously, glennw (Glenn Watson) wrote…
agreed, fixed Comments from Reviewable |
3f21d66
to
d34ba26
|
|
|
Nice! The change to bake in screen space actually simplifies quite a bit of the code (conceptually at least), I think. It's perhaps worth a couple of comments describing how the Apart from that, this looks good to me once we get the reftest issue resolved! |
Combined clip rect workaround There is a problem with `combined_local_viewport_rect` that makes it too tight for transformed layers. This PR attempts to work around this, not a proper fix. Having it would make the new reftest of #1169 to pass. r? @mrobinson <!-- 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/1177) <!-- Reviewable:end -->
- match statement for `isolaton` in frame_builder - preserve-3d - make_polygon comments - blerp
Rich comments for in build_render_task(). Removed the hack of getting the reference frame for SplitComposite primitives.
…ve3d content, with a new ref test.
…duplication
| @@ -51,9 +52,10 @@ pub enum RenderTaskLocation { | |||
|
|
|||
| #[derive(Debug, Clone)] | |||
| pub enum AlphaRenderItem { | |||
| Primitive(ClipScrollGroupIndex, PrimitiveIndex, i32), | |||
| Primitive(Option<ClipScrollGroupIndex>, PrimitiveIndex, i32), | |||
This comment has been minimized.
This comment has been minimized.
|
@kvark One minor change above - the |
|
I kinda left this by intention - an ability to draw without transformation may be handy one day, and there is next to no maintenance cost to this feature.
I don't mind cutting it out, just making a comment :)
… On May 1, 2017, at 18:02, Glenn Watson ***@***.***> wrote:
@kvark One minor change above - the Option in the AlphaRenderItem is no longer required, now that we bake in screen space. Once that is done and CI is happy, r=me - let's get this merged!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
That's fine - if it's intentional let's leave it :) |
|
@bors-servo r+ |
|
|
Basic preserve-3d support Goes towards #739 This is a basic implementation that features a green test case. It can be merged independently, but more work is expected to solidify it. There is a lot of interaction of "preserve3d" stacking contexts with filters, composite ops, and such, that is not thought-through or tested at the moment. The new code should be totally safe as long as the client continues to use `TransformStyle::Flat` (as both Gecko/Servo still do). r? @glennw <!-- 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/1169) <!-- Reviewable:end -->
|
|
Better Preserve3D support Follow up to #1169 Includes #1207 r? @glennw @mrobinson - "preserve-3d" only affects children stacking contexts and contained items - generated polygon coordinates of non-zero local bounds - sorting order The Servo PR is being [worked on](servo/servo@master...kvark:preserve3d), but it's not required here, since it may safely continue using `TransformStyle::Flat`. There is at least one feature on the horizon to be implemented before #739 can be truly closed. The `TransformStyle` should be moved out of the stacking context and deserve it's own pushable item (similar to clip-scroll groups). This is required because an item without "preserve-3d" automatically becomes "flat" but does not establish a stacking context, which is [tested by Servo](https://raw.githubusercontent.com/servo/servo/master/tests/wpt/css-tests/css-transforms-1_dev/html/transform3d-sorting-004.htm). Edit: apparently, Chrome disagrees here, so the current approach of WR might stay. Create Bugstar [issue-1362543](https://bugzilla.mozilla.org/show_bug.cgi?id=1362543). <!-- 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/1208) <!-- Reviewable:end -->
WR update: preserve-3d support <!-- Please describe your changes on the following line: --> This is WR update to servo/webrender@d335555 having new features: - limited "preserve-3d" support (servo/webrender#1169, servo/webrender#1208) - rayon thread pool (servo/webrender#1202) - further border rendering improvements Edit: the references to bincode serialization and border styles are removed from here, since they are already integrated into Servo. Edit2: this is alternative/similar to #16801, based on @mrobinson code (see first commit). --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). Related to #9087 Note that I'm unlocking a few tests as well as changing some related to `preserve-3d`. The changes come from common sense and comparison to Chromium. I'm ready to discuss them on a individual basis. <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ There is still an investigation to do with regards to the differences of preserve3d logic between Blink and Gecko. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16775) <!-- Reviewable:end -->
kvark commentedApr 26, 2017
•
edited by larsbergstrom
Goes towards #739
This is a basic implementation that features a green test case. It can be merged independently, but more work is expected to solidify it.
There is a lot of interaction of "preserve3d" stacking contexts with filters, composite ops, and such, that is not thought-through or tested at the moment. The new code should be totally safe as long as the client continues to use
TransformStyle::Flat(as both Gecko/Servo still do).r? @glennw
This change is