Android canvas setShadowLayer greatly decreases performance

前端 未结 3 634
南笙
南笙 2020-12-21 07:58

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 lik

3条回答
  •  醉话见心
    2020-12-21 08:31

    You can achieve almost the same result using this code instead:

    mPaint.setMaskFilter(new BlurMaskFilter(20, BlurMaskFilter.Blur.OUTER));

提交回复
热议问题