Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

SkPicture draw performance with large number of polygons

49 views
Skip to first unread message

Jeff Wheeler

unread,
Feb 3, 2025, 7:09:00 AMFeb 3
to skia-discuss
Hi,

I am working on a WebGL application where I draw a large number of shapes (lines, polygons, text, etc.; it's for CAD). The shapes are static, but I need to support zoom.

I have been trying to record an SkPicture, cache it, and then draw that to the GL canvas with a transform matrix. But, I have found that Skia spends a relatively long time replaying the drawing commands from the SkPicture and so my frame rate degrades for complex drawings.

I have tried a few other approaches, like drawing to an offscreen SkSurface, but the other techniques I've found all cache the rasterization, which doesn't work well for smoothly scrolling.

Is there an alternative to SkPicture that caches at a more advanced state, e.g. with the vertices mesh, that can then be replayed more efficiently?

Thank you for any advice,

Jeff
Reply all
Reply to author
Forward
0 new messages