Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What time will you make skiasharp support hardware acceleration? #70

Closed
wildfire810 opened this issue Apr 28, 2016 · 15 comments
Closed

Comments

@wildfire810
Copy link

Excuse me, I want to know: what time will you make skiasharp support hardware acceleration?
Can you please tell me?
Because we plan to use it high load on windows wpf now, and the cross platform feature will be useful.

@migueldeicaza
Copy link
Contributor

You mean the APIs, or the actual libraries that we ship with the product?

The major challenge is that it would be a larger library for corner cases, so we would need to do some packaging work to sort that out.

In the meantime, we would love if you try it out by building the library on your own.

Currently, our main focus is to complete the API bindings, and likely add some of the missing APIs.

@wildfire810
Copy link
Author

Is there any hardware acceleration api in skiasharp?
I can not find it.
I think, the hardware render and soft render are different APIs in skia.
Is this true?

@alanricker
Copy link

I'm confused. Does this mean that the existing version of SkiSharp is using HW graphics acceleration to do the drawing or is it using SW emulation to do the drawing?
If HW, can you tell me what HW graphics API it is using on the various platforms:

  • Windows
  • iOS
  • Android

@wildfire810
Copy link
Author

I think it is useful

https://skia.org/user/api/canvas

Raster - CPU-only.
Ganesh - Skia’s GPU-accelerated backend.
SkPDF - PDF document creation.
SkPicture - Skia’s display list format.
NullCanvas - Useful for testing only.
SkXPS - Experimental XPS backend.
SkSVG - Experimental XPS backend.

https://skia.org/user/api/canvas#ganesh

https://skia.org/user/special/vulkan

@kekekeks
Copy link
Contributor

Actually the only thing needed for hw-acceleration is to properly wire up skia with native OpenGL context. There are some tricks, but I have some experience in doing this in native code. The question is how that should be exposed. See this issue for details. I've also submitted initial design with implementation example but got no response, so I've stopped the work on that front.

@wildfire810
Copy link
Author

How dose the offical dll work on windows?

@wildfire810
Copy link
Author

If offical skia can do, skiasharp should too...

@kekekeks
Copy link
Contributor

How dose the offical dll work on windows?

Official dll needs you to manually provide opengl context and manually configure GrContext. Something like this: https://github.com/AvaloniaUI/libperspesk/blob/master/src/gl.cpp

It's not the code that you want to write in C#.

@wildfire810
Copy link
Author

@mattleibow
Copy link
Contributor

@wildfire810 @kekekeks Right now, the native dll on all the platforms link out the GPU bits as there is no support from SkiaSharp yet... but, as I am busy on #33, that requires some of the GPU bits. As a result, the "next" version should have PDF and GPU support. I am not sure if I will include the C# bindings for GPU just then, as it is more PDF-y. But, once the native bits are there, it will be easy to wrap. Basically, I am doing a bit of work for UWP as this is not yet Google-supported

@alanricker
Copy link

@mattleibow Thanks for the update!
What is the ETA for "next" version?

@alanricker
Copy link

@mattleibow Now that you have closed #33 can you update us on the status of GPU support?
Thanks!

@mattleibow
Copy link
Contributor

@wildfire810, @alanricker, @kekekeks, @bratsche Hardware support is here (-ish)
I have started with getting all the bits together and I think it is working quite well. Right now All the platforms should have OpenGL support (DirectX is coming in a few). This means all the platforms, except UWP, can draw with hardware acceleration.

The global issue for hardware / GPU is here: #138
Please leave comments and suggestions so we can get the best product out.

There is also a preview NuGet: https://www.nuget.org/packages/SkiaSharp/1.53.2-gpu1
Please try that out and be sure to comment on how it went - if there are any features needed, just let us know!

@mdmozibur
Copy link

@mattleibow any update on GPU acceleration in UWP?

@mattleibow
Copy link
Contributor

It has been there for quite some time. Not sure exactly what you mean?

Right out the box, there is the SKSwapChainPanel that is GPU-only. There there is the SKGLView for Xamrin.Forms.

If you are talking the pure, non-UI way, then you have to first set up a GPU context - using ANGLE - and then do the SKSurface.Create.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants