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 up[WIP] Print WebRender display lists #19826
Conversation
highfive
commented
Jan 21, 2018
|
Heads up! This PR modifies the following files:
|
highfive
commented
Jan 21, 2018
|
See #19676 Blocked by: servo/webrender#2328 The main differences between the two formats are:
|
|
I'm happy to see us continuing to move along this path. |
| color: background_color.to_layout(), | ||
| }))); | ||
|
|
||
| // Skip transparent backgrounds. |
This comment has been minimized.
This comment has been minimized.
mrobinson
Jan 23, 2018
Member
We need to include transparent backgrounds to properly support hit testing.
This comment has been minimized.
This comment has been minimized.
| debug!("Layout done!"); | ||
|
|
||
| // TODO: Avoid the temporary conversion and build webrender sc/dl directly! | ||
| let wr_dl = rw_data.display_list.as_ref().unwrap().convert_to_webrender(self.id).finalize(); |
This comment has been minimized.
This comment has been minimized.
mrobinson
Jan 23, 2018
Member
I think it's be better to avoid obscure abbreviations here. Bytes are practically free! You can just write webrender_display_list.
This comment has been minimized.
This comment has been minimized.
pyfisch
Jan 24, 2018
Author
Contributor
Bytes happen to be practically free but my screen can still only display 100 character in a line.
This comment has been minimized.
This comment has been minimized.
mrobinson
Jan 24, 2018
Member
It's true that long names can lead to having to insert more new lines, but descriptive names make it a lot easier for people who are digesting the code for the first time.
| if opts::get().dump_display_list { | ||
| display_list.print(); | ||
| println!("// Display List from {:?}\n{}", |
This comment has been minimized.
This comment has been minimized.
mrobinson
Jan 23, 2018
Member
Looking at this now, I'm wondering if it's better to make WebRender responsible for printing the display list? Or is WebRender already doing a lot of the work here?
With this change, can't we remove the printing methods from the DisplayList struct as well?
This comment has been minimized.
This comment has been minimized.
pyfisch
Jan 24, 2018
Author
Contributor
Looking at this now, I'm wondering if it's better to make WebRender responsible for printing the display list? Or is WebRender already doing a lot of the work here?
I am not sure if I understand these questions. WebRender has the types and visitors for serialization. The RON crate formats it to actual text and servo just prints it. The comment heading Display List from {:?}is just because I found it somewhat difficult to see where one display list ends and another starts.
With this change, can't we remove the printing methods from the DisplayList struct as well?
Yes we can. This was the WIP part of the PR.
|
Updated. Not sure if I missed some printing stuff. I am not entirely sure how the display lists in servo will look after the migration of WebRender is complete but probably some structure is needed to represent the hierarchy of StackingContexts and to order the display items. This could be printed instead of the WebRender display lists. (And probably formatted as tree like today) |
The debug options * dump-display-list * dump-display-list-json now print WebRender display lists instead of Servo DLs.
|
Finally the name is correct. Some example output: https://gist.github.com/pyfisch/bc859bc53688aa0bc0db6726f9f61205 |
|
The ron output doesn't look super useful for debugging display list issues... What is the best way to make the WebRender display list as readable as the previous output? |
|
I am not sure. Probably the WebRender display lists should also be printed before flattening occurs. (And text spans should be printed and not resolved to glyphs.) |
|
@pyfisch Sorry! I didn't mean to imply that you needed to close this bug. I was just curious if there was a plan to go from the serialization-type output to one oriented toward debugging issues. |
|
I now think that unless WebRender gets some really good serialization for debugging itself it is best to stick with servos own serialization logic and make it work well with the types from WebRender as items. |
|
@pyfisch Okay. I'm sorry if I wasted your time in this review. It wasn't my intention at all. |
pyfisch commentedJan 21, 2018
•
edited by SimonSapin
The debug options
now print WebRender display lists instead of Servo DLs.
This change is