encapsulate canvas