Some improvements needed on icedtea Java2D renderers.

Xerxes Rånby xerxes at
Mon Apr 27 04:00:56 PDT 2009

Hello, during bug testing of icedtea6 on various embedded and stationary 
hardware i have stumbled across some rendering issues of java2d when 
running under icedtea6.


Sourcecode available from:

The attached picture displays my rendering error findings:

1. When the window are refreshed, the component borders gets redrawn 
with a mix of soft and sharp borders.

2. The rendering of the black box have been requested to be rendererd 
using a dotted CAP_ROUND BasicStroke: it should be dotted!
        BasicStroke dotted = new BasicStroke(3, BasicStroke.CAP_ROUND,
                     BasicStroke.JOIN_ROUND, 0, new float[]{0,6,0,6}, 0);

3. The six dotted lines should start with displaying a fill instead of a 
gap especially since phase are set to 0.0f.
        float j = 1.1f;
        for (int i = 0; i < bs.length; i++, j += 1.0f) {
            float dash[] = { j };
            BasicStroke b = new BasicStroke(1.0f, BasicStroke.CAP_BUTT,
                                BasicStroke.JOIN_MITER, 10.0f, dash, 0.0f);
            g2.drawLine(20, y, w-20, y);

4. The panel are not resized properly to fit the slider component.

5. and 6.  The last two issues are related. the specified joinType are 
not applyed to lines that gets inserted using closePath.
    public void drawDemo(int w, int h, Graphics2D g2) {
        BasicStroke bs = new BasicStroke(bswidth,
                                    BasicStroke.CAP_BUTT, joinType);
        GeneralPath p = new GeneralPath();
        p.moveTo(- w / 4.0f, - h / 12.0f);
        p.lineTo(+ w / 4.0f, - h / 12.0f);
        p.lineTo(- w / 6.0f, + h / 4.0f);
        p.lineTo(+     0.0f, - h / 4.0f);
        p.lineTo(+ w / 6.0f, + h / 4.0f);
        p.closePath();                                          //      
<-----  issue 6: this should have create a correct join. instead a round 
join are allways used.
        p.closePath();                                          //      
<-----  issue 5: this should have create a correct join. the rendering 
of the start line should
//                have  been updated when the second closepath was 
        g2.translate(w/2, h/2);

The second attached picture without pink markings displays how the 
testcase looks using Sun's properitary java2d for reference.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: icedtea6_Java2Demo.png
Type: image/png
Size: 73247 bytes
Desc: not available
Url : 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Sun6_Java2Demo.png
Type: image/png
Size: 71944 bytes
Desc: not available
Url : 

More information about the distro-pkg-dev mailing list