How to optimize BitmapShader when drawing
I'm developing an android application with a lot of 2D graphics (mostly drawing various shapes on canvas). All shapes have a noisy overlay on them, implemented with bitmapshader.
Everything is very slow. One shape is drawn in 1-2 ms, when without BitmapShader, and in 60-90ms when with. I'm caching my bitmaps, but that doesn't help much.
The slowest line of code is calling drawXYZ, when paint has this BitmapShader applied.
Is it possible to either optimize the BitmapShader usage or bypas it entirely with programmatic noise generation?
UPDATE:
All measurements a开发者_如何转开发re done in emulator on a moderate PC, real phone handles this much faster(3x-4x times), but the redraw lag is irritating still.
精彩评论