Repository navigation
Use more WebRender types in gfx/display_list. - #19782
Conversation
|
Heads up! This PR modifies the following files:
|
mrobinson
left a comment
There was a problem hiding this comment.
This is great work! I'm really glad to see us moving iteratively toward building a WebRender display list directly. In general, this looks very good to me, but I have a few comments on some minor details that would be good to change.
| }, | ||
| local_clip: LocalClip::from(max_rect().to_rectf()), | ||
| // Create a rectangle of maximal size. | ||
| local_clip: LocalClip::from(LayoutRect::new( |
There was a problem hiding this comment.
It probably makes sense to implement max_rect for LayoutRect if we can. Perhaps this can be a trait.
There was a problem hiding this comment.
There is a trait MaxRect in webrender but I can't use it from servo.
Maybe this trait should instead live in euclid?
There was a problem hiding this comment.
I think it makes sense to at least copy the trait from WebRender and replace max_rect with it.
| /// The algorithm we should use to stretch the image. See `image_rendering` in CSS-IMAGES-3 § | ||
| /// 5.3. | ||
| pub image_rendering: image_rendering::T, | ||
| pub image_rendering: webrender_api::ImageRendering, |
There was a problem hiding this comment.
We are importing the other webrender_api types directly in this file, so we should probably be consistent here and import ImageRendering directly as well.
| /// True if gradient repeats infinitly. | ||
| pub repeating: bool, | ||
| /// Whether the gradient is repeated or clamped. | ||
| pub extend: webrender_api::ExtendMode, |
There was a problem hiding this comment.
Same comment here and other places in the file as well. I would also call this extend_mode in order to make the code more readable.
| stops | ||
| } | ||
|
|
||
| fn as_gradient_extend(repeating: bool) -> ExtendMode { |
There was a problem hiding this comment.
Probably better to call this as as_gradient_extend_mode since, in my opinion, it makes it more obvious what this function does.
| fn simple_normal_border( | ||
| color: ColorF, | ||
| style: webrender_api::BorderStyle, | ||
| ) -> webrender_api::NormalBorder { |
There was a problem hiding this comment.
Again, I'd say just import NormalBorder directly.
| display_list_section, | ||
| ); | ||
|
|
||
| let radius_tmp = build_border_radius(&bounds, border_style_struct); |
There was a problem hiding this comment.
Why not just call this radius or border_radius?
| /// True if gradient repeats infinitly. | ||
| pub repeating: bool, | ||
| /// Whether the gradient is repeated or clamped. | ||
| pub extend: webrender_api::ExtendMode, |
There was a problem hiding this comment.
I would cal this extend_mode in order to make the code more readable.
|
I would also go ahead and title this commit 'Use more WebRender types in gfx/display_list' since I think that's a really excellent summary of what it does. |
|
All comments addressed except for |
|
☔ The latest upstream changes (presumably #19780) made this pull request unmergeable. Please resolve the merge conflicts. |
This uses floating-point (Layout) coordinates in where possible. Replace NormalBorder struct with WebRender equivalent. Remove ToPointF and ToRectF traits. Convert border RepeatKeyword with ToLayout. Add some definitions to malloc_size_of for WebRender types.
It is implemented for LayoutRect and Rect<Au>. Replaces the max_rect() function from servo_geometry.
|
Rebased and updated. Copied the MaxRect trait. |
mrobinson
left a comment
There was a problem hiding this comment.
This looks great! Thank you for the cleanups.
|
@bors-servo r+ |
|
📌 Commit af52233 has been approved by |
Use more WebRender types in gfx/display_list. Use more WebRender types in gfx/display_list. This uses floating-point (Layout) coordinates in where possible. Replace NormalBorder struct with WebRender equivalent. Remove ToPointF and ToRectF traits. Convert border RepeatKeyword with ToLayout. Add some definitions to malloc_size_of for WebRender types. <!-- 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/19782) <!-- Reviewable:end -->
|
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev |
Use more WebRender types in gfx Removes ImageBorder details from gfx. Use WebRender BorderRadius in BoxShadow. Stores cursors as integer. Use FilterOp, BorderWidths from WebRender. Store content_rect as LayoutRect. This amends #19782. <!-- 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/19824) <!-- Reviewable:end -->
Use more WebRender types in gfx Removes ImageBorder details from gfx. Use WebRender BorderRadius in BoxShadow. Stores cursors as integer. Use FilterOp, BorderWidths from WebRender. Store content_rect as LayoutRect. This amends #19782. <!-- 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/19824) <!-- Reviewable:end -->
Use more WebRender types in gfx/display_list.
This uses floating-point (Layout) coordinates in where possible.
Replace NormalBorder struct with WebRender equivalent.
Remove ToPointF and ToRectF traits.
Convert border RepeatKeyword with ToLayout.
Add some definitions to malloc_size_of for WebRender types.
This change is