CVSROOT: /cvsroot/classpath Module name: classpath Changes by: Lillian Angel <langel> 06/06/19 20:28:22
Modified files: . : ChangeLog gnu/java/awt/peer/gtk: CairoGraphics2D.java Log message: 2006-06-19 Lillian Angel <[EMAIL PROTECTED]> * gnu/java/awt/peer/gtk/CairoGraphics2D.java (drawImage): Should always use getRGB to get the pixels. getData returns an incorrect array of pixels. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&r1=1.7878&r2=1.7879 http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java?cvsroot=classpath&r1=1.25&r2=1.26 Patches: Index: ChangeLog =================================================================== RCS file: /cvsroot/classpath/classpath/ChangeLog,v retrieving revision 1.7878 retrieving revision 1.7879 diff -u -b -r1.7878 -r1.7879 --- ChangeLog 19 Jun 2006 12:43:48 -0000 1.7878 +++ ChangeLog 19 Jun 2006 20:28:22 -0000 1.7879 @@ -1,3 +1,9 @@ +2006-06-19 Lillian Angel <[EMAIL PROTECTED]> + + * gnu/java/awt/peer/gtk/CairoGraphics2D.java + (drawImage): Should always use getRGB to get the pixels. + getData returns an incorrect array of pixels. + 2006-06-19 Raif S. Naffah <[EMAIL PROTECTED]> * gnu/java/security/jce/hash/HavalSpi.java: Source formatting. Index: gnu/java/awt/peer/gtk/CairoGraphics2D.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -b -r1.25 -r1.26 --- gnu/java/awt/peer/gtk/CairoGraphics2D.java 16 Jun 2006 10:27:29 -0000 1.25 +++ gnu/java/awt/peer/gtk/CairoGraphics2D.java 19 Jun 2006 20:28:22 -0000 1.26 @@ -1201,6 +1201,7 @@ // Note - this can get us in trouble when the gdk lock is re-acquired. // for example by VolatileImage. See ComponentGraphics for how we work // around this. + if( !(img instanceof BufferedImage) ) { ImageProducer source = img.getSource(); @@ -1217,6 +1218,7 @@ // If this BufferedImage has a BufferedImageGraphics object, // use the cached CairoSurface that BIG is drawing onto + if( BufferedImageGraphics.bufferedImages.get( b ) != null ) db = (DataBuffer)BufferedImageGraphics.bufferedImages.get( b ); else @@ -1247,24 +1249,7 @@ setPaint( oldPaint ); } - int[] pixels; - - // Shortcut for easy color models. - if( b.getColorModel().equals(rgb32) ) - { - pixels = ((DataBufferInt)db).getData(); - for(int i = 0; i < pixels.length; i++) - pixels[i] |= 0xFF000000; - } - else if( b.getColorModel().equals(argb32) ) - { - pixels = ((DataBufferInt)db).getData(); - } - else - { - pixels = b.getRGB(0, 0, width, height, - null, 0, width); - } + int[] pixels = b.getRGB(0, 0, width, height, null, 0, width); drawPixels(nativePointer, pixels, width, height, width, i2u, alpha);