diff -r -up gcc.patched/libjava/gnu/awt/xlib/XGraphicsConfiguration.java gcc/libjava/gnu/awt/xlib/XGraphicsConfiguration.java --- gcc.patched/libjava/gnu/awt/xlib/XGraphicsConfiguration.java 2002-12-02 13:04:44.000000000 -0500 +++ gcc/libjava/gnu/awt/xlib/XGraphicsConfiguration.java 2002-12-02 13:06:35.000000000 -0500 @@ -353,15 +353,31 @@ public class XGraphicsConfiguration exte int getPixel(Color color) { + /* FIXME: consider an integer technique whenever + * the ColorModel is 8 bits per color. + * The problem with using integers is that it doesn't work unless + * the colors are 8 bits each (as in the array), since ColorModel.getDataElement(int[],int) + * expects non-normalized values. For example, in a 16-bit display mode, you + * would typically have 5 bits each for red and blue, and 6 bits for green. int[] components = - { - color.getRed(), - color.getGreen(), - color.getBlue(), - 0xff - }; - - ColorModel cm = getColorModel(); - return cm.getDataElement(components, 0); + { + color.getRed (), + color.getGreen (), + color.getBlue (), + 0xff + }; + */ + + float[] normalizedComponents = + { + ((float)color.getRed ()) / 255F, + ((float)color.getGreen ()) / 255F, + ((float)color.getBlue ()) / 255F, + 1 + }; + int[] unnormalizedComponents = { 0, 0, 0, 0xff }; + ColorModel cm = getColorModel (); + cm.getUnnormalizedComponents(normalizedComponents,0,unnormalizedComponents,0); + return cm.getDataElement (unnormalizedComponents, 0); } } diff -r -up gcc.patched/libjava/gnu/awt/xlib/XToolkit.java gcc/libjava/gnu/awt/xlib/XToolkit.java --- gcc.patched/libjava/gnu/awt/xlib/XToolkit.java 2002-12-02 11:45:17.000000000 -0500 +++ gcc/libjava/gnu/awt/xlib/XToolkit.java 2002-11-27 12:51:58.000000000 -0500 @@ -169,7 +169,7 @@ public class XToolkit extends Toolkit public java.awt.image.ColorModel getColorModel() { - throw new UnsupportedOperationException("not implemented yet"); + return getDefaultXGraphicsConfiguration().getColorModel(); } public String[] getFontList()