Metal clipPath low resolution

80 views
Skip to first unread message

Joe

unread,
May 26, 2023, 4:53:42 AM5/26/23
to skia-discuss
Hello!

I'm having a hard time tracking down an issue I'm experiencing when using Skia through a MTKView on macOS.

It seems that the clipPath sometimes clips at a low resolution. I thought it was an antialiasing problem, but it seems it might be something else.

Here's what I'm trying to render:
Screenshot-uhkzDkkv@2x.png
and here's the result:
Screenshot-O7mJKJR9@2x.png

You might think it's a matter of wrong backing scale, but my rendering contains multiple paths which appear correct, except some other paths that appear pixelated somehow.

Is there some kind of limit in the Metal backend, or some de-optimization that kicks-in under certain conditions that might cause the issue? Does it right a bell?

Thank you!


Joe

unread,
May 26, 2023, 5:03:19 AM5/26/23
to skia-discuss
To add more info:

When rendering the path I've shown in the previous message singularly, it renders correctly. Only when rendering the path inside my whole rendering scene it appears pixelated.

And it's not the only path that is pixelated. It happens reliably on the same paths in the same scene, but not all paths are pixelated. 
I'm using a combination of clipPath + drawPaint to draw all the paths.

Joe

unread,
May 26, 2023, 6:48:17 PM5/26/23
to skia-discuss
It seems the issue is not related to the clipPath, but to blend modes.

I've reported the bug here: 

John Stiles

unread,
May 26, 2023, 7:22:00 PM5/26/23
to skia-d...@googlegroups.com
When you make the Metal surface, do you set framebufferOnly? (

I'm not sure if it's the issue or not, but please try setting framebufferOnly to NO. Some of the advanced blend modes need to read the surface back, and they can't do it when it's set to YES. Alternatively, you can just avoid the advanced blend modes--it's pretty rare that you actually need them, particularly for a simple icon like this. 

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/f168bbf7-6429-4ec1-af08-14d2676d889fn%40googlegroups.com.

Joe

unread,
May 27, 2023, 3:07:53 AM5/27/23
to skia-discuss
Yes, when creating the MTKView I set the framebufferOnly to false.

Unfortunately, I can't disable the blend modes because I'm rendering Sketch documents, and designers love blend modes :)
But I can confirm that indeed disabling the blend modes fixes the issue.
Reply all
Reply to author
Forward
0 new messages