mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
fix for flicker in JAVA2D mode (issue #558)
This commit is contained in:
@@ -1445,10 +1445,18 @@ public class PApplet extends Applet
|
|||||||
|
|
||||||
// make sure the screen is visible and usable
|
// make sure the screen is visible and usable
|
||||||
// (also prevents over-drawing when using PGraphicsOpenGL)
|
// (also prevents over-drawing when using PGraphicsOpenGL)
|
||||||
if ((g != null) && (g.image != null)) {
|
if (g != null) {
|
||||||
// println("inside paint(), screen.drawImage()");
|
// added synchronization for 0194 because of flicker issues with JAVA2D
|
||||||
screen.drawImage(g.image, 0, 0, null);
|
//
|
||||||
|
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);
|
//System.out.println("handleDraw() " + frameCount);
|
||||||
|
|
||||||
|
synchronized (g) {
|
||||||
g.beginDraw();
|
g.beginDraw();
|
||||||
if (recorder != null) {
|
if (recorder != null) {
|
||||||
recorder.beginDraw();
|
recorder.beginDraw();
|
||||||
@@ -1620,12 +1629,14 @@ public class PApplet extends Applet
|
|||||||
}
|
}
|
||||||
|
|
||||||
g.endDraw();
|
g.endDraw();
|
||||||
|
|
||||||
if (recorder != null) {
|
if (recorder != null) {
|
||||||
recorder.endDraw();
|
recorder.endDraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
frameRateLastNanos = now;
|
frameRateLastNanos = now;
|
||||||
frameCount++;
|
frameCount++;
|
||||||
|
}
|
||||||
|
|
||||||
repaint();
|
repaint();
|
||||||
getToolkit().sync(); // force repaint now (proper method)
|
getToolkit().sync(); // force repaint now (proper method)
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
0194 core
|
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
|
_ bug: textAlign(RIGHT) is shutting off native fonts
|
||||||
|
|||||||
Reference in New Issue
Block a user