1 | #ifdef PIXMAN_FB_ACCESSORS
|
---|
2 |
|
---|
3 | #define ACCESS(sym) sym##_accessors
|
---|
4 |
|
---|
5 | #define READ(img, ptr) \
|
---|
6 | (((bits_image_t *)(img))->read_func ((ptr), sizeof(*(ptr))))
|
---|
7 | #define WRITE(img, ptr,val) \
|
---|
8 | (((bits_image_t *)(img))->write_func ((ptr), (val), sizeof (*(ptr))))
|
---|
9 |
|
---|
10 | #define MEMCPY_WRAPPED(img, dst, src, size) \
|
---|
11 | do { \
|
---|
12 | size_t _i; \
|
---|
13 | uint8_t *_dst = (uint8_t*)(dst), *_src = (uint8_t*)(src); \
|
---|
14 | for(_i = 0; _i < size; _i++) { \
|
---|
15 | WRITE((img), _dst +_i, READ((img), _src + _i)); \
|
---|
16 | } \
|
---|
17 | } while (0)
|
---|
18 |
|
---|
19 | #define MEMSET_WRAPPED(img, dst, val, size) \
|
---|
20 | do { \
|
---|
21 | size_t _i; \
|
---|
22 | uint8_t *_dst = (uint8_t*)(dst); \
|
---|
23 | for(_i = 0; _i < (size_t) size; _i++) { \
|
---|
24 | WRITE((img), _dst +_i, (val)); \
|
---|
25 | } \
|
---|
26 | } while (0)
|
---|
27 |
|
---|
28 | #else
|
---|
29 |
|
---|
30 | #define ACCESS(sym) sym
|
---|
31 |
|
---|
32 | #define READ(img, ptr) (*(ptr))
|
---|
33 | #define WRITE(img, ptr, val) (*(ptr) = (val))
|
---|
34 | #define MEMCPY_WRAPPED(img, dst, src, size) \
|
---|
35 | memcpy(dst, src, size)
|
---|
36 | #define MEMSET_WRAPPED(img, dst, val, size) \
|
---|
37 | memset(dst, val, size)
|
---|
38 |
|
---|
39 | #endif
|
---|
40 |
|
---|