mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 02:36:17 +03:00
Merge pull request #94 from olt/gil_image_fill
Release GIL during Image.fill
This commit is contained in:
commit
88e724c8d8
|
@ -24,6 +24,7 @@ Imaging
|
||||||
ImagingFill(Imaging im, const void* colour)
|
ImagingFill(Imaging im, const void* colour)
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
|
ImagingSectionCookie cookie;
|
||||||
|
|
||||||
if (im->type == IMAGING_TYPE_SPECIAL) {
|
if (im->type == IMAGING_TYPE_SPECIAL) {
|
||||||
/* use generic API */
|
/* use generic API */
|
||||||
|
@ -39,6 +40,7 @@ ImagingFill(Imaging im, const void* colour)
|
||||||
memset(im->image[y], 0, im->linesize);
|
memset(im->image[y], 0, im->linesize);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
ImagingSectionEnter(&cookie);
|
||||||
INT32 c = 0L;
|
INT32 c = 0L;
|
||||||
memcpy(&c, colour, im->pixelsize);
|
memcpy(&c, colour, im->pixelsize);
|
||||||
if (im->image32 && c != 0L) {
|
if (im->image32 && c != 0L) {
|
||||||
|
@ -50,6 +52,7 @@ ImagingFill(Imaging im, const void* colour)
|
||||||
for (y = 0; y < im->ysize; y++)
|
for (y = 0; y < im->ysize; y++)
|
||||||
memset(im->image[y], cc, im->linesize);
|
memset(im->image[y], cc, im->linesize);
|
||||||
}
|
}
|
||||||
|
ImagingSectionLeave(&cookie);
|
||||||
}
|
}
|
||||||
|
|
||||||
return im;
|
return im;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user