- static final Callable glyphRenderingTask = new Callable() { public Object run(Object o) {
- // FIXME: this should be a low-priority task
- glyphRenderingTaskIsScheduled = false;
- if (glyphsToBeCached.isEmpty()) return null;
- Glyph g = (Glyph)glyphsToBeCached.keys().nextElement();
- if (g == null) return null;
- glyphsToBeCached.remove(g);
- Log.debug(Font.class, "glyphRenderingTask rendering " + g.c + " of " + g.font);
- g.render();
- Log.debug(Glyph.class, " done rendering glyph " + g.c);
- glyphRenderingTaskIsScheduled = true;
- Platform.Scheduler.add(this);
- return null;
- } };
+ static { new Thread() { public void run() {
+ while(true) {
+ Glyph g = (Glyph)toBeRasterized.remove(true);
+ if (g == null) continue;
+ Log.debug(Font.class, "glyphRenderingTask rendering " + g.c + " of " + g.font);
+ g.render();
+ Log.debug(Glyph.class, " done rendering glyph " + g.c);
+ }
+ } }.start(); }