static cairo_path_t * _cairo_path_create_internal (cairo_path_fixed_t *path_fixed, cairo_gstate_t *gstate, cairo_bool_t flatten) { cairo_path_t *path; //+EAWebKitChange //11/10/2011 path = cairo_malloc (sizeof (cairo_path_t)); //-EAWebKitChange if (path == NULL) { _cairo_error_throw (CAIRO_STATUS_NO_MEMORY); return (cairo_path_t*) &_cairo_path_nil; } path->num_data = _cairo_path_count (path, path_fixed, _cairo_gstate_get_tolerance (gstate), flatten); if (path->num_data < 0) { //+EAWebKitChange //11/10/2011 cairo_free (path); //-EAWebKitChange return (cairo_path_t*) &_cairo_path_nil; } if (path->num_data) { path->data = _cairo_malloc_ab (path->num_data, sizeof (cairo_path_data_t)); if (path->data == NULL) { //+EAWebKitChange //11/10/2011 cairo_free (path); //-EAWebKitChange _cairo_error_throw (CAIRO_STATUS_NO_MEMORY); return (cairo_path_t*) &_cairo_path_nil; } path->status = _cairo_path_populate (path, path_fixed, gstate, flatten); } else { path->data = NULL; path->status = CAIRO_STATUS_SUCCESS; } return path; }
static cairo_path_t * _cairo_path_create_internal (cairo_path_fixed_t *path_fixed, cairo_t *cr, cairo_bool_t flatten) { cairo_path_t *path; path = xmemory_alloc (sizeof (cairo_path_t)); if (unlikely (path == XNULL)) { _cairo_error_throw (CAIRO_STATUS_NO_MEMORY); return (cairo_path_t*) &_cairo_path_nil; } path->num_data = _cairo_path_count (path, path_fixed, cairo_get_tolerance (cr), flatten); if (path->num_data < 0) { xmemory_free (path); return (cairo_path_t*) &_cairo_path_nil; } if (path->num_data) { path->data = _cairo_malloc_ab (path->num_data, sizeof (cairo_path_data_t)); if (unlikely (path->data == XNULL)) { xmemory_free (path); _cairo_error_throw (CAIRO_STATUS_NO_MEMORY); return (cairo_path_t*) &_cairo_path_nil; } path->status = _cairo_path_populate (path, path_fixed, cr, flatten); } else { path->data = XNULL; path->status = CAIRO_STATUS_SUCCESS; } return path; }