summaryrefslogtreecommitdiff
path: root/gnu/java/awt/peer/gtk/BufferedImageGraphics.java
diff options
context:
space:
mode:
authorFrancis Kung <fkung@redhat.com>2007-02-12 21:39:20 +0000
committerFrancis Kung <fkung@redhat.com>2007-02-12 21:39:20 +0000
commit9b132bf73abd2d8870ecc03782a254df7ca98a25 (patch)
tree24ac5891e3015f92fadc92766404b2a808e4834b /gnu/java/awt/peer/gtk/BufferedImageGraphics.java
parent898d45fed828c53f3e6c10b1db9978d541788f70 (diff)
downloadclasspath-9b132bf73abd2d8870ecc03782a254df7ca98a25.tar.gz
2007-02-12 Francis Kung <fkung@redhat.com>
* gnu/java/awt/ClasspathToolkit.java: * gnu/java/awt/peer/gtk/AsyncImage.java, * gnu/java/awt/peer/gtk/BufferedImageGraphics.java, * gnu/java/awt/peer/gtk/CairoGraphics2D.java, * gnu/java/awt/peer/gtk/CairoSurface.java, * gnu/java/awt/peer/gtk/ComponentGraphics.java, * gnu/java/awt/peer/gtk/FreetypeGlyphVector.java, * gnu/java/awt/peer/gtk/GdkFontPeer.java, * gnu/java/awt/peer/gtk/GdkPixbufDecoder.java, * gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java, * gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, * gnu/java/awt/peer/gtk/GtkChoicePeer.java, * gnu/java/awt/peer/gtk/GtkClipboard.java, * gnu/java/awt/peer/gtk/GtkClipboardNotifier.java, * gnu/java/awt/peer/gtk/GtkComponentPeer.java, * gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, * gnu/java/awt/peer/gtk/GtkFramePeer.java, * gnu/java/awt/peer/gtk/GtkImage.java, * gnu/java/awt/peer/gtk/GtkImageConsumer.java, * gnu/java/awt/peer/gtk/GtkLabelPeer.java, * gnu/java/awt/peer/gtk/GtkListPeer.java, * gnu/java/awt/peer/gtk/GtkMainThread.java, * gnu/java/awt/peer/gtk/GtkMenuBarPeer.java, * gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, * gnu/java/awt/peer/gtk/GtkMenuPeer.java, * gnu/java/awt/peer/gtk/GtkMouseInfoPeer.java, * gnu/java/awt/peer/gtk/GtkScrollbarPeer.java, * gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, * gnu/java/awt/peer/gtk/GtkSelection.java, * gnu/java/awt/peer/gtk/GtkTextAreaPeer.java, * gnu/java/awt/peer/gtk/GtkTextFieldPeer.java, * gnu/java/awt/peer/gtk/GtkToolkit.java, * gnu/java/awt/peer/gtk/GtkWindowPeer.java, * gnu/java/awt/peer/gtk/VolatileImageGraphics.java, * java/awt/RenderingHints.java, * java/awt/image/BufferedImage.java: Reformatted and added generics.
Diffstat (limited to 'gnu/java/awt/peer/gtk/BufferedImageGraphics.java')
-rw-r--r--gnu/java/awt/peer/gtk/BufferedImageGraphics.java25
1 files changed, 14 insertions, 11 deletions
diff --git a/gnu/java/awt/peer/gtk/BufferedImageGraphics.java b/gnu/java/awt/peer/gtk/BufferedImageGraphics.java
index 18182a77c..d5d26ee7e 100644
--- a/gnu/java/awt/peer/gtk/BufferedImageGraphics.java
+++ b/gnu/java/awt/peer/gtk/BufferedImageGraphics.java
@@ -87,7 +87,8 @@ public class BufferedImageGraphics extends CairoGraphics2D
/**
* Cache BufferedImageGraphics surfaces.
*/
- static WeakHashMap bufferedImages = new WeakHashMap();
+ static WeakHashMap<BufferedImage, CairoSurface> bufferedImages
+ = new WeakHashMap<BufferedImage, CairoSurface>();
/**
* Its corresponding cairo_t.
@@ -108,24 +109,24 @@ public class BufferedImageGraphics extends CairoGraphics2D
hasFastCM = false;
else if(bi.getColorModel().equals(CairoSurface.cairoCM_opaque))
{
- hasFastCM = true;
- hasAlpha = false;
+ hasFastCM = true;
+ hasAlpha = false;
}
else if(bi.getColorModel().equals(CairoSurface.cairoColorModel))
{
- hasFastCM = true;
- hasAlpha = true;
+ hasFastCM = true;
+ hasAlpha = true;
}
else
hasFastCM = false;
// Cache surfaces.
if( bufferedImages.get( bi ) != null )
- surface = (CairoSurface)bufferedImages.get( bi );
+ surface = bufferedImages.get( bi );
else
{
- surface = new CairoSurface( imageWidth, imageHeight );
- bufferedImages.put(bi, surface);
+ surface = new CairoSurface( imageWidth, imageHeight );
+ bufferedImages.put(bi, surface);
}
cairo_t = surface.newCairoContext();
@@ -154,7 +155,8 @@ public class BufferedImageGraphics extends CairoGraphics2D
int scanline = sm.getScanlineStride();
for (int i = 0; i < imageHeight; i++)
- System.arraycopy(pixels, (i - minY) * scanline - minX, pixels2, i * imageWidth, imageWidth);
+ System.arraycopy(pixels, (i - minY) * scanline - minX, pixels2,
+ i * imageWidth, imageWidth);
pixels = pixels2;
}
@@ -166,7 +168,8 @@ public class BufferedImageGraphics extends CairoGraphics2D
}
else
{
- pixels = CairoGraphics2D.findSimpleIntegerArray(image.getColorModel(),image.getData());
+ pixels = CairoGraphics2D.findSimpleIntegerArray(image.getColorModel(),
+ image.getData());
}
surface.setPixels( pixels );
@@ -393,7 +396,7 @@ public class BufferedImageGraphics extends CairoGraphics2D
// Find translated bounds
Rectangle2D bounds = new Rectangle(bImg.getMinX(), bImg.getMinY(),
- bImg.getWidth(), bImg.getHeight());
+ bImg.getWidth(), bImg.getHeight());
if (xform != null)
bounds = getTransformedBounds(bounds, xform);