Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/image.c
| Show First 20 Lines • Show All 1,298 Lines • ▼ Show 20 Lines | for (ima = bmain->images.first; ima; ima = ima->id.next) { | ||||
| if (size) { | if (size) { | ||||
| printf("%s len: %.3f MB\n", ima->id.name + 2, (double)size / (double)(1024 * 1024)); | printf("%s len: %.3f MB\n", ima->id.name + 2, (double)size / (double)(1024 * 1024)); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static bool imagecache_check_dirty(ImBuf *ibuf, void *UNUSED(userkey), void *UNUSED(userdata)) | static bool imagecache_check_dirty(ImBuf *ibuf, void *UNUSED(userkey), void *UNUSED(userdata)) | ||||
| { | { | ||||
| if (ibuf == NULL) { | |||||
| return false; | |||||
| } | |||||
| return (ibuf->userflags & IB_BITMAPDIRTY) == 0; | return (ibuf->userflags & IB_BITMAPDIRTY) == 0; | ||||
| } | } | ||||
| void BKE_image_free_all_textures(Main *bmain) | void BKE_image_free_all_textures(Main *bmain) | ||||
| { | { | ||||
| #undef CHECK_FREED_SIZE | #undef CHECK_FREED_SIZE | ||||
| Tex *tex; | Tex *tex; | ||||
| Show All 27 Lines | #endif | ||||
| } | } | ||||
| #ifdef CHECK_FREED_SIZE | #ifdef CHECK_FREED_SIZE | ||||
| printf("%s: freed total %lu MB\n", __func__, tot_freed_size / (1024 * 1024)); | printf("%s: freed total %lu MB\n", __func__, tot_freed_size / (1024 * 1024)); | ||||
| #endif | #endif | ||||
| } | } | ||||
| static bool imagecache_check_free_anim(ImBuf *ibuf, void *UNUSED(userkey), void *userdata) | static bool imagecache_check_free_anim(ImBuf *ibuf, void *UNUSED(userkey), void *userdata) | ||||
| { | { | ||||
| if (ibuf == NULL) { | |||||
| return true; | |||||
| } | |||||
| int except_frame = *(int *)userdata; | int except_frame = *(int *)userdata; | ||||
| return (ibuf->userflags & IB_BITMAPDIRTY) == 0 && (ibuf->index != IMA_NO_INDEX) && | return (ibuf->userflags & IB_BITMAPDIRTY) == 0 && (ibuf->index != IMA_NO_INDEX) && | ||||
| (except_frame != IMA_INDEX_ENTRY(ibuf->index)); | (except_frame != IMA_INDEX_ENTRY(ibuf->index)); | ||||
| } | } | ||||
| /* except_frame is weak, only works for seqs without offset... */ | /* except_frame is weak, only works for seqs without offset... */ | ||||
| void BKE_image_free_anim_ibufs(Image *ima, int except_frame) | void BKE_image_free_anim_ibufs(Image *ima, int except_frame) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 4,609 Lines • Show Last 20 Lines | |||||