Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4771101
Votes 0
Synopsis REGRESSION: Regtest sun/java2d/SunGraphics2D/PolyVertTest.java failed
Category java:classes_2d
Reported Against mantis , mantis-beta
Release Fixed 1.5(tiger)
State 10-Fix Delivered, Verified, bug
Priority: 3-Medium
Related Bugs 4665237 , 4678208 , 4867398
Submit Date 30-OCT-2002
Description




Filed By       : J2SE-SQA [j2se-tck-  xxxxx@xxxxx  ]
JDK            : JDK1.4.2-b04
Testbase       : RegTest-test
Platform[s]    :  customer  Linux 8.0 (GNOME)
switch/Mode    : -client -Xmixed -Xfuture
Falling test[s]: 
        sun/java2d/SunGraphics2D/PolyVertTest.java 

RegTest-test sun/java2d/SunGraphics2D/PolyVertTest.java test fails on JDK1.4.2-b04

Test source location:
=====================
/net/jdk/export/disk8/local.java/jdk1.4.2/ws/j2se/test/sun/java2d/SunGraphics2D/PolyVertTest.java

jtr file location:
==================
/net/jtgb4u4c.eng/export/sail15/results/mantis/b04/regtest/linux/redhat8.0_gnome_linux-11/sun/java2d/SunGraphics2D/PolyVertTest.jtr

How to reproduce:
=================
Run the following script (you may need to change its variables)
 
--- script start ---
#!/bin/sh
TESTJAVA="/net/jdk/export/disk8/local.java/jdk1.4.2/linux"
export TESTJAVA
TEST_BASE="/net/jdk/export/disk8/local.java/jdk1.4.2/ws/j2se"
JCT_PATH="/net/linux-15/export/home/java/jct"
JT="$JCT_PATH/lib/javatest.jar"
JTREG="$JCT_PATH/lib/jtreg.jar"
TEST_BASE_ROOT="$TEST_BASE/test"
TEST_PACKAGE=sun/java2d/SunGraphics2D
TEST_SHORT_NAME=PolyVertTest
TEST_NAME=$TEST_PACKAGE/$TEST_SHORT_NAME
TESTSRC="$TEST_BASE_ROOT/$TEST_PACKAGE"
export TESTSRC
CLASSPATH=".:$TESTJAVA:$TESTJAVA/lib/tools.jar:$TEST_BASE:$TESTSRC:$JT:$JTREG"
export CLASSPATH^S
$TESTJAVA/bin/javac -g -classpath "$CLASSPATH" -d . $TEST_BASE_ROOT/$TEST_NAME.java
#$TESTJAVA/bin/java -showversion -cp "$CLASSPATH" -Dtest.src=$TEST_BASE_ROOT/$TEST_PACKAGE $TEST_SHORT_NAME
$TESTJAVA/bin/java -showversion -cp "$CLASSPATH" -Dtest.src=$TEST_BASE_ROOT/$TEST_PACKAGE $TEST_SHORT_NAME  -count  -showerrors

--- script end ---

Test output:
============
java version "1.4.2-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b04)
Java HotSpot(TM) Client VM (build 1.4.2-beta-b04, mixed mode)

4 bad pixels found while testing Screen
9 bad pixels found while testing Offscreen
9 bad pixels found while testing Volatile
9 bad pixels found while testing X11GraphicsConfig[dev=X11GraphicsDevice[screen=0],vis=0x23].createCompat()
9 bad pixels found while testing X11GraphicsConfig[dev=X11GraphicsDevice[screen=0],vis=0x23].createCompat(OPAQUE)
9 bad pixels found while testing X11GraphicsConfig[dev=X11GraphicsDevice[screen=0],vis=0x23].createVolatile()
9 bad pixels found while testing X11GraphicsConfig[dev=X11GraphicsDevice[screen=0],vis=0x24].createCompat()
9 bad pixels found while testing X11GraphicsConfig[dev=X11GraphicsDevice[screen=0],vis=0x24].createCompat(OPAQUE)
9 bad pixels found while testing X11GraphicsConfig[dev=X11GraphicsDevice[screen=0],vis=0x24].createVolatile()
Exception in thread "main" java.lang.RuntimeException: 76 bad pixels found in 9 tests
        at PolyVertTest.main(PolyVertTest.java:284)


Specific machine info:
======================
Hostname: linux-11
OS:  customer  Linux 8.0 (GNOME)
Video Card: ATI Mach64 3D Range IIC AGP


======================================================================
Work Around
N/A
Evaluation
This test actually fails on all platforms, not just Linux.  The failures are
limited to the screen rendering tests (or accelerated offscreen rendering;
basically any case that uses the platform renderer (GDI/X11)).  This regression
test was introduced with the putback for 4678208 (single pixel polygons are not
drawn), the fix for which was Windows-centric.  Therefore, this test originally
passed just fine on Windows due to the fixes in 4678208, but similar fixes were
not applied on the X11 side, so the screen tests fail on Solaris and Linux.
Just as 4678208 included some changes to Win32Renderer.TransformPoly(), the
X11Renderer.transformPoints() method requires similar changes so that some
degenerate polygon cases are handled properly.  Most of the failures are related
to rendering polygon segments that don't go anywhere (e.g. (0,0) to (0,0)).

I discovered two other sources of failure.  One is that drawRect(x, y, 0, 0)
should produce a single pixel at (x,y), but does not render anything on X11.
The fix here is to trap the zero width/height case and instead issue an
XFillRect with the appropriate dimensions.  The second failure is in the
transformPoints() method; line 71 of X11Renderer.c should be
    close = (npoints > 1
to allow polygons with two points to be closed (in keeping with the
drawPolygon() spec).  This helps the "XOR'd drawPolygon() call with 2 points"
testcase work slightly better on X11, but it will still require the extended
transformPoints() changes mentioned above in order to pass completely.

Note that there is also now a single pixel failure on Windows due to the putback
of platform XOR rendering support in 4665237.  This case will require more
investigation.

Also note that these failures only affect corner cases and are not necessarily
new in Mantis; the issue is that there is a new regression test (PolyVertTest)
that calls out these failures.  In fact, Mantis provides much more consistent
results with degenerate primitive rendering than previous releases due to the
fixes for 4678208.  With the suggested fixes (mentioned above) in place,
PolyVertTest should pass completely in all cases on all platforms.
  xxxxx@xxxxx   2002-11-04

Transferring to engineer reponsible for 4678208.
  xxxxx@xxxxx   2002-11-08

I modified the X11 renderer to collapse empty edges out of polygons and
then to use a more reliable rendering method like XDrawLine (or XFillRect
in the case of empty XDrawRectangles) if the polygon simplifies down
to empty or a single segment.  This seems to correct the non-XOR rendering
in every X11 implementation I ran against, including 2 configurations that
got most of our "empty primtive" tests wrong.

  xxxxx@xxxxx   2003-02-26
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang