-
Notifications
You must be signed in to change notification settings - Fork 306
Fix some calculation errors for ps_split_composite and make_polygon. #1787
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
| anchor: usize, | ||
| device_pixel_ratio: f32, | ||
| ) -> Polygon<f32, WorldPixel> { | ||
| //TODO: only work with `isolated_items_bounds.size` worth of space |
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.
why is this comment removed?
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 removed this accidentally. I'll add it back.
| AlphaBatchTask src_task = fetch_alpha_batch_task(ci.src_task_index); | ||
| AlphaBatchTask dest_task = fetch_alpha_batch_task(ci.render_task_index); | ||
|
|
||
| vec2 dest_origin = dest_task.render_target_origin - |
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.
nice!
webrender/src/frame_builder.rs
Outdated
| let rect = stacking_context.screen_bounds.to_f32() / device_pixel_ratio; | ||
| let bounds = LayerRect::new(LayerPoint::new(rect.origin.x, rect.origin.y), | ||
| LayerSize::new(rect.size.width, rect.size.height)); | ||
| return Polygon::from_transformed_rect(bounds, LayerToWorldTransform::identity(), anchor); |
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.
hmm, I'm not seeing the point here. If a stacking context has no items to isolate, why would we even want it to participate in the plane splitting (and hence, generate a polygon here)?
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.
In the reftest we have following display list.
sc1 (preserve3d)
sc2 (preserve3d)
rect1
sc3 (flat)
sc4 (preserve3d)
sc5 (preserve3d)
rect2
sc6 (preserve3d)
rect3
We'll create plane splitting for rect 2 and rect 3, then render it in sc3. Next, we'll create plane splitting for sc3 and render it on the screen. Thus, we have a sc with no item bound but need a plane splitting. Does it makes sense?
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 believe the isolated_items_bounds for SC3 would then need to include the bounds of SC4. Given that SC4 is transformed, its bounds would need to be projected onto SC3 (transformed).
69f04bd to
556ee36
Compare
|
@kvark , Now if the SC doesn't have any primitive I'll use the union of all children's bounds as isolated_items_bounds. Can you review it again? Thanks. |
|
@mephisto41 looks good to me now, thank you! |
|
Sure, I'll submit a try. |
|
☔ The latest upstream changes (presumably #1693) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@mephisto41 looks good, thank you! |
|
@bors-servo delegate=mephisto41 |
|
✌️ @mephisto41 can now approve this pull request |
556ee36 to
7c1ffa0
Compare
|
☔ The latest upstream changes (presumably #1844) made this pull request unmergeable. Please resolve the merge conflicts. |
7c1ffa0 to
12f5b3b
Compare
|
@kvark, I found the original solution did not resolved the issue completely. If the SC is not isolation and it contains primitives and preserve-3d SCs. The bounds for make_polygon should include primitives bounds and all SC children bounds. My original solution only works with the non-isolation SC without any primitives. So I add a new test case for this problem and add a condition in the |
1. ps_split_composite shader did not take position of dest_task into account. 2. make_polygon didn't work if isolated_items_bounds is empty.
12f5b3b to
1b97c1f
Compare
Could you have a test case for that? AFAIS, both your reftests have all the contexts being isolated. |
|
I think the SC in line 19 of intermediate-2.yaml is non-isolated SC which has a primitive and a preserve-3d SC. |
|
@mephisto41 ok, I think we are good to go then, thank you! |
|
📌 Commit 1b97c1f has been approved by |
Fix some calculation errors for ps_split_composite and make_polygon. There are some bugs when we have a transform-style:flat in the middle of transform-style:preserve-3d. So I fixed it by following changes. 1. ps_split_composite shader did not take position of dest_task into account. 2. make_polygon didn't work if isolated_items_bounds is empty. r? kvark <!-- 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/1787) <!-- Reviewable:end -->
|
☀️ Test successful - status-appveyor, status-travis |
There are some bugs when we have a transform-style:flat in the middle of transform-style:preserve-3d. So I fixed it by following changes.
account.
r? kvark
This change is