Closed Bug 1279131 Opened 9 years ago Closed 8 years ago

Consider using android::SurfaceTexture for sharing content-painted textures to the Compositor on Android

Categories

(Core :: Graphics: Layers, defect, P3)

38 Branch
defect

Tracking

()

RESOLVED DUPLICATE of bug 1092294

People

(Reporter: sotaro, Unassigned)

References

Details

(Keywords: feature, Whiteboard: [gfx-noted])

Attachments

(1 file)

SurfaceTexture owns andoroid::GraphicBuffer(gralloc), it could have better performance for rendering to OpenGL compositor than MemoryTextureData. This was originally motivated by the SurfaceTexture "single buffered mode". https://developer.android.com/reference/android/graphics/SurfaceTexture.html#SurfaceTexture%28int,%20boolean%29
See Also: → 1265824
SurfaceTexture has 2 ways of usages. -[1] android modules rendering via ANativeWindow. + Used for video decoding, camera rendering, OpenGL rendering. + Fiefox android use it for video decoding like the following. > https://github.com/sotaroikeda/firefox-diagrams/blob/master/gfx/gfx_AndroidSurfaceTextureData_47.pdf -[2] Lock ANativeWindow, get drawing buffer and drawing into the buffer. + If we could use SurfaceTexture "single buffered mode", it seems possible use SurfaceTexture as andoroid::GraphicBuffer(gralloc).
The patch creates SurfaceTexture as "single buffered mode". But SurfaceTexture seems not work as using single buffer. Then rendering was a bit broken.
From attachment 8761462 [details] [diff] [review], I saw the following problem. - SurfaceTexture has "single buffered mode" since KK(API 19). But SurfaceTexture does not work as to own single buffer. It worked as double buffering. It caused rendering break. BufferQueue's min max buffer count is always more than 2. It is 2 also in "single buffered mode". Therefore "single buffered mode" SurfaceTexture could allocate 2 buffers. The meaning of "single buffered mode" is not clear, but "single buffered mode" seems broken on android. http://androidxref.com/6.0.1_r10/xref/frameworks/native/libs/gui/BufferQueueCore.cpp#160 - Allocating and deallocating SurfaceTexture rapidly seemed to cause out of file descriptor. - When SurfaceTexture was locked, it needs to pass invalid region. If the invalid region is not passed, it expects that whole locked buffer is rendered during the locking period.
From comment 3, attachment 8761462 [details] [diff] [review] seems not a way to go. But it might help for another investigations.
chromium has a bug to add "single buffer SurfaceTexture mode". https://codereview.chromium.org/1419623008/
Keywords: feature
Whiteboard: [gfx-noted]
I just noticed this is a duplicate of bug 1092294
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: