Skip to content
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

Upgrade webrender #23510

Closed
jdm opened this issue Jun 4, 2019 · 6 comments
Closed

Upgrade webrender #23510

jdm opened this issue Jun 4, 2019 · 6 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Jun 4, 2019

WIP branch that encounters errors in layout:
master...jdm:wrup

Two particular commits that are making this upgrade difficult:
servo/webrender@717b1a2
servo/webrender@d33e637

The errors are coming from the code in layout/display_list/; our display list is a composite of WR item types and Servo item types, since we have a Servo DL construction pass followed by a WR conversion pass in components/layout/display_list/webrender_helpers.rs. The WR changes suggest that we need to merge these passes and create a WR display list from the start, since the things like SpatialId aren't available when we're creating the Servo display list.

@pcwalton
Copy link
Contributor

@pcwalton pcwalton commented Jun 4, 2019

@gankro Perhaps you could point us in the right direction here?

@Eijebong Eijebong self-assigned this Jun 4, 2019
@jdm
Copy link
Member Author

@jdm jdm commented Jun 4, 2019

Relevant errors:

   Compiling layout v0.0.1 (/Users/jdm/src/master-servo/components/layout)
error[E0432]: unresolved import `webrender_api::SpecificDisplayItem`
  --> components/layout/display_list/webrender_helpers.rs:15:22
   |
15 |     PropertyBinding, SpecificDisplayItem,
   |                      ^^^^^^^^^^^^^^^^^^^ no `SpecificDisplayItem` in the root

error[E0412]: cannot find type `LayoutPoint` in module `wr`
   --> components/layout/display_list/conversions.rs:117:21
    |
117 |     type Type = wr::LayoutPoint;
    |                     ^^^^^^^^^^^ not found in `wr`
help: possible candidate is found in another module, you can import it into scope
    |
5   | use webrender_api::units::LayoutPoint;
    |

error[E0063]: missing field `common` in initializer of `webrender_api::display_item::RectangleDisplayItem`
   --> components/layout/display_list/builder.rs:718:17
    |
718 |                 webrender_api::RectangleDisplayItem {
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `common`

error[E0063]: missing fields `bounds`, `common` in initializer of `webrender_api::display_item::ImageDisplayItem`
   --> components/layout/display_list/builder.rs:853:17
    |
853 |                 webrender_api::ImageDisplayItem {
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `bounds`, `common`

error[E0063]: missing fields `bounds`, `common` in initializer of `webrender_api::display_item::GradientDisplayItem`
   --> components/layout/display_list/builder.rs:974:32
    |
974 |                     let item = webrender_api::GradientDisplayItem {
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `bounds`, `common`

error[E0063]: missing fields `bounds`, `common` in initializer of `webrender_api::display_item::RadialGradientDisplayItem`
   --> components/layout/display_list/builder.rs:990:32
    |
990 |                     let item = webrender_api::RadialGradientDisplayItem {
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `bounds`, `common`

error[E0063]: missing field `common` in initializer of `webrender_api::display_item::BoxShadowDisplayItem`
    --> components/layout/display_list/builder.rs:1033:17
     |
1033 |                 webrender_api::BoxShadowDisplayItem {
     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `common`

error[E0063]: missing fields `bounds`, `common` in initializer of `webrender_api::display_item::BorderDisplayItem`
    --> components/layout/display_list/builder.rs:1159:13
     |
1159 |             webrender_api::BorderDisplayItem {
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `bounds`, `common`

error[E0063]: missing fields `bounds`, `common` in initializer of `webrender_api::display_item::BorderDisplayItem`
    --> components/layout/display_list/builder.rs:1263:13
     |
1263 |             webrender_api::BorderDisplayItem {
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `bounds`, `common`

error[E0063]: missing fields `bounds`, `common` in initializer of `webrender_api::display_item::BorderDisplayItem`
    --> components/layout/display_list/builder.rs:1315:13
     |
1315 |             webrender_api::BorderDisplayItem {
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `bounds`, `common`

error[E0063]: missing fields `bounds`, `common` in initializer of `webrender_api::display_item::BorderDisplayItem`
    --> components/layout/display_list/builder.rs:1346:13
     |
1346 |             webrender_api::BorderDisplayItem {
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `bounds`, `common`

error[E0063]: missing fields `area`, `common` in initializer of `webrender_api::display_item::LineDisplayItem`
    --> components/layout/display_list/builder.rs:1377:13
     |
1377 |             webrender_api::LineDisplayItem {
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `area`, `common`

error[E0063]: missing fields `bounds`, `common` in initializer of `webrender_api::display_item::BorderDisplayItem`
    --> components/layout/display_list/builder.rs:1403:13
     |
1403 |             webrender_api::BorderDisplayItem {
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `bounds`, `common`

error[E0063]: missing field `common` in initializer of `webrender_api::display_item::RectangleDisplayItem`
    --> components/layout/display_list/builder.rs:1445:17
     |
1445 |                 webrender_api::RectangleDisplayItem {
     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `common`

error[E0063]: missing field `common` in initializer of `webrender_api::display_item::RectangleDisplayItem`
    --> components/layout/display_list/builder.rs:1491:13
     |
1491 |             webrender_api::RectangleDisplayItem {
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `common`

error[E0063]: missing field `common` in initializer of `webrender_api::display_item::RectangleDisplayItem`
    --> components/layout/display_list/builder.rs:1675:17
     |
1675 |                 webrender_api::RectangleDisplayItem {
     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `common`

error[E0063]: missing fields `bounds`, `common` in initializer of `webrender_api::display_item::ImageDisplayItem`
    --> components/layout/display_list/builder.rs:1826:29
     |
1826 |                             webrender_api::ImageDisplayItem {
     |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `bounds`, `common`

error[E0063]: missing fields `bounds`, `common` in initializer of `webrender_api::display_item::ImageDisplayItem`
    --> components/layout/display_list/builder.rs:1847:25
     |
1847 |                         webrender_api::ImageDisplayItem {
     |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `bounds`, `common`

error[E0063]: missing fields `bounds`, `common` in initializer of `webrender_api::display_item::ImageDisplayItem`
    --> components/layout/display_list/builder.rs:1878:36
     |
1878 |                 let display_item = webrender_api::ImageDisplayItem {
     |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `bounds`, `common`

error[E0560]: struct `webrender_api::display_item::Shadow` has no field named `should_inflate`
    --> components/layout/display_list/builder.rs:2015:25
     |
2015 |                         should_inflate: true,
     |                         ^^^^^^^^^^^^^^ `webrender_api::display_item::Shadow` does not have this field
     |
     = note: available fields are: `offset`, `color`, `blur_radius`

error[E0063]: missing fields `bounds`, `common` in initializer of `webrender_api::display_item::TextDisplayItem`
    --> components/layout/display_list/builder.rs:2074:17
     |
2074 |                 webrender_api::TextDisplayItem {
     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `bounds`, `common`

error[E0063]: missing fields `area`, `common` in initializer of `webrender_api::display_item::LineDisplayItem`
    --> components/layout/display_list/builder.rs:2132:13
     |
2132 |             webrender_api::LineDisplayItem {
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `area`, `common`

error[E0063]: missing fields `bounds`, `common` in initializer of `webrender_api::display_item::BorderDisplayItem`
    --> components/layout/display_list/builder.rs:2845:13
     |
2845 |             webrender_api::BorderDisplayItem {
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `bounds`, `common`

error[E0061]: this function takes 3 parameters but 2 parameters were supplied
   --> components/layout/display_list/webrender_helpers.rs:190:25
    |
190 |                 builder.push_shadow(/*&self.prim_info(),*/ &space_clip_info, item.shadow);
    |                         ^^^^^^^^^^^ expected 3 parameters

error[E0599]: no method named `bounds` found for type `&display_list::items::BaseDisplayItem` in the current scope
   --> components/layout/display_list/webrender_helpers.rs:198:33
    |
198 |                     self.base().bounds(),
    |                                 ^^^^^^-- help: remove the arguments
    |                                 |
    |                                 field, not a method
    |
    = help: items from traits can only be used if the trait is implemented and in scope
    = note: the following trait defines an item `bounds`, perhaps you need to implement it:
            candidate #1: `image::image::GenericImageView`

error: aborting due to 25 previous errors

Some errors have detailed explanations: E0061, E0063, E0412, E0432, E0560, E0599.
For more information about an error, try `rustc --explain E0061`.
error: Could not compile `layout`.
@Gankra
Copy link
Contributor

@Gankra Gankra commented Jun 4, 2019

Not entirely sure what the issue is here, but you can always dummy initialize a lot of things like SpatialIds/ClipIds and do a fixup pass afterwards. For instance, SpatialId::root_scroll_node(PipelineId::dummy()), ClipId::root(PipelineId::dummy()).

(ClipId::invalid() is a thing I want to kill so i am not advising using that)

https://searchfox.org/mozilla-central/source/gfx/wr/webrender_api/src/api.rs#832
https://searchfox.org/mozilla-central/source/gfx/wr/webrender_api/src/display_item.rs#1102

@pcwalton
Copy link
Contributor

@pcwalton pcwalton commented Jun 4, 2019

@gankro Thanks, that's helpful!

@jdm
Copy link
Member Author

@jdm jdm commented Jun 6, 2019

#23516 might be enough, we just need to address the test failures now.

@Eijebong
Copy link
Member

@Eijebong Eijebong commented Jul 12, 2019

#23516 has been merged, this can be closed :)

@Eijebong Eijebong closed this Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.