canvasTmp can be null in not supported. you can get NPE. please process this error case