Implement on-demand, tiled drawing

NEW
Unassigned

Status

()

7 years ago
6 years ago

People

(Reporter: cwiiis, Unassigned)

Tracking

Trunk
ARM
Android
Points:
---

Firefox Tracking Flags

(fennec-)

Details

(Reporter)

Description

7 years ago
With the work going on to draw into tiled areas to correspond to the tiled texture that fronts it, it makes sense that we draw on demand, rather than having the drawing driven by Gecko in response to events sent.

Doing this would allow us to more intelligently retain tiles of the page, and to respond quicker to movement/do less unnecessary drawing. It would also allow us to more easily interrupt drawing, in the situation that we can't keep up with what's being drawn on the screen, and should make viewport prediction (bug 729528) more efficient.

For the record, we attempted something similar when using the Java compositor, in bug 716581.

I think there are a few ways we can go about this, here's one:

- Separate layer size from buffer size
- Manually size the display-port to the size of the page
- Rename 'draw' events to 'invalidate' events, and just record the invalid region in layers
- Add interfaces necessary to request tiles be drawn via the CompositorParent (<-- massive simplification!)
- Augment the existing progressive texture upload code (bug 732917) to drive drawing as well as uploading tiles
- Optional: Improve the request interface and progressive upload code to prioritise tiles

The progressive tile upload code is already interruptable. We may use the current window size to pre-render some tiles before they're requested(?)


Another (maybe better, maybe harder) way of going about it would be to add a flag that would mark a frame 'boundless', somehow? (the equivalent of manually setting the displayport to the page size) This would make the display-port sizing part a lot less delicate.

Ideas very much welcome, especially from people that know layout and can point out the stupid assumptions I've probably made.
(Reporter)

Updated

7 years ago
tracking-fennec: --- → ?
I don't yet understand what you're proposing, especially what happens on the main thread vs the compositor thread. Are you talking about doing tile uploads on the main thread synchronously with drawing?
(Reporter)

Comment 2

7 years ago
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #1)
> I don't yet understand what you're proposing, especially what happens on the
> main thread vs the compositor thread. Are you talking about doing tile
> uploads on the main thread synchronously with drawing?

No, though that'd certainly be nice (and will sort-of be the case when tiles are gralloc-backed).

I'm proposing the main thread will not do any drawing until asked to by the compositor thread - Instead, it will just keep track of what tiles it's been asked previously to render, and it will invalidate them as necessary.
I don't fully understand what's being proposed either, but gecko has to drive drawing in many common cases like CSS animations/transitions, animated gifs, canvas, video, etc.  Round-tripping through the compositor adds latency.  This is the approach that was taken with fennec 2.0 and it worked badly for the examples above.

But again, don't fully understand the details here.

As a side note, it's very easy for us to interrupt drawing by having a flag in shmem that the compositor sets and our drawing code reads in critical loops.
BenWa - how is this related to the tile work you are doing?
tracking-fennec: ? → -
I'm already working on related feature in bug 771219, bug 783368.
You need to log in before you can comment on or make changes to this bug.