23#define MAX_CELL_SIZE 0x1000
25#define IS_PERSISTENT(id) (id < 8 && This->pstcache_fd[id] > 0)
39 fd =
This->pstcache_fd[cache_id];
53 if (!
This->bitmap_cache_persist_enable)
59 fd =
This->pstcache_fd[cache_id];
70 DEBUG((
"Load bitmap from disk: id=%d, idx=%d, bmp=0x%x)\n", cache_id, cache_idx,
bitmap));
94 fd =
This->pstcache_fd[cache_id];
116 if (
This->pstcache_enumerated)
119 DEBUG_RDP5((
"Persistent bitmap cache enumeration... "));
132 if (
This->bitmap_cache_precache && cellhdr.
stamp &&
This->server_depth > 8)
136 for (
n =
idx;
n > 0 && cellhdr.
stamp < mru_stamp[
n - 1];
n--)
138 mru_idx[
n] = mru_idx[
n - 1];
139 mru_stamp[
n] = mru_stamp[
n - 1];
143 mru_stamp[
n] = cellhdr.
stamp;
165 if (
This->pstcache_enumerated)
168 This->pstcache_fd[cache_id] = 0;
170 if (!(
This->bitmap_cache &&
This->bitmap_cache_persist_enable))
175 DEBUG((
"failed to get/make cache directory!\n"));
179 This->pstcache_Bpp = (
This->server_depth + 7) / 8;
189 warning(
"Persistent bitmap caching is disabled. (The file is already in use)\n");
194 This->pstcache_fd[cache_id] =
fd;
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
void cache_put_bitmap(uint8 id, uint16 idx, RD_HBITMAP bitmap)
void cache_rebuild_bmpcache_linked_list(uint8 id, sint16 *idx, int count)
#define BMPCACHE2_NUM_PSTCELLS
RD_HBITMAP ui_create_bitmap(int width, int height, uint8 *data)
int rd_write_file(int fd, void *ptr, int len)
int rd_read_file(int fd, void *ptr, int len)
void rd_close_file(int fd)
RD_BOOL rd_lock_file(int fd, int start, int len)
RD_BOOL rd_pstcache_mkdir(void)
int rd_lseek_file(int fd, int offset)
int rd_open_file(char *filename)
RD_BOOL pstcache_init(uint8 cache_id)
RD_BOOL pstcache_save_bitmap(uint8 cache_id, uint16 cache_idx, uint8 *key, uint8 width, uint8 height, uint16 length, uint8 *data)
void pstcache_touch_bitmap(uint8 cache_id, uint16 cache_idx, uint32 stamp)
RD_BOOL pstcache_load_bitmap(uint8 cache_id, uint16 cache_idx)
#define IS_PERSISTENT(id)
int pstcache_enumerate(uint8 id, HASH_KEY *keylist)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLuint GLsizei GLsizei * length
#define memcpy(s1, s2, n)
#define sprintf(buf, format,...)