[PATCH 12/13] mi: Fill all spans for PolyFillArc at once

Eric Anholt eric at anholt.net
Tue May 6 09:43:49 PDT 2014


walter harms <wharms at bfs.de> writes:

> Am 06.05.2014 00:02, schrieb Keith Packard:
>> This allocates span data for all of the provided arcs and draws the
>> whole set in one call, rather than doing them one at a time. For
>> modern hardware, this is a significant performance improvement.
>> 
>> Signed-off-by: Keith Packard <keithp at keithp.com>
>> ---
>>  mi/mifillarc.c | 98 ++++++++++++++++++++--------------------------------------
>>  1 file changed, 34 insertions(+), 64 deletions(-)
>> 
>> diff --git a/mi/mifillarc.c b/mi/mifillarc.c
>> index 337343d..1695121 100644
>> --- a/mi/mifillarc.c
>> +++ b/mi/mifillarc.c

>> +
>> +    pts = points = malloc (sizeof (DDXPointRec) * nspans + sizeof(int) * nspans);
>> +    if (!points)
>> +        return;
>> +    wids = widths = (int *) (points + nspans);
>
>
> this looks like a case for calloc().

calloc also does the work of zero initialization, which you don't want
in your rendering paths where the data is getting fully initialized
anyway.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140506/60aa3a62/attachment.sig>


More information about the xorg-devel mailing list