LibCore+LibWeb: Use Metal backend for Skia painter on macOS

If Metal context and IOSurface are available, Skia painter will use
Ganesh GPU backend on macOS, which is noticeably faster than the default
CPU backend.

Painting pipeline:
1. (WebContent) Allocate IOSurface for backing store
2. (WebContent) Allocate MTLTexture that wraps IOSurface
3. (WebContent) Paint into MTLTexture using Skia
4. (Browser) Wrap IOSurface into Gfx::Painter and use
   QPainter/CoreGraphics to blit backing store into viewport.

Things we should improve in the future:
1. Upload textures for images in advance instead of doing that before
   every repaint.
2. Teach AppKit client to read directly from IOSurface instead of
   copying.
This commit is contained in:
Aliaksandr Kalenik
2024-06-26 17:56:55 +02:00
committed by Alexander Kalenik
parent 8de9516272
commit 79acb998e1
10 changed files with 288 additions and 21 deletions

View File

@@ -9,9 +9,21 @@
"libjpeg-turbo",
{
"name": "libpng",
"features": [ "apng" ]
"features": [
"apng"
]
},
{
"name": "skia",
"platform": "osx",
"features": [
"metal"
]
},
{
"name": "skia",
"platform": "linux | freebsd | openbsd"
},
"skia",
"sqlite3",
"woff2"
],