Custom implementation of the 9-patch (picture with insets) algorithm in OpenGL for OS X