Platform/GFX/Surfaces: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 73: Line 73:
We mentioned that in the Android world, android::GraphicBuffer provided two key features: serialization, and locking. As we mentioned, in our world, serialization is done by GrallocBufferActor and wrapped by SurfaceDescriptor in cross-platform code. If we walk one level of abstraction up, we're now going to see where we take care of locking.
We mentioned that in the Android world, android::GraphicBuffer provided two key features: serialization, and locking. As we mentioned, in our world, serialization is done by GrallocBufferActor and wrapped by SurfaceDescriptor in cross-platform code. If we walk one level of abstraction up, we're now going to see where we take care of locking.


Locking is currently taken care of by a pair of classes, TextureClient and TextureHost. The producer sees the surface as a TextureClient, and the consumer receives it as a TextureHost. TextureClient and TextureHost only take care of locking themselves; inside, they have a TextureSource that wraps the actual pixels.
Locking is currently taken care of by a pair of classes, TextureClient and TextureHost. The producer sees the surface as a TextureClient, and the consumer receives it as a TextureHost.


For example, here is the diagram for the B2G case:
For example, here is the diagram for the B2G case:




            *** Figure 2: TextureClient/TextureHost, our current best approximation ***
  *** Figure 2: TextureClient/TextureHost, our current best approximation ***
            ***          of a sane surface concept                                ***
  ***          of a sane surface concept                                ***
   
   
   
   
                         paired / IPC                             wraps
                         paired / IPC
         TextureClient  ==================  TextureHost   ------------------------>  TextureSource
         TextureClient  ==================  TextureHost
   
   
                 |                                |                                        |
                 |                                |
   implemented  |                  implemented  |                                         |  implemented
   implemented  |                  implemented  |
       by        V                      by        V                                         V      by
       by        V                      by        V
                                                                    wraps
 
     GrallocTextureClientOGL              GrallocTextureHostOGL -------------->  GrallocTextureSourceOGL
     GrallocTextureClientOGL              GrallocTextureHostOGL
   
   
                 |                                |                                        |
                 |                                |
       wraps    |                        wraps    |                                         |    wraps
       wraps    |                        wraps    |
                 V                                V                                        V
                 V                                V
                           paired / IPC                             wraps
                           paired / IPC
       GrallocBufferActor  ==============  GrallocBufferActor ---------------------> android::GraphicBuffer
       GrallocBufferActor  ==============  GrallocBufferActor




Confirmed users
753

edits

Navigation menu