JDK-5046469 : JDK on Linux: doesn't draw a rotated/tall string completely
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.4.0,5.0,5.0u1,6
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS:
    linux,linux_redhat_3.0,linux_redhat_9.0,solaris_10 linux,linux_redhat_3.0,linux_redhat_9.0,solaris_10
  • CPU: x86
  • Submitted: 2004-05-13
  • Updated: 2012-10-09
  • Resolved: 2009-03-20
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Description
============================================================================
Tested JDK :
b50
Tested OS: Cinnabar, RD AS 3
Locale: zh_CN
Video: NVIDIA GeForce4 
Test host: i18n-gw700-9, i18n-gw700-8
============================================================================

GlobalSuit test case
font-render/2d/one/TextTransformRenderTest.java

The transformed text string dosen't display completely, after moving around the text frame, it sometimes got displayed completely.

Tested with earlier builds up to b33, there is a minor difference between builds prior b44 and builds after b45, but the major symptom is same for all the tested builds.

This can only be reproduced on the above two platforms, not on Solaris.
This symptom can not be seen using CharView or Font2DTest.

To reproduce, get gs bundle gs15-06.tar.gz from
/net/sqesvr-nfs/global/nfs/i18n/workspaces/i18n_tiger_ws/i18n/bundles/b06

after untar, go to i18n/src/GS

sh run_gs.sh -jdk:[test jdk] font-render/2d/one/TextTransformRenderTest.java

###@###.### 2004-05-12
Here is a test case contributed by a developer that was added to the JDC
comments for 5106732 (closed as a dup of this one)
He noted it reproduced on Fedora Core 1.

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;

public class Bug extends JPanel
{
  public Bug()
  {
    setPreferredSize(new Dimension(800,500));
  }

  public void paint(Graphics g)
  {
    super.paint(g);
    for (int i = 300; i < 360; i++){
      Graphics2D g2d = (Graphics2D) g.create();
      g2d.scale(4, 4);
      g2d.rotate(Math.toRadians(i), 30, 30);
      int c = (i*20)%255;
      g2d.setColor(new Color(c, c, 255));
      g2d.drawString("XXXXXXXXXXXX", 30, 100);
      g2d.setColor(Color.red);
      g2d.drawLine(30,100, 120,100);
      g2d.dispose();
    }
  }
  
  public static void main(String[] args){
    JFrame frame = new JFrame();
    final JPanel bug = new Bug();
    frame.getContentPane().add(bug, BorderLayout.CENTER);
    JPanel buttons = new JPanel();
    frame.getContentPane().add(buttons, BorderLayout.SOUTH);
    buttons.add(new JButton(new AbstractAction("Reset Bug"){
      public void actionPerformed(ActionEvent evt){
        bug.repaint();
      }
    }));
    buttons.add(new JButton(new AbstractAction("Less Buggy"){
      public void actionPerformed(ActionEvent evt){
        bug.repaint(bug.getWidth()/2, 0, bug.getWidth()/2, bug.getHeight());
      }
    }));
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setVisible(true);
  }
}

Comments
EVALUATION This was observed only on what are now very old drivers on an obsolete XFree86 server, and appeared to be a bug in one of those components. So I'm closing as not reproducible.
20-03-2009

EVALUATION I am not sure any of this is useful but I'll capture it anyway. I did some testing on one of the systems listed in the bug description :i18n-gw700-9. I tested with Cinnabar b37 (uses the X.org server) and RHEL 4 using the test case in the description of this report. I didn't see any problems. Both of the OSes are a different than before (RH AS 3 is now RHEL 4) and rather than some unidentified but definitely earlier build of Cinnabar (thats JDS Linux 3) its a close to FCS version. I also tested on Solaris 10 x86 FCS on a system with a Matrox Millenium (jcg-x86-14) No problems. I tested on a Fedora Core 3 system with an ATI Radeon 9800 Pro and an ATI Radeon 7200 No problems. Then I tried an ancient RH 7.2 system with an Nvida Riva TnT2 and a Matrox Millenium configured in Xinerama mode. Here I was able to reproduce some problems but ONLY on the screen which was backed by the Matrox Millenium as the right hand screen. And when I reconfigured the Xserver to use that device in single screen mode I saw no problems. But I don't know what to make of that because it then seemed as if the problem was transient. It didn't immediately show up when I restored the system to its earlier Xinerama mode, but later it did. So what does that mean? That other systems may reproduce the problem too if I persist? But for how long? When I was able to reproduce the problem I did have an opportunity to try some JDK changes and check for problems. I didn't find a clipping problem. Nor did I find that using new X11 pixmap for every stipple fill call helped. The only thing that seemed to help was significantly increasing the height of the stipple mask. Also I only reproduced this painting to a Swing back buffer which is a Pixmap. Drawing to the screen had no problems. I'd like to suspect an Xserver problem or DDX problem but I didn't manage to do enough testing to be sure about it.
23-08-2005

EVALUATION I had a look at this as it sounded similar to 4844952: drawString corruption on Matrox video cards on linux but its not the same problem, although the same code is being executed. The text that's drawn is rotated so that its drawn in several passes of the pixmap stipple, as its higher than the pixmap. So that's the similarity with 4844952, but in this case rather than repetition or corruption the topmost "pass" or passes are completely missing. However if one moves the window off-screen and moves it back on slowly the text is drawn properly. Moving it on quickly so that all the damage needs to be repaired at once, shows the problem - this is similar to the initial display. It could be a - buggy assumption in the JDK stipple text blitting code - X11 DDX bug - clipping problem. - MT/timing problem But I don't see any evidence of which if any of these is the issue. Eg, as far as I can see the AWT lock is acquired and released properly. Both the systems under test appear to be equipped with an Nvidia GEForce 4 Ti4200 Also this is not a new problem. I reproduced it on 1.4.0 and 1.4.2 on the same system. ###@###.### 2004-05-13 ============================
13-05-2004