As I know so far, surfaceflinger providers surfaces to APP to render to and then composite all the surfaces to the final screen. (If any mistake, please point out Thx).
First question: Is the surface created by surfaceflinger is global available that can be used by all processes. (is the memory of the surface is in GPU memory?)
While as I googled it not possible to share openGL context between processes(here I mean the APP process and the surfaceflinger process). I'm not sure if so as to the GPU memory used by the surface?
If the answer to my first question is yes, than is there any openGL resource sharing to the surfaceflinger when an APP render to the surface? And how these shard things including the memory of the surface worked?