summaryrefslogtreecommitdiffstats
path: root/src/pixman/pixman/pixman-accessor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pixman/pixman/pixman-accessor.h')
-rw-r--r--src/pixman/pixman/pixman-accessor.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/pixman/pixman/pixman-accessor.h b/src/pixman/pixman/pixman-accessor.h
new file mode 100644
index 0000000..8e0b036
--- /dev/null
+++ b/src/pixman/pixman/pixman-accessor.h
@@ -0,0 +1,25 @@
+#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
+
OpenPOWER on IntegriCloud