Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_image/image_edit.c
| Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | void ED_space_image_set_mask(bContext *C, SpaceImage *sima, Mask *mask) | ||||
| } | } | ||||
| } | } | ||||
| ImBuf *ED_space_image_acquire_buffer(SpaceImage *sima, void **r_lock, int tile) | ImBuf *ED_space_image_acquire_buffer(SpaceImage *sima, void **r_lock, int tile) | ||||
| { | { | ||||
| ImBuf *ibuf; | ImBuf *ibuf; | ||||
| if (sima && sima->image) { | if (sima && sima->image) { | ||||
| const Image *image = sima->image; | |||||
| #if 0 | #if 0 | ||||
| if (sima->image->type == IMA_TYPE_R_RESULT && BIF_show_render_spare()) { | if (image->type == IMA_TYPE_R_RESULT && BIF_show_render_spare()) { | ||||
| return BIF_render_spare_imbuf(); | return BIF_render_spare_imbuf(); | ||||
| } | } | ||||
| else | else | ||||
| #endif | #endif | ||||
| { | { | ||||
| sima->iuser.tile = tile; | sima->iuser.tile = tile; | ||||
| ibuf = BKE_image_acquire_ibuf(sima->image, &sima->iuser, r_lock); | ibuf = BKE_image_acquire_ibuf(sima->image, &sima->iuser, r_lock); | ||||
| sima->iuser.tile = 0; | sima->iuser.tile = 0; | ||||
| } | } | ||||
| if (ibuf) { | if (ibuf) { | ||||
| if (image->type == IMA_TYPE_R_RESULT && ibuf->x != 0 && ibuf->y != 0) { | |||||
| /* Render result might be lazily allocated. Return ibuf without buffers to indicate that | |||||
| * there is image buffer but it has no data yet. */ | |||||
| return ibuf; | |||||
| } | |||||
| if (ibuf->rect || ibuf->rect_float) { | if (ibuf->rect || ibuf->rect_float) { | ||||
| return ibuf; | return ibuf; | ||||
| } | } | ||||
| BKE_image_release_ibuf(sima->image, ibuf, *r_lock); | BKE_image_release_ibuf(sima->image, ibuf, *r_lock); | ||||
| *r_lock = NULL; | *r_lock = NULL; | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 372 Lines • Show Last 20 Lines | |||||