ncvisual_blit: call resize_bitmap() for implicit scaling without multimedia engine #1718

This commit is contained in:
nick black 2021-06-06 01:07:42 -04:00 committed by Nick Black
parent c64e6e265e
commit 383dc90842

View File

@ -64,9 +64,18 @@ int ncvisual_blit(ncvisual* ncv, int rows, int cols, ncplane* n,
ret = 0; ret = 0;
} }
}else{ }else{
if(rgba_blit_dispatch(n, bset, ncv->rowstride, ncv->data, rows, cols, barg) >= 0){ int stride = 4 * cols;
uint32_t* data = resize_bitmap(ncv->data, ncv->pixy, ncv->pixx,
ncv->rowstride, rows, cols, stride);
if(data == NULL){
return -1;
}
if(rgba_blit_dispatch(n, bset, stride, data, rows, cols, barg) >= 0){
ret = 0; ret = 0;
} }
if(data != ncv->data){
free(data);
}
} }
return ret; return ret;
} }