2003/10/01 03:08:32
[org.ibex.core.git] / src / org / xwt / plat / AWT.java
index e186789..3dfd153 100644 (file)
@@ -160,14 +160,20 @@ public class AWT extends JVM {
         public int getWidth() { return i == null ? 0 : i.getWidth(null); }
         public void setClip(int x, int y, int x2, int y2) { g.setClip(x, y, x2 - x, y2 - y); }
 
-        public void drawPicture(Picture source, int x, int y) {
-            drawPicture(source, x, y, x + source.getWidth(), y + source.getHeight(), 0, 0, source.getWidth(), source.getHeight());
-        }
-
         public void drawPicture(Picture source, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2) {
             g.drawImage(((AWTPicture)source).i, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null);
         }
         
+        public void drawPictureAlphaOnly(Picture source, int dx1, int dy1, int dx2, int dy2,
+                                         int sx1, int sy1, int sx2, int sy2, int rgb) {
+            AWTPicture p = (AWTPicture)source;
+            Graphics g = p.i.getGraphics();
+            g.setXORMode(new Color(rgb));
+            g.fillRect(0, 0, p.i.getWidth(null), p.i.getHeight(null));
+            drawPicture(source, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2);
+            g.fillRect(0, 0, p.i.getWidth(null), p.i.getHeight(null));
+        }
+
         public void fillRect(int x, int y, int x2, int y2, int argb) {
             // FEATURE: use an LRU cache for Color objects
         }