base: Optimize toGrayscale function

 Let's transform the original bitmap before doing any changes to make it grayscale/tint it

Change-Id: I8126769d6d8fed8464821d92165b086e366c921e
2 files changed