jdk/src/share/classes/sun/awt/image/ImageRepresentation.java
changeset 4207 a9ca0ff33862
parent 2 90ce3da70b43
child 5188 6208e3cf4275
--- a/jdk/src/share/classes/sun/awt/image/ImageRepresentation.java	Thu Sep 10 14:15:47 2009 +0400
+++ b/jdk/src/share/classes/sun/awt/image/ImageRepresentation.java	Mon Sep 14 11:46:16 2009 +0400
@@ -336,10 +336,6 @@
     public native void setICMpixels(int x, int y, int w, int h, int[] lut,
                                     byte[] pix, int off, int scansize,
                                     IntegerComponentRaster ict);
-
-    public native void setBytePixels(int x, int y, int w, int h, byte[] pix,
-                                     int off, int scansize,
-                                     ByteComponentRaster bct, int chanOff);
     public native int setDiffICM(int x, int y, int w, int h, int[] lut,
                                  int transPix, int numLut, IndexColorModel icm,
                                  byte[] pix, int off, int scansize,
@@ -450,27 +446,17 @@
                      (biRaster instanceof ByteComponentRaster) &&
                      (biRaster.getNumDataElements() == 1)){
                 ByteComponentRaster bt = (ByteComponentRaster) biRaster;
-                if (w*h > 200) {
-                    if (off == 0 && scansize == w) {
-                        bt.putByteData(x, y, w, h, pix);
-                    }
-                    else {
-                        byte[] bpix = new byte[w];
-                        poff = off;
-                        for (int yoff=y; yoff < y+h; yoff++) {
-                            System.arraycopy(pix, poff, bpix, 0, w);
-                            bt.putByteData(x, yoff, w, 1, bpix);
-                            poff += scansize;
-                        }
-                    }
+                if (off == 0 && scansize == w) {
+                    bt.putByteData(x, y, w, h, pix);
                 }
                 else {
-                    // Only is faster if #pixels
-                    // Note that setBytePixels modifies the raster directly
-                    // so we must mark it as changed afterwards
-                    setBytePixels(x, y, w, h, pix, off, scansize, bt,
-                                  bt.getDataOffset(0));
-                    bt.markDirty();
+                    byte[] bpix = new byte[w];
+                    poff = off;
+                    for (int yoff=y; yoff < y+h; yoff++) {
+                        System.arraycopy(pix, poff, bpix, 0, w);
+                        bt.putByteData(x, yoff, w, 1, bpix);
+                        poff += scansize;
+                    }
                 }
             }
             else {