I don't remember very much, but have you tried making a SkImage snapshot on the first call to getImageData (and calls to drawImage that use that canvas), and just reusing that? I think it might do its own caching when you read pixels from it
Also invalidate the snapshot on any calls that invalidate the contents of the snapshot of course (stroke, fill, drawImage, fillRect, strokeRect... probably a couple others).
I have also reimplemented the canvas 2d api using skia for my own stuff.
Also invalidate the snapshot on any calls that invalidate the contents of the snapshot of course (stroke, fill, drawImage, fillRect, strokeRect... probably a couple others).
I have also reimplemented the canvas 2d api using skia for my own stuff.