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

Rasterize blob images during scene building #2759

Closed
nical opened this issue May 15, 2018 · 4 comments
Closed

Rasterize blob images during scene building #2759

nical opened this issue May 15, 2018 · 4 comments
Assignees

Comments

@nical
Copy link
Collaborator

@nical nical commented May 15, 2018

Blob images can some times take forever to rasterize and blocking scrolling on it looks bad.

There is a variety of things we can do to improve this but I'll focus here on the short-term solution that can be improved upon later: During scene building, clip blob images against the display port (which is relatively small at the moment) and rasterize them directly. This should get rid of the majority of cases where we rasterize blobs during frame building.

To do this we need clips and transforms, so I'll split the clip scroll tree update into the part that resolves transforms/clips and the part that makes gpu cache requests so that the former can be done in the scene builder to figure out blob images.
Then we'll see how things go from there.

@nical nical self-assigned this May 15, 2018
@jrmuizel
Copy link
Contributor

@jrmuizel jrmuizel commented May 15, 2018

When I was thinking about your suggestion to just paint on the Gecko side and some things that @mstange said about the visible rect, I thought of an even easier solution to this.

When Gecko builds the display list, it only includes items that are in the display port. In order to do that it keeps track of a current visible rect. Some of these items may extend beyond the visible rect, but items which are entirely outside will get culled. WebRender should never paint more than this visible rect because that will give inconsistent results for the areas outside of it.

The visible rect gets computed and stored on each display item during display list building. We can send the visible rect of the outer display item to webrender and it can just use that during scene building to request and wait for the all of the tiles of the blob image that are in that rect. This avoids having to do any major surgery on webrender.

Why not just size the blob image to the visible rect? Having a larger blob image gives us more flexibility when updating the blob image because we can just change the visible rect without having to update all of the contents.

@nical
Copy link
Collaborator Author

@nical nical commented May 15, 2018

The visible rect gets computed and stored on each display item during display list building. We can send the visible rect of the outer display item to webrender [...]

Nice! sounds like we could clip the bounds of the image display items to this visible rect. you are referring to nsDisplayItem::mVisibleRect, right?

@jrmuizel
Copy link
Contributor

@jrmuizel jrmuizel commented May 15, 2018

Correct.

@gw3583
Copy link
Collaborator

@gw3583 gw3583 commented Aug 2, 2018

@nical Can this be closed now?

@nical nical closed this Aug 3, 2018
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
3 participants
You can’t perform that action at this time.