Re: PangoXft and PangoFT2 patch from hell
- From: Hans Breuer <hans breuer org>
- To: Tor Lillqvist <tml iki fi>
- Cc: gtk-devel-list gnome org
- Subject: Re: PangoXft and PangoFT2 patch from hell
- Date: Wed, 21 Nov 2001 20:50:20 +0100
At 01:41 21.11.01 +0200, Tor Lillqvist wrote:
>Hans Breuer writes:
> > Yeah, exactly before writing the last mail. But probably my
> > local tree diverges somewhat with cvs due to Alex last commit
> > and some time restriction.
>
>There are some strange stuff in that program. Like:
>
> if (cClrBits != 24)
> pbmi = (PBITMAPINFO) GlobalAlloc(LPTR,
> sizeof(BITMAPINFOHEADER) +
> sizeof(RGBQUAD) * (2^cClrBits));
>
>What if cClrBits == 32?
>
>What is that ^ (xor) operator doing there (and in another place)?
>cut-and-paste from code written by somebody who thought ^ was an
>exponentiation operator?
>
Now when thinking about it looks strange indeed. Maybe I should have
checked, after copying from the MSDN Sample :) [VC5.0 : 'Storing an Image']
>Also, if cClrBits >= 24, the biClrUsed field is never initialised.
>
Probably the code was written before there where so much bits
supported by windos ...
>There is also a bug in the creation the bitmap. The DC passed to
>CreateCompatibleBitmap should be the DC of the window, not the memory
>DC created by CreateCompatibleDC (as that memory DC initially has a
>1x1 *monochrome* bitmap selected into it).
>
>With these problems fixed, it works for me.
>
I'm not sure if it really should _not_ create a monochrome bitmap,
given that the resulting bitmap already was huge.
Anyway, thanks for fixing it.
Hans
-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it. -- Dilbert
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]