102 ((
ID *)(icon->
obj))->icon_id = 0;
207 Icon *icon =
nullptr;
209 if (!icon_id ||
G.background) {
228 if (p_prv && *p_prv) {
231 (*p_prv)->changed_timestamp[i]++;
273 if (!
id ||
G.background) {
290 if (p_prv && *p_prv) {
292 (*p_prv)->runtime->icon_id =
id->icon_id;
318 if (!gpl ||
G.background) {
338 if (!preview ||
G.background) {
346 if (preview->
runtime->icon_id) {
348 return preview->
runtime->icon_id;
351 if (
id && id->icon_id) {
352 preview->
runtime->icon_id =
id->icon_id;
353 return preview->
runtime->icon_id;
358 if (!preview->
runtime->icon_id) {
366 id->icon_id = preview->
runtime->icon_id;
373 return preview->
runtime->icon_id;
394 CLOG_ERROR(&
LOG,
"icon ID does not refer to an imbuf icon: %d", icon_id);
405 Icon *icon =
nullptr;
453 const int icon_id =
id->icon_id;
537 std::unique_ptr<uchar> data_wrapper(std::move(data));
541 const int div = 3 * 2 * 3;
542 const int coords_len = data_len / div;
543 if (coords_len * div != data_len) {
547 const uchar header[4] = {
'V',
'C',
'O', 0};
548 uchar *p = data_wrapper.get();
549 if (memcmp(p, header,
ARRAY_SIZE(header)) != 0) {
561 geom->
coords =
reinterpret_cast<decltype(geom-
>coords)>(p);
562 geom->
colors =
reinterpret_cast<decltype(geom-
>colors)>(p + (data_len / 3));
565 geom->
mem = data_wrapper.release();
574 if (data ==
nullptr) {
PreviewImage * BKE_previewimg_id_ensure(ID *id)
PreviewImage ** BKE_previewimg_id_get_p(const ID *id)
void BKE_studiolight_unset_icon_id(StudioLight *sl, int icon_id)
#define BLI_assert_unreachable()
File and directory operations.
void * BLI_file_read_binary_as_mem(const char *filepath, size_t pad_bytes, size_t *r_size)
void * BLI_ghash_popkey(GHash *gh, const void *key, GHashKeyFreeFP keyfreefp) ATTR_WARN_UNUSED_RESULT
bool BLI_ghash_remove(GHash *gh, const void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
GHash * BLI_ghash_int_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
bool BLI_ghash_ensure_p(GHash *gh, void *key, void ***r_val) ATTR_WARN_UNUSED_RESULT
void BLI_linklist_lockfree_free(LockfreeLinkList *list, LockfreeeLinkNodeFreeFP free_func)
LockfreeLinkNode * BLI_linklist_lockfree_begin(LockfreeLinkList *list)
void BLI_linklist_lockfree_clear(LockfreeLinkList *list, LockfreeeLinkNodeFreeFP free_func)
void BLI_linklist_lockfree_insert(LockfreeLinkList *list, LockfreeLinkNode *node)
void BLI_linklist_lockfree_init(LockfreeLinkList *list)
int BLI_thread_is_main(void)
#define POINTER_FROM_INT(i)
#define CLOG_ERROR(clg_ref,...)
ID and Library types, which are fundamental for SDNA.
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
void IMB_freeImBuf(ImBuf *)
int BKE_icon_gplayer_color_ensure(bGPDlayer *gpl)
static LockfreeLinkList g_icon_delete_queue
static int icon_id_ensure_create_icon(ID *id)
bool BKE_icon_is_preview(const int icon_id)
void BKE_icon_changed(const int icon_id)
void BKE_icons_deferred_free()
static void icon_free(void *val)
static int get_next_free_id()
int BKE_icon_preview_ensure(ID *id, PreviewImage *preview)
int BKE_icon_imbuf_create(ImBuf *ibuf)
int BKE_icon_ensure_studio_light(StudioLight *sl, int id_type)
static void icon_free_data(int icon_id, Icon *icon)
static std::mutex gIconMutex
void BKE_icon_id_delete(ID *id)
bool BKE_icon_is_image(const int icon_id)
static int icon_gplayer_color_ensure_create_icon(bGPDlayer *gpl)
Icon_Geom * BKE_icon_geom_from_memory(uchar *data, size_t data_len)
int BKE_icon_geom_ensure(Icon_Geom *geom)
static Icon * icon_ghash_lookup(int icon_id)
static void icon_add_to_deferred_delete_queue(int icon_id)
int BKE_icon_id_ensure(ID *id)
void BKE_icon_set(const int icon_id, Icon *icon)
bool BKE_icon_delete_unmanaged(const int icon_id)
Icon_Geom * BKE_icon_geom_from_file(const char *filename)
ImBuf * BKE_icon_imbuf_get_buffer(int icon_id)
static Icon * icon_create(int icon_id, int obj_type, void *obj)
Icon * BKE_icon_get(const int icon_id)
void BKE_icons_init(int first_dyn_id)
bool BKE_icon_delete(const int icon_id)
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
DeferredIconDeleteNode * next
unsigned char(* colors)[4]
unsigned char(* coords)[2]
DrawInfoFreeFP drawinfo_free
struct LockfreeLinkNode * next
PreviewImageRuntimeHandle * runtime
bGPDlayer_Runtime runtime