You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a project where I am using SkiaSharp to draw to a window provided by GLFW. In the code below, I have reproduced the issue with just Silk.NET's GLFW bindings (whereas I am normally using my own bindings) and SkiaSharp. The code is not doing anything fancy. It simply draws a circle while the window is open, and during a resize, the entire surface is recreated and redrawn.
The issue is that when the window is resized, the drawing is stretched or compressed during the resize. It isn't clear what is causing this, as the entire surface is recreated during the resize callback and the drawing redrawn, and the callback is blocking. In this case, only a constant sized circle in a constant location is drawn, so it should be impossible for the drawing to contain anything other than a circle. However, the circle is often stretched into an ellipse in either or both directions during a window resize.
What's curious is that this does not occur when integrated Intel graphics are used. It only seems to occur when NVIDIA graphics are used. Thus, it is unclear whether this is a SkiaSharp problem, a Skia problem, whatever backend graphics API is being chosen by Skia or SkiaSharp, or an NVIDIA driver problem. I have searched, and it seems pathological resize behavior has occurred in various forms in all three contexts.
This issue prevents any proper resize functionality in a window.
Code
Attached is a .zip of the source file and project. Below is a copy of the source file. This issue occurs on any version of SkiaSharp I have tried, including the latest stable 2.88.8.
I expected that the resize happens as it does in the integrated Intel graphics situation, where the image drawn inside the main loop and resize callback is always as specified and not warped.
Actual Behavior
Resizing with integrated Intel graphics
Integrated.graphics.mp4
Resizing with NVIDIA graphics
NVIDIA.graphics.mp4
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
Windows
Platform / Operating System Version
I am running Windows 11. I currently can't run SkiaSharp on Linux, and I don't have a macOS machine to test on.
winver returns Version 23H2 (OS Build 22631.3447).
Devices
Dell XPS Desktop
Dell XPS 15 laptop
Dell XPS 17 laptop
Relevant Screenshots
You can see in this screenshots how the circle is stretched. The issue seems to be related to a race condition somewhere. In the underlying stack, as the only time a circle is drawn in the top-level code is inside the draw function, and it's a constant circle in the same location every time, so the stretching is being performed by something else.
Description
I have a project where I am using SkiaSharp to draw to a window provided by GLFW. In the code below, I have reproduced the issue with just Silk.NET's GLFW bindings (whereas I am normally using my own bindings) and SkiaSharp. The code is not doing anything fancy. It simply draws a circle while the window is open, and during a resize, the entire surface is recreated and redrawn.
The issue is that when the window is resized, the drawing is stretched or compressed during the resize. It isn't clear what is causing this, as the entire surface is recreated during the resize callback and the drawing redrawn, and the callback is blocking. In this case, only a constant sized circle in a constant location is drawn, so it should be impossible for the drawing to contain anything other than a circle. However, the circle is often stretched into an ellipse in either or both directions during a window resize.
What's curious is that this does not occur when integrated Intel graphics are used. It only seems to occur when NVIDIA graphics are used. Thus, it is unclear whether this is a SkiaSharp problem, a Skia problem, whatever backend graphics API is being chosen by Skia or SkiaSharp, or an NVIDIA driver problem. I have searched, and it seems pathological resize behavior has occurred in various forms in all three contexts.
This issue prevents any proper resize functionality in a window.
Code
Attached is a .zip of the source file and project. Below is a copy of the source file. This issue occurs on any version of SkiaSharp I have tried, including the latest stable 2.88.8.
SilkNETGLFWWindowTest.zip
Expected Behavior
I expected that the resize happens as it does in the integrated Intel graphics situation, where the image drawn inside the main loop and resize callback is always as specified and not warped.
Actual Behavior
Resizing with integrated Intel graphics
Integrated.graphics.mp4
Resizing with NVIDIA graphics
NVIDIA.graphics.mp4
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
Windows
Platform / Operating System Version
I am running Windows 11. I currently can't run SkiaSharp on Linux, and I don't have a macOS machine to test on.
winver
returnsVersion 23H2 (OS Build 22631.3447)
.Devices
Relevant Screenshots
You can see in this screenshots how the circle is stretched. The issue seems to be related to a race condition somewhere. In the underlying stack, as the only time a circle is drawn in the top-level code is inside the
draw
function, and it's a constant circle in the same location every time, so the stretching is being performed by something else.Relevant Log Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: