PDA

View Full Version : Irregular display related to color depth[FIXED by change src


HenryHu
May 3rd, 2007, 02:22 PM
I'm using beryl 0.2.1 from ports on FreeBSD-6.2, with Xorg-7.2, ATI open source driver "radeon" on ATI Radeon 7500.
I made beryl work by executing "beryl --force-aiglx --use-copy". But when beryl started, no text can be displayed normally. For example, I can start a gtk2 program, everything is fine, but when I move over a button or menu, or anywhere that already has something, things go wrong.
I occasionally found that the Terminal program from xfce4 can be displayed properly. After some experiments, I found that windows with default color depth of 32 can be displayed normally.
I made a simple gtk2 program, which displays a button. By default, when I move mouse over the button, everything goes wrong. But if I add these lines:
colormap = gdk_screen_get_rgba_colormap (gdk_screen_get_default());
gtk_widget_push_colormap(colormap);
Then it can be displayed normally.
The wrong image looks like that it is drawing the image with wrong width.
My default screen color depth is 24, and "radeon" driver cannot accept color depth of 32.
What's the matter with beryl?
screenshot: the button(after mouse move)
[attachment=1:41155]screenshot4.png[/attachment:41155]
screenshot: the xterm
[attachment=0:41155]screenshot7.png[/attachment:41155]
Sorry for my poor English.
Any help is appreciated. Thanks in advance.

HenryHu
May 4th, 2007, 06:11 AM
Finally I've solved my problem, at least it seems so.
I modified bindPixmapToTexture() in src/texture.c:
After the "if ( depth == 32 ) ... else "
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGB, width, height, 0, GL_BGRA, GL_UNSIGNED_BYTE, 0);
=>
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, 0);

And everything works like a charm!
Now the only problem is that Java programs cannot display properly, but most things are working quite well!
I hope this is helpful to anyone faces the problem.