JDK-6467628 : Incompatibility appearence between 1.3.1 and 5.0 when a program draws tranparent gif image
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.4.2,5.0u8
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic,windows_xp
  • CPU: generic,x86
  • Submitted: 2006-09-06
  • Updated: 2013-10-10
  • Resolved: 2013-10-10
Related Reports
Relates :  
Description
There seems regression in 5.0u8 when a program draws transparent image in GIF.

Please see the attached jpeg image.(images-diff-between-131-50.JPG) 
The result of 5.0u8 shows incorrect appearence on background image.

REPRODUCE:
 Compile the test program(ImageCanvas.java) in 1.3.1_16 and invoke "java ImageCanvas"

NOTE: 
  This problem occurs 1.4.1 and 5.0u8, not in 1.3.1_16, 1.4.2_12 and 6.0b97.

Comments
EVALUATION The fix for 6389283 will fix this problem as well since it rewrites the SystemColor class to use the "value" field compatibly with the way that the base Color class uses it. Unfortunately, that fix will appear in Dolphin only at this point. Parts of that fix could be back-ported to older releases once we have more input on its risks.
19-09-2006

EVALUATION SystemColor class is descendant of the java.awt.Color class but it uses (package private) filed "value" differently. Color keeps actual color value there but SystemColor stores their index of system color. However, the GrPrim_ColorGetRGB() method directly access this field an interprets result as background color value for BlitBg operation. This cause wrong results if SystemColor is used (index of color is not color). To solve this problem we can call getRGB() method to get color value instead of accessing class field directly. Obviously, using the method call instead of reading field will have some performance impact. But this happens once per BlitBg operation and thereofre impact have to be quite limited.
19-09-2006

EVALUATION I am able to reproduce this bug with both 5u8 and 1.4.2_13 using same testcase. Therefore it is not regression. Note that original testcase works fine with mustang and this seems to be sideeffect of changes done for 5051527. However, updated testcase that perform drawImage() without scaling still has similar problem.
06-09-2006

EVALUATION This problem can be reproduced on early 6.0 builds (up to b09) and seems to be fixed in b10.
06-09-2006

WORK AROUND Use java.awt.Color instead of SystemColor to specify image background.
06-09-2006