refactor Texture2D.as