summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-06-26 15:51:17 +0000
committerTavian Barnes <tavianator@gmail.com>2009-06-26 15:51:17 +0000
commit9f0fb6f24b8da085cfbc8612067ac0370b71ebc4 (patch)
tree44b96978174a03fed3da95d561c3a64f3f89cfbe /libdimension/dimension
parent3ee98f3bac24fd1c70a9de3e0fbe774e762c25b3 (diff)
downloaddimension-9f0fb6f24b8da085cfbc8612067ac0370b71ebc4.tar.xz
Remove thread-synchronicity from canvases.
Diffstat (limited to 'libdimension/dimension')
-rw-r--r--libdimension/dimension/canvas.h16
1 files changed, 3 insertions, 13 deletions
diff --git a/libdimension/dimension/canvas.h b/libdimension/dimension/canvas.h
index 50cc612..cd414a9 100644
--- a/libdimension/dimension/canvas.h
+++ b/libdimension/dimension/canvas.h
@@ -25,8 +25,6 @@
#ifndef DIMENSION_CANVAS_H
#define DIMENSION_CANVAS_H
-#include <pthread.h>
-
typedef struct {
unsigned int x, y;
@@ -35,26 +33,18 @@ typedef struct {
* at (a,b) is accessible as pixels[b*x + a].
*/
dmnsn_color *pixels;
-
- /* Read-write locks for each pixel */
- pthread_rwlock_t *rwlocks;
} dmnsn_canvas;
/* Allocate and free a canvas */
dmnsn_canvas *dmnsn_new_canvas(unsigned int x, unsigned int y);
void dmnsn_delete_canvas(dmnsn_canvas *canvas);
-/* These handle the rwlocks correctly */
+/* Pixel accessors */
dmnsn_color dmnsn_get_pixel(const dmnsn_canvas *canvas,
unsigned int x, unsigned int y);
void dmnsn_set_pixel(dmnsn_canvas *canvas,
unsigned int x, unsigned int y, dmnsn_color color);
-
-/* Manual locking */
-void dmnsn_rdlock_pixel(const dmnsn_canvas *canvas,
- unsigned int x, unsigned int y);
-void dmnsn_wrlock_pixel(dmnsn_canvas *canvas, unsigned int x, unsigned int y);
-void dmnsn_unlock_pixel(const dmnsn_canvas *canvas,
- unsigned int x, unsigned int y);
+dmnsn_color *dmnsn_pixel_at(dmnsn_canvas *canvas,
+ unsigned int x, unsigned int y);
#endif /* DIMENSION_CANVAS_H */