Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/image.c
| Show First 20 Lines • Show All 182 Lines • ▼ Show 20 Lines | static void image_free_data(ID *id) | ||||
| BKE_image_free_views(image); | BKE_image_free_views(image); | ||||
| MEM_SAFE_FREE(image->stereo3d_format); | MEM_SAFE_FREE(image->stereo3d_format); | ||||
| BKE_icon_id_delete(&image->id); | BKE_icon_id_delete(&image->id); | ||||
| BKE_previewimg_free(&image->preview); | BKE_previewimg_free(&image->preview); | ||||
| BLI_freelistN(&image->tiles); | BLI_freelistN(&image->tiles); | ||||
| BLI_freelistN(&image->gpu_refresh_areas); | |||||
| } | } | ||||
| static void image_foreach_cache(ID *id, | static void image_foreach_cache(ID *id, | ||||
| IDTypeForeachCacheFunctionCallback function_callback, | IDTypeForeachCacheFunctionCallback function_callback, | ||||
| void *user_data) | void *user_data) | ||||
| { | { | ||||
| Image *image = (Image *)id; | Image *image = (Image *)id; | ||||
| IDCacheKey key = { | IDCacheKey key = { | ||||
| ▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | static void image_blend_read_data(BlendDataReader *reader, ID *id) | ||||
| BLI_listbase_clear(&ima->anims); | BLI_listbase_clear(&ima->anims); | ||||
| BLO_read_data_address(reader, &ima->preview); | BLO_read_data_address(reader, &ima->preview); | ||||
| BKE_previewimg_blend_read(reader, ima->preview); | BKE_previewimg_blend_read(reader, ima->preview); | ||||
| BLO_read_data_address(reader, &ima->stereo3d_format); | BLO_read_data_address(reader, &ima->stereo3d_format); | ||||
| LISTBASE_FOREACH (ImageTile *, tile, &ima->tiles) { | LISTBASE_FOREACH (ImageTile *, tile, &ima->tiles) { | ||||
| tile->ok = IMA_OK; | tile->ok = IMA_OK; | ||||
| } | } | ||||
| ima->gpuflag = 0; | |||||
| BLI_listbase_clear(&ima->gpu_refresh_areas); | |||||
| } | } | ||||
| static void image_blend_read_lib(BlendLibReader *UNUSED(reader), ID *id) | static void image_blend_read_lib(BlendLibReader *UNUSED(reader), ID *id) | ||||
| { | { | ||||
| Image *ima = (Image *)id; | Image *ima = (Image *)id; | ||||
| /* Images have some kind of 'main' cache, when NULL we should also clear all others. */ | /* Images have some kind of 'main' cache, when NULL we should also clear all others. */ | ||||
| /* Needs to be done *after* cache pointers are restored (call to | /* Needs to be done *after* cache pointers are restored (call to | ||||
| * `foreach_cache`/`blo_cache_storage_entry_restore_in_new`), easier for now to do it in | * `foreach_cache`/`blo_cache_storage_entry_restore_in_new`), easier for now to do it in | ||||
| ▲ Show 20 Lines • Show All 3,583 Lines • ▼ Show 20 Lines | if (ima->rr) { | ||||
| rr = ima->rr; | rr = ima->rr; | ||||
| } | } | ||||
| else if (ima->type == IMA_TYPE_R_RESULT) { | else if (ima->type == IMA_TYPE_R_RESULT) { | ||||
| if (ima->render_slot == ima->last_render_slot) { | if (ima->render_slot == ima->last_render_slot) { | ||||
| rr = RE_AcquireResultRead(RE_GetSceneRender(scene)); | rr = RE_AcquireResultRead(RE_GetSceneRender(scene)); | ||||
| } | } | ||||
| else { | else { | ||||
| rr = BKE_image_get_renderslot(ima, ima->render_slot)->render; | rr = BKE_image_get_renderslot(ima, ima->render_slot)->render; | ||||
| ima->gpuflag |= IMA_GPU_REFRESH; | |||||
| } | } | ||||
| /* set proper views */ | /* set proper views */ | ||||
| image_init_multilayer_multiview(ima, rr); | image_init_multilayer_multiview(ima, rr); | ||||
| } | } | ||||
| return rr; | return rr; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 2,035 Lines • Show Last 20 Lines | |||||