porting some code from AOSP to implement hardware canvas
copy some files from Android 4.4 AOSP