3 ms·
You're right but that is not how Flutter works. Flutter supports rendering using multiple client rendering APIs (OpenGL, Metal, Vulkan) and the embedder gets to
by chinmaygarde 6y ago
You're right but that is not how Flutter works. Flutter supports rendering using multiple client rendering APIs (OpenGL, Metal, Vulkan) and the embedder gets to pick one. Based on that decision, the embedder then has to handle WSI to provide the Flutter Engine a render target. In the case of OpenGL, it is a framebuffer object that passes all completeness checks. The engine will render directly to it. This way, the framebuffer backing stores are completely under the control of the embedder and the engine does not have to do unnecessary render to texture passes. The engine will never allocate an array of pixels in host memory when a GPU backend is selected. As you said, that would be slow and inefficient. We typically go to great lengths to minimize the device (and host) allocations and render target switches when rendering.
Disclosure: I am one of the authors of the Flutter Embedder API.