3 ms·
If Canvas means pixmap/bitmap (2D array of pixels) then unfortunately that's not enough in modern world. On high-dpi monitors you must use GPU to offload raste
by c-smile 6y ago
If Canvas means pixmap/bitmap (2D array of pixels) then unfortunately that's not enough in modern world.
On high-dpi monitors you must use GPU to offload rasterization of drawing primitives from CPU to GPU.
Otherwise the only job your will do is drawing at 100% load - say "hi" to batteries and other apps on the desktop.
That's why I am supporting in Sciter as plain pixmap targets as GPU based ones: Direct2D/DirectX, Skia/OpenGL/Vulkan + the ones used by OS -CoreGraphics and Cairo.
- diskzero 6y agoFlutter has a Skia-based backend with GPU acceleration. A bitmap/pixmap solution would be the worst-case scenario and probably only occur on an esoteric platform where GPU support is absent.
- chinmaygarde 6y agoYou'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.