Blender V4.3
gpencil_update_cache_legacy.cc File Reference
#include <cstdio>
#include "BKE_gpencil_update_cache_legacy.h"
#include "BLI_dlrbTree.h"
#include "BLI_listbase.h"
#include "DNA_gpencil_legacy_types.h"
#include "MEM_guardedalloc.h"

Go to the source code of this file.

Functions

static GPencilUpdateCacheupdate_cache_alloc (int index, int flag, void *data)
 
static void cache_node_free (void *node)
 
static void update_cache_free (GPencilUpdateCache *cache)
 
static void gpencil_traverse_update_cache_ex (GPencilUpdateCache *parent_cache, GPencilUpdateCacheTraverseSettings *ts, int depth, void *user_data)
 
Update Cache API
GPencilUpdateCacheBKE_gpencil_create_update_cache (void *data, bool full_copy)
 
void BKE_gpencil_traverse_update_cache (GPencilUpdateCache *cache, GPencilUpdateCacheTraverseSettings *ts, void *user_data)
 
void BKE_gpencil_free_update_cache (bGPdata *gpd)
 

Function Documentation

◆ BKE_gpencil_create_update_cache()

GPencilUpdateCache * BKE_gpencil_create_update_cache ( void * data,
bool full_copy )

Allocates a new GPencilUpdateCache and populates it.

Parameters
dataA data pointer to populate the initial cache with.
full_copyIf 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 79 of file gpencil_update_cache_legacy.cc.

References data, GP_UPDATE_NODE_FULL_COPY, GP_UPDATE_NODE_LIGHT_COPY, and update_cache_alloc().

◆ BKE_gpencil_free_update_cache()

void BKE_gpencil_free_update_cache ( struct bGPdata * gpd)

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 92 of file gpencil_update_cache_legacy.cc.

References bGPdata::runtime, bGPdata_Runtime::update_cache, and update_cache_free().

Referenced by BKE_gpencil_free_data().

◆ BKE_gpencil_traverse_update_cache()

void BKE_gpencil_traverse_update_cache ( GPencilUpdateCache * cache,
GPencilUpdateCacheTraverseSettings * ts,
void * user_data )

Traverses an update cache and executes callbacks at each level.

Parameters
cacheThe update cache to traverse.
tsThe traversal settings. This stores the callbacks that are called at each level.
user_dataCustom data passed to each callback.

Definition at line 85 of file gpencil_update_cache_legacy.cc.

References gpencil_traverse_update_cache_ex().

◆ cache_node_free()

static void cache_node_free ( void * node)
static

Definition at line 41 of file gpencil_update_cache_legacy.cc.

References MEM_freeN(), and update_cache_free().

Referenced by update_cache_free().

◆ gpencil_traverse_update_cache_ex()

◆ update_cache_alloc()

◆ update_cache_free()

static void update_cache_free ( GPencilUpdateCache * cache)
static