kolibrios-fun/programs/develop/libraries/pixman/pixman-accessor.h
Sergey Semyonov (Serge) 40a47213e6 pixman-0.30.2
git-svn-id: svn://kolibrios.org@3931 a494cfbc-eb01-0410-851d-a64ba20cac60
2013-09-22 20:55:51 +00:00

26 lines
647 B
C

#ifdef PIXMAN_FB_ACCESSORS
#define READ(img, ptr) \
(((bits_image_t *)(img))->read_func ((ptr), sizeof(*(ptr))))
#define WRITE(img, ptr,val) \
(((bits_image_t *)(img))->write_func ((ptr), (val), sizeof (*(ptr))))
#define MEMSET_WRAPPED(img, dst, val, size) \
do { \
size_t _i; \
uint8_t *_dst = (uint8_t*)(dst); \
for(_i = 0; _i < (size_t) size; _i++) { \
WRITE((img), _dst +_i, (val)); \
} \
} while (0)
#else
#define READ(img, ptr) (*(ptr))
#define WRITE(img, ptr, val) (*(ptr) = (val))
#define MEMSET_WRAPPED(img, dst, val, size) \
memset(dst, val, size)
#endif