mono / SkiaSharp

SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
MIT License
4.14k stars 522 forks source link

[PERFORMANCE] On iOS, layout speed of pages with SKGLView is slow, making layout wobbly at start (SKCanvasView is instantaneous) #2842

Open janne-hmp opened 4 weeks ago

janne-hmp commented 4 weeks ago

Description

On iOS in all SkiaSharp versions from 2.80.3 to 3.00.0 Preview 3.1, when I have an SKGLView on a page, the layout is ordered visibly slowly (adjusting elements back and forth for a few first 100ms or so), causing undesirable wobbliness to the start of the page / new grid made visible on the existing page. If I change the SKGLView to an SKCanvasView, the layout ordering is instant without any wobbliness.

In my case, I have a title, a subtitle, the SKGLView, and a buttons grid on the page, which may change based on which data is being shown. If you change the data on the page, iOS performance is wobbly between the old page data and the new one with SKGLView. On Android or with an SKCanvasView, the page data and the layout are changed instantaneously.

Code

https://github.com/hyvanmielenpelit/GnollHack

Expected Behavior

With SKGLView, the page layout is ordered instantly when it becomes visible, similar to what happens with SKCanvasView.

Actual Behavior

With SKGLView, the page layout is ordered over a few first 100s of milliseconds after the page becomes visible, causing it to look wobbly, with various elements being adjusted in position and size over a period of time. This is in GnollHack especially visible on the menu grid on the GamePage (which shows all game menus in the game), where you can move from showing one menu to another using the same grid.

Version of SkiaSharp

3.x (Alpha)

Last Known Good Version of SkiaSharp

Other (Please indicate in the description)

IDE / Editor

Visual Studio (Windows)

Platform / Operating System

iOS

Platform / Operating System Version

iOS 17.4.1

Devices

iPad 11,7 (and all other tested iOS devices)

Relevant Screenshots

No response

Relevant Log Output

No response

Code of Conduct