Optimizing Skia Surface Creation for GPU Rendering: Evaluating CPU vs GPU Approaches

102 views
Skip to first unread message

stephane

unread,
Jan 19, 2024, 11:28:08 AM1/19/24
to skia-discuss
What is the most efficient and effective method to create a Skia surface for drawing graphics, with the intention of later converting it into an SkImage for rendering on a GPU-accelerated surface like OpenGL, Vulkan, or Metal, to ensure optimal performance within the graphics pipeline? While creating a CPU-based surface seems easiest, I'm uncertain if it's the most appropriate approach for this purpose.

Jim Van Verth

unread,
Jan 29, 2024, 1:08:10 PM1/29/24
to skia-d...@googlegroups.com
You could create a GPU SkSurface and then use SkSurface::makeImageSnapshot() to get an SkImage from it. That will make a copy, which I'm not sure whether you want or not.

On Fri, Jan 19, 2024 at 11:28 AM stephane <zeus9...@gmail.com> wrote:
What is the most efficient and effective method to create a Skia surface for drawing graphics, with the intention of later converting it into an SkImage for rendering on a GPU-accelerated surface like OpenGL, Vulkan, or Metal, to ensure optimal performance within the graphics pipeline? While creating a CPU-based surface seems easiest, I'm uncertain if it's the most appropriate approach for this purpose.

--
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/99d762fa-7254-4871-a9b2-500e18038c32n%40googlegroups.com.


--

Jim Van Verth |
 Software Engineer | Google.com
Reply all
Reply to author
Forward
0 new messages