Combining stride and skia Render Engine

hi there. I am just setting up a new Project. I gonna have 2D Grafics, Text and Videos in one Projeciton.

What is the best combination of tools?

using MediaFoundation Video Player, which forces me to use a stride Renderer? Adding 2D stuff and text with Skia and merge all with a skiaRenderer to Stride? Am I loosing performance comgining both Render Enginges?

Or would you do most 2D stuff with stride and import text as a skiaTexture?

Or would the gstreamer be a solution to stay in Skia only? Never used it so far.

would be grateful to hears your recommodation or experiences


I would say 2D UI in skia, scene in stride. I believe using the geometric layers in skia is a bit of performance tradeoff for a lot of flexibility. Then again, it always depends on your usecase.

I also think that media foundation could come with a dedicated skia player. this video conversion takes a lot of performance.

Gstreamer was the first video implementation and is not maintained any more. last update Q1 2020

thanks. Yes, I think this will be my way again.

And Is there a way to handle 2D Text via Stride. Text will be the mein reason to integrate Skia and not stick to Stride only.

What exactly do you mean by handle? If you are looking for a texture transform there is a “transform” filter textureFX preview.

There’re still plans to bring the Skia version of the VideoPlayer back (there’s a discussion about that on github). Since we switched the rendering backend of Skia to ANGLE, we should be able to reinterpret the Direct3D surface provided by MediaFoundation as a Skia image. This functionality could probably be also made available as a node and uploaded here as a contribution should in not make it into the .4 release. So at least the performance penalties from Texture to SkImage would be gone.

Using Skia and Stride side by side you’ll still need to consider the subtle differences in alpha blending as was pointed out in other threads already. I think switching the Stride engine to Gamma color space would be the best choice then to have the same results in both worlds, but if you’re also rendering 3D content the looks of it will be different / need tweaking. We’re still not happy with that situation, but that’s how it currently is.

I ment Text not Texture, sorry

I’ve recently asked in the skia forums about this issue and got an answer yesterday. the skia developers have added a new color type 3 weeks ago that should work with our setup. however, we have to wait until SkiaSharp adds this or we have to make PR and push for it.

We just recently added a new SkColorType that corresponds to a HW _SRGB format: include/core/SkImageInfo.h - skia - Git at Google

That probably doesn’t exist in SkiaSharp yet, but when it does, I think the correct SkSurface configuration to get linear blending would be to use that color type, and a linear color space (eg, SkColorSpace::MakeSRGBLinear).

related issue: [FEATURE] Update SKColorType to latest to get _SRgb GPU surface support · Issue #1809 · mono/SkiaSharp · GitHub

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.