missing pixels when drawing connecting lines

Bug #353137 reported by Graeme Geldenhuys
4
Affects Status Importance Assigned to Milestone
xserver-xorg-video-ati (Ubuntu)
Expired
Low
Unassigned

Bug Description

I have written a custom draw GUI toolkit called fpGUI Toolkit [http://opensoft.homeip.net/fpgui/] and noticed since I started using Ubuntu 9.04 and Kubuntu 9.04 that my widgets have missing pixels in the bottom left corners. I previously used Ubuntu 7.10 where this was not the case. fpGUI uses XLib drawing routines directly, it DOESN'T used other toolkits like GTK, QT, Cairo etc... fpGUI Toolkit is written in Object Pascal language.

I have also noticed the same issue in other applications not based on fpGUI Toolkit. For example, I ran Beyond Compare v2 under Wine and it displayed the same problems. The Bottom left corners of Menus, Buttons, ComboBoxes etc are all missing pixels.

I did some testing and the XLib XDrawRectangle() method seems to work, but using the XLib XDrawLine() method doesn't in the latest Ubuntu 9.04. Like I said, in Ubuntu 7.10 and Ubuntu 8.04 this worked perfectly.

Button face drawing code used in fpGUI Toolkit
====================
procedure TfpgStyle.DrawButtonFace(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord; AFlags: TFButtonFlags);
var
  r: TfpgRect;
begin
  r.SetRect(x, y, w, h);

  if btfIsDefault in AFlags then
  begin
    ACanvas.SetColor(clBlack);
    ACanvas.SetLineStyle(1, lsSolid);
    ACanvas.DrawRectangle(r);
    InflateRect(r, -1, -1);
    Exclude(AFlags, btfIsDefault);
    fpgStyle.DrawButtonFace(ACanvas, r.Left, r.Top, r.Width, r.Height, AFlags);
    Exit; //==>
  end;

  ACanvas.SetColor(clButtonFace);
  ACanvas.SetLineStyle(1, lsSolid);
  ACanvas.FillRectangle(x, y, w, h);

  if (btfFlat in AFlags) and not (btfIsPressed in AFlags) then
    Exit; // no need to go further

  // Left and Top (outer)
  if (btfIsPressed in AFlags) then
  begin
    if (btfIsEmbedded in AFlags) then
      ACanvas.SetColor(clHilite2)
    else
      ACanvas.SetColor(clShadow2);
  end
  else
    ACanvas.SetColor(clHilite2);

  ACanvas.DrawLine(r.Left, r.Bottom, r.Left, r.Top); // left
  ACanvas.DrawLine(r.Left, r.Top, r.Right, r.Top); // top

  // Right and Bottom (outer)
  if (btfIsPressed in AFlags) then
  begin
    if (btfIsEmbedded in AFlags) then
      ACanvas.SetColor(clHilite1)
    else
      ACanvas.SetColor(clShadow2);
  end
  else
    ACanvas.SetColor(clShadow2);

  ACanvas.DrawLine(r.Right, r.Top, r.Right, r.Bottom); // right
  ACanvas.DrawLine(r.Right, r.Bottom, r.Left-1, r.Bottom); // bottom

  // Right and Bottom (inner)
  if btfIsPressed in AFlags then
  begin
    if (btfIsEmbedded in AFlags) then
      ACanvas.SetColor(clButtonFace)
    else
      ACanvas.SetColor(clHilite1);
  end
  else
    ACanvas.SetColor(clShadow1);

  ACanvas.DrawLine(r.Right-1, r.Top+1, r.Right-1, r.Bottom-1); // right
  ACanvas.DrawLine(r.Right-1, r.Bottom-1, r.Left, r.Bottom-1); // bottom
end;
====================

...and ACanvas.DrawLine calls the following XLib method as follows...

==========================
procedure TfpgCanvasImpl.DoDrawLine(x1, y1, x2, y2: TfpgCoord);
begin
  // Same behavior as Windows. See documentation for reason.
  XDrawLine(xapplication.display, FDrawHandle, Fgc, x1, y1, x2, y2);
end;
===========================

attached screenshot clearly shows the missing pixels. I used 'xmag' to enlarge the areas.

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
Package: libx11-6 2:1.1.99.2-1ubuntu2
ProcEnviron:
 LC_TIME=en_DK.UTF-8
 PATH=(custom, user)
 LANG=en_ZA.UTF-8
 SHELL=/bin/bash
ProcVersion: Linux version 2.6.28-11-generic (buildd@palmer) (gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) ) #37-Ubuntu SMP Mon Mar 23 16:40:23 UTC 2009
SourcePackage: libx11
Uname: Linux 2.6.28-11-generic i686

[lspci]
00:00.0 Host bridge [0600]: ATI Technologies Inc Radeon 9100 IGP Host Bridge [1002:7833]
     Subsystem: ATI Technologies Inc Radeon 9100 IGP Host Bridge [1002:7833]
01:05.0 VGA compatible controller [0300]: ATI Technologies Inc Radeon 9100 PRO IGP [1002:7834]
     Subsystem: Giga-byte Technology Device [1458:5000]

Revision history for this message
Graeme Geldenhuys (graemeg) wrote :
Revision history for this message
Graeme Geldenhuys (graemeg) wrote :

Looking at the screenshot again. It looks like the bottom two horizontal lines are incorrectly offset by 1 pixel to the left.

Bryce Harrington (bryce)
Changed in libx11 (Ubuntu):
status: New → Confirmed
Bryce Harrington (bryce)
description: updated
Revision history for this message
Graeme Geldenhuys (graemeg) wrote :

I believe this bug is related to bug #373781

  https://bugs.launchpad.net/bugs/373781

Revision history for this message
Graeme Geldenhuys (graemeg) wrote :
Download full text (10.4 KiB)

This bug has been fixed, but unfortunately I do not know which update fixed this. On Saturday (2009-08-22) I updated my 9.04 Ubuntu to all the latests updates and after the update the bug was fixed. Below is the list of packages my system was updated with. But like I said, unfortunately I do not know which package actually solved the problem. Good news is that it is fixed. :-)

========================
Upgraded the following packages:
acpid (1.0.6-9ubuntu4) to 1.0.6-9ubuntu4.9.04.3
app-install-data (0.7.6) to 0.7.6.1
app-install-data-partner (11.9.04) to 11.9.04.2
apport (1.0-0ubuntu5) to 1.0-0ubuntu5.2
apport-gtk (1.0-0ubuntu5) to 1.0-0ubuntu5.2
apturl (0.3.3ubuntu1) to 0.3.3ubuntu1.1
bind9-host (1:9.5.1.dfsg.P2-1) to 1:9.5.1.dfsg.P2-1ubuntu0.1
bluetooth (4.32-0ubuntu4) to 4.32-0ubuntu4.1
bluez (4.32-0ubuntu4) to 4.32-0ubuntu4.1
bluez-alsa (4.32-0ubuntu4) to 4.32-0ubuntu4.1
bluez-cups (4.32-0ubuntu4) to 4.32-0ubuntu4.1
bluez-gstreamer (4.32-0ubuntu4) to 4.32-0ubuntu4.1
bluez-utils (4.32-0ubuntu4) to 4.32-0ubuntu4.1
brasero (2.26.0-0ubuntu3) to 2.26.1-0ubuntu1
checkbox (0.7.1) to 0.7.2
checkbox-gtk (0.7.1) to 0.7.2
compiz (1:0.8.2-0ubuntu8) to 1:0.8.2-0ubuntu8.1
compiz-core (1:0.8.2-0ubuntu8) to 1:0.8.2-0ubuntu8.1
compiz-gnome (1:0.8.2-0ubuntu8) to 1:0.8.2-0ubuntu8.1
compiz-plugins (1:0.8.2-0ubuntu8) to 1:0.8.2-0ubuntu8.1
compiz-wrapper (1:0.8.2-0ubuntu8) to 1:0.8.2-0ubuntu8.1
compizconfig-backend-gconf (0.8.2-0ubuntu1) to 0.8.2-0ubuntu2
consolekit (0.3.0-2ubuntu3) to 0.3.0-2ubuntu4
cron (3.0pl1-105ubuntu1) to 3.0pl1-105ubuntu1.1
cups (1.3.9-17ubuntu1) to 1.3.9-17ubuntu3.2
cups-bsd (1.3.9-17ubuntu1) to 1.3.9-17ubuntu3.2
cups-client (1.3.9-17ubuntu1) to 1.3.9-17ubuntu3.2
cups-common (1.3.9-17ubuntu1) to 1.3.9-17ubuntu3.2
dbus (1.2.12-0ubuntu2) to 1.2.12-0ubuntu2.1
dbus-x11 (1.2.12-0ubuntu2) to 1.2.12-0ubuntu2.1
dhcp3-client (3.1.1-5ubuntu8) to 3.1.1-5ubuntu8.1
dhcp3-common (3.1.1-5ubuntu8) to 3.1.1-5ubuntu8.1
dnsutils (1:9.5.1.dfsg.P2-1) to 1:9.5.1.dfsg.P2-1ubuntu0.1
ekiga (3.2.0-0ubuntu1) to 3.2.0-0ubuntu2
evince (2.26.0-0ubuntu1) to 2.26.1-0ubuntu1
evolution (2.26.1-0ubuntu1) to 2.26.1-0ubuntu2
evolution-common (2.26.1-0ubuntu1) to 2.26.1-0ubuntu2
evolution-data-server (2.26.1-0ubuntu1) to 2.26.1-0ubuntu2
evolution-data-server-common (2.26.1-0ubuntu1) to 2.26.1-0ubuntu2
evolution-documentation-en (2.26.1-0ubuntu1) to 2.26.1-0ubuntu2
evolution-exchange (2.26.0-0ubuntu2) to 2.26.0-0ubuntu3
evolution-plugins (2.26.1-0ubuntu1) to 2.26.1-0ubuntu2
file (4.26-2ubuntu3) to 4.26-2ubuntu4
firefox (3.0.8+nobinonly-0ubuntu3) to 3.0.13+nobinonly-0ubuntu0.9.04.1
firefox-3.0 (3.0.8+nobinonly-0ubuntu3) to 3.0.13+nobinonly-0ubuntu0.9.04.1
firefox-3.0-branding (3.0.8+nobinonly-0ubuntu3) to 3.0.13+nobinonly-0ubuntu0.9.04.1
firefox-3.0-gnome-support (3.0.8+nobinonly-0ubuntu3) to 3.0.13+nobinonly-0ubuntu0.9.04.1
firefox-gnome-support (3.0.8+nobinonly-0ubuntu3) to 3.0.13+nobinonly-0ubuntu0.9.04.1
foomatic-db-engine (4.0.0-0ubuntu6) to 4.0.0-0ubuntu6.1
gnome-about (1:2.26.1-0ubuntu1) to 1:2.26.1-0ubuntu2
gnome-app-install (0.5.24-0ubuntu1) to 0.5.24-0ubuntu1.1
gnome-applets (2.26.0-0ubuntu4) to 2.26.1-0ubuntu1
gnome-applets-data (2.26.0-0ubuntu4) to 2.26.1-0ubunt...

Bryce Harrington (bryce)
tags: added: kubuntu
Revision history for this message
Graeme Geldenhuys (graemeg) wrote :

Correction on my last message. This bug has NOT been fixed. This issue is still visible in a new installation of Ubuntu 9.10 (32 & 64bit versions). I also downloaded Fedora 12 LiveCD today, and the exact same bug is visible there as well. So this doesn't seem to be a distro issue, but rather a specific version of X or one of it's libraries.

Revision history for this message
Graeme Geldenhuys (graemeg) wrote :

The attached images [x11_paint_bug.png] shows how WINE applications (and my custom drawn GUI toolkit - fpGUI) looks like with the default open-source ATI driver. Notice all the lines are not connecting. This bug has now been in Ubuntu since the 8.10 release.

Today I installed Ubuntu 10.04 (64-bit) and still this bug is visible there. As soon as I upgrade to the proprietary ATI driver, then the bug is gone.

I have created numerous tests to make sure the issue is not in my fpGUI Toolkit, but as I said, the bug is also in all Windows applications run under WINE. A simple test I did was draw a vertical line from the bottom up. The first pixel is never painted with the open-source ATI drivers. In Ubuntu 8.04.3 and earlier, this bug was not there.

bugbot (bugbot)
tags: added: jaunty
Revision history for this message
bugbot (bugbot) wrote :

This bug report was filed against an old version of Ubuntu.
Can you confirm whether this is still an issue in natty?

If you don't mind, it would be very helpful if you could update the bug
report in launchpad to 'Fix Released' if it is no longer an issue for
you, or if it is still occurring under natty, please tag the bug 'natty'
so it's easier for us to track.

Changed in libx11 (Ubuntu):
status: Confirmed → New
status: New → Incomplete
Revision history for this message
Graeme Geldenhuys (graemeg) wrote :

Yes this bug still exists in Ubuntu 10.04 and Ubuntu 11.04. I have recently experimented with various X11 setups too. If I use the FrameBuffer driver (fbdev) the bug is gone. If I use the proprietary AMD/ATI Radeon driver the bug is gone. It seems only if I use the open source ATI (ati) or ATI Radeon (radeon) driver then the bug is there. So maybe that gives some clues as to where this bug is located?

tags: added: lucid natty
Revision history for this message
Graeme Geldenhuys (graemeg) wrote :

Since the original bug report, I have changed to a new PC with a different hardware and ATI video card. The problem still exists. Here is the 'lspci' output on my new system.

---------------------------------------
$ lspci
00:00.0 Host bridge: Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller (rev 10)
00:01.0 PCI bridge: Intel Corporation 82G33/G31/P35/P31 Express PCI Express Root Port (rev 10)
00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition Audio Controller (rev 01)
00:1d.0 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #3 (rev 01)
00:1d.3 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #4 (rev 01)
00:1d.7 USB Controller: Intel Corporation N10/ICH 7 Family USB2 EHCI Controller (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1)
00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge (rev 01)
00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01)
00:1f.2 IDE interface: Intel Corporation N10/ICH7 Family SATA IDE Controller (rev 01)
00:1f.3 SMBus: Intel Corporation N10/ICH 7 Family SMBus Controller (rev 01)
01:00.0 VGA compatible controller: ATI Technologies Inc RV710 [Radeon HD 4350]
01:00.1 Audio device: ATI Technologies Inc RV710/730
02:05.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet (rev 10)
---------------------------------------

Timo Aaltonen (tjaalton)
affects: libx11 (Ubuntu) → xserver-xorg-video-ati (Ubuntu)
Bryce Harrington (bryce)
Changed in xserver-xorg-video-ati (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
penalvch (penalvch) wrote :

Graeme Geldenhuys, this bug was reported a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue? If so, could you please test for this with the latest development release of Ubuntu? ISO images are available from http://cdimage.ubuntu.com/daily-live/current/ .

If it remains an issue, could you please run the following command in the development release from a Terminal (Applications->Accessories->Terminal), as it will automatically gather and attach updated debug information to this report:

apport-collect -p xserver-xorg-video-ati REPLACE-WITH-BUG-NUMBER

Please note, given that the information from the prior release is already available, doing this on a release prior to the development one would not be helpful.

Thank you for your understanding.

Helpful bug reporting tips:
https://wiki.ubuntu.com/ReportingBugs

no longer affects: xserver-xorg-video-ati (Ubuntu)
affects: fedora → xserver-xorg-video-ati (Ubuntu)
Changed in xserver-xorg-video-ati (Ubuntu):
status: New → Incomplete
importance: Undecided → Low
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for xserver-xorg-video-ati (Ubuntu) because there has been no activity for 60 days.]

Changed in xserver-xorg-video-ati (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.