[Mesa-dev] [PATCH 03/11] st/nine: Simplify Surface9 Managed resources implementation

Axel Davy axel.davy at ens.fr
Sun Apr 26 01:22:36 PDT 2015


On 25/04/2015 22:53, Ilia Mirkin wrote :
> On Fri, Apr 24, 2015 at 4:11 PM, Axel Davy <axel.davy at ens.fr> wrote:
>> +    if (damaged) {
>> +        box = *damaged;
>> +        box.z = This->layer;
>> +        box.depth = 1;
>> +    } else {
>> +        box.x = 0;
>> +        box.y = 0;
>> +        box.z = This->layer;
>> +        box.width = This->desc.Width;
>> +        box.height = This->desc.Height;
>> +        box.depth = 1;
>> +    }
> Might I suggest
>
> if (damaged)
>    box = *damaged;
> else
>    u_box_2d(0, 0, This->desc.Width, This->desc.Height, &box);
> box.z = This->layer;
> box.depth = 1;
>
I have no strong opinion on that, but I get the impression the version 
without u_box_2d is clearer for the reader, as we see exactly which/how 
the fields are set.



More information about the mesa-dev mailing list