Open Bug 1673842 Opened 4 years ago Updated 15 days ago

Use ASurfaceControl with WebRender on Android

Categories

(Core :: Graphics: WebRender, enhancement)

enhancement

Tracking

()

People

(Reporter: sotaro, Assigned: sotaro)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

No description provided.
Assignee: nobody → sotaro.ikeda.g
Blocks: 1562818
Summary: Investigate if ASurfaceControl could be used for wr os compositor on Android → Use ASurfaceControl for os compositor on Android

For now, ASurfaceControl with AndroidHardwareBuffer seems to work well with wr os compositor api. But it could cause performance problems on android.

  • AndroidHardwareBuffer is a scarce resource. wr os compositor uses more hardware buffers than just default frame buffer.
  • AndroidHardwareBuffer allocation is slow.
  • When a lot of tiles are used by WebRender, it could make android SurfaceFlinger heavy weight.

Then it seems better if WebRender supports default frame buffer + Video/WebGL overlay like chromium. When Video/WebGL texture provides AndroidHardwareBuffer, the buffer could be directly posted to android SurfaceFlinger via ASurfaceControl.

:gw, is it possible to add "default frame buffer + Video/WebGL overlay" support to WebRender on Android?

Flags: needinfo?(gwatson)

It could be possible, yes.

One option, for example, would be to have a single picture cache slice (possibly with larger tiles than default) and support a single compositor video / webgl surface.

Do you have any performance numbers for the cost per allocation / slowdown when using different number of tiles?

Flags: needinfo?(gwatson)

Great! I do not have an actual performance number. I am going to check it.

I tested with the current D95258. During scrolling, tiles were allocated and de-allocated regularly.

  • AndroidHardwareBuffer creation : 0.4ms - 1.3ms
  • EGLImage creation : 0.1ms - 0.3ms
  • SurfaceControl creation : 0.5ms - 1.5ms

And ASurfaceControl transaction duration from commit to callback took 20ms - 40ms. It seems to mean android SurfaceFlinger became busy.

Since, when ASurfaceControl was used only for WebGL, ASurfaceControl transaction duration from commit to callback took around 10ms. And it does not have tile allocation/de-allocation.

D96523 was used to check "ASurfaceControl was used only for WebGL".

Summary: Use ASurfaceControl for os compositor on Android → Use ASurfaceControl with WebRender on Android
Depends on: 1811424
Blocks: 1811424
No longer depends on: 1811424
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: