fixed canvas render texture issue

works if matrix is null
Separated out the canvas buffer class