Skip to content

Flatten display list structure - #9756

Merged
bors-servo merged 1 commit into
servo:masterfrom
mrobinson:flat-display-lists-webrender
Mar 2, 2016
Merged

bors-servo merged 1 commit into
servo:masterfrom
mrobinson:flat-display-lists-webrender

Conversation

@mrobinson

Copy link
Copy Markdown
Member

Instead of producing a tree of stacking contexts, display list
generation now produces a flat list of display items and a tree of
stacking contexts. This will eventually allow display list construction
to produce and modify WebRender vertex buffers directly, removing the
overhead of display list conversion. This change also moves
layerization of the display list to the paint thread, since it isn't
currently useful for WebRender.

To accomplish this, display list generation now takes three passes of
the flow tree:

    1. Calculation of absolute positions.
    2. Collection of a tree of stacking contexts.
    3. Creation of a list of display items.

After collection of display items, they are sorted based upon the index
of their parent stacking contexts and their position in CSS 2.1
Appendeix E stacking order.

This is a big change, but it actually simplifies display list generation.

Review on Reviewable

@highfive

Copy link
Copy Markdown

warning Warning warning

  • These commits modify gfx and layout code, but no tests are modified. Please consider adding a test!

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Feb 25, 2016
@mrobinson

Copy link
Copy Markdown
Member Author

@pcwalton, @glennw r?

I really am sorry for the size of this patch, but I couldn't really figure out a way to split it up. I'm happy to help out in whatever way to get it reviewed.

@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #9717) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Feb 26, 2016
@pcwalton

pcwalton commented Mar 1, 2016

Copy link
Copy Markdown
Contributor

Review status: 0 of 27 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.


components/gfx/paint_thread.rs, line 58 [r1] (raw file):
How about single_item?

Also, I'm not sure why this flag exists. Could you explain?


components/gfx/paint_thread.rs, line 198 [r1] (raw file):
nit: could be self.layer_details_stack.last().as_ref().map(|layer| layer.layer_properties.id)


Comments from the review on Reviewable.io

@mrobinson

Copy link
Copy Markdown
Member Author

Review status: 0 of 27 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.


components/gfx/paint_thread.rs, line 58 [r1] (raw file):
Sure. This is necessary because we don't want to process the surrounding stacking context of this item. Normally the outermost stacking context, including its transformation and filters are applied to the items drawn. In the case of a canvas element, for example, we should just draw the item at the location specified without worrying about the surrounding context.


Comments from the review on Reviewable.io

@pcwalton

pcwalton commented Mar 1, 2016

Copy link
Copy Markdown
Contributor

Ah, OK.

In that case, this looks good to me modulo the surrounding comments! Rebase and I'll r+.

@mrobinson

Copy link
Copy Markdown
Member Author

Review status: 0 of 27 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.


components/gfx/paint_thread.rs, line 58 [r1] (raw file):
Done.


components/gfx/paint_thread.rs, line 198 [r1] (raw file):
Done.


Comments from the review on Reviewable.io

Instead of producing a tree of stacking contexts, display list
generation now produces a flat list of display items and a tree of
stacking contexts. This will eventually allow display list construction
to produce and modify WebRender vertex buffers directly, removing the
overhead of display list conversion.  This change also moves
layerization of the display list to the paint thread, since it isn't
currently useful for WebRender.

To accomplish this, display list generation now takes three passes of
the flow tree:

        1. Calculation of absolute positions.
        2. Collection of a tree of stacking contexts.
        3. Creation of a list of display items.

After collection of display items, they are sorted based upon the index
of their parent stacking contexts and their position in CSS 2.1
Appendeix E stacking order.

This is a big change, but it actually simplifies display list generation.
@mrobinson
mrobinson force-pushed the flat-display-lists-webrender branch from b5c6e67 to e7019f2 Compare March 1, 2016 23:43
@mrobinson

Copy link
Copy Markdown
Member Author

Thanks for the review! I think I've addressed all your comments and uploaded the rebased patch.


Review status: 0 of 27 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.


Comments from the review on Reviewable.io

@pcwalton

pcwalton commented Mar 2, 2016

Copy link
Copy Markdown
Contributor

@bors-servo: r+

Here we go!

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit e7019f2 has been approved by pcwalton

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. S-needs-rebase There are merge conflict errors. labels Mar 2, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit e7019f2 with merge 62814f7...

bors-servo pushed a commit that referenced this pull request Mar 2, 2016
Flatten display list structure

Instead of producing a tree of stacking contexts, display list
generation now produces a flat list of display items and a tree of
stacking contexts. This will eventually allow display list construction
to produce and modify WebRender vertex buffers directly, removing the
overhead of display list conversion.  This change also moves
layerization of the display list to the paint thread, since it isn't
currently useful for WebRender.

To accomplish this, display list generation now takes three passes of
the flow tree:

        1. Calculation of absolute positions.
        2. Collection of a tree of stacking contexts.
        3. Creation of a list of display items.

After collection of display items, they are sorted based upon the index
of their parent stacking contexts and their position in CSS 2.1
Appendeix E stacking order.

This is a big change, but it actually simplifies display list generation.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9756)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt

@bors-servo
bors-servo merged commit e7019f2 into servo:master Mar 2, 2016
@metajack

metajack commented Mar 2, 2016

Copy link
Copy Markdown
Collaborator

Woohoo!

Great job on this @mrobinson !

@mrobinson
mrobinson deleted the flat-display-lists-webrender branch November 16, 2016 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants