Closed Bug 1381981 Opened 7 years ago Closed 6 years ago

Add invalidation for blob image

Categories

(Core :: Graphics: WebRender, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
Tracking Status
firefox56 --- unaffected
firefox57 --- unaffected

People

(Reporter: jrmuizel, Assigned: jrmuizel)

References

Details

(Whiteboard: [wr-reserve] [gfx-noted])

The plan here is to use a separate recording per display item, along with an index that gives the bounds of the display items.

With the index we can merge an update blob image with an existing blob image to produce a blob image that represents the update.
One thing to be careful about is that even though webrender supports specifying a dirty rect for image updates, it assumes that you can still re-render the whole thing in some situations (like if the image is not in the texture cache or if the size changed).
If you want to send a subset of the blob image recording that only renders the dirty rect, you will also need to make sure the blob image renderer is able to build the previous version of the image and replay the update on top of it.
Yep, the intention is that we'll have a merged recording that can will support drawing the entire blob image.
Priority: -- → P3
Whiteboard: [gfx-noted]
The basic sketch for collecting the necessary information for this is as follows:
 - We add a FlushItem(rect) to DrawTarget.
 - Every time that FlushItem is called we start a new recording in DrawTargetRecording.
 - For items that use a temporary surface we'll we'll end up with a FlushItem for the PushLayer call and a FlushItem for the PopLayer call (or equivalent creating/painting of a source surface) 


FlushItem will need a device pixel bounding rect for every item that is being painted. It's not clear to me what the best way to get this is. Thoughts?
Flags: needinfo?(matt.woodrow)
FrameLayerBuilders DrawItems function knows the bounds of the items that it draws.

How do you plan on correlating each entry in the list back to the items?
Flags: needinfo?(matt.woodrow)
I guess you're building this on top of Layer free actually. Still the nsDisplayItem knows the bounds that will be painted, so you can use that.

Can we just create a new recording by hand, rather than adding a new API to DrawTarget?

FlushItem doesn't really make sense for any other consumer of Moz2D, so it seems a pain to add it to the general API.
So after trying to get this to work with FrameLayerBuilder's invalidation, I've concluded that it's probably more work to get working than is worth it. It's not easy to get a good bounding box per frame that corresponds to an area that's strictly inside the invalidation region.

i.e. ComputeGeometryChangeForItem does quite a bit of processing on bounds and such before passing this down to accumulate into a region. We'd need to replicate this when recording the bounds or maintain the information some other way. I've also needed other hacks (like disabling subframe invalidation) to make things work. At this point it seems easier to build up the invalidation infrastructure that we'll need to match, as we'll need to build it for layers-free anyways.
Depends on: 1388845
Priority: P3 → P2
Whiteboard: [gfx-noted] → [wr-mvp] [gfx-noted]
Priority: P2 → P3
Whiteboard: [wr-mvp] [gfx-noted] → [wr-reserve] [gfx-noted]
Assignee: nobody → jmuizelaar
This is on now.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.