Found a simpler function for rounded rects at the cairo cookbook. This handles the simple case and possibly with more work will handle more complex cases.