Faster alternative to saveLayer

26 views
Skip to first unread message

Sherlock Doyle

unread,
Nov 14, 2021, 5:40:48 AMNov 14
to skia-discuss
I've several complex shapes which I need to draw with some opacity. I'm using saveLayer with a paint of required opacity. Points to note:
  1. Each of the shape has multiple paints, so can't change opacity of those paints.
  2. Each shape might have different opacity, so can't use a single saveLayer for all the shapes.
But each saveLayer almost doubles the time required for drawing.

I've also tried drawing to a Picture (with PictureRecorder) followed by a canvas.drawPicture(picture), which is fast. But as soon as I include a Paint (canvas.drawPicture(picture, nullptr, paint)), it slows down.

Any suggestions?
Reply all
Reply to author
Forward
0 new messages