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 upAllow rasterizing blobs on the scene builder thread #2785
Conversation
956d949
to
122d739
|
|
|
I looked at it briefly, comments below Review status: 0 of 7 files reviewed at latest revision, all discussions resolved, some commit checks failed. webrender/examples/blob.rs, line 224 at r1 (raw file):
given that the same trio appears in webrender/examples/blob.rs, line 226 at r1 (raw file):
would using an associated type be more appropriate here instead of a trait object? webrender/examples/blob.rs, line 246 at r1 (raw file):
can't we do webrender/src/render_backend.rs, line 236 at r1 (raw file):
this is a little concerning to me. Semantically, this is no longer just forwarding the transaction but actually starting the work on it (by rasterizing blobs) webrender/src/resource_cache.rs, line 429 at r1 (raw file):
did you try going with webrender/src/resource_cache.rs, line 433 at r1 (raw file):
Comments from Reviewable |
|
Review status: 0 of 7 files reviewed at latest revision, 6 unresolved discussions, some commit checks failed. webrender/examples/blob.rs, line 224 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
I am not sure what the actual interface will be by the time this merges (do we pass a rect decide which tiles to render or do we pass tiles explicitly, etc), so this is the simple version, but It'll be a struct by the time this PR is finished. webrender/examples/blob.rs, line 226 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
I don't use associated types very often but my understanding is that the actual type needs to be known at compile time which wouldn't work with BlobImageRenderer and its request object that are selected at runtime. webrender/examples/blob.rs, line 246 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Yeah that looks like a remnant of a previous version of the code where this was needed. webrender/src/render_backend.rs, line 236 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
We don't necessarily start any work here. We just take the blob image renderer as &mut in order to let it do a bit of internal bookkeeping when creating the request object. We can hide that behind a webrender/src/resource_cache.rs, line 429 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
I'll give it a try, there's also the option of maintaining a separate array. webrender/src/resource_cache.rs, line 433 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
There's two kinds of tiling: whether the blob image is rendered into separate tiles and whether we upload it into separate tiles in the texture cache. When we support rendering blobs in tiles I don't see a reason to keep the two separate but in the mean time we need to support splitting a big non-tiled blob image into texture cache tiles. Comments from Reviewable |
|
Review status: 0 of 7 files reviewed, 6 unresolved discussions (waiting on @kvark and @nical) webrender/src/resource_cache.rs, line 429 at r1 (raw file): Previously, nical (Nicolas Silva) wrote…
So I looked into this again and the reason I did the replace dance was the classic "gotta call a &mut method while iterating on member array" story. Comments from Reviewable |
|
Review status: 0 of 7 files reviewed, 6 unresolved discussions (waiting on @kvark and @nical) webrender/src/resource_cache.rs, line 429 at r1 (raw file): Previously, nical (Nicolas Silva) wrote…
Sorry, actually it was because the font variants need to move non-copy stuff out of the vector. Comments from Reviewable |
Progress update
Outstanding missing stuff
Assuming gecko already has the visible rect info for each blob image, I think that the simplest approach to fixing the missing stuff is to add something like As a second step, to avoid rasterizing the whole thing at once we could set a tighter visible rect when building the display list, let the culling pass update the visible rect and have it schedule async rasterization as things scroll. That way we would get back some of the benefits of lazy rasterization we had while remaining fully async. |
|
I implemented rasterizing blob tiles and the API to specify the visible rect of an image, which restricts blob rasterization to the tiles that intersect it. On the gecko side I think I figured out how to compute the intersection of the blob image and the viewport, but I haven't integrated that in a way that I can test with the webrender parts yet. |
|
Things are starting to look good on the WebRender side. There were some complications around invalidation, though: Currently with sync blobs we lazily rasterize and block the render backend which means that if a blob is rendered we know it will be uploaded right away, and when we update it, we can decide to render only the dirty rect if the previous version of the blob is in the texture cache. So for now I disabled sending dirty rects to the blob rasterizer implementation. In order to partially redraw blobs it is still possible to tile the image, and only damaged tiles will be rasterized (although full tiles will be rendered, so we might want to try and use small tile sizes). I tested this implementation on http://digitalocean.com/ and it successfully preserves 60fps scrolling while the blob at the bottom of the page renders at ~14fps. So that's great however requesting rasterization for all blob images in the display list means that we rasterize off-screen blobs while we used to only render visible ones, so saving APZ comes at the cost of quite a bit of extra work when an animation keeps invalidating an off-screen blob. I have ideas about how to bring back fine-grained invalidation and rasterize less than the full content of the view port, but I am hopeful that we can first land something that is close to the current version of this PR and add these optimizations as followups. I'll finish the gecko integration and do a try push to see how much of a regression we get from doing this extra amount of rasterization. |
2f62b15
to
3ac231a
|
The PR is not ready to land because some stuff on the gecko side still block testing it thoroughly, but it's ready for reviews. How this worksThe blob image mechanism now has two traits:
When receiving a transaction, the render backend / resource cache look at the list of added and updated blob images in that transaction, collect the list of blob images and tiles that need to be rendered, create a rasterizer, and ship the two to the scene builder. When the scene building and rasterization is done, the render backend receives the rasterized blobs and stores them so that they are available when frame building needs them. Because blob images can be huge, we don't always want to rasterize them entirely during scene building. To decide what should be rasterized, we rely on gecko giving us a hint through the added Sometimes, however, Gecko gets this visible area "wrong", or at least gives webrender a certain visible area but eventually webrender requests tiles during frame building that weren't in that area. I think that this is inevitable because the culling logic in gecko and webrender works very differently, so relying on them to match exactly is fragile at best. Another important detail is that for this to work, resources that are used by blob images (so currently only fonts), need to be in sync with the blobs. Fortunately, fonts are currently immutable so we mostly need to make sure they are added before the transaction is built and removed after the transaction is swapped. If blob images were to use images, then we'd have to either do the same for these images (and disallow updating them), or maintain the state of images before and after scene building like we effectively do for blob. ShortcomingsI'll admit this whole mechanism isn't particularly exciting or beautiful. It's the simplest I could come up with that satisfies the transaction rules and need to b, etc. In its current state it has a few ugly corners:
Both of these things can be mitigated by incorporating the same kind of optimizations we do in gecko's layers tiling logic (copy-on-write tiles, checkerboarding, clever heuristics to decide which tiles are really important to rasterize depending on scroll speed, etc). But it's not clear to me how much effort should go into these optimizations, versus into using blob images less (certainly a mix of both). More importantly it'll be miraculous if this lands as is without making waves, so let's not make it even more complicated, prepare for some regressions and land this anyway, since this makes APZ a ton smoother even if at the expense extra CPU time spent during rasterization. |
Checking i understand what this means: ideally we would only rasterize blobs that are actually on screen, but with this design we need to rasterize all the tiles which might be APZ scrolled onto the screen with the current scene? |
Yes. We can make extensions to this implementation where the render backend decides what critical area needs to be rasterized eagerly and asynchronously schedule rasterization of blobs we think we will see soon because of scroll speed, etc. That would be similar to gecko's layer tiling logic. |
|
|
|
Review ping @kvark @gankro @gw3583 @staktrace (and anyone else interested). |
webrender/src/render_backend.rs, line 1251 at r2 (raw file):
match *update is preferred style webrender/src/resource_cache.rs, line 105 at r2 (raw file):
nit: bob webrender/src/resource_cache.rs, line 758 at r2 (raw file):
Can use expect() here webrender/src/resource_cache.rs, line 901 at r2 (raw file):
Is it worth emitting a warning in this case or recording some kind of stats? Perhaps as a follow up... webrender/src/resource_cache.rs, line 990 at r2 (raw file):
Should we warn / error if we get a not sane request? webrender/src/resource_cache.rs, line 1089 at r2 (raw file):
match *tile webrender/src/scene_builder.rs, line 153 at r2 (raw file):
Could probably be blob_rasterizer.map_or() or similar. webrender_api/src/image.rs, line 184 at r2 (raw file):
nit: teh |
|
Added some minor comments in the review above, nothing major. The overview description above sounds reasonable, although I haven't thought it through completely. It's perhaps worth including that description somewhere in the Overall, I'm happy to get this merged once others are - like you said, it's probably best to get it in and working, and deal with any fallout from it. There is a CI failure - I haven't investigated that, and I expect we'll also want a try run, plus signoff from @kvark before merging. Nice work! |
|
Thanks a lot for starting the review.
It's tricky because pages that run into this might run into this continuously, so I'd rather not make it worse by spamming stdout or stderr.
Maybe we could warn, I'm not sure where the line but it's something to think about. But here again we have to be careful about not spamming stderr if the page runs into this continuously like that gatsbyjs.org page.
It was a build failure while compiling osmesa, let's see if the next round of CI comes greener. |
| Sometimes, however, Gecko gets this visible area "wrong", or at least gives webrender a certain visible area but eventually webrender requests tiles during frame building that weren't in that area. I think that this is inevitable because the culling logic in gecko and webrender works very differently, so relying on them to match exactly is fragile at best. | ||
| So to work around this type of situation, [keep around the async blob rasterizer](https://github.com/servo/webrender/pull/2785/files#diff-3722af8f0bcba9c3ce197a9aa3052014R769) that we sent to the scene builder, and store it in the resource cache when we swap the scene. This blob rasterizer represents the state of the blob commands at the time the transaction was built (and is potentially different from the state of the blob image handler). Frame building [collects a list of blob images](https://github.com/servo/webrender/pull/2785/files#diff-77cbdf7ba9ebae81feb38a64c21b8454R811) (or blob tiles) that are not already rasterized, and asks the current async blob rasterizer to rasterize them synchronously on the render backend. The hope is that this would happen rarely. | ||
|
|
||
| Another important detail is that for this to work, resources that are used by blob images (so currently only fonts), need to be in sync with the blobs. Fortunately, fonts are currently immutable so we mostly need to make sure they are added {before the transaction](https://github.com/servo/webrender/pull/2785/files#diff-77cbdf7ba9ebae81feb38a64c21b8454R440) is built and [removed after](https://github.com/servo/webrender/pull/2785/files#diff-77cbdf7ba9ebae81feb38a64c21b8454R400) the transaction is swapped. If blob images were to use images, then we'd have to either do the same for these images (and disallow updating them), or maintain the state of images before and after scene building like we effectively do for blob. |
This comment has been minimized.
This comment has been minimized.
|
It took me a while to go through the PR, including a force reboot, because (apparently!) address-sanitized Gecko + Reviewable is a deadly combo, literally. Thank you for the "How it works" description, it helps a ton reviewing the big change.
So this appears to be related to display port of Gecko, in which case - why don't we communicate it as such (i.e. a general set_display_port or something) instead of having a state per image?
Why would we want to rely on it? In my understanding, Gecko's viewport should be considered an optimization hint by WR, (e.g. this is how much stuff you should expect to be shown) not much more.
That sounds reasonable to me.
I don't understand this part.
Aren't we only rasterizing the current viewport blobs (as opposed to "entire scene")?
Didn't we previously decide to force those images to be in the texture cache for the duration of async blob rasterization?
examples/blob.rs, line 147 at r3 (raw file):
why is the variable called examples/blob.rs, line 168 at r3 (raw file):
similarly, why is examples/blob.rs, line 169 at r3 (raw file):
nit: could be webrender/doc/blob.md, line 4 at r3 (raw file):
wouldn't this link die after a pull request is closed (and the branch is deleted)? webrender/src/image.rs, line 239 at r3 (raw file):
how can we make sure this case doesn't overflow? webrender/src/image.rs, line 255 at r3 (raw file):
looks like webrender/src/render_backend.rs, line 229 at r3 (raw file):
could this be webrender/src/render_backend.rs, line 1015 at r3 (raw file):
hold on - aren't we rasterizing them on the scene building thread now? webrender/src/render_backend.rs, line 1248 at r3 (raw file):
could also be webrender/src/resource_cache.rs, line 429 at r1 (raw file): Previously, nical (Nicolas Silva) wrote…
what if we go though the updates twice - first, iterating mutably, so that we can do all the things we need, including moving out the font variants (by replacing with webrender/src/resource_cache.rs, line 101 at r3 (raw file):
can it have both the tiled and untiled results? if not, it would be cleaner to make this an enum: enum RasterizedBloobImage {
Single(BlobImageResult),
Tiled(FastHashMap<TileOffset, BlobImageResult>),
}webrender/src/resource_cache.rs, line 489 at r3 (raw file):
so this is asking to split our resource updates into pre/post at the type level webrender/src/resource_cache.rs, line 762 at r3 (raw file):
could this be logic be shared with webrender/src/resource_cache.rs, line 941 at r3 (raw file):
I think by this point we'd long panic if the handler is webrender/src/resource_cache.rs, line 983 at r3 (raw file):
we could also have the webrender/src/resource_cache.rs, line 985 at r3 (raw file):
what happens if they don't intersect? seems like we are missing that code path webrender/src/resource_cache.rs, line 1052 at r3 (raw file):
hmm, seems not obvious that webrender/src/resource_cache.rs, line 1055 at r3 (raw file):
could this just return the rasterizer right away? webrender/src/resource_cache.rs, line 1090 at r3 (raw file):
let's shout out accordingly - at least with webrender/src/resource_cache.rs, line 1344 at r3 (raw file):
does it make sense to still prepare resources if the blob rasterizer is webrender/src/resource_cache.rs, line 1373 at r3 (raw file):
you shouldn't need to do webrender/src/resource_cache.rs, line 1384 at r3 (raw file):
nit: let's print out the request webrender/src/resource_cache.rs, line 1684 at r3 (raw file):
does it have to be heap-allocated? webrender_api/src/image.rs, line 191 at r3 (raw file):
let's comment the hell out of these trait methods, please webrender_api/src/image.rs, line 210 at r3 (raw file):
nit: turn into a doc comment webrender_api/src/units.rs, line 119 at r3 (raw file):
uh, this is tricky. I think of normazilation as a property of an existing space rather than a space of it's own (e.g. normalized device coordinates) wrench/src/blob.rs, line 189 at r3 (raw file):
can just do wrench/src/rawtest.rs, line 201 at r3 (raw file):
isn't this number deterministic? could use a stronger check wrench/src/rawtest.rs, line 269 at r3 (raw file):
nit: reuse image_size |
To do this we'd need to resolve the scroll tree during frame building to figure out where each image item is with respect to the display port (which long term would be my favorite solution, but requires quite a bit more work).
The way I read your question, I think that we are agreeing: relying on gecko's culling and webrender's to match perfectly would be hard/fragile, hence the current approach being to treat the visible area information provided by gecko more as an optimization hint than a drawing parameter like a clip.
currently (non-blob) image updates are applied to the resource cache after we swap the scene. This is because it is information relevant to frame building, so if we were to add image updates to the resource cache when the transaction arrives before scene building, we would expose APZ frames which don't have the new scene built to the updated versions of the images that should arrive later with the scene.
So there is a bit of confusion around viewport/displayport and I totally get it wrong half of the time. In this PR the rectangle that we use to decide what we rasterize is one that corresponds to the size of the entire scene, which in practice represents a few screenfuls of content (it's not the entire page).
This comes back to the problem of being able to know where the image items are in screen space and requires resolving the scroll tree during scene building and doing a subset of the culling phase there. It'd be really cool because we could be much smarter about what to rasterize ahead of time (could take into account scroll direction and velocity, etc), but that requires some work.
It was one of the possibilities we talked about but I believe we ended up leaning towards rasterizing more instead of uploading more. The reason is that doing extra rasterization on the scene builder is costly for the CPU but won't cause janky scrolling, while uploading too much puts us at risk of missing the frame budget in the critical path. |
examples/blob.rs, line 147 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Because it was already called _services in a few parts of the code and copy-pasting ensued. I'll change it to _resources. examples/blob.rs, line 168 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
I'm not sure I understand the question. webrender/doc/blob.md, line 4 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
I guess so? It probably makes most sense to remove this doc from the PR and do it later when we have actual stable urls to link to. webrender/doc/blob.md, line 17 at r3 (raw file): Previously, Darkspirit (Jan Andre Ikenmeyer) wrote…
Done. webrender/src/image.rs, line 239 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
We could use more bits to store tile offsets, but since this is in number of tiles, 16 bits covers quite a bit of area already, and it wouldn't make sense to change it here without changing it everywhere so a lot of hash keys would get bigger. webrender/src/image.rs, line 255 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Sure, that's sugar, though. I'd rather not spend too much time in the details of small things that we can change as followups. webrender/src/render_backend.rs, line 1251 at r2 (raw file): Previously, gw3583 (Glenn Watson) wrote…
Done. webrender/src/render_backend.rs, line 229 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. webrender/src/render_backend.rs, line 1015 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
This comment doesn't make sense anymore. Removed it. webrender/src/render_backend.rs, line 1248 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Sounds reasonable. Let's make it a followup. webrender/src/resource_cache.rs, line 429 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
I'm not sure I follow. To move out the native handle in the font stuff I need to consume the vector. Since the vector is consumed there needs to be another allocation. In order to avoid the allocation we'd need to be able to not move out the font variants without consuming the vector. At some point I tried to add a webrender/src/resource_cache.rs, line 758 at r2 (raw file): Previously, gw3583 (Glenn Watson) wrote…
Done. webrender/src/resource_cache.rs, line 1089 at r2 (raw file): Previously, gw3583 (Glenn Watson) wrote…
Done. webrender/src/resource_cache.rs, line 101 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
I agree the type would look nicer but this currently maps directly to how the things are used, so it would make the code that manipulates rasterized blob images more branchy. I don't mind it too much but let's make it a followup thing if you want to do that. webrender/src/resource_cache.rs, line 762 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. webrender/src/resource_cache.rs, line 941 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
If keys is empty we still want to forward the rasterizer to the scene builder so that frame building gets an up to date rasterizer to deal with missing blobs if any. webrender/src/resource_cache.rs, line 983 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
If we do that we need to add code below to handle tiles being None if there is no dirty rect, so I think it's simpler this way. webrender/src/resource_cache.rs, line 985 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Good question. In theory, viewport tiles cover the entire display list so changes to something outside the are of DL shouldn't get into the blob image, but it doesn't hurt to play safe. I'll make it not request any tile. webrender/src/resource_cache.rs, line 1052 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
It's similar to how requesting texture uploads mutates the dirty rect of the image template: this state represents the amount of invalid content we haven't requested yet, so in my opinion where we request rasterization is the right place to keep track of this information. webrender/src/resource_cache.rs, line 1055 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
We also need to prepare resources when rasterizing missing blobs at which point the rasterizer already exists. webrender/src/resource_cache.rs, line 1090 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. webrender/src/resource_cache.rs, line 1344 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
At this point if we have missing blobs but no blob handler I'm pretty sure we have panicked long ago. webrender/src/resource_cache.rs, line 1373 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. webrender/src/resource_cache.rs, line 1384 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Sure I can make it an webrender/src/resource_cache.rs, line 1684 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Good catch. I removed the allocation. webrender/src/scene_builder.rs, line 153 at r2 (raw file): Previously, gw3583 (Glenn Watson) wrote…
Done. webrender_api/src/image.rs, line 191 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. webrender_api/src/units.rs, line 119 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Physically speaking the normalization is unit-less in the sense that it is a ratio. It's both in DevicePixels divided by DivicePixels, and in LayoutPixels divided by LayoutPixels. We generate it by dividing layout coordinates by layout coordinates and use it by multiplying it to device pixels. wrench/src/blob.rs, line 189 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. wrench/src/rawtest.rs, line 201 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
It's sensible to any heuristic we change in the code that decides to what to rasterize. Right now this code is deterministic but I want to followup with more involved tweaks to compensate the extra work we do due to eager rasterization. This check is there to verify that we don't render thousands of tiles so there isn't much value in making it more precise. |
TileRange is a TypedRect which is in euclid even if one of type parameter is defined in webrender (I tried to be sure). There is a green try push from a week ago but there was a few rather bumpy rebases in between so I do want do another one before landing (I tried on Friday but got stuck with non-trivial wr update) |
|
Latest try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=a167b8873fba6c7b9a6802b88b6046d6580686c3 (so far the failures are unexpected passes) |
|
Looks good, thank you! |
|
|
Allow rasterizing blobs on the scene builder thread The general idea is to let the user of the API provide a list of blob images to rasterize in the transaction which will be rasterized during scene building. On the render backend thread before dispatching the scene building request the blob image renderer builds a request object which is sent over to the scene builder along with the rest of the transaction. In its current state, this PR does not replace the current mechanism for triggering blob image rasterization during culling, it only provides a way to pre-rasterize blobs (which makes it more likely to avoid the lazy rasterization). We can probably simplify this significantly in the future depending on what the long term plan is for blob images. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/2785) <!-- Reviewable:end -->
|
Is bors stuck? The taskcluster jobs on the merge commit passed but it didn't finish the merge... |
|
@bors-servo retry |
Allow rasterizing blobs on the scene builder thread The general idea is to let the user of the API provide a list of blob images to rasterize in the transaction which will be rasterized during scene building. On the render backend thread before dispatching the scene building request the blob image renderer builds a request object which is sent over to the scene builder along with the rest of the transaction. In its current state, this PR does not replace the current mechanism for triggering blob image rasterization during culling, it only provides a way to pre-rasterize blobs (which makes it more likely to avoid the lazy rasterization). We can probably simplify this significantly in the future depending on what the long term plan is for blob images. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/2785) <!-- Reviewable:end -->
|
@staktrace it looks like bors was stuck. I issued a retry - if that doesn't work, we can manually merge, or if @nical pushes an amended commit hash, that is generally enough to fix up the state that bors is in. |
|
|
@bors-servo retry |
Allow rasterizing blobs on the scene builder thread The general idea is to let the user of the API provide a list of blob images to rasterize in the transaction which will be rasterized during scene building. On the render backend thread before dispatching the scene building request the blob image renderer builds a request object which is sent over to the scene builder along with the rest of the transaction. In its current state, this PR does not replace the current mechanism for triggering blob image rasterization during culling, it only provides a way to pre-rasterize blobs (which makes it more likely to avoid the lazy rasterization). We can probably simplify this significantly in the future depending on what the long term plan is for blob images. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/2785) <!-- Reviewable:end -->
|
|
|
@bors-servo retry |
Allow rasterizing blobs on the scene builder thread The general idea is to let the user of the API provide a list of blob images to rasterize in the transaction which will be rasterized during scene building. On the render backend thread before dispatching the scene building request the blob image renderer builds a request object which is sent over to the scene builder along with the rest of the transaction. In its current state, this PR does not replace the current mechanism for triggering blob image rasterization during culling, it only provides a way to pre-rasterize blobs (which makes it more likely to avoid the lazy rasterization). We can probably simplify this significantly in the future depending on what the long term plan is for blob images. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/2785) <!-- Reviewable:end -->
|
|
This commit changes the blob image entry points to allow rasterizing blob images eagerly during scene building to avoid rasterizing them lazily during frame building. This is a tradeoff that in some case will cause more rasterization than is necessary but moves slow rasterization out of the critical path for smooth scrolling.
|
Rebased and squashed. @bors-servo r=kvark |
|
|
Allow rasterizing blobs on the scene builder thread The general idea is to move the rasterization of blob images that we think will be rendered soon to the scene builder thread so that it can happen asynchronously and not block scrolling. The current heuristic for what "we think will be rendered soon" is to rasterize anything that is in the bounds of the display list. This is simple but will typically rasterize more than necessary when off-screen blobs are animated. We can look into tweaking this as a followup. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/2785) <!-- Reviewable:end -->
|
|
nical commentedMay 28, 2018
•
edited by larsbergstrom
The general idea is to move the rasterization of blob images that we think will be rendered soon to the scene builder thread so that it can happen asynchronously and not block scrolling.
The current heuristic for what "we think will be rendered soon" is to rasterize anything that is in the bounds of the display list. This is simple but will typically rasterize more than necessary when off-screen blobs are animated. We can look into tweaking this as a followup.
This change is