Skip to content

Blob improvements #3497

Open
Open
@nical

Description

@nical

Logging some ideas for later to make blob a bit better. Some of them aren't very hard to implement, some more so (maybe even to the point that getting basic path rendering working on the GPU to avoid blobs in a lot of cases would be a better use of our time).

Detecting empty tiles

On some pages we have a lot of tiles that have nothing rendered at all (especially because of the small tile size). All of these tiles get allocated and uploaded which is not cheap. We could have the blob painting callback communicate to the rasterizer that nothing was painted to that tile and just not render anything.

Another common case is tiles with only a solid color covering the entire tile. it's unfortunately quite a bit harder to detect because the shape that covers the tile might not be a simple rect but on some sites it would make a difference if we could detect it and turn it into a solid rect primitive in webrender.

Detecting opaque tiles

Somewhat similar to the above, if we could detect that an opaque command covers an entire tile we could mark the tile as opaque and reduce overdraw.

Tiled dirty regions

Now that blobs and images have different creation/update APIs we could add some more blob-tailored mechanisms for updating blobs. In particular right now we pass a dirty rect but we could instead pass a bit mask or a list of tile offsets that were invalidated and avoid repainting a lot of tiles when two small things that are far apart change (I see that happening on some test cases).

Recycling tile allocations

We currently reallocate the tile's buffer each time. Not cheap.

More advanced scheduling mechanism for blob rasterization.

During the transaction we could rasterize all of the tiles that were visible at the time the transaction was created plus some threshold, and start rasterizing the rest asynchronously without waiting for the render backend to request the missing tiles. The blob backend could hold on to a sort of promise object per tile that would block until rasterization is complete for its corresponding tile (and even work-steal that tile if it hasn't started rasterizing on another thread).
This would be equivalent to what we have now but would allow rasterizing less during scene building while making it likely for tiles to be rasterized by the time scrolling reaches them.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions