}
-void
+boolean
util_format_translate(enum pipe_format dst_format,
void *dst, unsigned dst_stride,
unsigned dst_x, unsigned dst_y,
util_copy_rect(dst, dst_format, dst_stride, dst_x, dst_y,
width, height, src, (int)src_stride,
src_x, src_y);
- return;
+ return TRUE;
}
assert(dst_x % dst_format_desc->block.width == 0);
FREE(tmp_z);
- return;
+ return TRUE;
}
if (util_format_fits_8unorm(src_format_desc) ||
unsigned tmp_stride;
uint8_t *tmp_row;
+ if (!src_format_desc->unpack_rgba_8unorm ||
+ !dst_format_desc->pack_rgba_8unorm) {
+ return FALSE;
+ }
+
tmp_stride = MAX2(width, x_step) * 4 * sizeof *tmp_row;
tmp_row = MALLOC(y_step * tmp_stride);
if (!tmp_row)
- return;
+ return FALSE;
while (height >= y_step) {
src_format_desc->unpack_rgba_8unorm(tmp_row, tmp_stride, src_row, src_stride, width, y_step);
unsigned tmp_stride;
float *tmp_row;
+ if (!src_format_desc->unpack_rgba_float ||
+ !dst_format_desc->pack_rgba_float) {
+ return FALSE;
+ }
+
tmp_stride = MAX2(width, x_step) * 4 * sizeof *tmp_row;
tmp_row = MALLOC(y_step * tmp_stride);
if (!tmp_row)
- return;
+ return FALSE;
while (height >= y_step) {
src_format_desc->unpack_rgba_float(tmp_row, tmp_stride, src_row, src_stride, width, y_step);
FREE(tmp_row);
}
+ return TRUE;
}
void util_format_compose_swizzles(const unsigned char swz1[4],