aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu/awt
diff options
context:
space:
mode:
author(no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-31 20:38:54 +0000
committer(no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-31 20:38:54 +0000
commit59ac20130178f4dc977d171044c85f3cf07caa84 (patch)
treeaa369ecffc2a87f503929cfae66b07b606cbdc64 /libjava/gnu/awt
parent964944fc854c1dd723f7b8150d0deac634aabdbb (diff)
This commit was manufactured by cvs2svn to create taghammer-3_3-merge-20030131
'hammer-3_3-merge-20030131'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/tags/hammer-3_3-merge-20030131@62199 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu/awt')
-rw-r--r--libjava/gnu/awt/j2d/DirectRasterGraphics.java5
-rw-r--r--libjava/gnu/awt/j2d/Graphics2DImpl.java5
-rw-r--r--libjava/gnu/awt/j2d/IntegerGraphicsState.java18
-rw-r--r--libjava/gnu/awt/xlib/XGraphics.java8
-rw-r--r--libjava/gnu/awt/xlib/XGraphicsConfiguration.java37
-rw-r--r--libjava/gnu/awt/xlib/XToolkit.java4
6 files changed, 46 insertions, 31 deletions
diff --git a/libjava/gnu/awt/j2d/DirectRasterGraphics.java b/libjava/gnu/awt/j2d/DirectRasterGraphics.java
index 8d25b88d018..28aad9b0404 100644
--- a/libjava/gnu/awt/j2d/DirectRasterGraphics.java
+++ b/libjava/gnu/awt/j2d/DirectRasterGraphics.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2003 Free Software Foundation
This file is part of libgcj.
@@ -61,7 +61,8 @@ public interface DirectRasterGraphics extends Cloneable
public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints);
- public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints);
+ public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints,
+ int translateX, int translateY);
public void drawString(String str, int x, int y);
diff --git a/libjava/gnu/awt/j2d/Graphics2DImpl.java b/libjava/gnu/awt/j2d/Graphics2DImpl.java
index ef4d742c056..5af41bfc9cb 100644
--- a/libjava/gnu/awt/j2d/Graphics2DImpl.java
+++ b/libjava/gnu/awt/j2d/Graphics2DImpl.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002 Free Software Foundation
+/* Copyright (C) 2000, 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -24,6 +24,7 @@ import java.awt.Stroke;
import java.awt.geom.AffineTransform;
import java.awt.image.ImageObserver;
import java.awt.image.BufferedImage;
+import java.awt.image.BufferedImageOp;
import java.awt.image.RenderedImage;
import java.awt.image.renderable.RenderableImage;
import java.text.AttributedCharacterIterator;
@@ -459,7 +460,7 @@ public class Graphics2DImpl extends Graphics2D implements Cloneable
throw new UnsupportedOperationException(msg);
}
- public void drawImage(BufferedImage image, BufferedImage op, int x, int y)
+ public void drawImage(BufferedImage image, BufferedImageOp op, int x, int y)
{
throw new UnsupportedOperationException("not implemented yet");
}
diff --git a/libjava/gnu/awt/j2d/IntegerGraphicsState.java b/libjava/gnu/awt/j2d/IntegerGraphicsState.java
index 90a1a4d2ab5..bfea6611ca5 100644
--- a/libjava/gnu/awt/j2d/IntegerGraphicsState.java
+++ b/libjava/gnu/awt/j2d/IntegerGraphicsState.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2003 Free Software Foundation
This file is part of libgcj.
@@ -212,7 +212,7 @@ public class IntegerGraphicsState extends AbstractGraphicsState
public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
{
- if ((tx == 0) || (ty == 0))
+ if ((tx == 0) && (ty == 0))
{
directGfx.drawPolyline(xPoints, yPoints, nPoints);
return;
@@ -223,7 +223,7 @@ public class IntegerGraphicsState extends AbstractGraphicsState
public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
{
- if ((tx == 0) || (ty == 0))
+ if ((tx == 0) && (ty == 0))
{
directGfx.drawPolygon(xPoints, yPoints, nPoints);
return;
@@ -232,15 +232,11 @@ public class IntegerGraphicsState extends AbstractGraphicsState
throw new UnsupportedOperationException("translate not implemented");
}
- public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
+ public void fillPolygon (int[] xPoints, int[] yPoints, int nPoints)
{
- if ((tx == 0) || (ty == 0))
- {
- directGfx.fillPolygon(xPoints, yPoints, nPoints);
- return;
- }
-
- throw new UnsupportedOperationException("translate not implemented");
+ // FIXME: remove tx & ty args once translation via AffineTransform
+ // is implemented.
+ directGfx.fillPolygon (xPoints, yPoints, nPoints, tx, ty);
}
public boolean drawImage(Image image, int x, int y,
diff --git a/libjava/gnu/awt/xlib/XGraphics.java b/libjava/gnu/awt/xlib/XGraphics.java
index 27b07a2369a..90f53880e85 100644
--- a/libjava/gnu/awt/xlib/XGraphics.java
+++ b/libjava/gnu/awt/xlib/XGraphics.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2003 Free Software Foundation
This file is part of libgcj.
@@ -176,10 +176,10 @@ public class XGraphics implements Cloneable, DirectRasterGraphics
throw new UnsupportedOperationException("not implemented");
}
- public void fillPolygon(int[] xPoints, int[] yPoints, int
- nPoints)
+ public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints,
+ int translateX, int translateY)
{
- throw new UnsupportedOperationException("not implemented");
+ context.fillPolygon(xPoints, yPoints, nPoints, translateX, translateY);
}
public void drawString(String str, int x, int y)
diff --git a/libjava/gnu/awt/xlib/XGraphicsConfiguration.java b/libjava/gnu/awt/xlib/XGraphicsConfiguration.java
index 9ae12d6f8b9..7d7d5159fe0 100644
--- a/libjava/gnu/awt/xlib/XGraphicsConfiguration.java
+++ b/libjava/gnu/awt/xlib/XGraphicsConfiguration.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2003 Free Software Foundation
This file is part of libgcj.
@@ -389,15 +389,32 @@ public class XGraphicsConfiguration extends GraphicsConfiguration
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 --git a/libjava/gnu/awt/xlib/XToolkit.java b/libjava/gnu/awt/xlib/XToolkit.java
index 0c199b2b7f7..c71b39d0f80 100644
--- a/libjava/gnu/awt/xlib/XToolkit.java
+++ b/libjava/gnu/awt/xlib/XToolkit.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002 Free Software Foundation
+/* Copyright (C) 2000, 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -173,7 +173,7 @@ public class XToolkit extends Toolkit
public java.awt.image.ColorModel getColorModel()
{
- throw new UnsupportedOperationException("not implemented yet");
+ return getDefaultXGraphicsConfiguration().getColorModel();
}
public String[] getFontList()