Revert "Revert "maybe revert: setPixel applies directly to cache. but, performance issues""

This reverts commit 373c09a9b586772ffc087a925c8cd064f4a18d96.
Revert "Revert "moved canvas cache to a global variable""

This reverts commit 1ad493ee92d2677affc53acf7ce48fd0da0ccabd.