Performance fixes

- Cache context object
- Invalidate all pixels in 1 operation on each frame
- Avoid drawing black pixels