Blender V2.61 - r43446
Classes | Defines | Typedefs | Functions | Variables

cache.c File Reference

#include "MEM_guardedalloc.h"
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
#include "BLI_listbase.h"
#include "BLI_memarena.h"
#include "BLI_threads.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "IMB_filetype.h"
#include "imbuf.h"

Go to the source code of this file.

Classes

struct  ImGlobalTile
struct  ImThreadTile
struct  ImThreadTileCache
struct  ImGlobalTileCache

Defines

#define IB_THREAD_CACHE_SIZE   100

Typedefs

typedef struct ImGlobalTile ImGlobalTile
typedef struct ImThreadTile ImThreadTile
typedef struct ImThreadTileCache ImThreadTileCache
typedef struct ImGlobalTileCache ImGlobalTileCache

Functions

static unsigned int imb_global_tile_hash (const void *gtile_p)
static int imb_global_tile_cmp (const void *a_p, const void *b_p)
static unsigned int imb_thread_tile_hash (const void *ttile_p)
static int imb_thread_tile_cmp (const void *a_p, const void *b_p)
static void imb_global_cache_tile_load (ImGlobalTile *gtile)
static void imb_global_cache_tile_unload (ImGlobalTile *gtile)
void imb_tile_cache_tile_free (ImBuf *ibuf, int tx, int ty)
static void imb_thread_cache_init (ImThreadTileCache *cache)
static void imb_thread_cache_exit (ImThreadTileCache *cache)
void imb_tile_cache_init (void)
void imb_tile_cache_exit (void)
void IMB_tile_cache_params (int totthread, int maxmem)
static ImGlobalTileimb_global_cache_get_tile (ImBuf *ibuf, int tx, int ty, ImGlobalTile *replacetile)
static unsigned int * imb_thread_cache_get_tile (ImThreadTileCache *cache, ImBuf *ibuf, int tx, int ty)
unsigned int * IMB_gettile (ImBuf *ibuf, int tx, int ty, int thread)
void IMB_tiles_to_rect (ImBuf *ibuf)

Variables

static ImGlobalTileCache GLOBAL_CACHE

Detailed Description

Definition in file cache.c.


Define Documentation

#define IB_THREAD_CACHE_SIZE   100

Definition at line 51 of file cache.c.

Referenced by imb_thread_cache_init().


Typedef Documentation

typedef struct ImGlobalTile ImGlobalTile
typedef struct ImThreadTile ImThreadTile

Function Documentation

unsigned int* IMB_gettile ( ImBuf ibuf,
int  tx,
int  ty,
int  thread 
)

Definition at line 403 of file cache.c.

References imb_thread_cache_get_tile(), and ImGlobalTileCache::thread_cache.

static ImGlobalTile* imb_global_cache_get_tile ( ImBuf ibuf,
int  tx,
int  ty,
ImGlobalTile replacetile 
) [static]
static void imb_global_cache_tile_load ( ImGlobalTile gtile) [static]
static void imb_global_cache_tile_unload ( ImGlobalTile gtile) [static]
static int imb_global_tile_cmp ( const void *  a_p,
const void *  b_p 
) [static]

Definition at line 104 of file cache.c.

References ImGlobalTile::ibuf, ImGlobalTile::tx, and ImGlobalTile::ty.

Referenced by IMB_tile_cache_params().

static unsigned int imb_global_tile_hash ( const void *  gtile_p) [static]

Definition at line 97 of file cache.c.

References ImGlobalTile::ibuf, ImGlobalTile::tx, and ImGlobalTile::ty.

Referenced by IMB_tile_cache_params().

static void imb_thread_cache_exit ( ImThreadTileCache cache) [static]

Definition at line 198 of file cache.c.

References BLI_ghash_free(), NULL, and ImThreadTileCache::tilehash.

Referenced by imb_tile_cache_exit().

static unsigned int* imb_thread_cache_get_tile ( ImThreadTileCache cache,
ImBuf ibuf,
int  tx,
int  ty 
) [static]
static void imb_thread_cache_init ( ImThreadTileCache cache) [static]
static int imb_thread_tile_cmp ( const void *  a_p,
const void *  b_p 
) [static]

Definition at line 121 of file cache.c.

References ImThreadTile::ibuf, ImThreadTile::tx, and ImThreadTile::ty.

Referenced by imb_thread_cache_init().

static unsigned int imb_thread_tile_hash ( const void *  ttile_p) [static]

Definition at line 114 of file cache.c.

References ImThreadTile::ibuf, ImThreadTile::tx, and ImThreadTile::ty.

Referenced by imb_thread_cache_init().

void imb_tile_cache_exit ( void  )
void imb_tile_cache_init ( void  )
void IMB_tile_cache_params ( int  totthread,
int  maxmem 
)
void imb_tile_cache_tile_free ( ImBuf ibuf,
int  tx,
int  ty 
)
void IMB_tiles_to_rect ( ImBuf ibuf)

Variable Documentation

Definition at line 93 of file cache.c.