improved Java2 AWT performance
authoradam <adam@megacz.com>
Thu, 8 Apr 2004 02:33:49 +0000 (02:33 +0000)
committeradam <adam@megacz.com>
Thu, 8 Apr 2004 02:33:49 +0000 (02:33 +0000)
darcs-hash:20040408023349-5007d-878738fc0f9604e43c54363e884b8929b1610894.gz

src/org/ibex/plat/Java2.java

index ec48893..7a1909b 100644 (file)
@@ -176,17 +176,16 @@ public class Java2 extends AWT {
         private DataBuffer buf = null;
 
         // this doens't seem to work on Windows
-        public void drawGlyph(Picture source, int dx, int dy, int cx1, int cy1, int cx2, int cy2, int rgb) {
-            AWTPicture src = (AWTPicture)source;
-            src.init();
+        public void drawGlyph(org.ibex.Font.Glyph source, int dx, int dy, int cx1, int cy1, int cx2, int cy2, int rgb) {
+            Image i2 = ((AWTGlyph)source).getImage();
             Graphics2D g2 = (Graphics2D)i.getGraphics();
             g2.setComposite(AlphaComposite.DstOut);
             g2.setClip(cx1, cy1, cx2 - cx1, cy2 - cy1);
-            g2.drawImage(src.i, dx, dy, null);
+            g2.drawImage(i2, dx, dy, null);
             g2.setComposite(AlphaComposite.DstOver);
             g2.setColor(new Color((rgb & 0x00FF0000) >> 16, (rgb & 0x0000FF00) >> 8, (rgb & 0x000000FF)));
             g2.fillRect(dx, dy, cx2 - dx, cy2 - dy);
-            g2.drawImage(i, 0, 0, null);
+            g2.drawImage(i2, 0, 0, null);
             g2.setClip(0, 0, i.getWidth(null), i.getHeight(null));
         }