Android canvas setShadowLayer greatly decreases performance
问题 I'm writing a canvas app on android and I'm looking to add shadows, but I've noticed a great slow-down when I add them to my paint object. My code is simple it looks like this: ... Paint paint = new Paint(); paint.setShadowLayer(8.f, 0, 0, 0xff000000); // this line makes terribly slow drawing canvas.drawRect(left, top, right, bottom, paint); How can I make this faster? 回答1: While digging around to find a way to speed up my large text shadows, I stumbled on this question and answer: