Open Bug 720575 Opened 13 years ago Updated 2 years ago

Make thumbnailing faster and/or asynchronous


(Core :: Graphics: Canvas2D, defect)





(Reporter: ttaubert, Unassigned)


(Depends on 3 open bugs, Blocks 3 open bugs)


(Whiteboard: [Async:ready])

Spin-off from bug 497543 comment #74:

"When thumbnailing a visible tab, we could just recompose the layer subtree for that tab. This should be very fast (apart from reading back from the GPU). With OMTC, it can be made asynchronous as well if necessary. This will require new layers API and some drawWindow implementation changes, though. We could make it even cheaper by making a new API to deliver a copy of the visible tab next time we recompose it normally; then we could keep a copy of what was composited for the visible tab, and read it back asynchronously."
Depends on: 809043
Blocks: 742594
Depends on: 809051
We already have the support to do this use draw widget layers feature so morphing this bug into optimizing thumbnailing by using this feature.
Component: Canvas: 2D → Places
Product: Core → Toolkit
Summary: Make drawWindow() faster and/or asynchronous → Make thumbnailing faster and/or asynchronous
Depends on: 809056
(In reply to Benoit Girard (:BenWa) from comment #1)
> We already have the support to do this use draw widget layers feature

Do you mean DRAWWINDOW_USE_WIDGET_LAYERS? Last I heard there were various issues making that not suitable for use here (like maybe bug 678392 comment 48, but there are others I can't find at the moment).

It also doesn't really cover the "async" parts of comment 0. I see we have asyncDrawXULElement now, but bug 619591 means there's no way to tell when it's done...
Component: Places → Canvas: 2D
Product: Toolkit → Core
DRAWWINDOW_USE_WIDGET_LAYERS will only ever work for content that is currently visible on screen, so if you want to use this for background tabs it's not going to help.
We only currently need to capture tabs that are on screen, AFAIK, but having a fast/async way to do background tabs could be useful too.
We could extend DRAWWINDOW_USE_WIDGET_LAYERS to composite the screen without doing a finish with hardware compositing. This would be somewhat async since we wouldn't wait on the GPU to complete thus reducing main thread wait for thumbnail. That + off main thread encoding would help.
No longer blocks: 841495
I discussed the issue with nical. It would be rather simple to extend the composer with an async API that would callback with a copy of the screen after the next redisplay.
No longer depends on: 809051, 809056 has a proposal for improving things here (not quite sure how that compares to bug 744100).
For reference, here is the Telemetry:

50% of cases are above 21ms, which is not good.
5% are 80ms, which is bad.
Whiteboard: [Async] → [Async:ready]
blocking-b2g: 2.2r? → ---
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.