X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Fplat%2FAWT.java;h=1138f26ec1f7237f84466f8e0126c2e589d19645;hb=91fa07eeabb1c256410385947e6a76f1e45c8b48;hp=2af3e8023baeef16296c474b8f234afc6b5e5452;hpb=ef61babe77a94eba181c95a52c0069a612276dff;p=org.ibex.core.git diff --git a/src/org/xwt/plat/AWT.java b/src/org/xwt/plat/AWT.java index 2af3e80..1138f26 100644 --- a/src/org/xwt/plat/AWT.java +++ b/src/org/xwt/plat/AWT.java @@ -16,13 +16,13 @@ public class AWT extends JVM { protected String getDescriptiveName() { return "Generic JDK 1.1+ with AWT"; } protected PixelBuffer _createPixelBuffer(int w, int h, Surface owner) { return new AWTPixelBuffer(w, h); } - protected Picture _createPicture(Res r) { return new AWTPicture(r); } + protected Picture _createPicture(Stream r) { return new AWTPicture(r); } protected int _getScreenWidth() { return Toolkit.getDefaultToolkit().getScreenSize().width; } protected int _getScreenHeight() { return Toolkit.getDefaultToolkit().getScreenSize().height; } protected Surface _createSurface(Box b, boolean framed) { return new AWTSurface(b, framed); } protected void postInit() { - if (Log.on) Log.info(Platform.class, " color depth = " + + if (Log.on) Log.diag(Platform.class, " color depth = " + Toolkit.getDefaultToolkit().getColorModel().getPixelSize() + "bpp"); } @@ -117,17 +117,28 @@ public class AWT extends JVM { protected org.xwt.Font.Glyph _createGlyph(org.xwt.Font f, char c) { return new AWTGlyph(f, c); } protected static class AWTGlyph extends org.xwt.Font.Glyph { private Image i = null; + private static ColorModel cmodel = new DirectColorModel(32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000); + + // this doesn't work on Win32 because the JVM is broken + /* static final ColorModel cmodel = new ColorModel(8) { public int getRed(int p) { return 0; } public int getGreen(int p) { return 0; } public int getBlue(int p) { return 0; } public int getAlpha(int p) { return p & 0xFF; } }; + */ public AWTGlyph(org.xwt.Font f, char c) { super(f, c); } Image getImage() { if (i == null && isLoaded) { - i = Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(width, height, cmodel, data, 0, width)); + + int[] data2 = new int[data.length]; + for(int i=0; i