In BufferedImage.getSource() we must pass a DirectColorModel to the
ImageConsumer(s), because we convert the data to RGB before. Before we
passed the BufferedImage's color model which doesn't work in all
possible cases.

2006-06-27  Roman Kennke  <[EMAIL PROTECTED]>

        * java/awt/image/BufferedImage.java
        (getSource): Use a fixed DirectColorModel to deliver the
        RGB pixels to the ImageConsumer.

/Roman
-- 
“Improvement makes straight roads, but the crooked roads, without
Improvement, are roads of Genius.” - William Blake
Index: java/awt/image/BufferedImage.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/image/BufferedImage.java,v
retrieving revision 1.15
diff -u -1 -2 -r1.15 BufferedImage.java
--- java/awt/image/BufferedImage.java	9 Jun 2006 15:00:57 -0000	1.15
+++ java/awt/image/BufferedImage.java	27 Jun 2006 14:42:53 -0000
@@ -495,25 +495,28 @@
 
         public void startProduction(ImageConsumer ic)
         {
           int x = 0;
           int y = 0;
           int width = getWidth();
           int height = getHeight();
           int stride = width;
           int offset = 0;
           int[] pixels = getRGB(x, y, 
                                 width, height, 
                                 (int[])null, offset, stride);
-          ColorModel model = getColorModel();
+          // We already convert the color to RGB in the getRGB call, so
+          // we pass a simple RGB color model to the consumers.
+          ColorModel model = new DirectColorModel(32, 0xff0000, 0xff00, 0xff,
+                                                  0xff000000);
 
           consumers.add(ic);
 
 	  for(int i=0;i<consumers.size();i++)
             {
               ImageConsumer c = (ImageConsumer) consumers.elementAt(i);
               c.setHints(ImageConsumer.SINGLEPASS);
               c.setDimensions(getWidth(), getHeight());
               c.setPixels(x, y, width, height, model, pixels, offset, stride);
               c.imageComplete(ImageConsumer.STATICIMAGEDONE);
             }
         }

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

Reply via email to