summaryrefslogtreecommitdiff
path: root/pixman
diff options
context:
space:
mode:
authorChristian Biesinger <cbiesinger@web.de>2006-04-19 00:29:48 +0200
committerChristian Biesinger <cbiesinger@web.de>2006-04-19 00:31:47 +0200
commitefbe40bb8f770fbf60de794488803d3edacd7ed6 (patch)
tree2727e040be3c099623de7742e306b71cd6124781 /pixman
parenteadb26a1c13da1af292f0262e108878133cbadf0 (diff)
Use calloc rather than malloc+memset
Diffstat (limited to 'pixman')
-rw-r--r--pixman/src/icpixels.c3
-rw-r--r--pixman/src/ictrap.c6
2 files changed, 2 insertions, 7 deletions
diff --git a/pixman/src/icpixels.c b/pixman/src/icpixels.c
index 2ad34f47..c5efae95 100644
--- a/pixman/src/icpixels.c
+++ b/pixman/src/icpixels.c
@@ -65,12 +65,11 @@ FbPixelsCreate (int width, int height, int depth)
adjust = 8 - (base & 7);
buf_size += adjust;
- pixels = malloc(base + buf_size);
+ pixels = calloc(base + buf_size, 1);
if (!pixels)
return NULL;
buf = (pixman_bits_t *) ((char *)pixels + base + adjust);
- memset (buf, 0, height * stride);
FbPixelsInit (pixels, buf, width, height, depth, bpp, stride);
diff --git a/pixman/src/ictrap.c b/pixman/src/ictrap.c
index 08bd0247..72616f31 100644
--- a/pixman/src/ictrap.c
+++ b/pixman/src/ictrap.c
@@ -45,16 +45,12 @@ FbCreateAlphaPicture (pixman_image_t *dst,
return NULL;
}
+ /* pixman_image_create zeroes out the pixels, so we don't have to */
image = pixman_image_create (format, width, height);
if (own_format)
pixman_format_destroy (format);
- /* XXX: Is this a reasonable way to clear the image? Would
- probably be preferable to use pixman_image_fill_rectangle once such a
- beast exists. */
- memset (image->pixels->data, 0, height * image->pixels->stride);
-
return image;
}