SkCanvas creation tutorial is outdated. Proposal to update it

25 views
Skip to first unread message

Aitor Gomila

unread,
Aug 3, 2025, 12:51:52 PMAug 3
to skia-discuss
Hi! I was following the following tutorial: https://skia.org/docs/user/api/skcanvas_creation/#gpu which instructs to create the most basic SkCanvas (specifically, I was following the GPU part).
I was getting some errors because SkSurfaces and skgpu 'does not exist'. Looking at the documentation, it seems SkSurfaces::RenderTarget had been deprecated. So unfortunately I had to recur to ChatGPT.

The fix is to use SkSurface::MakeRenderTarget and SkBudgeted::kNo. The imports also have to be changed from include/gpu/ganesh/gl to include/gpu/gl.
If this was properly updated other people won't be hours debugging like I was!
Thanks!

Michael Ludwig

unread,
Aug 3, 2025, 12:55:52 PMAug 3
to skia-discuss
What version of Skia are you using? The latest release of Skia uses `SkSurfaces::RenderTarget()` and the GrGLInterface is defined in "include/gpu/ganesh/gl".
Reply all
Reply to author
Forward
0 new messages