From ff2e0e9636b1dd3690b5ab5e1dff04ff5c9a07ab Mon Sep 17 00:00:00 2001 From: Soren Sandmann Pedersen Date: Fri, 18 May 2007 11:54:01 -0400 Subject: [PATCH] Add new function pixman_image_set_indexed() --- pixman/pixman-image.c | 20 ++++++++++++++++++++ pixman/pixman.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c index f790538..ac0088e 100644 --- a/pixman/pixman-image.c +++ b/pixman/pixman-image.c @@ -361,6 +361,26 @@ pixman_image_set_filter (pixman_image_t *image, } void +pixman_image_set_indexed (pixman_image_t *image, + const pixman_indexed_t *indexed) +{ + bits_image_t *bits = (bits_image_t *)image; + + if (bits->indexed == indexed) + return; + + if (bits->indexed) + free (bits->indexed); + + bits->indexed = malloc (sizeof (pixman_indexed_t)); + + if (!bits->indexed) + return; + + memcpy (bits->indexed, indexed, sizeof (pixman_indexed_t)); +} + +void pixman_image_set_alpha_map (pixman_image_t *image, pixman_image_t *alpha_map, int16_t x, diff --git a/pixman/pixman.h b/pixman/pixman.h index 4684429..bb5739a 100644 --- a/pixman/pixman.h +++ b/pixman/pixman.h @@ -452,6 +452,8 @@ void pixman_image_set_component_alpha (pixman_image_t void pixman_image_set_accessors (pixman_image_t *image, pixman_read_memory_func_t read_func, pixman_write_memory_func_t write_func); +void pixman_image_set_indexed (pixman_image_t *image, + const pixman_indexed_t *indexed); /* Composite */ void pixman_image_composite_rect (pixman_op_t op, -- 2.7.4