Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4387987

Merlin b38:TextLayout.draw() method throws Exception on Solaris2.6/x86.

XMLWordPrintable

    • 2d
    • x86
    • solaris

      Merlin-B38, Slaris 2.6/x86, TextLayout.draw() throws the following exceptions when executed and can not draw string characters correctly:

      -------------------------------------------------------------------------------
      sun.dc.pr.PRException: endPath: bad path
              at sun.dc.pr.Rasterizer.endPath(Rasterizer.java:540)
              at sun.java2d.pipe.DuctusRenderer.createShapeRasterizer(DuctusRenderer.java:3
      73)
              at sun.java2d.pipe.DuctusShapeRenderer.renderPath(DuctusShapeRenderer.java:59
      )
              at sun.java2d.pipe.DuctusShapeRenderer.draw(DuctusShapeRenderer.java:48)
              at sun.java2d.SunGraphics2D.draw(SunGraphics2D.java:2095)
              at TextLayoutTest.paint(TextLayoutTest.java:112)
              at sun.awt.RepaintArea.paintRect(RepaintArea.java:336)
              at sun.awt.RepaintArea.paint(RepaintArea.java:321)
              at sun.awt.motif.MComponentPeer.handleEvent(MComponentPeer.java:309)
              at java.awt.Component.dispatchEventImpl(Component.java:2965)
              at java.awt.Component.dispatchEvent(Component.java:2764)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:423)
              at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:136)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:122)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:118)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
      --------------------------------------------------------------------------------

      To reproduce,

      1. compile attached TextLayout.java with jdk1.4_b38
      2. run java TextLayout

      This program works fine on Sparc, but does not work on x86.
      This problem is not seen both on x86 and Sparc with Kestral.
      However, once run this program with kestarl, this problem never occurs on x86 with b38.

      % java -version
      java version "1.4.0beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0beta-b38)
      Java HotSpot(TM) Client VM (build 1.4beta-B38, mixed mode)

      ==================================
      Here is a part of TextLayout.java
      ==================================
         100 // getBlackBoxBounds()
         101 tl = new TextLayout("abcABCdefgHIjk", bigFont, g2d.getFontRen
      derContext());
         102 sh += tl.getAscent()+tl.getDescent();
         103 g2d.setColor(Color.black);
         104 tl.draw(g2d, 0.0f, sh);
         105 Shape selection = tl.getBlackBoxBounds(3, 9);
         106 g2d.setColor(Color.blue);
         107 g2d.setStroke(new BasicStroke(1.5f));
         108 AffineTransform at = new AffineTransform();
         109 at.setToTranslation(0.0f, sh);
         110 selection = at.createTransformedShape(selection);
         112 g2d.draw(selection); <---- thrown here eception above!!
                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      Please compare attached 2 gif files(jdk1.4_sparc.gif and jdk1.4_x86.gif).
      You can see the problem on x86.

      I run the program with truss command and attached truss file.
      The file may be useful to understand this problem.




            dougfelt Doug Felt
            rsuzukisunw Rieko Suzuki (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: