refactoring YUV code -> moving opengl calls into common