fix for flicker in JAVA2D mode (issue #558)

This commit is contained in:
benfry
2011-03-09 17:43:46 +00:00
parent adbcafa53d
commit fbfca79ca0
2 changed files with 16 additions and 3 deletions

View File

@@ -1445,10 +1445,18 @@ public class PApplet extends Applet
// make sure the screen is visible and usable
// (also prevents over-drawing when using PGraphicsOpenGL)
if ((g != null) && (g.image != null)) {
// println("inside paint(), screen.drawImage()");
screen.drawImage(g.image, 0, 0, null);
if (g != null) {
// added synchronization for 0194 because of flicker issues with JAVA2D
//
synchronized (g) {
if (g.image != null) {
screen.drawImage(g.image, 0, 0, null);
}
}
}
// if ((g != null) && (g.image != null)) {
// screen.drawImage(g.image, 0, 0, null);
// }
}
@@ -1565,6 +1573,7 @@ public class PApplet extends Applet
//System.out.println("handleDraw() " + frameCount);
synchronized (g) {
g.beginDraw();
if (recorder != null) {
recorder.beginDraw();
@@ -1620,12 +1629,14 @@ public class PApplet extends Applet
}
g.endDraw();
if (recorder != null) {
recorder.endDraw();
}
frameRateLastNanos = now;
frameCount++;
}
repaint();
getToolkit().sync(); // force repaint now (proper method)

View File

@@ -1,4 +1,6 @@
0194 core
X flicker between background and rest with JAVA2D
X http://code.google.com/p/processing/issues/detail?id=558
_ bug: textAlign(RIGHT) is shutting off native fonts