[Mono-winforms-list] Patch for bug 426305
Dick Porter
dporter at codicesoftware.com
Thu Mar 31 14:26:07 EDT 2011
On 31/03/2011 7:24PM, Sebastien Pouliot wrote:
> On Thu, 2011-03-31 at 17:00 +0100, Dick Porter wrote:
>> Hi all
>>
>> I've just added a patch to
>> https://bugzilla.novell.com/show_bug.cgi?id=426305 and am copying it
>> here too for review.
>>
>> It removes the premultiplication when loading PNGs, as no other image
>> format does the same. It then adds premultiplication when calling
>> assorted Draw*() functions in image.c, except when the graphics context
>> is a memory bitmap (so that if an image is drawn onto another image, it
>> doesn't get premultiplied multiple times.)
>
> From the little I recall of the issue it makes sense (but will affect
> performance) to delay the pre-multiplication.
>
> The other way would be to keep a flag about the state of each image (and
> handle saving correctly, i.e. de-multiplication).
I tried adding a flag to the PNG image when it was loaded, to say that
it was already premultiplied. However, it seemed that the image_flags
got lost along the way when images were manipulated.
I may of course be wrong about that, as I hadn't thought of the image on
image drawing at that point.
- Dick
More information about the Mono-winforms-list
mailing list