Hi Ismael, Mox,
I forward this discussion to [EMAIL PROTECTED], because interesting for all.
Début du message réexpédié :
De : Ismael <[EMAIL PROTECTED]>
Date : 13 avril 2007 11:31:14 HAEC
À : Mox Soini <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Objet : Rép : [mac aqua] salbmp.cxx byteorder fix
Hi,
It's great to take care of the byte order and to follow the Apple
recommendation.
+1
I have tested your patch but i have a problem: images are strange,
maybe because of a bad color depth. Indeed, I'm not sure all images
in vcl are 32 bits depth (kCGBitmapByteOrder32Host). If I remember
correctly, VCL uses images of 1, 8, 16, 24 and 32 bits.
Not sure at all, but a track : just reading (fastly) the codeI see
you are OR'ing two different properties :
"... kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Host ... "
Can we really " or " them ?
Reading XCode doc, I see kCGImageAlphaNoneSkipFirst belongs to a
typedef CGImageAlphaInfo ( enumaration ), while
kCGBitmapByteOrder32Host belongs to another type ( CGBitmapInfo )
Maybe I'm wrong, but I'd search in this direction first...
Another question: is the VCL code safe for endianness? How does it
manage endianness to manage it in the same way?
Good question.
Maybe ask on [EMAIL PROTECTED] will help ?
Here's a screenshot of the problem: http://lebasket.free.fr/OOo/
13_04_07/ColorProblem.png
Clear, there is a problem :-)
Ismael
Mox Soini a écrit :
Hi Ismael,
Ericb wanted me to ask for your comments on the fix for salbmp.cxx
that I have. Below is the irc chat I had with ericb that explains the
changes.
Can you please check the patch?
Mox
P.S. I have looked into your dialog patch and it looks nice. I have
not tested it as I have other things to fix first, but I think your
changes are important.
[20:51] Moxed: Hi all, I have another bugfix for
vcl/aqua/source/gdi/salbmp.cxx... PATCH:
http://mox.fidisk.fi/opensource/i72385-salbmp-byteorderfix.patch
[20:58] ericb2: Moxed: you should dicsuss this change with Ismael
[21:00] ericb2: Moxed: what does it fix ? issues depending of
architectures ?
[21:01] Moxed: ericb2: it adds a bit flag that ensures that we use
correct byte ordering when the data is handled. It does not change
any
behaviour. Apple recommends using that flag.
[21:03] Moxed: ericb2: that change is necessary for cairo quartz
backed in OOo Canvas, with that change I can see the images in Full
screen mode in impress
[21:03] ericb2: Moxed: ok. but why assert ?
[21:04] Moxed: ericb2: assert is important to make sure we do not
have
any mistakes in the code (i.e. we must always have that flag set)
...
[21:08] Moxed: GetSystemData function that includes that assert is a
function to export quartz native images to outside-VCL. For that kind
of API it is important to make sure the function does not export data
that is wrong.
[21:09] Moxed: Like I said, if code works normally, the assert
succeeds always. Only if we have bugs in code it doesn't, but then
those bugs should be fixed
[21:09] ericb2: Moxed: sure. But what will change your code in
Aqua port ?
...
[21:11] Moxed: ericb2: my code fixes the code to behave as Apple
says it should.
I think your idea/code is interesting, but maybe not correctly
implemented, or hidding something missing or whatever I ignore now.
Let's discuss more ...
Regards,
Eric Bachard