27#define NUM_ELEMENTS(array) (sizeof(array) / sizeof(array[0]))
28#define IS_PERSISTENT(id) (This->pstcache_fd[id] > 0)
31#define IS_SET(idx) (idx >= 0)
49 while (--
n >= 0 &&
This->cache.bmpcache[
id][
idx[
n]].bitmap ==
NULL);
65 while (--
n >= 0 &&
This->cache.bmpcache[
id][
idx[
n]].bitmap ==
NULL);
70 This->cache.bmpcache[
id][n_idx].previous =
idx[
n];
77 This->cache.bmpcache_lru[
id] = n_idx;
79 if (
c !=
This->cache.bmpcache_count[
id])
81 error(
"Oops. %d in bitmap cache linked list, %d in ui cache...\n",
c,
82 This->cache.bmpcache_count[
id]);
96 if (
This->cache.bmpcache_mru[
id] ==
idx)
99 DEBUG_RDP5((
"bump bitmap: id=%d, idx=%d, bump=%d\n",
id,
idx, bump));
101 n_idx =
This->cache.bmpcache[
id][
idx].next;
102 p_idx =
This->cache.bmpcache[
id][
idx].previous;
107 --
This->cache.bmpcache_count[
id];
109 This->cache.bmpcache[
id][p_idx].next = n_idx;
111 This->cache.bmpcache_lru[
id] = n_idx;
113 This->cache.bmpcache[
id][n_idx].previous = p_idx;
115 This->cache.bmpcache_mru[
id] = p_idx;
120 n_idx =
This->cache.bmpcache_lru[
id];
125 for (
n = 0;
n < bump &&
IS_SET(n_idx);
n++)
128 n_idx =
This->cache.bmpcache[
id][p_idx].next;
133 p_idx =
This->cache.bmpcache_mru[
id];
138 ++
This->cache.bmpcache_count[
id];
139 This->cache.bmpcache[
id][
idx].previous = p_idx;
140 This->cache.bmpcache[
id][
idx].next = n_idx;
143 This->cache.bmpcache[
id][p_idx].next =
idx;
148 This->cache.bmpcache[
id][n_idx].previous =
idx;
164 n_idx =
This->cache.bmpcache[
id][
idx].next;
165 DEBUG_RDP5((
"evict bitmap: id=%d idx=%d n_idx=%d bmp=0x%x\n",
id,
idx, n_idx,
166 This->cache.bmpcache[
id][
idx].bitmap));
169 --
This->cache.bmpcache_count[
id];
170 This->cache.bmpcache[
id][
idx].bitmap = 0;
172 This->cache.bmpcache_lru[
id] = n_idx;
189 return This->cache.bmpcache[
id][
idx].bitmap;
194 return This->cache.volatile_bc[
id];
197 error(
"get bitmap %d:%d\n",
id,
idx);
209 old =
This->cache.bmpcache[
id][
idx].bitmap;
226 old =
This->cache.volatile_bc[
id];
233 error(
"put bitmap %d:%d\n",
id,
idx);
247 DEBUG_RDP5((
"Saving cache state for bitmap cache %d...",
id));
268 glyph = &
This->cache.fontcache[
font][character];
273 error(
"get font %d:%d\n",
font, character);
286 glyph = &
This->cache.fontcache[
font][character];
298 error(
"put font %d:%d\n",
font, character);
310 text = &
This->cache.textcache[cache_id];
324 text = &
This->cache.textcache[cache_id];
363 cx *= bytes_per_pixel;
392 error(
"get cursor %d\n", cache_idx);
404 old =
This->cache.cursorcache[cache_idx];
412 error(
"put cursor %d\n", cache_idx);
void cache_put_font(uint8 font, uint16 character, uint16 offset, uint16 baseline, uint16 width, uint16 height, RD_HGLYPH pixmap)
RD_HCURSOR cache_get_cursor(uint16 cache_idx)
void cache_put_text(uint8 cache_id, void *data, int length)
RD_HBITMAP cache_get_bitmap(uint8 id, uint16 idx)
FONTGLYPH * cache_get_font(uint8 font, uint16 character)
void cache_put_desktop(uint32 offset, int cx, int cy, int scanline, int bytes_per_pixel, uint8 *data)
void cache_put_cursor(uint16 cache_idx, RD_HCURSOR cursor)
void cache_bump_bitmap(uint8 id, uint16 idx, int bump)
#define NUM_ELEMENTS(array)
void cache_put_bitmap(uint8 id, uint16 idx, RD_HBITMAP bitmap)
DATABLOB * cache_get_text(uint8 cache_id)
void cache_rebuild_bmpcache_linked_list(uint8 id, sint16 *idx, int count)
void cache_evict_bitmap(uint8 id)
void cache_save_state(void)
uint8 * cache_get_desktop(uint32 offset, int cx, int cy, int bytes_per_pixel)
#define BMPCACHE2_C2_CELLS
#define IS_PERSISTENT(id)
void ui_destroy_bitmap(RD_HBITMAP bmp)
void pstcache_touch_bitmap(uint8 cache_id, uint16 cache_idx, uint32 stamp)
RD_BOOL pstcache_load_bitmap(uint8 cache_id, uint16 cache_idx)
void ui_destroy_cursor(RD_HCURSOR cursor)
void ui_destroy_glyph(RD_HGLYPH glyph)
GLuint GLuint GLsizei count
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)
_Out_opt_ int _Out_opt_ int * cy