Skia clipping optimization

257 views
Skip to first unread message

Luis Grimaldo

unread,
Jul 5, 2022, 12:56:49 AM7/5/22
to skia-discuss
Hi,
Does Skia optimize to only render or compute operations in a canvas for elements that are only visible for the current clipped bounds? Meaning for example, if I have a large Skottie animation or large SkScene, is it efficient or ok to do a lot of renders (say 100) of that object but clipped on different small circles through out the whole animation/scene?
Thanks

Luis Grimaldo

unread,
Jul 27, 2022, 2:37:35 AM7/27/22
to skia-discuss
Any idea anyone? Thanks!

Brian Osman

unread,
Jul 27, 2022, 9:31:44 AM7/27/22
to skia-d...@googlegroups.com
This is _generally_ efficient, but there are no guarantees, and it partly depends on the kinds and sizes of shapes in your scene. For shapes that are fully outside the clip, SkCanvas does quick rejection (based on bounding box). So if you have many small shapes in your animation, then those that can be fully rejected will incur very little cost. But if you have an animation made of very large shapes, and the clip is intersecting a small region of many of those, then there is likely to be work for each (entire) shape.

--
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/689a5f69-979f-491c-8671-0f9cc6638c66n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages