Skia clipping optimization

Skip to first unread message

Luis Grimaldo

Jul 5, 2022, 12:56:49 AMJul 5
to skia-discuss
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?

Luis Grimaldo

Jul 27, 2022, 2:37:35 AMJul 27
to skia-discuss
Any idea anyone? Thanks!

Brian Osman

Jul 27, 2022, 9:31:44 AMJul 27
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
To view this discussion on the web visit
Reply all
Reply to author
0 new messages