From: Soren Sandmann Pedersen Date: Fri, 18 May 2007 15:54:01 +0000 (-0400) Subject: Add new function pixman_image_set_indexed() X-Git-Tag: pixman-0.9.4~98 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff2e0e9636b1dd3690b5ab5e1dff04ff5c9a07ab;p=platform%2Fupstream%2Fpixman.git Add new function pixman_image_set_indexed() --- 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,