2004/01/14 06:12:03
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:44:31 +0000 (07:44 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:44:31 +0000 (07:44 +0000)
darcs-hash:20040130074431-2ba56-2d0a9365bf2f19d90b79f6402ce62055f072ee75.gz

src/org/xwt/plat/Darwin.java
src/org/xwt/plat/OpenGL.java

index 7743441..211c88c 100644 (file)
@@ -91,6 +91,7 @@ public class Darwin extends POSIX {
         natInit();
     }
     
+    protected Scheduler _getScheduler() { return new DarwinScheduler(); }
     protected native void runApplicationEventLoop();
     private class DarwinScheduler extends org.xwt.Scheduler {
         public void run() {
@@ -261,19 +262,22 @@ public class Darwin extends POSIX {
         
         // The blit_lock ensures the window size does not change through the entire blit operation.
         public void render() {
+            /*
             blitLock();
             while(pendingResize) blitWait();
+            */
             if(needsReshape) {
                 needsReshape = false;
                 
                 reshape(winWidth,winHeight);
                 clear();
                 Dirty(0,0,winWidth,winHeight);
-                //Dirty(0,0,getWidth(),getHeight());
             }
             super.render();
             flush();
+            /*
             blitUnlock();
+            */
         }
         
         private native void reshape(int w, int h);
index 3b8d689..c18d09c 100644 (file)
@@ -119,7 +119,7 @@ abstract class OpenGL {
         return oglp.realPicture;
     }
     
-    public Picture _createPicture(JS r, boolean alphaOnly) { return new OpenGLPicture(r, alphaOnly); }
+    public Picture _createPicture(JS r, boolean alphaOnly) { return new OpenGLPicture(r, false); }
 
     public static class OpenGLPicture extends Picture {
         public OpenGLPicture(JS r, boolean a) { super(r); alphaOnly = a; }
@@ -127,24 +127,8 @@ abstract class OpenGL {
         GLPicture realPicture = null;
     }
 
-    public Font.Glyph _createGlyph(org.xwt.Font f, char c) { return new OpenGLGlyph(f, c); }
+    public Font.Glyph _createGlyph(org.xwt.Font f, char c) { return new org.xwt.Platform.DefaultGlyph(f, c); }
     
-    public static class OpenGLGlyph extends Font.Glyph {
-        private Picture p = null;
-        public OpenGLGlyph(org.xwt.Font f, char c) { super(f, c); }
-        Picture getPicture() {
-            if (p == null && isLoaded) {
-                p = new OpenGLPicture(null, true);
-                p.data = new int[data.length];
-                for(int i=0; i<data.length; i++) p.data[i] = (data[i] & 0xff) << 24;
-                data = null;
-                p.width = this.width;
-                p.height = this.height;
-            }
-            return p;
-        }
-    }
-
     private native void natDeleteTexture(int tex);
     public void deleteTexture(final int tex) {
         // CHECKME: Is this safe to do from finalize()?