Blender
V3.3
|
#include <stdio.h>
#include "BKE_gpencil_update_cache.h"
#include "BLI_dlrbTree.h"
#include "BLI_listbase.h"
#include "BKE_gpencil.h"
#include "DNA_gpencil_types.h"
#include "DNA_userdef_types.h"
#include "MEM_guardedalloc.h"
Go to the source code of this file.
GPencilUpdateCache* BKE_gpencil_create_update_cache | ( | void * | data, |
bool | full_copy | ||
) |
Allocates a new GPencilUpdateCache and populates it.
data | A data pointer to populate the initial cache with. |
full_copy | If true, will mark this update cache as a full copy (GP_UPDATE_NODE_FULL_COPY). If false, it will be marked as a struct copy (GP_UPDATE_NODE_LIGHT_COPY). |
Definition at line 226 of file gpencil_update_cache.c.
References data, GP_UPDATE_NODE_FULL_COPY, GP_UPDATE_NODE_LIGHT_COPY, and update_cache_alloc().
Frees the GPencilUpdateCache on the gpd->runtime. This will not free the data that the cache node might point to. It assumes that the cache does not own the data.
Definition at line 249 of file gpencil_update_cache.c.
References NULL, bGPdata::runtime, bGPdata_Runtime::update_cache, and update_cache_free().
Referenced by BKE_gpencil_free_data(), BKE_gpencil_update_on_write(), and blender::deg::GPencilBackup::restore_to_gpencil().
void BKE_gpencil_tag_full_update | ( | struct bGPdata * | gpd, |
struct bGPDlayer * | gpl, | ||
struct bGPDframe * | gpf, | ||
struct bGPDstroke * | gps | ||
) |
Tags an element (bGPdata, bGPDlayer, bGPDframe, or bGPDstroke) and all of its containing data to be updated in the next update-on-write operation.
The function assumes that when a parameter is NULL all of the following parameters are NULL too. E.g. in order to tag a layer (gpl), the parameters would have to be (gpd, gpl, NULL, NULL).
Definition at line 239 of file gpencil_update_cache.c.
References update_cache_node_create().
Referenced by gpencil_paint_initstroke(), gpencil_sculpt_brush_do_frame(), gpencil_sculpt_brush_init_stroke(), gpencil_stroke_newfrombuffer(), and gpencil_update_geometry().
void BKE_gpencil_tag_light_update | ( | struct bGPdata * | gpd, |
struct bGPDlayer * | gpl, | ||
struct bGPDframe * | gpf, | ||
struct bGPDstroke * | gps | ||
) |
Tags an element (bGPdata, bGPDlayer, bGPDframe, or bGPDstroke) to be updated in the next update-on-write operation. This function will not update any of the containing data, only the struct itself.
The function assumes that when a parameter is NULL all of the following parameters are NULL too. E.g. in order to tag a layer (gpl), the parameters would have to be (gpd, gpl, NULL, NULL).
Definition at line 244 of file gpencil_update_cache.c.
References update_cache_node_create().
void BKE_gpencil_traverse_update_cache | ( | GPencilUpdateCache * | cache, |
GPencilUpdateCacheTraverseSettings * | ts, | ||
void * | user_data | ||
) |
Traverses an update cache and executes callbacks at each level.
cache | The update cache to traverse. |
ts | The traversal settings. This stores the callbacks that are called at each level. |
user_data | Custom data passed to each callback. |
Definition at line 232 of file gpencil_update_cache.c.
References gpencil_traverse_update_cache_ex(), and user_data.
Referenced by BKE_gpencil_update_on_write().
|
static |
Definition at line 43 of file gpencil_update_cache.c.
References GPencilUpdateCacheNode::cache, data, and MEM_callocN.
Referenced by update_cache_node_create_ex().
Definition at line 33 of file gpencil_update_cache.c.
Referenced by update_cache_node_create_ex().
Definition at line 59 of file gpencil_update_cache.c.
References MEM_freeN, node, NULL, and update_cache_free().
Referenced by cache_node_update(), update_cache_free(), and update_cache_node_create_ex().
Definition at line 68 of file gpencil_update_cache.c.
References BLI_dlrbTree_free(), cache_node_free(), GPencilUpdateCache::children, GPencilUpdateCache::data, data, GPencilUpdateCache::flag, GP_UPDATE_NODE_FULL_COPY, node, and update_cache_free().
Referenced by update_cache_node_create_ex().
|
static |
Definition at line 197 of file gpencil_update_cache.c.
References BLI_listbase_is_empty(), GPencilUpdateCache::children, LISTBASE_FOREACH, NULL, GPencilUpdateCacheTraverseSettings::update_cache_cb, and user_data.
Referenced by BKE_gpencil_traverse_update_cache().
|
static |
Definition at line 22 of file gpencil_update_cache.c.
References BLI_dlrbTree_new(), GPencilUpdateCache::children, GPencilUpdateCache::data, data, GPencilUpdateCache::flag, GPencilUpdateCache::index, and MEM_callocN.
Referenced by BKE_gpencil_create_update_cache(), update_cache_node_create(), and update_cache_node_create_ex().
|
static |
Definition at line 52 of file gpencil_update_cache.c.
References BLI_dlrbTree_free(), cache_node_free(), GPencilUpdateCache::children, MEM_freeN, and MEM_SAFE_FREE.
Referenced by BKE_gpencil_free_update_cache(), cache_node_free(), and cache_node_update().
|
static |
Definition at line 160 of file gpencil_update_cache.c.
References BLI_findindex(), data, GPencilUpdateCache::flag, bGPDlayer::frames, GP_UPDATE_NODE_FULL_COPY, GP_UPDATE_NODE_NO_COPY, bGPdata::layers, NULL, bGPdata::runtime, bGPDframe::strokes, bGPdata_Runtime::update_cache, update_cache_alloc(), and update_cache_node_create_ex().
Referenced by BKE_gpencil_tag_full_update(), and BKE_gpencil_tag_light_update().
|
static |
Definition at line 91 of file gpencil_update_cache.c.
References BLI_dlrbTree_add(), BLI_dlrbTree_free(), BLI_dlrbTree_linkedlist_sync(), GPencilUpdateCacheNode::cache, cache_node_alloc(), cache_node_compare(), cache_node_free(), cache_node_update(), GPencilUpdateCache::children, GPencilUpdateCache::data, data, GPencilUpdateCache::flag, GP_UPDATE_NODE_FULL_COPY, GP_UPDATE_NODE_LIGHT_COPY, GP_UPDATE_NODE_NO_COPY, NULL, and update_cache_alloc().
Referenced by update_cache_node_create().