This is a preparatory patch to add support for nine-patch like
functionality to border gradients. The new API is based on mstage's
proposed API from #1875.