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 upFix some calculation errors for ps_split_composite and make_polygon. #1787
Conversation
| ) -> Polygon<f32, WorldPixel> { | ||
| //TODO: only work with `isolated_items_bounds.size` worth of space |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| @@ -38,11 +38,15 @@ void main(void) { | |||
| CompositeInstance ci = fetch_composite_instance(); | |||
| SplitGeometry geometry = fetch_split_geometry(ci.user_data0); | |||
| 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 - | |||
This comment has been minimized.
This comment has been minimized.
| 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); |
This comment has been minimized.
This comment has been minimized.
kvark
Oct 2, 2017
Member
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)?
This comment has been minimized.
This comment has been minimized.
mephisto41
Oct 3, 2017
Author
Contributor
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?
This comment has been minimized.
This comment has been minimized.
kvark
Oct 3, 2017
Member
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
|
@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. |
|
|
|
@mephisto41 looks good, thank you! |
|
@bors-servo delegate=mephisto41 |
|
|
556ee36
to
7c1ffa0
|
|
7c1ffa0
to
12f5b3b
|
@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
|
12f5b3b
to
1b97c1f
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! |
|
|
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 -->
|
|
mephisto41 commentedOct 2, 2017
•
edited by larsbergstrom
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