summaryrefslogtreecommitdiffstats
path: root/libdimension/canvas.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2014-04-27 14:00:33 -0400
committerTavian Barnes <tavianator@tavianator.com>2014-04-27 14:00:33 -0400
commit12eeb9524aa9421c03f253ab6161634bec66793b (patch)
tree6d1c20e3f27bc76c9b1c30a5980c6e2de3de8f75 /libdimension/canvas.c
parent3f949f8a9705972a4b61532602814b5b47d1a328 (diff)
downloaddimension-12eeb9524aa9421c03f253ab6161634bec66793b.tar.xz
gl: Make drawing faster by using a better pixel format.
Diffstat (limited to 'libdimension/canvas.c')
-rw-r--r--libdimension/canvas.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libdimension/canvas.c b/libdimension/canvas.c
index c7c1994..1ee68e2 100644
--- a/libdimension/canvas.c
+++ b/libdimension/canvas.c
@@ -66,6 +66,20 @@ dmnsn_canvas_optimize(dmnsn_canvas *canvas,
dmnsn_array_push(canvas->optimizers, optimizer);
}
+/* Find an optimizer if it's already installed */
+dmnsn_canvas_optimizer *
+dmnsn_canvas_find_optimizer(const dmnsn_canvas *canvas,
+ dmnsn_canvas_optimizer_fn *optimizer_fn)
+{
+ DMNSN_ARRAY_FOREACH (dmnsn_canvas_optimizer *, i, canvas->optimizers) {
+ if (i->optimizer_fn == optimizer_fn) {
+ return i;
+ }
+ }
+
+ return NULL;
+}
+
/* Set the value of a pixel */
void
dmnsn_canvas_set_pixel(dmnsn_canvas *canvas, size_t x, size_t y,