UNDERSTANDING ANDROID GRAPHICS INTERNALS – GRAPHIC BUFFER HANDLING INTERFACES

In this post, we touch IGraphicBufferProducer, IGraphicBufferAlloc.

  • IGraphicBufferProducer

Defined in include/gui/IGraphicBufferProducer.h, it was formerly known as ISurfaceTexture. It is the Interface underpinning the queueBuffer(), dequeueBuffer, requestBuffer() and cancelBuffer() operations in Surface class.

An IGraphicBufferProducer is instantiated in ISurfaceComposerClient::createSurface();  BnGraphicBufferProducer implementor is BufferQueue (declared in frameworks/native/include/gui/BufferQueue.h); In SurfaceFlinger, its subclass variant SurfaceTextureLayer with reference to SurfaceFlinger is actually used,  and each instance of SurfaceTextureLayer corresponds to a Layer instance.

  • IGraphicBufferAlloc

Defined in framework/native/include/gui/IGraphicBufferAlloc.h, IGraphicBufferAlloc’s use is coupled with IGraphicBufferProducer to realize dequeueBuffer() operation.  ISurfaceComposer::createGraphicBufferAlloc() creates the interface.

In the SurfaceFlinger, the BnGraphicBufferAlloc implementor is GraphicBufferAlloc, declared in framework/native/include/gui/GraphicBufferAlloc.h.

發佈了8 篇原創文章 · 獲贊 5 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章